signetai 0.42.2 → 0.42.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dashboard/_app/immutable/chunks/{HYZmioPA.js → D5aO9ubX.js} +1 -1
- package/dashboard/_app/immutable/entry/{app.DGX_UtVA.js → app.DyM7lGEH.js} +2 -2
- package/dashboard/_app/immutable/entry/start.CoXcqq-r.js +1 -0
- package/dashboard/_app/immutable/nodes/{1.5G1XVGqs.js → 1.C86LAzjx.js} +1 -1
- package/dashboard/_app/version.json +1 -1
- package/dashboard/index.html +6 -6
- package/dist/daemon.js +178 -152
- package/package.json +1 -1
- package/dashboard/_app/immutable/entry/start.Dp7zEnDj.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ba as be,o as je,s as A,g as U,b as T,Q as ee,bb as pt}from"./DRrAwi3T.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 wt(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 vt(...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="${vt(...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(w=>parseInt(w,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 w=p.exec(h);if(w)return At(w,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 Ne(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_34dwjg?.base??"",Tt=globalThis.__sveltekit_34dwjg?.assets??x??"",Pt="1772811030133",He="sveltekit:snapshot",We="sveltekit:scroll",Je="sveltekit:states",It="sveltekit:pageurl",K="sveltekit:history",H="sveltekit:navigation",j={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={...j,"":j.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 jt(e){return e instanceof Se?e.text:"Internal Error"}let k,W,pe;const Nt=je.toString().includes("$$")||/function \w+\(\) \{\}/.test(je.toString());Nt?(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,we,v;const re=[],ae=[];let L=null;function ve(){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,N;const se=new Set,Fe=new Map;async function fn(e,t,n){globalThis.__sveltekit_34dwjg?.data&&globalThis.__sveltekit_34dwjg.data,document.URL!==location.href&&(location.href=location.href),v=e,await e.hooks.init?.(),Ue=Ut(e),P=document.documentElement,we=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(we,n)):(await B({type:"enter",url:Ye(v.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),Ne(We,$),ot(R),Ne(He,J)}async function Gt(e,t,n,r){let a;t.invalidateAll&&ve(),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){ve();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&&ve(),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 v.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],w=_.branch[u];h?.data!==w?.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:wt(n,()=>{o&&(l.url=!0)},f=>{o&&l.search_params.add(f)},v.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:w}=lt(f,u,n);return o&&d(h.href),w},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 w=[];for(let m=0;m<c.length;m+=1)if(c[m])try{w.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,w,s);return I?ie({url:n,params:r,branch:w.slice(0,I.idx).concat(I.node),status:E,error:S,route:a}):await ft(n,{id:a.id},S,E)}else w.push(void 0);return ie({url:n,params:r,branch:w,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 v.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);v.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,v.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(v.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function le(e){return(v.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=N;N=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(),N===l&&(N=f);return}const w=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,v.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,N!==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(w),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,we,!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,j.hover)},20)});function r(o){o.defaultPrevented||i(o.composedPath()[0],j.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,v.hash);if(f||u)return;const h=te(c),w=p&&le(_.url)===le(p);if(!(h.reload||w))if(l<=h.preload_data){t={element:c,href:c.href},n=j.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,v.hash);if(c||d)continue;const p=te(o);p.reload||(p.preload_code===j.viewport&&a.observe(o),p.preload_code===j.eager&&ge(l))}}M.add(s),s()}function X(e,t){if(e instanceof ke)return e.body;const n=Le(e),r=jt(e);return v.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,v.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]=(v.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(N={},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:N,event:t})}else if(!F){const n=new URL(location.href);e(n),v.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(w,m)=>{const g=o[m];return g?.uses&&(g.uses=nn(g.uses)),Pe({loader:v.nodes[w],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 w=d.layouts;for(let m=0;m<w.length;m++)w[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(v.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
|
+
import{ba as be,o as Ne,s as A,g as U,b as T,Q as ee,bb as pt}from"./DRrAwi3T.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_hdmqsa?.base??"",Tt=globalThis.__sveltekit_hdmqsa?.assets??x??"",Pt="1772814628184",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 q(){return{x:pageXOffset,y:pageYOffset}}function V(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const qe={...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:qe[r??"off"],preload_data:qe[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function De(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 qt(e){Object.assign(k,e)}const Ve={spanContext(){return Dt},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}},Dt={traceId:"",spanId:"",traceFlags:0},Vt=new Set(["icon","shortcut icon","apple-touch-icon"]),$=Me(We)??{},J=Me(He)??{},C={url:De({}),page:De({}),navigating:be(null),updated:Ot()};function Ae(e){$[e]=q()}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_hdmqsa?.data&&globalThis.__sveltekit_hdmqsa.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]??q()},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,D=>D(h.navigation)))).filter(D=>typeof D=="function");if(b.length>0){let D=function(){b.forEach(fe=>{M.delete(fe)})};b.push(D),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),qt(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?q():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=q()),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]=q(),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}=q();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:q()},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.DsRNLJkb.js","../chunks/DRrAwi3T.js","../assets/vendor-ui.BHIBfuhK.css","../assets/0.BnOlCuNp.css","../nodes/1.
|
|
2
|
-
import{_ as v}from"../chunks/PPVm8Dsz.js";import{a as Q,B as g,a5 as F,P as G,o as H,g as i,b as h,Q as K,q as l,i as b,d as N,h as d,l as S,s as p,m as E,C as P,J as O,c as U,r as W,z as C,u as x,t as X,e as Y,f as Z,a6 as $}from"../chunks/DRrAwi3T.js";const it={};var tt=C('<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=C("<!> <!>",1);function at(a,t){Q(t,!0);let r=g(t,"components",23,()=>[]),_=g(t,"data_0",3,null),y=g(t,"data_1",3,null);F(()=>t.stores.page.set(t.page)),G(()=>{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),K().then(()=>{h(w,document.title||"untitled page",!0)}))});return h(f,!0),e});const I=x(()=>t.constructors[1]);var R=et(),k=l(R);{var L=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 A=E(),z=l(A);P(z,()=>i(I),(B,J)=>{O(J(B,{get data(){return y()},get form(){return t.form},get params(){return t.page.params}}),M=>r()[1]=M,()=>r()?.[1])}),d(u,A)},$$slots:{default:!0}}),u=>r()[0]=u,()=>r()?.[0])}),d(e,o)},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}}),u=>r()[0]=u,()=>r()?.[0])}),d(e,o)};b(k,e=>{t.constructors[1]?e(L):e(T,!1)})}var V=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(V,e=>{i(f)&&e(q)})}d(a,R),S()}const ct=$(at),dt=[()=>v(()=>import("../nodes/0.DsRNLJkb.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),()=>v(()=>import("../nodes/1.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.DsRNLJkb.js","../chunks/DRrAwi3T.js","../assets/vendor-ui.BHIBfuhK.css","../assets/0.BnOlCuNp.css","../nodes/1.C86LAzjx.js","../chunks/D5aO9ubX.js","../nodes/2.C-O8KSxS.js","../chunks/DmRdylYe.js","../chunks/PPVm8Dsz.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as v}from"../chunks/PPVm8Dsz.js";import{a as Q,B as g,a5 as F,P as G,o as H,g as i,b as h,Q as K,q as l,i as b,d as N,h as d,l as S,s as p,m as E,C as P,J as O,c as U,r as W,z as C,u as x,t as X,e as Y,f as Z,a6 as $}from"../chunks/DRrAwi3T.js";const it={};var tt=C('<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=C("<!> <!>",1);function at(a,t){Q(t,!0);let r=g(t,"components",23,()=>[]),_=g(t,"data_0",3,null),y=g(t,"data_1",3,null);F(()=>t.stores.page.set(t.page)),G(()=>{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),K().then(()=>{h(w,document.title||"untitled page",!0)}))});return h(f,!0),e});const I=x(()=>t.constructors[1]);var R=et(),k=l(R);{var L=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 A=E(),z=l(A);P(z,()=>i(I),(B,J)=>{O(J(B,{get data(){return y()},get form(){return t.form},get params(){return t.page.params}}),M=>r()[1]=M,()=>r()?.[1])}),d(u,A)},$$slots:{default:!0}}),u=>r()[0]=u,()=>r()?.[0])}),d(e,o)},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}}),u=>r()[0]=u,()=>r()?.[0])}),d(e,o)};b(k,e=>{t.constructors[1]?e(L):e(T,!1)})}var V=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(V,e=>{i(f)&&e(q)})}d(a,R),S()}const ct=$(at),dt=[()=>v(()=>import("../nodes/0.DsRNLJkb.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),()=>v(()=>import("../nodes/1.C86LAzjx.js"),__vite__mapDeps([4,1,2,5]),import.meta.url),()=>v(()=>import("../nodes/2.C-O8KSxS.js"),__vite__mapDeps([6,7,8,1,2]),import.meta.url)],mt=[],ut={"/":[2]},D={handleError:(({error:a})=>{console.error(a)}),reroute:(()=>{}),transport:{}},rt=Object.fromEntries(Object.entries(D.transport).map(([a,t])=>[a,t.decode])),lt=Object.fromEntries(Object.entries(D.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,D 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/D5aO9ubX.js";export{o as load_css,r as start};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m,_ as u,q as g,e as l,h as d,l as v,z as _,c as a,r as s,d as x,f as o}from"../chunks/DRrAwi3T.js";import{s as $,p}from"../chunks/
|
|
1
|
+
import{a as m,_ as u,q as g,e as l,h as d,l as v,z as _,c as a,r as s,d as x,f as o}from"../chunks/DRrAwi3T.js";import{s as $,p}from"../chunks/D5aO9ubX.js";const k={get error(){return p.error},get status(){return p.status}};$.updated.check;const c=k;var b=_("<h1> </h1> <p> </p>",1);function E(n,f){m(f,!1),u();var r=b(),t=g(r),h=a(t,!0);s(t);var e=x(t,2),i=a(e,!0);s(e),l(()=>{o(h,c.status),o(i,c.error?.message)}),d(n,r),v()}export{E as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1772814628184"}
|
package/dashboard/index.html
CHANGED
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
document.documentElement.dataset.theme = t;
|
|
18
18
|
})();
|
|
19
19
|
</script>
|
|
20
|
-
<link href="/_app/immutable/entry/start.
|
|
21
|
-
<link href="/_app/immutable/chunks/
|
|
20
|
+
<link href="/_app/immutable/entry/start.CoXcqq-r.js" rel="modulepreload">
|
|
21
|
+
<link href="/_app/immutable/chunks/D5aO9ubX.js" rel="modulepreload">
|
|
22
22
|
<link href="/_app/immutable/chunks/DRrAwi3T.js" rel="modulepreload">
|
|
23
|
-
<link href="/_app/immutable/entry/app.
|
|
23
|
+
<link href="/_app/immutable/entry/app.DyM7lGEH.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
|
-
|
|
32
|
+
__sveltekit_hdmqsa = {
|
|
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.
|
|
40
|
-
import("/_app/immutable/entry/app.
|
|
39
|
+
import("/_app/immutable/entry/start.CoXcqq-r.js"),
|
|
40
|
+
import("/_app/immutable/entry/app.DyM7lGEH.js")
|
|
41
41
|
]).then(([kit, app]) => {
|
|
42
42
|
kit.start(app, element);
|
|
43
43
|
});
|
package/dist/daemon.js
CHANGED
|
@@ -7059,8 +7059,8 @@ function isHarnessAvailable(harness) {
|
|
|
7059
7059
|
const [bin] = buildCommand(harness, "");
|
|
7060
7060
|
return Bun.which(bin) !== null;
|
|
7061
7061
|
}
|
|
7062
|
-
async function spawnTask(harness, prompt, workingDirectory, timeoutMs = DEFAULT_TIMEOUT_MS2, hooks) {
|
|
7063
|
-
const [bin, args] = buildCommand(harness, prompt);
|
|
7062
|
+
async function spawnTask(harness, prompt, workingDirectory, timeoutMs = DEFAULT_TIMEOUT_MS2, hooks, model) {
|
|
7063
|
+
const [bin, args] = buildCommand(harness, prompt, model);
|
|
7064
7064
|
const resolvedBin = Bun.which(bin);
|
|
7065
7065
|
if (resolvedBin === null) {
|
|
7066
7066
|
return {
|
|
@@ -21174,8 +21174,8 @@ import {
|
|
|
21174
21174
|
unlinkSync as unlinkSync3,
|
|
21175
21175
|
writeFileSync as writeFileSync9
|
|
21176
21176
|
} from "fs";
|
|
21177
|
-
import { homedir as
|
|
21178
|
-
import { basename as basename5, dirname as dirname7, join as
|
|
21177
|
+
import { homedir as homedir17 } from "os";
|
|
21178
|
+
import { basename as basename5, dirname as dirname7, join as join27 } from "path";
|
|
21179
21179
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
21180
21180
|
|
|
21181
21181
|
// ../../node_modules/.bun/@hono+node-server@1.19.9+ec04c4d79e01fadf/node_modules/@hono/node-server/dist/index.mjs
|
|
@@ -43781,6 +43781,14 @@ function resolveEmbeddingBaseUrl(cfg) {
|
|
|
43781
43781
|
}
|
|
43782
43782
|
return cfg.base_url;
|
|
43783
43783
|
}
|
|
43784
|
+
function requiresOpenAiApiKey(baseUrl) {
|
|
43785
|
+
try {
|
|
43786
|
+
const parsed = new URL(baseUrl.trim());
|
|
43787
|
+
return (parsed.protocol === "https:" || parsed.protocol === "http:") && parsed.hostname === "api.openai.com";
|
|
43788
|
+
} catch {
|
|
43789
|
+
return false;
|
|
43790
|
+
}
|
|
43791
|
+
}
|
|
43784
43792
|
async function resolveEmbeddingApiKey(rawApiKey) {
|
|
43785
43793
|
const configured = rawApiKey?.trim() ?? "";
|
|
43786
43794
|
if (configured.startsWith("$secret:")) {
|
|
@@ -43826,14 +43834,16 @@ async function fetchEmbedding(text, cfg) {
|
|
|
43826
43834
|
return await fetchOllamaEmbedding(text, cfg.base_url, cfg.model);
|
|
43827
43835
|
}
|
|
43828
43836
|
const apiKey = await resolveEmbeddingApiKey(cfg.api_key);
|
|
43829
|
-
if (!apiKey)
|
|
43830
|
-
return null;
|
|
43831
43837
|
const baseUrl = resolveEmbeddingBaseUrl(cfg);
|
|
43838
|
+
if (!apiKey && requiresOpenAiApiKey(baseUrl)) {
|
|
43839
|
+
logger.warn("embedding", "No API key configured for OpenAI embeddings, skipping request to api.openai.com");
|
|
43840
|
+
return null;
|
|
43841
|
+
}
|
|
43832
43842
|
const res = await fetch(`${baseUrl.replace(/\/$/, "")}/embeddings`, {
|
|
43833
43843
|
method: "POST",
|
|
43834
43844
|
headers: {
|
|
43835
43845
|
"Content-Type": "application/json",
|
|
43836
|
-
Authorization: `Bearer ${apiKey}`
|
|
43846
|
+
...apiKey ? { Authorization: `Bearer ${apiKey}` } : {}
|
|
43837
43847
|
},
|
|
43838
43848
|
body: JSON.stringify({ model: cfg.model, input: text }),
|
|
43839
43849
|
signal: AbortSignal.timeout(30000)
|
|
@@ -48145,15 +48155,6 @@ function normalizeCodexTranscript(raw2) {
|
|
|
48145
48155
|
if (item.type === "function_call_output" && typeof item.output === "string") {
|
|
48146
48156
|
lines.push(`Tool output: ${item.output.trim().slice(0, 1000)}`);
|
|
48147
48157
|
}
|
|
48148
|
-
if (item.type === "item.completed") {
|
|
48149
|
-
const completed = item.item;
|
|
48150
|
-
if (typeof completed === "object" && completed !== null) {
|
|
48151
|
-
const done = completed;
|
|
48152
|
-
if (done.type === "agent_message" && typeof done.text === "string") {
|
|
48153
|
-
lines.push(`Assistant: ${done.text.trim()}`);
|
|
48154
|
-
}
|
|
48155
|
-
}
|
|
48156
|
-
}
|
|
48157
48158
|
}
|
|
48158
48159
|
}
|
|
48159
48160
|
}
|
|
@@ -49118,9 +49119,9 @@ function createCodexProvider(config) {
|
|
|
49118
49119
|
}, timeoutMs);
|
|
49119
49120
|
try {
|
|
49120
49121
|
const [stdout, stderr, exitCode] = await Promise.all([
|
|
49121
|
-
new Response(proc.stdout).text(),
|
|
49122
|
-
new Response(proc.stderr).text(),
|
|
49123
|
-
proc.exited
|
|
49122
|
+
new Response(proc.stdout).text().catch(() => ""),
|
|
49123
|
+
new Response(proc.stderr).text().catch(() => ""),
|
|
49124
|
+
proc.exited.catch(() => -1)
|
|
49124
49125
|
]);
|
|
49125
49126
|
if (timedOut) {
|
|
49126
49127
|
throw new Error(`codex timeout after ${timeoutMs}ms`);
|
|
@@ -49129,11 +49130,6 @@ function createCodexProvider(config) {
|
|
|
49129
49130
|
throw new Error(`codex exit ${exitCode}: ${stderr.slice(0, 300)}`);
|
|
49130
49131
|
}
|
|
49131
49132
|
return parseCodexJsonl(stdout);
|
|
49132
|
-
} catch (e) {
|
|
49133
|
-
if (timedOut) {
|
|
49134
|
-
throw new Error(`codex timeout after ${timeoutMs}ms`);
|
|
49135
|
-
}
|
|
49136
|
-
throw e;
|
|
49137
49133
|
} finally {
|
|
49138
49134
|
clearTimeout(timer);
|
|
49139
49135
|
}
|
|
@@ -51181,6 +51177,10 @@ async function stopPipeline() {
|
|
|
51181
51177
|
logger.info("pipeline", "Pipeline stopped");
|
|
51182
51178
|
}
|
|
51183
51179
|
|
|
51180
|
+
// ../daemon/src/scheduler/worker.ts
|
|
51181
|
+
import { homedir as homedir13 } from "os";
|
|
51182
|
+
import { join as join21 } from "path";
|
|
51183
|
+
|
|
51184
51184
|
// ../daemon/src/scheduler/cron.ts
|
|
51185
51185
|
var import_cron_parser = __toESM(require_dist(), 1);
|
|
51186
51186
|
function computeNextRun(expr, from = new Date) {
|
|
@@ -51333,6 +51333,12 @@ function emitTaskStream(event) {
|
|
|
51333
51333
|
init_logger();
|
|
51334
51334
|
var POLL_INTERVAL_MS2 = 15000;
|
|
51335
51335
|
var MAX_CONCURRENT = 3;
|
|
51336
|
+
var AGENTS_DIR6 = process.env.SIGNET_PATH || join21(homedir13(), ".agents");
|
|
51337
|
+
var TASK_MODEL_CACHE_TTL_MS = 5000;
|
|
51338
|
+
var taskModelCache = new Map;
|
|
51339
|
+
function isTaskHarness(value) {
|
|
51340
|
+
return value === "claude-code" || value === "opencode" || value === "codex";
|
|
51341
|
+
}
|
|
51336
51342
|
function selectDueTasks(db, nowIso, limit) {
|
|
51337
51343
|
if (limit <= 0)
|
|
51338
51344
|
return [];
|
|
@@ -51350,6 +51356,22 @@ function selectDueTasks(db, nowIso, limit) {
|
|
|
51350
51356
|
ORDER BY t.next_run_at ASC
|
|
51351
51357
|
LIMIT ?`).all(nowIso, limit);
|
|
51352
51358
|
}
|
|
51359
|
+
function resolveTaskModel(harness, agentsDir2 = AGENTS_DIR6) {
|
|
51360
|
+
if (harness !== "codex")
|
|
51361
|
+
return;
|
|
51362
|
+
const now = Date.now();
|
|
51363
|
+
const cached = taskModelCache.get(agentsDir2);
|
|
51364
|
+
if (cached && cached.expiresAt > now) {
|
|
51365
|
+
return cached.model;
|
|
51366
|
+
}
|
|
51367
|
+
const cfg = loadMemoryConfig(agentsDir2);
|
|
51368
|
+
const model = cfg.pipelineV2.extraction.provider === "codex" ? cfg.pipelineV2.extraction.model : undefined;
|
|
51369
|
+
taskModelCache.set(agentsDir2, {
|
|
51370
|
+
model,
|
|
51371
|
+
expiresAt: now + TASK_MODEL_CACHE_TTL_MS
|
|
51372
|
+
});
|
|
51373
|
+
return model;
|
|
51374
|
+
}
|
|
51353
51375
|
function startSchedulerWorker(db) {
|
|
51354
51376
|
let running = true;
|
|
51355
51377
|
let timer = null;
|
|
@@ -51440,6 +51462,10 @@ async function executeTask(db, task) {
|
|
|
51440
51462
|
const effectivePrompt = resolveSkillPrompt(task.prompt, task.skill_name, task.skill_mode);
|
|
51441
51463
|
let result;
|
|
51442
51464
|
try {
|
|
51465
|
+
if (!isTaskHarness(task.harness)) {
|
|
51466
|
+
throw new Error(`Unsupported harness: ${task.harness}`);
|
|
51467
|
+
}
|
|
51468
|
+
const model = resolveTaskModel(task.harness);
|
|
51443
51469
|
result = await spawnTask(task.harness, effectivePrompt, task.working_directory, undefined, {
|
|
51444
51470
|
onStdoutChunk: (chunk) => {
|
|
51445
51471
|
emitTaskStream({
|
|
@@ -51461,7 +51487,7 @@ async function executeTask(db, task) {
|
|
|
51461
51487
|
timestamp: new Date().toISOString()
|
|
51462
51488
|
});
|
|
51463
51489
|
}
|
|
51464
|
-
});
|
|
51490
|
+
}, model);
|
|
51465
51491
|
} catch (err) {
|
|
51466
51492
|
result = {
|
|
51467
51493
|
exitCode: null,
|
|
@@ -75141,14 +75167,14 @@ function mountMcpRoute(app) {
|
|
|
75141
75167
|
// ../daemon/src/routes/skills.ts
|
|
75142
75168
|
import { spawn as spawn3 } from "child_process";
|
|
75143
75169
|
import { existsSync as existsSync17, readFileSync as readFileSync13, readdirSync as readdirSync6, rmSync } from "fs";
|
|
75144
|
-
import { homedir as
|
|
75145
|
-
import { join as
|
|
75170
|
+
import { homedir as homedir14 } from "os";
|
|
75171
|
+
import { join as join23 } from "path";
|
|
75146
75172
|
init_logger();
|
|
75147
75173
|
function getAgentsDir() {
|
|
75148
|
-
return process.env.SIGNET_PATH ||
|
|
75174
|
+
return process.env.SIGNET_PATH || join23(homedir14(), ".agents");
|
|
75149
75175
|
}
|
|
75150
75176
|
function getSkillsDir() {
|
|
75151
|
-
return
|
|
75177
|
+
return join23(getAgentsDir(), "skills");
|
|
75152
75178
|
}
|
|
75153
75179
|
var catalogCache = [];
|
|
75154
75180
|
var catalogFetchedAt = 0;
|
|
@@ -75192,13 +75218,13 @@ function listInstalledSkills() {
|
|
|
75192
75218
|
if (!existsSync17(getSkillsDir()))
|
|
75193
75219
|
return [];
|
|
75194
75220
|
return readdirSync6(getSkillsDir(), { withFileTypes: true }).filter((d2) => d2.isDirectory()).flatMap((d2) => {
|
|
75195
|
-
const skillMdPath =
|
|
75221
|
+
const skillMdPath = join23(getSkillsDir(), d2.name, "SKILL.md");
|
|
75196
75222
|
if (!existsSync17(skillMdPath))
|
|
75197
75223
|
return [];
|
|
75198
75224
|
try {
|
|
75199
75225
|
const content = readFileSync13(skillMdPath, "utf-8");
|
|
75200
75226
|
const meta3 = parseSkillFrontmatter(content);
|
|
75201
|
-
return [{ name: d2.name, ...meta3, path:
|
|
75227
|
+
return [{ name: d2.name, ...meta3, path: join23(getSkillsDir(), d2.name) }];
|
|
75202
75228
|
} catch {
|
|
75203
75229
|
return [];
|
|
75204
75230
|
}
|
|
@@ -75428,7 +75454,7 @@ function mountSkillsRoutes(app) {
|
|
|
75428
75454
|
if (!name || name.includes("/") || name.includes("..")) {
|
|
75429
75455
|
return c2.json({ error: "Invalid skill name" }, 400);
|
|
75430
75456
|
}
|
|
75431
|
-
const skillMdPath =
|
|
75457
|
+
const skillMdPath = join23(getSkillsDir(), name, "SKILL.md");
|
|
75432
75458
|
if (existsSync17(skillMdPath)) {
|
|
75433
75459
|
try {
|
|
75434
75460
|
const content = readFileSync13(skillMdPath, "utf-8");
|
|
@@ -75436,7 +75462,7 @@ function mountSkillsRoutes(app) {
|
|
|
75436
75462
|
return c2.json({
|
|
75437
75463
|
name,
|
|
75438
75464
|
...meta3,
|
|
75439
|
-
path:
|
|
75465
|
+
path: join23(getSkillsDir(), name),
|
|
75440
75466
|
content
|
|
75441
75467
|
});
|
|
75442
75468
|
} catch (e) {
|
|
@@ -75536,7 +75562,7 @@ function mountSkillsRoutes(app) {
|
|
|
75536
75562
|
if (!name || name.includes("/") || name.includes("..")) {
|
|
75537
75563
|
return c2.json({ error: "Invalid skill name" }, 400);
|
|
75538
75564
|
}
|
|
75539
|
-
const skillDir =
|
|
75565
|
+
const skillDir = join23(getSkillsDir(), name);
|
|
75540
75566
|
if (!existsSync17(skillDir)) {
|
|
75541
75567
|
return c2.json({ error: `Skill '${name}' not found` }, 404);
|
|
75542
75568
|
}
|
|
@@ -75553,8 +75579,8 @@ function mountSkillsRoutes(app) {
|
|
|
75553
75579
|
|
|
75554
75580
|
// ../daemon/src/routes/marketplace.ts
|
|
75555
75581
|
import { existsSync as existsSync18, mkdirSync as mkdirSync9, readFileSync as readFileSync14, writeFileSync as writeFileSync7 } from "fs";
|
|
75556
|
-
import { homedir as
|
|
75557
|
-
import { join as
|
|
75582
|
+
import { homedir as homedir15 } from "os";
|
|
75583
|
+
import { join as join25 } from "path";
|
|
75558
75584
|
|
|
75559
75585
|
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.26.0/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js
|
|
75560
75586
|
class ExperimentalClientTasks {
|
|
@@ -77600,16 +77626,16 @@ var catalogCache2 = new Map;
|
|
|
77600
77626
|
var referenceCatalogCache = null;
|
|
77601
77627
|
var toolsCache = new Map;
|
|
77602
77628
|
function getAgentsDir2() {
|
|
77603
|
-
return process.env.SIGNET_PATH ||
|
|
77629
|
+
return process.env.SIGNET_PATH || join25(homedir15(), ".agents");
|
|
77604
77630
|
}
|
|
77605
77631
|
function getMarketplaceDir() {
|
|
77606
|
-
return
|
|
77632
|
+
return join25(getAgentsDir2(), "marketplace");
|
|
77607
77633
|
}
|
|
77608
77634
|
function getInstalledMcpPath() {
|
|
77609
|
-
return
|
|
77635
|
+
return join25(getMarketplaceDir(), "mcp-servers.json");
|
|
77610
77636
|
}
|
|
77611
77637
|
function getExposurePolicyPath() {
|
|
77612
|
-
return
|
|
77638
|
+
return join25(getMarketplaceDir(), "mcp-policy.json");
|
|
77613
77639
|
}
|
|
77614
77640
|
function ensureMarketplaceDir() {
|
|
77615
77641
|
const dir = getMarketplaceDir();
|
|
@@ -78690,8 +78716,8 @@ function mountMarketplaceRoutes(app) {
|
|
|
78690
78716
|
// ../daemon/src/routes/marketplace-reviews.ts
|
|
78691
78717
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
78692
78718
|
import { existsSync as existsSync19, mkdirSync as mkdirSync10, readFileSync as readFileSync15, writeFileSync as writeFileSync8 } from "fs";
|
|
78693
|
-
import { homedir as
|
|
78694
|
-
import { join as
|
|
78719
|
+
import { homedir as homedir16 } from "os";
|
|
78720
|
+
import { join as join26 } from "path";
|
|
78695
78721
|
var DEFAULT_CONFIG2 = {
|
|
78696
78722
|
enabled: false,
|
|
78697
78723
|
endpointUrl: "",
|
|
@@ -78699,16 +78725,16 @@ var DEFAULT_CONFIG2 = {
|
|
|
78699
78725
|
lastSyncError: null
|
|
78700
78726
|
};
|
|
78701
78727
|
function getAgentsDir3() {
|
|
78702
|
-
return process.env.SIGNET_PATH ||
|
|
78728
|
+
return process.env.SIGNET_PATH || join26(homedir16(), ".agents");
|
|
78703
78729
|
}
|
|
78704
78730
|
function getMarketplaceDir2() {
|
|
78705
|
-
return
|
|
78731
|
+
return join26(getAgentsDir3(), "marketplace");
|
|
78706
78732
|
}
|
|
78707
78733
|
function getReviewsPath() {
|
|
78708
|
-
return
|
|
78734
|
+
return join26(getMarketplaceDir2(), "reviews.json");
|
|
78709
78735
|
}
|
|
78710
78736
|
function getReviewsConfigPath() {
|
|
78711
|
-
return
|
|
78737
|
+
return join26(getMarketplaceDir2(), "reviews-config.json");
|
|
78712
78738
|
}
|
|
78713
78739
|
function ensureMarketplaceDir2() {
|
|
78714
78740
|
const dir = getMarketplaceDir2();
|
|
@@ -78997,12 +79023,12 @@ function mountMarketplaceReviewsRoutes(app) {
|
|
|
78997
79023
|
}
|
|
78998
79024
|
|
|
78999
79025
|
// ../daemon/src/daemon.ts
|
|
79000
|
-
var
|
|
79001
|
-
var DAEMON_DIR =
|
|
79002
|
-
var PID_FILE =
|
|
79003
|
-
var LOG_DIR =
|
|
79004
|
-
var MEMORY_DB2 =
|
|
79005
|
-
var SCRIPTS_DIR =
|
|
79026
|
+
var AGENTS_DIR7 = process.env.SIGNET_PATH || join27(homedir17(), ".agents");
|
|
79027
|
+
var DAEMON_DIR = join27(AGENTS_DIR7, ".daemon");
|
|
79028
|
+
var PID_FILE = join27(DAEMON_DIR, "pid");
|
|
79029
|
+
var LOG_DIR = join27(DAEMON_DIR, "logs");
|
|
79030
|
+
var MEMORY_DB2 = join27(AGENTS_DIR7, "memory", "memories.db");
|
|
79031
|
+
var SCRIPTS_DIR = join27(AGENTS_DIR7, "scripts");
|
|
79006
79032
|
var PORT = Number.parseInt(process.env.SIGNET_PORT || "3850", 10);
|
|
79007
79033
|
var HOST = process.env.SIGNET_HOST || "localhost";
|
|
79008
79034
|
var providerTracker = createProviderTracker();
|
|
@@ -79016,7 +79042,7 @@ var projectionInFlight = new Map;
|
|
|
79016
79042
|
var projectionErrors = new Map;
|
|
79017
79043
|
var PROJECTION_ERROR_TTL_MS = 30000;
|
|
79018
79044
|
var hasMemoriesSessionIdColumnCache = null;
|
|
79019
|
-
var authConfig = parseAuthConfig(undefined,
|
|
79045
|
+
var authConfig = parseAuthConfig(undefined, AGENTS_DIR7);
|
|
79020
79046
|
var authSecret = null;
|
|
79021
79047
|
var authForgetLimiter = new AuthRateLimiter(60000, 30);
|
|
79022
79048
|
var authModifyLimiter = new AuthRateLimiter(60000, 60);
|
|
@@ -79045,9 +79071,9 @@ function getDaemonVersion() {
|
|
|
79045
79071
|
const __filename3 = fileURLToPath3(import.meta.url);
|
|
79046
79072
|
const __dirname3 = dirname7(__filename3);
|
|
79047
79073
|
const candidates = [
|
|
79048
|
-
|
|
79049
|
-
|
|
79050
|
-
|
|
79074
|
+
join27(__dirname3, "..", "package.json"),
|
|
79075
|
+
join27(__dirname3, "..", "..", "signetai", "package.json"),
|
|
79076
|
+
join27(__dirname3, "..", "..", "package.json")
|
|
79051
79077
|
];
|
|
79052
79078
|
for (const candidate of candidates) {
|
|
79053
79079
|
const version2 = getVersionFromPackageJson(candidate);
|
|
@@ -79248,7 +79274,7 @@ function isMissingEmbeddingsTableError(error48) {
|
|
|
79248
79274
|
return message.includes("no such table: embeddings");
|
|
79249
79275
|
}
|
|
79250
79276
|
async function runLegacyEmbeddingsExport(withVectors, limit, offset) {
|
|
79251
|
-
const scriptPath =
|
|
79277
|
+
const scriptPath = join27(AGENTS_DIR7, "memory", "scripts", "export_embeddings.py");
|
|
79252
79278
|
if (!existsSync20(scriptPath)) {
|
|
79253
79279
|
return null;
|
|
79254
79280
|
}
|
|
@@ -79258,7 +79284,7 @@ async function runLegacyEmbeddingsExport(withVectors, limit, offset) {
|
|
|
79258
79284
|
}
|
|
79259
79285
|
return await new Promise((resolve4) => {
|
|
79260
79286
|
const proc = spawn5("python3", args, {
|
|
79261
|
-
cwd:
|
|
79287
|
+
cwd: AGENTS_DIR7,
|
|
79262
79288
|
stdio: "pipe",
|
|
79263
79289
|
timeout: withVectors ? 120000 : 30000
|
|
79264
79290
|
});
|
|
@@ -79434,13 +79460,13 @@ function getDashboardPath() {
|
|
|
79434
79460
|
const __filename3 = fileURLToPath3(import.meta.url);
|
|
79435
79461
|
const __dirname3 = dirname7(__filename3);
|
|
79436
79462
|
const candidates = [
|
|
79437
|
-
|
|
79438
|
-
|
|
79439
|
-
|
|
79440
|
-
|
|
79463
|
+
join27(__dirname3, "..", "..", "cli", "dashboard", "build"),
|
|
79464
|
+
join27(__dirname3, "..", "..", "..", "cli", "dashboard", "build"),
|
|
79465
|
+
join27(__dirname3, "..", "dashboard"),
|
|
79466
|
+
join27(__dirname3, "dashboard")
|
|
79441
79467
|
];
|
|
79442
79468
|
for (const candidate of candidates) {
|
|
79443
|
-
if (existsSync20(
|
|
79469
|
+
if (existsSync20(join27(candidate, "index.html"))) {
|
|
79444
79470
|
return candidate;
|
|
79445
79471
|
}
|
|
79446
79472
|
}
|
|
@@ -79483,7 +79509,7 @@ app.get("/health", (c2) => {
|
|
|
79483
79509
|
pid: process.pid,
|
|
79484
79510
|
version: CURRENT_VERSION,
|
|
79485
79511
|
port: PORT,
|
|
79486
|
-
agentsDir:
|
|
79512
|
+
agentsDir: AGENTS_DIR7,
|
|
79487
79513
|
db: dbOk,
|
|
79488
79514
|
updateAvailable: us.lastCheck?.updateAvailable ?? false,
|
|
79489
79515
|
pendingRestart: us.pendingRestartVersion !== null
|
|
@@ -79673,10 +79699,10 @@ app.get("/api/logs/stream", (c2) => {
|
|
|
79673
79699
|
app.get("/api/config", async (c2) => {
|
|
79674
79700
|
try {
|
|
79675
79701
|
const files = [];
|
|
79676
|
-
const dirFiles = readdirSync7(
|
|
79702
|
+
const dirFiles = readdirSync7(AGENTS_DIR7);
|
|
79677
79703
|
const configFiles = dirFiles.filter((f2) => f2.endsWith(".md") || f2.endsWith(".yaml"));
|
|
79678
79704
|
for (const fileName of configFiles) {
|
|
79679
|
-
const filePath =
|
|
79705
|
+
const filePath = join27(AGENTS_DIR7, fileName);
|
|
79680
79706
|
const fileStat = statSync5(filePath);
|
|
79681
79707
|
if (fileStat.isFile()) {
|
|
79682
79708
|
const content = readFileSync16(filePath, "utf-8");
|
|
@@ -79713,7 +79739,7 @@ app.post("/api/config", async (c2) => {
|
|
|
79713
79739
|
if (!file2.endsWith(".md") && !file2.endsWith(".yaml")) {
|
|
79714
79740
|
return c2.json({ error: "Invalid file type" }, 400);
|
|
79715
79741
|
}
|
|
79716
|
-
writeFileSync9(
|
|
79742
|
+
writeFileSync9(join27(AGENTS_DIR7, file2), content, "utf-8");
|
|
79717
79743
|
logger.info("api", "Config file updated", { file: file2 });
|
|
79718
79744
|
return c2.json({ success: true });
|
|
79719
79745
|
} catch (e) {
|
|
@@ -79723,7 +79749,7 @@ app.post("/api/config", async (c2) => {
|
|
|
79723
79749
|
});
|
|
79724
79750
|
app.get("/api/identity", (c2) => {
|
|
79725
79751
|
try {
|
|
79726
|
-
const content = readFileSync16(
|
|
79752
|
+
const content = readFileSync16(join27(AGENTS_DIR7, "IDENTITY.md"), "utf-8");
|
|
79727
79753
|
const lines = content.split(`
|
|
79728
79754
|
`);
|
|
79729
79755
|
const identity2 = {
|
|
@@ -80213,7 +80239,7 @@ app.post("/api/memory/remember", async (c2) => {
|
|
|
80213
80239
|
const raw2 = body.content?.trim();
|
|
80214
80240
|
if (!raw2)
|
|
80215
80241
|
return c2.json({ error: "content is required" }, 400);
|
|
80216
|
-
const fullCfg = loadMemoryConfig(
|
|
80242
|
+
const fullCfg = loadMemoryConfig(AGENTS_DIR7);
|
|
80217
80243
|
const pipelineCfg = fullCfg.pipelineV2;
|
|
80218
80244
|
if (pipelineCfg.mutationsFrozen) {
|
|
80219
80245
|
return c2.json({ error: "Mutations are frozen (kill switch active)" }, 503);
|
|
@@ -80436,7 +80462,7 @@ app.post("/api/memory/remember", async (c2) => {
|
|
|
80436
80462
|
}
|
|
80437
80463
|
let embedded = false;
|
|
80438
80464
|
try {
|
|
80439
|
-
const cfg = loadMemoryConfig(
|
|
80465
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
80440
80466
|
const vec = await fetchEmbedding(normalizedContent.storageContent, cfg.embedding);
|
|
80441
80467
|
if (vec) {
|
|
80442
80468
|
if (vec.length !== cfg.embedding.dimensions) {
|
|
@@ -80611,7 +80637,7 @@ app.post("/api/memory/:id/recover", async (c2) => {
|
|
|
80611
80637
|
return c2.json({ error: "if_version must be a positive integer" }, 400);
|
|
80612
80638
|
}
|
|
80613
80639
|
const ifVersion = ifVersionBody ?? ifVersionQuery;
|
|
80614
|
-
const cfg = loadMemoryConfig(
|
|
80640
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
80615
80641
|
if (cfg.pipelineV2.mutationsFrozen) {
|
|
80616
80642
|
return c2.json({ error: "Mutations are frozen (kill switch active)" }, 503);
|
|
80617
80643
|
}
|
|
@@ -80683,7 +80709,7 @@ app.patch("/api/memory/:id", async (c2) => {
|
|
|
80683
80709
|
if (!parsedPatch.ok) {
|
|
80684
80710
|
return c2.json({ error: parsedPatch.error }, 400);
|
|
80685
80711
|
}
|
|
80686
|
-
const cfg = loadMemoryConfig(
|
|
80712
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
80687
80713
|
if (cfg.pipelineV2.mutationsFrozen) {
|
|
80688
80714
|
return c2.json({ error: "Mutations are frozen (kill switch active)" }, 503);
|
|
80689
80715
|
}
|
|
@@ -80780,7 +80806,7 @@ app.delete("/api/memory/:id", async (c2) => {
|
|
|
80780
80806
|
return c2.json({ error: "if_version must be a positive integer" }, 400);
|
|
80781
80807
|
}
|
|
80782
80808
|
const ifVersion = ifVersionBody ?? ifVersionQuery;
|
|
80783
|
-
const cfg = loadMemoryConfig(
|
|
80809
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
80784
80810
|
if (cfg.pipelineV2.mutationsFrozen) {
|
|
80785
80811
|
return c2.json({ error: "Mutations are frozen (kill switch active)" }, 503);
|
|
80786
80812
|
}
|
|
@@ -80923,7 +80949,7 @@ app.post("/api/memory/forget", async (c2) => {
|
|
|
80923
80949
|
}, 400);
|
|
80924
80950
|
}
|
|
80925
80951
|
}
|
|
80926
|
-
const cfg = loadMemoryConfig(
|
|
80952
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
80927
80953
|
if (cfg.pipelineV2.mutationsFrozen) {
|
|
80928
80954
|
return c2.json({ error: "Mutations are frozen (kill switch active)" }, 503);
|
|
80929
80955
|
}
|
|
@@ -80966,7 +80992,7 @@ app.post("/api/memory/modify", async (c2) => {
|
|
|
80966
80992
|
error: `patches[] exceeds maximum batch size (${MAX_MUTATION_BATCH})`
|
|
80967
80993
|
}, 400);
|
|
80968
80994
|
}
|
|
80969
|
-
const cfg = loadMemoryConfig(
|
|
80995
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
80970
80996
|
if (cfg.pipelineV2.mutationsFrozen) {
|
|
80971
80997
|
return c2.json({ error: "Mutations are frozen (kill switch active)" }, 503);
|
|
80972
80998
|
}
|
|
@@ -81064,7 +81090,7 @@ app.post("/api/memory/recall", async (c2) => {
|
|
|
81064
81090
|
const query = body.query?.trim() ?? "";
|
|
81065
81091
|
if (!query)
|
|
81066
81092
|
return c2.json({ error: "query is required" }, 400);
|
|
81067
|
-
const cfg = loadMemoryConfig(
|
|
81093
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
81068
81094
|
try {
|
|
81069
81095
|
const result = await hybridRecall({ ...body, query }, cfg, fetchEmbedding);
|
|
81070
81096
|
return c2.json(result);
|
|
@@ -81084,7 +81110,7 @@ app.get("/api/memory/search", async (c2) => {
|
|
|
81084
81110
|
const pinned = c2.req.query("pinned");
|
|
81085
81111
|
const importanceMin = c2.req.query("importance_min");
|
|
81086
81112
|
const since = c2.req.query("since");
|
|
81087
|
-
const cfg = loadMemoryConfig(
|
|
81113
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
81088
81114
|
try {
|
|
81089
81115
|
const result = await hybridRecall({
|
|
81090
81116
|
query: q2,
|
|
@@ -81241,13 +81267,13 @@ app.get("/api/embeddings", async (c2) => {
|
|
|
81241
81267
|
}
|
|
81242
81268
|
});
|
|
81243
81269
|
app.get("/api/embeddings/status", async (c2) => {
|
|
81244
|
-
const config2 = loadMemoryConfig(
|
|
81270
|
+
const config2 = loadMemoryConfig(AGENTS_DIR7);
|
|
81245
81271
|
const status = await checkEmbeddingProvider(config2.embedding);
|
|
81246
81272
|
const tracker = embeddingTrackerHandle?.getStats() ?? null;
|
|
81247
81273
|
return c2.json({ ...status, tracker });
|
|
81248
81274
|
});
|
|
81249
81275
|
app.get("/api/embeddings/health", async (c2) => {
|
|
81250
|
-
const cfg = loadMemoryConfig(
|
|
81276
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
81251
81277
|
const providerStatus = await checkEmbeddingProvider(cfg.embedding);
|
|
81252
81278
|
const report = getDbAccessor().withReadDb((db) => buildEmbeddingHealth(db, cfg.embedding, providerStatus));
|
|
81253
81279
|
return c2.json(report);
|
|
@@ -81784,13 +81810,13 @@ mountMarketplaceRoutes(app);
|
|
|
81784
81810
|
mountMarketplaceReviewsRoutes(app);
|
|
81785
81811
|
app.get("/api/harnesses", async (c2) => {
|
|
81786
81812
|
const configs = [
|
|
81787
|
-
{ name: "Claude Code", id: "claude-code", path:
|
|
81813
|
+
{ name: "Claude Code", id: "claude-code", path: join27(homedir17(), ".claude", "CLAUDE.md") },
|
|
81788
81814
|
{
|
|
81789
81815
|
name: "OpenCode",
|
|
81790
81816
|
id: "opencode",
|
|
81791
|
-
path:
|
|
81817
|
+
path: join27(homedir17(), ".config", "opencode", "AGENTS.md")
|
|
81792
81818
|
},
|
|
81793
|
-
{ name: "OpenClaw", id: "openclaw", path:
|
|
81819
|
+
{ name: "OpenClaw", id: "openclaw", path: join27(AGENTS_DIR7, "AGENTS.md") }
|
|
81794
81820
|
];
|
|
81795
81821
|
const harnesses = configs.map((config2) => ({
|
|
81796
81822
|
name: config2.name,
|
|
@@ -81803,14 +81829,14 @@ app.get("/api/harnesses", async (c2) => {
|
|
|
81803
81829
|
});
|
|
81804
81830
|
app.post("/api/harnesses/regenerate", async (c2) => {
|
|
81805
81831
|
return new Promise((resolve4) => {
|
|
81806
|
-
const script =
|
|
81832
|
+
const script = join27(SCRIPTS_DIR, "generate-harness-configs.py");
|
|
81807
81833
|
if (!existsSync20(script)) {
|
|
81808
81834
|
resolve4(c2.json({ success: false, error: "Regeneration script not found" }, 404));
|
|
81809
81835
|
return;
|
|
81810
81836
|
}
|
|
81811
81837
|
const proc = spawn5("python3", [script], {
|
|
81812
81838
|
timeout: 1e4,
|
|
81813
|
-
cwd:
|
|
81839
|
+
cwd: AGENTS_DIR7
|
|
81814
81840
|
});
|
|
81815
81841
|
let stdout = "";
|
|
81816
81842
|
let stderr = "";
|
|
@@ -82239,7 +82265,7 @@ app.post("/api/hooks/compaction-complete", async (c2) => {
|
|
|
82239
82265
|
}
|
|
82240
82266
|
});
|
|
82241
82267
|
app.get("/api/hooks/synthesis/config", (c2) => {
|
|
82242
|
-
const config2 = loadMemoryConfig(
|
|
82268
|
+
const config2 = loadMemoryConfig(AGENTS_DIR7).pipelineV2.synthesis;
|
|
82243
82269
|
return c2.json(config2);
|
|
82244
82270
|
});
|
|
82245
82271
|
app.post("/api/hooks/synthesis", async (c2) => {
|
|
@@ -82281,7 +82307,7 @@ app.post("/api/synthesis/trigger", async (c2) => {
|
|
|
82281
82307
|
});
|
|
82282
82308
|
app.get("/api/synthesis/status", (c2) => {
|
|
82283
82309
|
const worker = getSynthesisWorker();
|
|
82284
|
-
const config2 = loadMemoryConfig(
|
|
82310
|
+
const config2 = loadMemoryConfig(AGENTS_DIR7).pipelineV2.synthesis;
|
|
82285
82311
|
const lastRunAt = readLastSynthesisTime();
|
|
82286
82312
|
return c2.json({
|
|
82287
82313
|
running: worker?.running ?? false,
|
|
@@ -82694,7 +82720,7 @@ app.get("/api/tasks/:id/runs", (c2) => {
|
|
|
82694
82720
|
return c2.json({ runs, total, hasMore: offset + limit < total });
|
|
82695
82721
|
});
|
|
82696
82722
|
app.get("/api/status", (c2) => {
|
|
82697
|
-
const config2 = loadMemoryConfig(
|
|
82723
|
+
const config2 = loadMemoryConfig(AGENTS_DIR7);
|
|
82698
82724
|
let health;
|
|
82699
82725
|
try {
|
|
82700
82726
|
const report = getDbAccessor().withReadDb((db) => getDiagnostics(db, providerTracker, getUpdateState()));
|
|
@@ -82709,7 +82735,7 @@ app.get("/api/status", (c2) => {
|
|
|
82709
82735
|
startedAt: new Date(Date.now() - process.uptime() * 1000).toISOString(),
|
|
82710
82736
|
port: PORT,
|
|
82711
82737
|
host: HOST,
|
|
82712
|
-
agentsDir:
|
|
82738
|
+
agentsDir: AGENTS_DIR7,
|
|
82713
82739
|
memoryDb: existsSync20(MEMORY_DB2),
|
|
82714
82740
|
pipelineV2: config2.pipelineV2,
|
|
82715
82741
|
...health ? { health } : {},
|
|
@@ -82745,7 +82771,7 @@ app.get("/api/diagnostics/:domain", (c2) => {
|
|
|
82745
82771
|
return c2.json(domainData);
|
|
82746
82772
|
});
|
|
82747
82773
|
app.get("/api/pipeline/status", (c2) => {
|
|
82748
|
-
const cfg = loadMemoryConfig(
|
|
82774
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
82749
82775
|
const accessor2 = getDbAccessor();
|
|
82750
82776
|
const dbData = accessor2.withReadDb((db) => {
|
|
82751
82777
|
const memoryRows = db.prepare("SELECT status, COUNT(*) as count FROM memory_jobs GROUP BY status").all();
|
|
@@ -82790,19 +82816,19 @@ function resolveRepairContext(c2) {
|
|
|
82790
82816
|
return { reason, actor, actorType, requestId };
|
|
82791
82817
|
}
|
|
82792
82818
|
app.post("/api/repair/requeue-dead", (c2) => {
|
|
82793
|
-
const cfg = loadMemoryConfig(
|
|
82819
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
82794
82820
|
const ctx = resolveRepairContext(c2);
|
|
82795
82821
|
const result = requeueDeadJobs(getDbAccessor(), cfg.pipelineV2, ctx, repairLimiter);
|
|
82796
82822
|
return c2.json(result, result.success ? 200 : 429);
|
|
82797
82823
|
});
|
|
82798
82824
|
app.post("/api/repair/release-leases", (c2) => {
|
|
82799
|
-
const cfg = loadMemoryConfig(
|
|
82825
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
82800
82826
|
const ctx = resolveRepairContext(c2);
|
|
82801
82827
|
const result = releaseStaleLeases(getDbAccessor(), cfg.pipelineV2, ctx, repairLimiter);
|
|
82802
82828
|
return c2.json(result, result.success ? 200 : 429);
|
|
82803
82829
|
});
|
|
82804
82830
|
app.post("/api/repair/check-fts", async (c2) => {
|
|
82805
|
-
const cfg = loadMemoryConfig(
|
|
82831
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
82806
82832
|
const ctx = resolveRepairContext(c2);
|
|
82807
82833
|
let repair = false;
|
|
82808
82834
|
try {
|
|
@@ -82813,7 +82839,7 @@ app.post("/api/repair/check-fts", async (c2) => {
|
|
|
82813
82839
|
return c2.json(result, result.success ? 200 : 429);
|
|
82814
82840
|
});
|
|
82815
82841
|
app.post("/api/repair/retention-sweep", (c2) => {
|
|
82816
|
-
const cfg = loadMemoryConfig(
|
|
82842
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
82817
82843
|
const ctx = resolveRepairContext(c2);
|
|
82818
82844
|
return c2.json({
|
|
82819
82845
|
action: "triggerRetentionSweep",
|
|
@@ -82835,7 +82861,7 @@ function repairHttpStatus(result) {
|
|
|
82835
82861
|
return 500;
|
|
82836
82862
|
}
|
|
82837
82863
|
app.post("/api/repair/re-embed", async (c2) => {
|
|
82838
|
-
const cfg = loadMemoryConfig(
|
|
82864
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
82839
82865
|
const ctx = resolveRepairContext(c2);
|
|
82840
82866
|
let batchSize = 50;
|
|
82841
82867
|
let dryRun = false;
|
|
@@ -82853,13 +82879,13 @@ app.post("/api/repair/re-embed", async (c2) => {
|
|
|
82853
82879
|
return c2.json(result, repairHttpStatus(result));
|
|
82854
82880
|
});
|
|
82855
82881
|
app.post("/api/repair/resync-vec", (c2) => {
|
|
82856
|
-
const cfg = loadMemoryConfig(
|
|
82882
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
82857
82883
|
const ctx = resolveRepairContext(c2);
|
|
82858
82884
|
const result = resyncVectorIndex(getDbAccessor(), cfg.pipelineV2, ctx, repairLimiter);
|
|
82859
82885
|
return c2.json(result, repairHttpStatus(result));
|
|
82860
82886
|
});
|
|
82861
82887
|
app.post("/api/repair/clean-orphans", (c2) => {
|
|
82862
|
-
const cfg = loadMemoryConfig(
|
|
82888
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
82863
82889
|
const ctx = resolveRepairContext(c2);
|
|
82864
82890
|
const result = cleanOrphanedEmbeddings(getDbAccessor(), cfg.pipelineV2, ctx, repairLimiter);
|
|
82865
82891
|
return c2.json(result, repairHttpStatus(result));
|
|
@@ -82869,7 +82895,7 @@ app.get("/api/repair/dedup-stats", (c2) => {
|
|
|
82869
82895
|
return c2.json(stats);
|
|
82870
82896
|
});
|
|
82871
82897
|
app.post("/api/repair/deduplicate", async (c2) => {
|
|
82872
|
-
const cfg = loadMemoryConfig(
|
|
82898
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7);
|
|
82873
82899
|
const ctx = resolveRepairContext(c2);
|
|
82874
82900
|
const options = {};
|
|
82875
82901
|
try {
|
|
@@ -83131,7 +83157,7 @@ function loadGitConfig() {
|
|
|
83131
83157
|
remote: "origin",
|
|
83132
83158
|
branch: "main"
|
|
83133
83159
|
};
|
|
83134
|
-
const paths = [
|
|
83160
|
+
const paths = [join27(AGENTS_DIR7, "agent.yaml"), join27(AGENTS_DIR7, "AGENT.yaml")];
|
|
83135
83161
|
for (const p2 of paths) {
|
|
83136
83162
|
if (!existsSync20(p2))
|
|
83137
83163
|
continue;
|
|
@@ -83162,7 +83188,7 @@ var gitSyncTimer = null;
|
|
|
83162
83188
|
var lastGitSync = null;
|
|
83163
83189
|
var gitSyncInProgress = false;
|
|
83164
83190
|
function isGitRepo(dir) {
|
|
83165
|
-
return existsSync20(
|
|
83191
|
+
return existsSync20(join27(dir, ".git"));
|
|
83166
83192
|
}
|
|
83167
83193
|
async function runCommand(cmd, args, options) {
|
|
83168
83194
|
return new Promise((resolve4) => {
|
|
@@ -83245,15 +83271,15 @@ async function getGhCliToken() {
|
|
|
83245
83271
|
}
|
|
83246
83272
|
}
|
|
83247
83273
|
async function hasAnyGitCredentials() {
|
|
83248
|
-
if (!isGitRepo(
|
|
83274
|
+
if (!isGitRepo(AGENTS_DIR7))
|
|
83249
83275
|
return false;
|
|
83250
|
-
const remoteUrl = await getRemoteUrl(
|
|
83276
|
+
const remoteUrl = await getRemoteUrl(AGENTS_DIR7, gitConfig.remote);
|
|
83251
83277
|
if (!remoteUrl)
|
|
83252
83278
|
return false;
|
|
83253
83279
|
if (remoteUrl.startsWith("git@"))
|
|
83254
83280
|
return true;
|
|
83255
83281
|
if (remoteUrl.startsWith("https://")) {
|
|
83256
|
-
const creds = await getCredentialHelperToken(remoteUrl,
|
|
83282
|
+
const creds = await getCredentialHelperToken(remoteUrl, AGENTS_DIR7);
|
|
83257
83283
|
if (creds)
|
|
83258
83284
|
return true;
|
|
83259
83285
|
}
|
|
@@ -83333,10 +83359,10 @@ function runGitCommand(args, cwd) {
|
|
|
83333
83359
|
});
|
|
83334
83360
|
}
|
|
83335
83361
|
async function gitPull() {
|
|
83336
|
-
if (!isGitRepo(
|
|
83362
|
+
if (!isGitRepo(AGENTS_DIR7)) {
|
|
83337
83363
|
return { success: false, message: "Not a git repository" };
|
|
83338
83364
|
}
|
|
83339
|
-
const creds = await resolveGitCredentials(
|
|
83365
|
+
const creds = await resolveGitCredentials(AGENTS_DIR7, gitConfig.remote);
|
|
83340
83366
|
if (creds.method === "no-remote") {
|
|
83341
83367
|
return {
|
|
83342
83368
|
success: true,
|
|
@@ -83346,9 +83372,9 @@ async function gitPull() {
|
|
|
83346
83372
|
}
|
|
83347
83373
|
let fetchResult;
|
|
83348
83374
|
if (creds.usePlainGit) {
|
|
83349
|
-
fetchResult = await runGitCommand(["fetch", gitConfig.remote, gitConfig.branch],
|
|
83375
|
+
fetchResult = await runGitCommand(["fetch", gitConfig.remote, gitConfig.branch], AGENTS_DIR7);
|
|
83350
83376
|
} else if (creds.authUrl) {
|
|
83351
|
-
fetchResult = await runGitCommand(["fetch", creds.authUrl, gitConfig.branch],
|
|
83377
|
+
fetchResult = await runGitCommand(["fetch", creds.authUrl, gitConfig.branch], AGENTS_DIR7);
|
|
83352
83378
|
} else {
|
|
83353
83379
|
return {
|
|
83354
83380
|
success: false,
|
|
@@ -83359,16 +83385,16 @@ async function gitPull() {
|
|
|
83359
83385
|
logger.warn("git", `Fetch failed: ${fetchResult.stderr}`);
|
|
83360
83386
|
return { success: false, message: `Fetch failed: ${fetchResult.stderr}` };
|
|
83361
83387
|
}
|
|
83362
|
-
const diffResult = await runGitCommand(["rev-list", "--count", `HEAD..${gitConfig.remote}/${gitConfig.branch}`],
|
|
83388
|
+
const diffResult = await runGitCommand(["rev-list", "--count", `HEAD..${gitConfig.remote}/${gitConfig.branch}`], AGENTS_DIR7);
|
|
83363
83389
|
const incomingChanges = Number.parseInt(diffResult.stdout.trim(), 10) || 0;
|
|
83364
83390
|
if (incomingChanges === 0) {
|
|
83365
83391
|
return { success: true, message: "Already up to date", changes: 0 };
|
|
83366
83392
|
}
|
|
83367
|
-
const statusResult = await runGitCommand(["status", "--porcelain"],
|
|
83393
|
+
const statusResult = await runGitCommand(["status", "--porcelain"], AGENTS_DIR7);
|
|
83368
83394
|
const hasLocalChanges = statusResult.stdout.trim().length > 0;
|
|
83369
83395
|
let stashed = false;
|
|
83370
83396
|
if (hasLocalChanges) {
|
|
83371
|
-
const stashResult = await runGitCommand(["stash", "push", "-m", "signet-auto-stash"],
|
|
83397
|
+
const stashResult = await runGitCommand(["stash", "push", "-m", "signet-auto-stash"], AGENTS_DIR7);
|
|
83372
83398
|
if (stashResult.code !== 0) {
|
|
83373
83399
|
logger.warn("git", `Stash failed: ${stashResult.stderr}`);
|
|
83374
83400
|
return {
|
|
@@ -83378,9 +83404,9 @@ async function gitPull() {
|
|
|
83378
83404
|
}
|
|
83379
83405
|
stashed = true;
|
|
83380
83406
|
}
|
|
83381
|
-
const pullResult = await runGitCommand(["merge", `${gitConfig.remote}/${gitConfig.branch}`, "--ff-only"],
|
|
83407
|
+
const pullResult = await runGitCommand(["merge", `${gitConfig.remote}/${gitConfig.branch}`, "--ff-only"], AGENTS_DIR7);
|
|
83382
83408
|
if (stashed) {
|
|
83383
|
-
const popResult = await runGitCommand(["stash", "pop"],
|
|
83409
|
+
const popResult = await runGitCommand(["stash", "pop"], AGENTS_DIR7);
|
|
83384
83410
|
if (popResult.code !== 0) {
|
|
83385
83411
|
logger.warn("git", `Stash pop failed \u2014 local changes preserved in git stash: ${popResult.stderr}`);
|
|
83386
83412
|
}
|
|
@@ -83397,10 +83423,10 @@ async function gitPull() {
|
|
|
83397
83423
|
};
|
|
83398
83424
|
}
|
|
83399
83425
|
async function gitPush() {
|
|
83400
|
-
if (!isGitRepo(
|
|
83426
|
+
if (!isGitRepo(AGENTS_DIR7)) {
|
|
83401
83427
|
return { success: false, message: "Not a git repository" };
|
|
83402
83428
|
}
|
|
83403
|
-
const creds = await resolveGitCredentials(
|
|
83429
|
+
const creds = await resolveGitCredentials(AGENTS_DIR7, gitConfig.remote);
|
|
83404
83430
|
if (creds.method === "no-remote") {
|
|
83405
83431
|
return {
|
|
83406
83432
|
success: true,
|
|
@@ -83408,16 +83434,16 @@ async function gitPush() {
|
|
|
83408
83434
|
changes: 0
|
|
83409
83435
|
};
|
|
83410
83436
|
}
|
|
83411
|
-
const diffResult = await runGitCommand(["rev-list", "--count", `${gitConfig.remote}/${gitConfig.branch}..HEAD`],
|
|
83437
|
+
const diffResult = await runGitCommand(["rev-list", "--count", `${gitConfig.remote}/${gitConfig.branch}..HEAD`], AGENTS_DIR7);
|
|
83412
83438
|
const outgoingChanges = Number.parseInt(diffResult.stdout.trim(), 10) || 0;
|
|
83413
83439
|
if (outgoingChanges === 0) {
|
|
83414
83440
|
return { success: true, message: "Nothing to push", changes: 0 };
|
|
83415
83441
|
}
|
|
83416
83442
|
let pushResult;
|
|
83417
83443
|
if (creds.usePlainGit) {
|
|
83418
|
-
pushResult = await runGitCommand(["push", gitConfig.remote, `HEAD:${gitConfig.branch}`],
|
|
83444
|
+
pushResult = await runGitCommand(["push", gitConfig.remote, `HEAD:${gitConfig.branch}`], AGENTS_DIR7);
|
|
83419
83445
|
} else if (creds.authUrl) {
|
|
83420
|
-
pushResult = await runGitCommand(["push", creds.authUrl, `HEAD:${gitConfig.branch}`],
|
|
83446
|
+
pushResult = await runGitCommand(["push", creds.authUrl, `HEAD:${gitConfig.branch}`], AGENTS_DIR7);
|
|
83421
83447
|
} else {
|
|
83422
83448
|
return {
|
|
83423
83449
|
success: false,
|
|
@@ -83494,16 +83520,16 @@ function stopGitSyncTimer() {
|
|
|
83494
83520
|
}
|
|
83495
83521
|
async function getGitStatus() {
|
|
83496
83522
|
const status = {
|
|
83497
|
-
isRepo: isGitRepo(
|
|
83523
|
+
isRepo: isGitRepo(AGENTS_DIR7),
|
|
83498
83524
|
hasCredentials: false,
|
|
83499
83525
|
autoSync: gitConfig.autoSync
|
|
83500
83526
|
};
|
|
83501
83527
|
if (!status.isRepo)
|
|
83502
83528
|
return status;
|
|
83503
|
-
const creds = await resolveGitCredentials(
|
|
83529
|
+
const creds = await resolveGitCredentials(AGENTS_DIR7, gitConfig.remote);
|
|
83504
83530
|
status.hasCredentials = creds.method !== "none" && creds.method !== "no-remote";
|
|
83505
83531
|
status.authMethod = creds.method;
|
|
83506
|
-
const branchResult = await runGitCommand(["rev-parse", "--abbrev-ref", "HEAD"],
|
|
83532
|
+
const branchResult = await runGitCommand(["rev-parse", "--abbrev-ref", "HEAD"], AGENTS_DIR7);
|
|
83507
83533
|
if (branchResult.code === 0) {
|
|
83508
83534
|
status.branch = branchResult.stdout.trim();
|
|
83509
83535
|
}
|
|
@@ -83511,17 +83537,17 @@ async function getGitStatus() {
|
|
|
83511
83537
|
if (lastGitSync) {
|
|
83512
83538
|
status.lastSync = lastGitSync.toISOString();
|
|
83513
83539
|
}
|
|
83514
|
-
const statusResult = await runGitCommand(["status", "--porcelain"],
|
|
83540
|
+
const statusResult = await runGitCommand(["status", "--porcelain"], AGENTS_DIR7);
|
|
83515
83541
|
if (statusResult.code === 0) {
|
|
83516
83542
|
status.uncommittedChanges = statusResult.stdout.trim().split(`
|
|
83517
83543
|
`).filter((l2) => l2.trim()).length;
|
|
83518
83544
|
}
|
|
83519
83545
|
if (status.hasCredentials) {
|
|
83520
|
-
const unpushedResult = await runGitCommand(["rev-list", "--count", `${gitConfig.remote}/${gitConfig.branch}..HEAD`],
|
|
83546
|
+
const unpushedResult = await runGitCommand(["rev-list", "--count", `${gitConfig.remote}/${gitConfig.branch}..HEAD`], AGENTS_DIR7);
|
|
83521
83547
|
if (unpushedResult.code === 0) {
|
|
83522
83548
|
status.unpushedCommits = Number.parseInt(unpushedResult.stdout.trim(), 10) || 0;
|
|
83523
83549
|
}
|
|
83524
|
-
const unpulledResult = await runGitCommand(["rev-list", "--count", `HEAD..${gitConfig.remote}/${gitConfig.branch}`],
|
|
83550
|
+
const unpulledResult = await runGitCommand(["rev-list", "--count", `HEAD..${gitConfig.remote}/${gitConfig.branch}`], AGENTS_DIR7);
|
|
83525
83551
|
if (unpulledResult.code === 0) {
|
|
83526
83552
|
status.unpulledCommits = Number.parseInt(unpulledResult.stdout.trim(), 10) || 0;
|
|
83527
83553
|
}
|
|
@@ -83588,12 +83614,12 @@ function scheduleAutoCommit(changedPath) {
|
|
|
83588
83614
|
commitPending = true;
|
|
83589
83615
|
const changes = [...pendingChanges];
|
|
83590
83616
|
pendingChanges = [];
|
|
83591
|
-
await gitAutoCommit(
|
|
83617
|
+
await gitAutoCommit(AGENTS_DIR7, changes);
|
|
83592
83618
|
commitPending = false;
|
|
83593
83619
|
}, COMMIT_DEBOUNCE_MS);
|
|
83594
83620
|
}
|
|
83595
83621
|
async function syncHarnessConfigs() {
|
|
83596
|
-
const agentsMdPath =
|
|
83622
|
+
const agentsMdPath = join27(AGENTS_DIR7, "AGENTS.md");
|
|
83597
83623
|
if (!existsSync20(agentsMdPath))
|
|
83598
83624
|
return;
|
|
83599
83625
|
const rawContent = readFileSync16(agentsMdPath, "utf-8");
|
|
@@ -83607,7 +83633,7 @@ async function syncHarnessConfigs() {
|
|
|
83607
83633
|
{ name: "MEMORY.md", desc: "Working memory context" },
|
|
83608
83634
|
{ name: "agent.yaml", desc: "Configuration & settings" }
|
|
83609
83635
|
];
|
|
83610
|
-
const existingFiles = files.filter((f2) => existsSync20(
|
|
83636
|
+
const existingFiles = files.filter((f2) => existsSync20(join27(AGENTS_DIR7, f2.name)));
|
|
83611
83637
|
const fileList = existingFiles.map((f2) => `# - ~/.agents/${f2.name} (${f2.desc})`).join(`
|
|
83612
83638
|
`);
|
|
83613
83639
|
return `# ${targetName}
|
|
@@ -83631,7 +83657,7 @@ ${fileList}
|
|
|
83631
83657
|
`;
|
|
83632
83658
|
};
|
|
83633
83659
|
const identityExtras = ["SOUL.md", "IDENTITY.md", "USER.md", "MEMORY.md"].map((name) => {
|
|
83634
|
-
const p2 =
|
|
83660
|
+
const p2 = join27(AGENTS_DIR7, name);
|
|
83635
83661
|
if (!existsSync20(p2))
|
|
83636
83662
|
return "";
|
|
83637
83663
|
try {
|
|
@@ -83649,19 +83675,19 @@ ${c2}`;
|
|
|
83649
83675
|
}).filter(Boolean).join(`
|
|
83650
83676
|
`);
|
|
83651
83677
|
const composed = withBlock + identityExtras;
|
|
83652
|
-
const claudeDir =
|
|
83678
|
+
const claudeDir = join27(homedir17(), ".claude");
|
|
83653
83679
|
if (existsSync20(claudeDir)) {
|
|
83654
83680
|
try {
|
|
83655
|
-
writeFileSync9(
|
|
83681
|
+
writeFileSync9(join27(claudeDir, "CLAUDE.md"), buildHeader("CLAUDE.md") + composed);
|
|
83656
83682
|
logger.sync.harness("claude-code", "~/.claude/CLAUDE.md");
|
|
83657
83683
|
} catch (e) {
|
|
83658
83684
|
logger.sync.failed("claude-code", e);
|
|
83659
83685
|
}
|
|
83660
83686
|
}
|
|
83661
|
-
const opencodeDir =
|
|
83687
|
+
const opencodeDir = join27(homedir17(), ".config", "opencode");
|
|
83662
83688
|
if (existsSync20(opencodeDir)) {
|
|
83663
83689
|
try {
|
|
83664
|
-
writeFileSync9(
|
|
83690
|
+
writeFileSync9(join27(opencodeDir, "AGENTS.md"), buildHeader("AGENTS.md") + composed);
|
|
83665
83691
|
logger.sync.harness("opencode", "~/.config/opencode/AGENTS.md");
|
|
83666
83692
|
} catch (e) {
|
|
83667
83693
|
logger.sync.failed("opencode", e);
|
|
@@ -83670,7 +83696,7 @@ ${c2}`;
|
|
|
83670
83696
|
ensureArchitectureDoc();
|
|
83671
83697
|
}
|
|
83672
83698
|
function ensureArchitectureDoc() {
|
|
83673
|
-
const archPath =
|
|
83699
|
+
const archPath = join27(AGENTS_DIR7, "SIGNET-ARCHITECTURE.md");
|
|
83674
83700
|
try {
|
|
83675
83701
|
const archContent = buildArchitectureDoc();
|
|
83676
83702
|
const existing = existsSync20(archPath) ? readFileSync16(archPath, "utf-8") : "";
|
|
@@ -83699,14 +83725,14 @@ function scheduleSyncHarnessConfigs() {
|
|
|
83699
83725
|
}
|
|
83700
83726
|
function startFileWatcher() {
|
|
83701
83727
|
watcher = watch([
|
|
83702
|
-
|
|
83703
|
-
|
|
83704
|
-
|
|
83705
|
-
|
|
83706
|
-
|
|
83707
|
-
|
|
83708
|
-
|
|
83709
|
-
|
|
83728
|
+
join27(AGENTS_DIR7, "agent.yaml"),
|
|
83729
|
+
join27(AGENTS_DIR7, "AGENTS.md"),
|
|
83730
|
+
join27(AGENTS_DIR7, "SOUL.md"),
|
|
83731
|
+
join27(AGENTS_DIR7, "MEMORY.md"),
|
|
83732
|
+
join27(AGENTS_DIR7, "IDENTITY.md"),
|
|
83733
|
+
join27(AGENTS_DIR7, "USER.md"),
|
|
83734
|
+
join27(AGENTS_DIR7, "SIGNET-ARCHITECTURE.md"),
|
|
83735
|
+
join27(AGENTS_DIR7, "memory")
|
|
83710
83736
|
], {
|
|
83711
83737
|
persistent: true,
|
|
83712
83738
|
ignoreInitial: true,
|
|
@@ -83747,10 +83773,10 @@ function startFileWatcher() {
|
|
|
83747
83773
|
}
|
|
83748
83774
|
var syncedClaudeMemories = new Set;
|
|
83749
83775
|
function startClaudeMemoryWatcher() {
|
|
83750
|
-
const claudeProjectsDir =
|
|
83776
|
+
const claudeProjectsDir = join27(homedir17(), ".claude", "projects");
|
|
83751
83777
|
if (!existsSync20(claudeProjectsDir))
|
|
83752
83778
|
return;
|
|
83753
|
-
const claudeWatcher = watch(
|
|
83779
|
+
const claudeWatcher = watch(join27(claudeProjectsDir, "**", "memory", "MEMORY.md"), {
|
|
83754
83780
|
persistent: true,
|
|
83755
83781
|
ignoreInitial: true
|
|
83756
83782
|
});
|
|
@@ -83768,7 +83794,7 @@ async function syncExistingClaudeMemories(claudeProjectsDir) {
|
|
|
83768
83794
|
const projects = readdirSync7(claudeProjectsDir);
|
|
83769
83795
|
let totalSynced = 0;
|
|
83770
83796
|
for (const project of projects) {
|
|
83771
|
-
const memoryFile =
|
|
83797
|
+
const memoryFile = join27(claudeProjectsDir, project, "memory", "MEMORY.md");
|
|
83772
83798
|
if (existsSync20(memoryFile)) {
|
|
83773
83799
|
const count = await syncClaudeMemoryFile(memoryFile);
|
|
83774
83800
|
totalSynced += count;
|
|
@@ -84065,7 +84091,7 @@ async function ingestMemoryMarkdown(filePath) {
|
|
|
84065
84091
|
return inserted;
|
|
84066
84092
|
}
|
|
84067
84093
|
async function importExistingMemoryFiles() {
|
|
84068
|
-
const memoryDir =
|
|
84094
|
+
const memoryDir = join27(AGENTS_DIR7, "memory");
|
|
84069
84095
|
if (!existsSync20(memoryDir)) {
|
|
84070
84096
|
logger.debug("daemon", "Memory directory does not exist, skipping initial import");
|
|
84071
84097
|
return 0;
|
|
@@ -84080,7 +84106,7 @@ async function importExistingMemoryFiles() {
|
|
|
84080
84106
|
}
|
|
84081
84107
|
let totalChunks = 0;
|
|
84082
84108
|
for (const file2 of files) {
|
|
84083
|
-
const count = await ingestMemoryMarkdown(
|
|
84109
|
+
const count = await ingestMemoryMarkdown(join27(memoryDir, file2));
|
|
84084
84110
|
totalChunks += count;
|
|
84085
84111
|
}
|
|
84086
84112
|
if (totalChunks > 0) {
|
|
@@ -84150,7 +84176,7 @@ process.on("uncaughtException", (err) => {
|
|
|
84150
84176
|
});
|
|
84151
84177
|
async function main() {
|
|
84152
84178
|
logger.info("daemon", "Signet Daemon starting");
|
|
84153
|
-
logger.info("daemon", "Agents directory", { path:
|
|
84179
|
+
logger.info("daemon", "Agents directory", { path: AGENTS_DIR7 });
|
|
84154
84180
|
logger.info("daemon", "Port configured", { port: PORT });
|
|
84155
84181
|
mkdirSync11(DAEMON_DIR, { recursive: true });
|
|
84156
84182
|
mkdirSync11(LOG_DIR, { recursive: true });
|
|
@@ -84160,7 +84186,7 @@ async function main() {
|
|
|
84160
84186
|
startFileWatcher();
|
|
84161
84187
|
logger.info("watcher", "File watcher started");
|
|
84162
84188
|
ensureArchitectureDoc();
|
|
84163
|
-
const memoryCfg = loadMemoryConfig(
|
|
84189
|
+
const memoryCfg = loadMemoryConfig(AGENTS_DIR7);
|
|
84164
84190
|
logger.info("config", "Resolved embedding config", {
|
|
84165
84191
|
provider: memoryCfg.embedding.provider,
|
|
84166
84192
|
model: memoryCfg.embedding.model,
|
|
@@ -84318,7 +84344,7 @@ async function main() {
|
|
|
84318
84344
|
const schedulerHandle = startSchedulerWorker(getDbAccessor());
|
|
84319
84345
|
checkpointPruneTimer = setInterval(() => {
|
|
84320
84346
|
try {
|
|
84321
|
-
const cfg = loadMemoryConfig(
|
|
84347
|
+
const cfg = loadMemoryConfig(AGENTS_DIR7).pipelineV2.continuity;
|
|
84322
84348
|
if (cfg.enabled) {
|
|
84323
84349
|
pruneCheckpoints(getDbAccessor(), cfg.retentionDays);
|
|
84324
84350
|
}
|
|
@@ -84329,7 +84355,7 @@ async function main() {
|
|
|
84329
84355
|
}
|
|
84330
84356
|
}, 3600000);
|
|
84331
84357
|
startGitSyncTimer();
|
|
84332
|
-
initUpdateSystem(CURRENT_VERSION,
|
|
84358
|
+
initUpdateSystem(CURRENT_VERSION, AGENTS_DIR7, () => {
|
|
84333
84359
|
const daemonScript = process.argv[1] ?? "";
|
|
84334
84360
|
if (!daemonScript) {
|
|
84335
84361
|
logger.warn("daemon", "Cannot self-restart: process.argv[1] is empty, falling back to clean exit");
|
|
@@ -84348,7 +84374,7 @@ async function main() {
|
|
|
84348
84374
|
env: {
|
|
84349
84375
|
...process.env,
|
|
84350
84376
|
SIGNET_PORT: String(PORT),
|
|
84351
|
-
SIGNET_PATH:
|
|
84377
|
+
SIGNET_PATH: AGENTS_DIR7
|
|
84352
84378
|
}
|
|
84353
84379
|
});
|
|
84354
84380
|
replacement.unref();
|
|
@@ -84357,7 +84383,7 @@ async function main() {
|
|
|
84357
84383
|
process.exit(0);
|
|
84358
84384
|
}, 500);
|
|
84359
84385
|
});
|
|
84360
|
-
initFeatureFlags(
|
|
84386
|
+
initFeatureFlags(AGENTS_DIR7);
|
|
84361
84387
|
startUpdateTimer();
|
|
84362
84388
|
serve({
|
|
84363
84389
|
fetch: app.fetch,
|
|
@@ -84370,7 +84396,7 @@ async function main() {
|
|
|
84370
84396
|
});
|
|
84371
84397
|
logger.info("daemon", "Daemon ready");
|
|
84372
84398
|
try {
|
|
84373
|
-
writeFileSync9(
|
|
84399
|
+
writeFileSync9(join27(DAEMON_DIR, "last-healthy-start"), JSON.stringify({
|
|
84374
84400
|
version: CURRENT_VERSION,
|
|
84375
84401
|
startedAt: new Date().toISOString(),
|
|
84376
84402
|
pid: process.pid
|
|
@@ -84380,7 +84406,7 @@ async function main() {
|
|
|
84380
84406
|
const errDetails = e instanceof Error ? { message: e.message, stack: e.stack } : { error: String(e) };
|
|
84381
84407
|
logger.error("daemon", "Failed to import existing memory files", undefined, errDetails);
|
|
84382
84408
|
});
|
|
84383
|
-
const claudeProjectsDir =
|
|
84409
|
+
const claudeProjectsDir = join27(homedir17(), ".claude", "projects");
|
|
84384
84410
|
if (existsSync20(claudeProjectsDir)) {
|
|
84385
84411
|
syncExistingClaudeMemories(claudeProjectsDir);
|
|
84386
84412
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as o,a as r}from"../chunks/HYZmioPA.js";export{o as load_css,r as start};
|