signetai 0.53.3 → 0.53.4
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/{R1uOjb-r.js → 5hcUiakN.js} +1 -1
- package/dashboard/_app/immutable/entry/{app.g14rtWz9.js → app.-fWI13U7.js} +2 -2
- package/dashboard/_app/immutable/entry/start.Dbvn3qU-.js +1 -0
- package/dashboard/_app/immutable/nodes/{1.ZwCpOLEt.js → 1.BxOyocEb.js} +1 -1
- package/dashboard/_app/version.json +1 -1
- package/dashboard/index.html +6 -6
- package/dist/daemon.js +397 -76
- package/dist/mcp-stdio.js +1 -1
- package/package.json +1 -1
- package/dashboard/_app/immutable/entry/start._kgbW0sW.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{bb as be,o as Ne,g as A,l as U,k as T,R as ee,bc as pt}from"./DD0ItAbu.js";class ke{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Ee{constructor(t,n){this.status=t,this.location=n}}class Se extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function gt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function mt(e){return e.split("%25").map(decodeURI).join("%25")}function _t(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function de({href:e}){return e.split("#")[0]}function vt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(s,o){if(o==="get"||o==="getAll"||o==="has")return(c,...d)=>(n(c),s[o](c,...d));t();const l=Reflect.get(s,o);return typeof l=="function"?l.bind(s):l}}),enumerable:!0,configurable:!0});const i=["href","pathname","search","toString","toJSON"];r&&i.push("hash");for(const s of i)Object.defineProperty(a,s,{get(){return t(),e[s]},enumerable:!0,configurable:!0});return a}function wt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;new TextDecoder;function yt(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const bt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&G.delete(Re(e)),bt(e,t));const G=new Map;function kt(e,t){const n=Re(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const s=r.getAttribute("data-ttl");return s&&G.set(n,{body:a,init:i,ttl:1e3*Number(s)}),r.getAttribute("data-b64")!==null&&(a=yt(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function Et(e,t,n){if(G.size>0){const r=Re(e,n),a=G.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);G.delete(r)}}return window.fetch(t,n)}function Re(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${wt(...a)}"]`}return r}const St=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Rt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Lt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return he(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return he(String.fromCharCode(...l.slice(2).split("-").map(v=>parseInt(v,16))));const d=St.exec(l),[,p,f,u,h]=d;return t.push({name:u,matcher:h,optional:!!p,rest:!!f,chained:f?c===1&&s[0]==="":!1}),f?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return he(l)}).join("")}).join("")}/?$`),params:t}}function xt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Lt(e){return e.slice(1).split("/").filter(xt)}function At(e,t,n){const r={},a=e.slice(1),i=a.filter(o=>o!==void 0);let s=0;for(let o=0;o<t.length;o+=1){const l=t[o];let c=a[o-s];if(l.chained&&l.rest&&s&&(c=a.slice(o-s,o+1).filter(d=>d).join("/"),s=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&l.chained&&(s=0),!d&&!p&&Object.keys(r).length===i.length&&(s=0);continue}if(l.optional&&l.chained){s++;continue}return}if(!s)return r}function he(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ut({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[l,c,d]])=>{const{pattern:p,params:f}=Rt(o),u={id:o,exec:h=>{const v=p.exec(h);if(v)return At(v,f,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...c||[]].map(s),leaf:i(l)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function i(o){const l=o<0;return l&&(o=~o),[l,e[o]]}function s(o){return o===void 0?o:[a.has(o),e[o]]}}function Me(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function je(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_1c7g34t?.base??"",Tt=globalThis.__sveltekit_1c7g34t?.assets??x??"",Pt="1773176091882",He="sveltekit:snapshot",We="sveltekit:scroll",Je="sveltekit:states",It="sveltekit:pageurl",K="sveltekit:history",H="sveltekit:navigation",N={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},xe=location.origin;function Ye(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function D(){return{x:pageXOffset,y:pageYOffset}}function V(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const De={...N,"":N.hover};function ze(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Xe(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=ze(e)}}function me(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||ce(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=r?.origin===xe&&e.hasAttribute("download");return{url:r,external:i,target:a,download:s}}function te(e){let t=null,n=null,r=null,a=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=V(o,"preload-code")),a===null&&(a=V(o,"preload-data")),t===null&&(t=V(o,"keepfocus")),n===null&&(n=V(o,"noscroll")),i===null&&(i=V(o,"reload")),s===null&&(s=V(o,"replacestate")),o=ze(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:De[r??"off"],preload_data:De[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function qe(e){const t=be(e);let n=!0;function r(){n=!0,t.update(s=>s)}function a(s){n=!1,t.set(s)}function i(s){let o;return t.subscribe(l=>{(o===void 0||n&&l!==o)&&s(o=l)})}return{notify:r,set:a,subscribe:i}}const Qe={v:()=>{}};function Ot(){const{set:e,subscribe:t}=be(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Tt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const s=(await a.json()).version!==Pt;return s&&(e(!0),Qe.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:r}}function ce(e,t,n){return e.origin!==xe||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function sn(e){}const Ze=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...Ze];const Ct=new Set([...Ze]);[...Ct];function $t(e){return e.filter(t=>t!=null)}function Le(e){return e instanceof ke||e instanceof Se?e.status:500}function Nt(e){return e instanceof Se?e.text:"Internal Error"}let k,W,pe;const jt=Ne.toString().includes("$$")||/function \w+\(\) \{\}/.test(Ne.toString());jt?(k={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},pe={current:!1}):(k=new class{#e=A({});get data(){return U(this.#e)}set data(t){T(this.#e,t)}#t=A(null);get form(){return U(this.#t)}set form(t){T(this.#t,t)}#n=A(null);get error(){return U(this.#n)}set error(t){T(this.#n,t)}#r=A({});get params(){return U(this.#r)}set params(t){T(this.#r,t)}#a=A({id:null});get route(){return U(this.#a)}set route(t){T(this.#a,t)}#o=A({});get state(){return U(this.#o)}set state(t){T(this.#o,t)}#s=A(-1);get status(){return U(this.#s)}set status(t){T(this.#s,t)}#i=A(new URL("https://example.com"));get url(){return U(this.#i)}set url(t){T(this.#i,t)}},W=new class{#e=A(null);get current(){return U(this.#e)}set current(t){T(this.#e,t)}},pe=new class{#e=A(!1);get current(){return U(this.#e)}set current(t){T(this.#e,t)}},Qe.v=()=>pe.current=!0);function Dt(e){Object.assign(k,e)}const Ve={spanContext(){return qt},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},qt={traceId:"",spanId:"",traceFlags:0},Vt=new Set(["icon","shortcut icon","apple-touch-icon"]),$=Me(We)??{},J=Me(He)??{},C={url:qe({}),page:qe({}),navigating:be(null),updated:Ot()};function Ae(e){$[e]=D()}function Kt(e,t){let n=e+1;for(;$[n];)delete $[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function Y(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function et(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function Ke(){}let Ue,_e,ne,P,ve,w;const re=[],ae=[];let L=null;function we(){L?.fork?.then(e=>e?.discard()),L=null}const Z=new Map,tt=new Set,Bt=new Set,M=new Set;let _={branch:[],error:null,url:null},nt=!1,oe=!1,Be=!0,z=!1,F=!1,rt=!1,Te=!1,at,y,R,j;const se=new Set,Fe=new Map;async function fn(e,t,n){globalThis.__sveltekit_1c7g34t?.data&&globalThis.__sveltekit_1c7g34t.data,document.URL!==location.href&&(location.href=location.href),w=e,await e.hooks.init?.(),Ue=Ut(e),P=document.documentElement,ve=t,_e=e.nodes[0],ne=e.nodes[1],_e(),ne(),y=history.state?.[K],R=history.state?.[H],y||(y=R=Date.now(),history.replaceState({...history.state,[K]:y,[H]:R},""));const r=$[y];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await tn(ve,n)):(await B({type:"enter",url:Ye(w.hash?an(new URL(location.href)):location.href),replace_state:!0}),a()),en()}function Ft(){re.length=0,Te=!1}function ot(e){ae.some(t=>t?.snapshot)&&(J[e]=ae.map(t=>t?.snapshot?.capture()))}function st(e){J[e]?.forEach((t,n)=>{ae[n]?.snapshot?.restore(t)})}function Ge(){Ae(y),je(We,$),ot(R),je(He,J)}async function Gt(e,t,n,r){let a;t.invalidateAll&&we(),await B({type:"goto",url:Ye(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Te=!0,a=[...Fe.keys()]),t.invalidate&&t.invalidate.forEach(Zt)}}),t.invalidateAll&&ee().then(ee).then(()=>{Fe.forEach(({resource:i},s)=>{a?.includes(s)&&i.refresh?.()})})}async function Mt(e){if(e.id!==L?.id){we();const t={};se.add(t),L={id:e.id,token:t,promise:ct({...e,preload:t}).then(n=>(se.delete(t),n.type==="loaded"&&n.state.error&&we(),n)),fork:null}}return L.promise}async function ge(e){const t=(await ue(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].map(n=>n?.[1]()))}async function it(e,t,n){_=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(k,e.props.page),at=new w.root({target:t,props:{...e.props,stores:C,components:ae},hydrate:n,sync:!1}),await Promise.resolve(),st(R),n){const a={from:null,to:{params:_.params,route:{id:_.route?.id??null},url:new URL(location.href),scroll:$[y]??D()},willUnload:!1,type:"enter",complete:Promise.resolve()};M.forEach(i=>i(a))}oe=!0}function ie({url:e,params:t,branch:n,status:r,error:a,route:i,form:s}){let o="never";if(x&&(e.pathname===x||e.pathname===x+"/"))o="always";else for(const u of n)u?.slash!==void 0&&(o=u.slash);e.pathname=gt(e.pathname,o),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:i},props:{constructors:$t(n).map(u=>u.node.component),page:$e(k)}};s!==void 0&&(l.props.form=s);let c={},d=!k,p=0;for(let u=0;u<Math.max(n.length,_.branch.length);u+=1){const h=n[u],v=_.branch[u];h?.data!==v?.data&&(d=!0),h&&(c={...c,...h.data},d&&(l.props[`data_${p}`]=c),p+=1)}return(!_.url||e.href!==_.url.href||_.error!==a||s!==void 0&&s!==k.form||d)&&(l.props.page={error:a,params:t,route:{id:i?.id??null},state:{},status:r,url:new URL(e),form:s??null,data:d?c:k.data}),l}async function Pe({loader:e,parent:t,url:n,params:r,route:a,server_data_node:i}){let s=null,o=!0;const l={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await e();if(c.universal?.load){let d=function(...f){for(const u of f){const{href:h}=new URL(u,n);l.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Ve,current:Ve},route:new Proxy(a,{get:(f,u)=>(o&&(l.route=!0),f[u])}),params:new Proxy(r,{get:(f,u)=>(o&&l.params.add(u),f[u])}),data:i?.data??null,url:vt(n,()=>{o&&(l.url=!0)},f=>{o&&l.search_params.add(f)},w.hash),async fetch(f,u){f instanceof Request&&(u={body:f.method==="GET"||f.method==="HEAD"?void 0:await f.blob(),cache:f.cache,credentials:f.credentials,headers:[...f.headers].length>0?f?.headers:void 0,integrity:f.integrity,keepalive:f.keepalive,method:f.method,mode:f.mode,redirect:f.redirect,referrer:f.referrer,referrerPolicy:f.referrerPolicy,signal:f.signal,...u});const{resolved:h,promise:v}=lt(f,u,n);return o&&d(h.href),v},setHeaders:()=>{},depends:d,parent(){return o&&(l.parent=!0),t()},untrack(f){o=!1;try{return f()}finally{o=!0}}};s=await c.universal.load.call(null,p)??null}return{node:c,loader:e,server:i,universal:c.universal?.load?{type:"data",data:s,uses:l}:null,data:s??i?.data??null,slash:c.universal?.trailingSlash??i?.slash}}function lt(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const i=oe?Et(r,a.href,t):kt(r,t);return{resolved:a,promise:i}}function Ht(e,t,n,r,a,i){if(Te)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const s of a.search_params)if(r.has(s))return!0;for(const s of a.params)if(i[s]!==_.params[s])return!0;for(const s of a.dependencies)if(re.some(o=>o(new URL(s))))return!0;return!1}function Ie(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Wt(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),i=t.searchParams.getAll(r);a.every(s=>i.includes(s))&&i.every(s=>a.includes(s))&&n.delete(r)}return n}function Jt({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:$e(k),constructors:[]}}}async function ct({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(L?.id===e)return se.delete(L.token),L.promise;const{errors:s,layouts:o,leaf:l}=a,c=[...o,l];s.forEach(m=>m?.().catch(()=>{})),c.forEach(m=>m?.[1]().catch(()=>{}));const d=_.url?e!==le(_.url):!1,p=_.route?a.id!==_.route.id:!1,f=Wt(_.url,n);let u=!1;const h=c.map(async(m,g)=>{if(!m)return;const E=_.branch[g];return m[1]===E?.loader&&!Ht(u,p,d,f,E.universal?.uses,r)?E:(u=!0,Pe({loader:m[1],url:n,params:r,route:a,parent:async()=>{const I={};for(let O=0;O<g;O+=1)Object.assign(I,(await h[O])?.data);return I},server_data_node:Ie(m[0]?{type:"skip"}:null,m[0]?E?.server:void 0)}))});for(const m of h)m.catch(()=>{});const v=[];for(let m=0;m<c.length;m+=1)if(c[m])try{v.push(await h[m])}catch(g){if(g instanceof Ee)return{type:"redirect",location:g.location};if(se.has(i))return Jt({error:await X(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let E=Le(g),S;if(g instanceof ke)S=g.body;else{if(await C.updated.check())return await et(),await Y(n);S=await X(g,{params:r,url:n,route:{id:a.id}})}const I=await Yt(m,v,s);return I?ie({url:n,params:r,branch:v.slice(0,I.idx).concat(I.node),status:E,error:S,route:a}):await ft(n,{id:a.id},S,E)}else v.push(void 0);return ie({url:n,params:r,branch:v,status:200,error:null,route:a,form:t?void 0:null})}async function Yt(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function Oe({status:e,error:t,url:n,route:r}){const a={};let i=null;try{const s=await Pe({loader:_e,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Ie(i)}),o={node:await ne(),loader:ne,universal:null,server:null,data:null};return ie({url:n,params:a,branch:[s,o],status:e,error:t,route:null})}catch(s){if(s instanceof Ee)return Gt(new URL(s.location,location.href),{},0);throw s}}async function zt(e){const t=e.href;if(Z.has(t))return Z.get(t);let n;try{const r=(async()=>{let a=await w.hooks.reroute({url:new URL(e),fetch:async(i,s)=>lt(i,s,e).promise})??e;if(typeof a=="string"){const i=new URL(e);w.hash?i.hash=a:i.pathname=a,a=i}return a})();Z.set(t,r),n=await r}catch{Z.delete(t);return}return n}async function ue(e,t){if(e&&!ce(e,x,w.hash)){const n=await zt(e);if(!n)return;const r=Xt(n);for(const a of Ue){const i=a.exec(r);if(i)return{id:le(e),invalidating:t,route:a,params:_t(i),url:e}}}}function Xt(e){return mt(w.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function le(e){return(w.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function ut({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let s=!1;const o=Ce(_,n,e,t,i??null);r!==void 0&&(o.navigation.delta=r),a!==void 0&&(o.navigation.event=a);const l={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return z||tt.forEach(c=>c(l)),s?null:o}async function B({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s={},redirect_count:o=0,nav_token:l={},accept:c=Ke,block:d=Ke,event:p}){const f=j;j=l;const u=await ue(t,!1),h=e==="enter"?Ce(_,u,t,e):ut({url:t,type:e,delta:n?.delta,intent:u,scroll:n?.scroll,event:p});if(!h){d(),j===l&&(j=f);return}const v=y,m=R;c(),z=!0,oe&&h.navigation.type!=="enter"&&C.navigating.set(W.current=h.navigation);let g=u&&await ct(u);if(!g){if(ce(t,x,w.hash))return await Y(t,i);g=await ft(t,{id:null},await X(new Se(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=u?.url||t,j!==l)return h.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(o<20){await B({type:e,url:new URL(g.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s,redirect_count:o+1,nav_token:l}),h.fulfil(void 0);return}g=await Oe({status:500,error:await X(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await C.updated.check()&&(await et(),await Y(t,i));if(Ft(),Ae(v),ot(m),g.props.page.url.pathname!==t.pathname&&(t.pathname=g.props.page.url.pathname),s=n?n.state:s,!n){const b=i?0:1,Q={[K]:y+=b,[H]:R+=b,[Je]:s};(i?history.replaceState:history.pushState).call(history,Q,"",t),i||Kt(y,R)}const E=u&&L?.id===u.id?L.fork:null;L=null,g.props.page.state=s;let S;if(oe){const b=(await Promise.all(Array.from(Bt,q=>q(h.navigation)))).filter(q=>typeof q=="function");if(b.length>0){let q=function(){b.forEach(fe=>{M.delete(fe)})};b.push(q),b.forEach(fe=>{M.add(fe)})}_=g.state,g.props.page&&(g.props.page.url=t);const Q=E&&await E;Q?S=Q.commit():(at.$set(g.props),Dt(g.props.page),S=pt?.()),rt=!0}else await it(g,ve,!1);const{activeElement:I}=document;await S,await ee(),await ee();let O=null;if(Be){const b=n?n.scroll:a?D():null;b?scrollTo(b.x,b.y):(O=t.hash&&document.getElementById(dt(t)))?O.scrollIntoView():scrollTo(0,0)}const ht=document.activeElement!==I&&document.activeElement!==document.body;!r&&!ht&&rn(t,!O),Be=!0,g.props.page&&Object.assign(k,g.props.page),z=!1,e==="popstate"&&st(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=D()),M.forEach(b=>b(h.navigation)),C.navigating.set(W.current=null)}async function ft(e,t,n,r,a){return e.origin===xe&&e.pathname===location.pathname&&!nt?await Oe({status:r,error:n,url:e,route:t}):await Y(e,a)}function Qt(){let e,t={element:void 0,href:void 0},n;P.addEventListener("mousemove",o=>{const l=o.target;clearTimeout(e),e=setTimeout(()=>{i(l,N.hover)},20)});function r(o){o.defaultPrevented||i(o.composedPath()[0],N.tap)}P.addEventListener("mousedown",r),P.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const l of o)l.isIntersecting&&(ge(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(o,l){const c=Xe(o,P),d=c===t.element&&c?.href===t.href&&l>=n;if(!c||d)return;const{url:p,external:f,download:u}=me(c,x,w.hash);if(f||u)return;const h=te(c),v=p&&le(_.url)===le(p);if(!(h.reload||v))if(l<=h.preload_data){t={element:c,href:c.href},n=N.tap;const m=await ue(p,!1);if(!m)return;Mt(m)}else l<=h.preload_code&&(t={element:c,href:c.href},n=l,ge(p))}function s(){a.disconnect();for(const o of P.querySelectorAll("a")){const{url:l,external:c,download:d}=me(o,x,w.hash);if(c||d)continue;const p=te(o);p.reload||(p.preload_code===N.viewport&&a.observe(o),p.preload_code===N.eager&&ge(l))}}M.add(s),s()}function X(e,t){if(e instanceof ke)return e.body;const n=Le(e),r=Nt(e);return w.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Zt(e){if(typeof e=="function")re.push(e);else{const{href:t}=new URL(e,location.href);re.push(n=>n.href===t)}}function en(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Ge(),!z){const r=Ce(_,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};tt.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ge()}),navigator.connection?.saveData||Qt(),P.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=Xe(t.composedPath()[0],P);if(!n)return;const{url:r,external:a,target:i,download:s}=me(n,x,w.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const o=te(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||s)return;const[c,d]=(w.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=c===de(location);if(a||o.reload&&(!p||!d)){ut({url:r,type:"link",event:t})?z=!0:t.preventDefault();return}if(d!==void 0&&p){const[,f]=_.url.href.split("#");if(f===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const u=n.ownerDocument.getElementById(decodeURIComponent(d));u&&(u.scrollIntoView(),u.focus())}return}if(F=!0,Ae(y),e(r),!o.replace_state)return;F=!1}t.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await B({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),P.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const s=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(ce(s,x,!1))return;const o=t.target,l=te(o);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(o,r);s.search=new URLSearchParams(c).toString(),B({type:"form",url:s,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??s.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!ye){if(t.state?.[K]){const n=t.state[K];if(j={},n===y)return;const r=$[n],a=t.state[Je]??{},i=new URL(t.state[It]??location.href),s=t.state[H],o=_.url?de(location)===de(_.url):!1;if(s===R&&(rt||o)){a!==k.state&&(k.state=a),e(i),$[y]=D(),r&&scrollTo(r.x,r.y),y=n;return}const c=n-y;await B({type:"popstate",url:i,popped:{state:a,scroll:r,delta:c},accept:()=>{y=n,R=s},block:()=>{history.go(-c)},nav_token:j,event:t})}else if(!F){const n=new URL(location.href);e(n),w.hash&&location.reload()}}}),addEventListener("hashchange",()=>{F&&(F=!1,history.replaceState({...history.state,[K]:++y,[H]:R},"",location.href))});for(const t of document.querySelectorAll("link"))Vt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&C.navigating.set(W.current=null)});function e(t){_.url=k.url=t,C.page.set($e(k)),C.page.notify()}}async function tn(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:s,data:o,form:l}){nt=!0;const c=new URL(location.href);let d;({params:a={},route:i={id:null}}=await ue(c,!1)||{}),d=Ue.find(({id:u})=>u===i.id);let p,f=!0;try{const u=r.map(async(v,m)=>{const g=o[m];return g?.uses&&(g.uses=nn(g.uses)),Pe({loader:w.nodes[v],url:c,params:a,route:i,parent:async()=>{const E={};for(let S=0;S<m;S+=1)Object.assign(E,(await u[S]).data);return E},server_data_node:Ie(g)})}),h=await Promise.all(u);if(d){const v=d.layouts;for(let m=0;m<v.length;m++)v[m]||h.splice(m,0,void 0)}p=ie({url:c,params:a,branch:h,status:t,error:n,form:l,route:d??null})}catch(u){if(u instanceof Ee){await Y(new URL(u.location,location.href));return}p=await Oe({status:Le(u),error:await X(u,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",f=!1}p.props.page&&(p.props.page.state={}),await it(p,e,f)}function nn(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let ye=!1;function rn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=dt(e);if(r&&document.getElementById(r)){const{x:i,y:s}=D();setTimeout(()=>{const o=history.state;ye=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),ye=!1})}else{const i=document.body,s=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),s!==null?i.setAttribute("tabindex",s):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let s=0;s<a.rangeCount;s+=1)i.push(a.getRangeAt(s));setTimeout(()=>{if(a.rangeCount===i.length){for(let s=0;s<a.rangeCount;s+=1){const o=i[s],l=a.getRangeAt(s);if(o.commonAncestorContainer!==l.commonAncestorContainer||o.startContainer!==l.startContainer||o.endContainer!==l.endContainer||o.startOffset!==l.startOffset||o.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function Ce(e,t,n,r,a=null){let i,s;const o=new Promise((c,d)=>{i=c,s=d});return o.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:D()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:o},fulfil:i,reject:s}}function $e(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function an(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function dt(e){let t;if(w.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{fn as a,sn as l,k as p,C as s};
|
|
1
|
+
import{bb as be,o as Ne,g as A,l as U,k as T,R as ee,bc as pt}from"./DD0ItAbu.js";class ke{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Ee{constructor(t,n){this.status=t,this.location=n}}class Se extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function gt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function mt(e){return e.split("%25").map(decodeURI).join("%25")}function _t(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function de({href:e}){return e.split("#")[0]}function vt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(s,o){if(o==="get"||o==="getAll"||o==="has")return(c,...d)=>(n(c),s[o](c,...d));t();const l=Reflect.get(s,o);return typeof l=="function"?l.bind(s):l}}),enumerable:!0,configurable:!0});const i=["href","pathname","search","toString","toJSON"];r&&i.push("hash");for(const s of i)Object.defineProperty(a,s,{get(){return t(),e[s]},enumerable:!0,configurable:!0});return a}function wt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;new TextDecoder;function yt(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const bt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&G.delete(Re(e)),bt(e,t));const G=new Map;function kt(e,t){const n=Re(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const s=r.getAttribute("data-ttl");return s&&G.set(n,{body:a,init:i,ttl:1e3*Number(s)}),r.getAttribute("data-b64")!==null&&(a=yt(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function Et(e,t,n){if(G.size>0){const r=Re(e,n),a=G.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);G.delete(r)}}return window.fetch(t,n)}function Re(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${wt(...a)}"]`}return r}const St=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Rt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${Lt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return he(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return he(String.fromCharCode(...l.slice(2).split("-").map(v=>parseInt(v,16))));const d=St.exec(l),[,p,f,u,h]=d;return t.push({name:u,matcher:h,optional:!!p,rest:!!f,chained:f?c===1&&s[0]==="":!1}),f?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return he(l)}).join("")}).join("")}/?$`),params:t}}function xt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Lt(e){return e.slice(1).split("/").filter(xt)}function At(e,t,n){const r={},a=e.slice(1),i=a.filter(o=>o!==void 0);let s=0;for(let o=0;o<t.length;o+=1){const l=t[o];let c=a[o-s];if(l.chained&&l.rest&&s&&(c=a.slice(o-s,o+1).filter(d=>d).join("/"),s=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&l.chained&&(s=0),!d&&!p&&Object.keys(r).length===i.length&&(s=0);continue}if(l.optional&&l.chained){s++;continue}return}if(!s)return r}function he(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ut({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[l,c,d]])=>{const{pattern:p,params:f}=Rt(o),u={id:o,exec:h=>{const v=p.exec(h);if(v)return At(v,f,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...c||[]].map(s),leaf:i(l)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function i(o){const l=o<0;return l&&(o=~o),[l,e[o]]}function s(o){return o===void 0?o:[a.has(o),e[o]]}}function Me(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function je(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_1vp4260?.base??"",Tt=globalThis.__sveltekit_1vp4260?.assets??x??"",Pt="1773184009029",He="sveltekit:snapshot",We="sveltekit:scroll",Je="sveltekit:states",It="sveltekit:pageurl",K="sveltekit:history",H="sveltekit:navigation",N={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},xe=location.origin;function Ye(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function D(){return{x:pageXOffset,y:pageYOffset}}function V(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const De={...N,"":N.hover};function ze(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function Xe(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=ze(e)}}function me(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||ce(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=r?.origin===xe&&e.hasAttribute("download");return{url:r,external:i,target:a,download:s}}function te(e){let t=null,n=null,r=null,a=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=V(o,"preload-code")),a===null&&(a=V(o,"preload-data")),t===null&&(t=V(o,"keepfocus")),n===null&&(n=V(o,"noscroll")),i===null&&(i=V(o,"reload")),s===null&&(s=V(o,"replacestate")),o=ze(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:De[r??"off"],preload_data:De[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function qe(e){const t=be(e);let n=!0;function r(){n=!0,t.update(s=>s)}function a(s){n=!1,t.set(s)}function i(s){let o;return t.subscribe(l=>{(o===void 0||n&&l!==o)&&s(o=l)})}return{notify:r,set:a,subscribe:i}}const Qe={v:()=>{}};function Ot(){const{set:e,subscribe:t}=be(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Tt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const s=(await a.json()).version!==Pt;return s&&(e(!0),Qe.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:r}}function ce(e,t,n){return e.origin!==xe||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function sn(e){}const Ze=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...Ze];const Ct=new Set([...Ze]);[...Ct];function $t(e){return e.filter(t=>t!=null)}function Le(e){return e instanceof ke||e instanceof Se?e.status:500}function Nt(e){return e instanceof Se?e.text:"Internal Error"}let k,W,pe;const jt=Ne.toString().includes("$$")||/function \w+\(\) \{\}/.test(Ne.toString());jt?(k={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},pe={current:!1}):(k=new class{#e=A({});get data(){return U(this.#e)}set data(t){T(this.#e,t)}#t=A(null);get form(){return U(this.#t)}set form(t){T(this.#t,t)}#n=A(null);get error(){return U(this.#n)}set error(t){T(this.#n,t)}#r=A({});get params(){return U(this.#r)}set params(t){T(this.#r,t)}#a=A({id:null});get route(){return U(this.#a)}set route(t){T(this.#a,t)}#o=A({});get state(){return U(this.#o)}set state(t){T(this.#o,t)}#s=A(-1);get status(){return U(this.#s)}set status(t){T(this.#s,t)}#i=A(new URL("https://example.com"));get url(){return U(this.#i)}set url(t){T(this.#i,t)}},W=new class{#e=A(null);get current(){return U(this.#e)}set current(t){T(this.#e,t)}},pe=new class{#e=A(!1);get current(){return U(this.#e)}set current(t){T(this.#e,t)}},Qe.v=()=>pe.current=!0);function Dt(e){Object.assign(k,e)}const Ve={spanContext(){return qt},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},qt={traceId:"",spanId:"",traceFlags:0},Vt=new Set(["icon","shortcut icon","apple-touch-icon"]),$=Me(We)??{},J=Me(He)??{},C={url:qe({}),page:qe({}),navigating:be(null),updated:Ot()};function Ae(e){$[e]=D()}function Kt(e,t){let n=e+1;for(;$[n];)delete $[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function Y(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function et(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function Ke(){}let Ue,_e,ne,P,ve,w;const re=[],ae=[];let L=null;function we(){L?.fork?.then(e=>e?.discard()),L=null}const Z=new Map,tt=new Set,Bt=new Set,M=new Set;let _={branch:[],error:null,url:null},nt=!1,oe=!1,Be=!0,z=!1,F=!1,rt=!1,Te=!1,at,y,R,j;const se=new Set,Fe=new Map;async function fn(e,t,n){globalThis.__sveltekit_1vp4260?.data&&globalThis.__sveltekit_1vp4260.data,document.URL!==location.href&&(location.href=location.href),w=e,await e.hooks.init?.(),Ue=Ut(e),P=document.documentElement,ve=t,_e=e.nodes[0],ne=e.nodes[1],_e(),ne(),y=history.state?.[K],R=history.state?.[H],y||(y=R=Date.now(),history.replaceState({...history.state,[K]:y,[H]:R},""));const r=$[y];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await tn(ve,n)):(await B({type:"enter",url:Ye(w.hash?an(new URL(location.href)):location.href),replace_state:!0}),a()),en()}function Ft(){re.length=0,Te=!1}function ot(e){ae.some(t=>t?.snapshot)&&(J[e]=ae.map(t=>t?.snapshot?.capture()))}function st(e){J[e]?.forEach((t,n)=>{ae[n]?.snapshot?.restore(t)})}function Ge(){Ae(y),je(We,$),ot(R),je(He,J)}async function Gt(e,t,n,r){let a;t.invalidateAll&&we(),await B({type:"goto",url:Ye(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Te=!0,a=[...Fe.keys()]),t.invalidate&&t.invalidate.forEach(Zt)}}),t.invalidateAll&&ee().then(ee).then(()=>{Fe.forEach(({resource:i},s)=>{a?.includes(s)&&i.refresh?.()})})}async function Mt(e){if(e.id!==L?.id){we();const t={};se.add(t),L={id:e.id,token:t,promise:ct({...e,preload:t}).then(n=>(se.delete(t),n.type==="loaded"&&n.state.error&&we(),n)),fork:null}}return L.promise}async function ge(e){const t=(await ue(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].map(n=>n?.[1]()))}async function it(e,t,n){_=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(k,e.props.page),at=new w.root({target:t,props:{...e.props,stores:C,components:ae},hydrate:n,sync:!1}),await Promise.resolve(),st(R),n){const a={from:null,to:{params:_.params,route:{id:_.route?.id??null},url:new URL(location.href),scroll:$[y]??D()},willUnload:!1,type:"enter",complete:Promise.resolve()};M.forEach(i=>i(a))}oe=!0}function ie({url:e,params:t,branch:n,status:r,error:a,route:i,form:s}){let o="never";if(x&&(e.pathname===x||e.pathname===x+"/"))o="always";else for(const u of n)u?.slash!==void 0&&(o=u.slash);e.pathname=gt(e.pathname,o),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:i},props:{constructors:$t(n).map(u=>u.node.component),page:$e(k)}};s!==void 0&&(l.props.form=s);let c={},d=!k,p=0;for(let u=0;u<Math.max(n.length,_.branch.length);u+=1){const h=n[u],v=_.branch[u];h?.data!==v?.data&&(d=!0),h&&(c={...c,...h.data},d&&(l.props[`data_${p}`]=c),p+=1)}return(!_.url||e.href!==_.url.href||_.error!==a||s!==void 0&&s!==k.form||d)&&(l.props.page={error:a,params:t,route:{id:i?.id??null},state:{},status:r,url:new URL(e),form:s??null,data:d?c:k.data}),l}async function Pe({loader:e,parent:t,url:n,params:r,route:a,server_data_node:i}){let s=null,o=!0;const l={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await e();if(c.universal?.load){let d=function(...f){for(const u of f){const{href:h}=new URL(u,n);l.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Ve,current:Ve},route:new Proxy(a,{get:(f,u)=>(o&&(l.route=!0),f[u])}),params:new Proxy(r,{get:(f,u)=>(o&&l.params.add(u),f[u])}),data:i?.data??null,url:vt(n,()=>{o&&(l.url=!0)},f=>{o&&l.search_params.add(f)},w.hash),async fetch(f,u){f instanceof Request&&(u={body:f.method==="GET"||f.method==="HEAD"?void 0:await f.blob(),cache:f.cache,credentials:f.credentials,headers:[...f.headers].length>0?f?.headers:void 0,integrity:f.integrity,keepalive:f.keepalive,method:f.method,mode:f.mode,redirect:f.redirect,referrer:f.referrer,referrerPolicy:f.referrerPolicy,signal:f.signal,...u});const{resolved:h,promise:v}=lt(f,u,n);return o&&d(h.href),v},setHeaders:()=>{},depends:d,parent(){return o&&(l.parent=!0),t()},untrack(f){o=!1;try{return f()}finally{o=!0}}};s=await c.universal.load.call(null,p)??null}return{node:c,loader:e,server:i,universal:c.universal?.load?{type:"data",data:s,uses:l}:null,data:s??i?.data??null,slash:c.universal?.trailingSlash??i?.slash}}function lt(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const i=oe?Et(r,a.href,t):kt(r,t);return{resolved:a,promise:i}}function Ht(e,t,n,r,a,i){if(Te)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const s of a.search_params)if(r.has(s))return!0;for(const s of a.params)if(i[s]!==_.params[s])return!0;for(const s of a.dependencies)if(re.some(o=>o(new URL(s))))return!0;return!1}function Ie(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Wt(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),i=t.searchParams.getAll(r);a.every(s=>i.includes(s))&&i.every(s=>a.includes(s))&&n.delete(r)}return n}function Jt({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:$e(k),constructors:[]}}}async function ct({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(L?.id===e)return se.delete(L.token),L.promise;const{errors:s,layouts:o,leaf:l}=a,c=[...o,l];s.forEach(m=>m?.().catch(()=>{})),c.forEach(m=>m?.[1]().catch(()=>{}));const d=_.url?e!==le(_.url):!1,p=_.route?a.id!==_.route.id:!1,f=Wt(_.url,n);let u=!1;const h=c.map(async(m,g)=>{if(!m)return;const E=_.branch[g];return m[1]===E?.loader&&!Ht(u,p,d,f,E.universal?.uses,r)?E:(u=!0,Pe({loader:m[1],url:n,params:r,route:a,parent:async()=>{const I={};for(let O=0;O<g;O+=1)Object.assign(I,(await h[O])?.data);return I},server_data_node:Ie(m[0]?{type:"skip"}:null,m[0]?E?.server:void 0)}))});for(const m of h)m.catch(()=>{});const v=[];for(let m=0;m<c.length;m+=1)if(c[m])try{v.push(await h[m])}catch(g){if(g instanceof Ee)return{type:"redirect",location:g.location};if(se.has(i))return Jt({error:await X(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let E=Le(g),S;if(g instanceof ke)S=g.body;else{if(await C.updated.check())return await et(),await Y(n);S=await X(g,{params:r,url:n,route:{id:a.id}})}const I=await Yt(m,v,s);return I?ie({url:n,params:r,branch:v.slice(0,I.idx).concat(I.node),status:E,error:S,route:a}):await ft(n,{id:a.id},S,E)}else v.push(void 0);return ie({url:n,params:r,branch:v,status:200,error:null,route:a,form:t?void 0:null})}async function Yt(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function Oe({status:e,error:t,url:n,route:r}){const a={};let i=null;try{const s=await Pe({loader:_e,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Ie(i)}),o={node:await ne(),loader:ne,universal:null,server:null,data:null};return ie({url:n,params:a,branch:[s,o],status:e,error:t,route:null})}catch(s){if(s instanceof Ee)return Gt(new URL(s.location,location.href),{},0);throw s}}async function zt(e){const t=e.href;if(Z.has(t))return Z.get(t);let n;try{const r=(async()=>{let a=await w.hooks.reroute({url:new URL(e),fetch:async(i,s)=>lt(i,s,e).promise})??e;if(typeof a=="string"){const i=new URL(e);w.hash?i.hash=a:i.pathname=a,a=i}return a})();Z.set(t,r),n=await r}catch{Z.delete(t);return}return n}async function ue(e,t){if(e&&!ce(e,x,w.hash)){const n=await zt(e);if(!n)return;const r=Xt(n);for(const a of Ue){const i=a.exec(r);if(i)return{id:le(e),invalidating:t,route:a,params:_t(i),url:e}}}}function Xt(e){return mt(w.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function le(e){return(w.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function ut({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let s=!1;const o=Ce(_,n,e,t,i??null);r!==void 0&&(o.navigation.delta=r),a!==void 0&&(o.navigation.event=a);const l={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return z||tt.forEach(c=>c(l)),s?null:o}async function B({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s={},redirect_count:o=0,nav_token:l={},accept:c=Ke,block:d=Ke,event:p}){const f=j;j=l;const u=await ue(t,!1),h=e==="enter"?Ce(_,u,t,e):ut({url:t,type:e,delta:n?.delta,intent:u,scroll:n?.scroll,event:p});if(!h){d(),j===l&&(j=f);return}const v=y,m=R;c(),z=!0,oe&&h.navigation.type!=="enter"&&C.navigating.set(W.current=h.navigation);let g=u&&await ct(u);if(!g){if(ce(t,x,w.hash))return await Y(t,i);g=await ft(t,{id:null},await X(new Se(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=u?.url||t,j!==l)return h.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(o<20){await B({type:e,url:new URL(g.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s,redirect_count:o+1,nav_token:l}),h.fulfil(void 0);return}g=await Oe({status:500,error:await X(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await C.updated.check()&&(await et(),await Y(t,i));if(Ft(),Ae(v),ot(m),g.props.page.url.pathname!==t.pathname&&(t.pathname=g.props.page.url.pathname),s=n?n.state:s,!n){const b=i?0:1,Q={[K]:y+=b,[H]:R+=b,[Je]:s};(i?history.replaceState:history.pushState).call(history,Q,"",t),i||Kt(y,R)}const E=u&&L?.id===u.id?L.fork:null;L=null,g.props.page.state=s;let S;if(oe){const b=(await Promise.all(Array.from(Bt,q=>q(h.navigation)))).filter(q=>typeof q=="function");if(b.length>0){let q=function(){b.forEach(fe=>{M.delete(fe)})};b.push(q),b.forEach(fe=>{M.add(fe)})}_=g.state,g.props.page&&(g.props.page.url=t);const Q=E&&await E;Q?S=Q.commit():(at.$set(g.props),Dt(g.props.page),S=pt?.()),rt=!0}else await it(g,ve,!1);const{activeElement:I}=document;await S,await ee(),await ee();let O=null;if(Be){const b=n?n.scroll:a?D():null;b?scrollTo(b.x,b.y):(O=t.hash&&document.getElementById(dt(t)))?O.scrollIntoView():scrollTo(0,0)}const ht=document.activeElement!==I&&document.activeElement!==document.body;!r&&!ht&&rn(t,!O),Be=!0,g.props.page&&Object.assign(k,g.props.page),z=!1,e==="popstate"&&st(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=D()),M.forEach(b=>b(h.navigation)),C.navigating.set(W.current=null)}async function ft(e,t,n,r,a){return e.origin===xe&&e.pathname===location.pathname&&!nt?await Oe({status:r,error:n,url:e,route:t}):await Y(e,a)}function Qt(){let e,t={element:void 0,href:void 0},n;P.addEventListener("mousemove",o=>{const l=o.target;clearTimeout(e),e=setTimeout(()=>{i(l,N.hover)},20)});function r(o){o.defaultPrevented||i(o.composedPath()[0],N.tap)}P.addEventListener("mousedown",r),P.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const l of o)l.isIntersecting&&(ge(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(o,l){const c=Xe(o,P),d=c===t.element&&c?.href===t.href&&l>=n;if(!c||d)return;const{url:p,external:f,download:u}=me(c,x,w.hash);if(f||u)return;const h=te(c),v=p&&le(_.url)===le(p);if(!(h.reload||v))if(l<=h.preload_data){t={element:c,href:c.href},n=N.tap;const m=await ue(p,!1);if(!m)return;Mt(m)}else l<=h.preload_code&&(t={element:c,href:c.href},n=l,ge(p))}function s(){a.disconnect();for(const o of P.querySelectorAll("a")){const{url:l,external:c,download:d}=me(o,x,w.hash);if(c||d)continue;const p=te(o);p.reload||(p.preload_code===N.viewport&&a.observe(o),p.preload_code===N.eager&&ge(l))}}M.add(s),s()}function X(e,t){if(e instanceof ke)return e.body;const n=Le(e),r=Nt(e);return w.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Zt(e){if(typeof e=="function")re.push(e);else{const{href:t}=new URL(e,location.href);re.push(n=>n.href===t)}}function en(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Ge(),!z){const r=Ce(_,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};tt.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ge()}),navigator.connection?.saveData||Qt(),P.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=Xe(t.composedPath()[0],P);if(!n)return;const{url:r,external:a,target:i,download:s}=me(n,x,w.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const o=te(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||s)return;const[c,d]=(w.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=c===de(location);if(a||o.reload&&(!p||!d)){ut({url:r,type:"link",event:t})?z=!0:t.preventDefault();return}if(d!==void 0&&p){const[,f]=_.url.href.split("#");if(f===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const u=n.ownerDocument.getElementById(decodeURIComponent(d));u&&(u.scrollIntoView(),u.focus())}return}if(F=!0,Ae(y),e(r),!o.replace_state)return;F=!1}t.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await B({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),P.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const s=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(ce(s,x,!1))return;const o=t.target,l=te(o);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(o,r);s.search=new URLSearchParams(c).toString(),B({type:"form",url:s,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??s.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!ye){if(t.state?.[K]){const n=t.state[K];if(j={},n===y)return;const r=$[n],a=t.state[Je]??{},i=new URL(t.state[It]??location.href),s=t.state[H],o=_.url?de(location)===de(_.url):!1;if(s===R&&(rt||o)){a!==k.state&&(k.state=a),e(i),$[y]=D(),r&&scrollTo(r.x,r.y),y=n;return}const c=n-y;await B({type:"popstate",url:i,popped:{state:a,scroll:r,delta:c},accept:()=>{y=n,R=s},block:()=>{history.go(-c)},nav_token:j,event:t})}else if(!F){const n=new URL(location.href);e(n),w.hash&&location.reload()}}}),addEventListener("hashchange",()=>{F&&(F=!1,history.replaceState({...history.state,[K]:++y,[H]:R},"",location.href))});for(const t of document.querySelectorAll("link"))Vt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&C.navigating.set(W.current=null)});function e(t){_.url=k.url=t,C.page.set($e(k)),C.page.notify()}}async function tn(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:s,data:o,form:l}){nt=!0;const c=new URL(location.href);let d;({params:a={},route:i={id:null}}=await ue(c,!1)||{}),d=Ue.find(({id:u})=>u===i.id);let p,f=!0;try{const u=r.map(async(v,m)=>{const g=o[m];return g?.uses&&(g.uses=nn(g.uses)),Pe({loader:w.nodes[v],url:c,params:a,route:i,parent:async()=>{const E={};for(let S=0;S<m;S+=1)Object.assign(E,(await u[S]).data);return E},server_data_node:Ie(g)})}),h=await Promise.all(u);if(d){const v=d.layouts;for(let m=0;m<v.length;m++)v[m]||h.splice(m,0,void 0)}p=ie({url:c,params:a,branch:h,status:t,error:n,form:l,route:d??null})}catch(u){if(u instanceof Ee){await Y(new URL(u.location,location.href));return}p=await Oe({status:Le(u),error:await X(u,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",f=!1}p.props.page&&(p.props.page.state={}),await it(p,e,f)}function nn(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let ye=!1;function rn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=dt(e);if(r&&document.getElementById(r)){const{x:i,y:s}=D();setTimeout(()=>{const o=history.state;ye=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),ye=!1})}else{const i=document.body,s=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),s!==null?i.setAttribute("tabindex",s):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let s=0;s<a.rangeCount;s+=1)i.push(a.getRangeAt(s));setTimeout(()=>{if(a.rangeCount===i.length){for(let s=0;s<a.rangeCount;s+=1){const o=i[s],l=a.getRangeAt(s);if(o.commonAncestorContainer!==l.commonAncestorContainer||o.startContainer!==l.startContainer||o.endContainer!==l.endContainer||o.startOffset!==l.startOffset||o.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function Ce(e,t,n,r,a=null){let i,s;const o=new Promise((c,d)=>{i=c,s=d});return o.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:D()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:o},fulfil:i,reject:s}}function $e(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function an(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function dt(e){let t;if(w.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{fn as a,sn as l,k as p,C as s};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BMbfWswK.js","../chunks/DD0ItAbu.js","../assets/vendor-ui.BHIBfuhK.css","../assets/0.CcgsnGth.css","../nodes/1.
|
|
2
|
-
import{_ as v}from"../chunks/PPVm8Dsz.js";import{p as M,F as g,a7 as Q,Q as B,o as H,l as i,k as h,R as J,f as l,w as b,j as N,b as d,d as S,g as p,c as E,G as P,K as O,i as U,v as W,D as A,z as x,t as X,q as Y,u as Z,a8 as $}from"../chunks/DD0ItAbu.js";const it={};var tt=A('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),et=A("<!> <!>",1);function at(a,t){M(t,!0);let r=g(t,"components",23,()=>[]),_=g(t,"data_0",3,null),y=g(t,"data_1",3,null);Q(()=>t.stores.page.set(t.page)),B(()=>{t.stores,t.page,t.constructors,r(),t.form,_(),y(),t.stores.page.notify()});let f=p(!1),j=p(!1),w=p(null);H(()=>{const e=t.stores.page.subscribe(()=>{i(f)&&(h(j,!0),J().then(()=>{h(w,document.title||"untitled page",!0)}))});return h(f,!0),e});const L=x(()=>t.constructors[1]);var R=et(),k=l(R);{var T=e=>{const s=x(()=>t.constructors[0]);var o=E(),m=l(o);P(m,()=>i(s),(n,c)=>{O(c(n,{get data(){return _()},get form(){return t.form},get params(){return t.page.params},children:(u,st)=>{var D=E(),z=l(D);P(z,()=>i(L),(F,G)=>{O(G(F,{get data(){return y()},get form(){return t.form},get params(){return t.page.params}}),K=>r()[1]=K,()=>r()?.[1])}),d(u,D)},$$slots:{default:!0}}),u=>r()[0]=u,()=>r()?.[0])}),d(e,o)},V=e=>{const s=x(()=>t.constructors[0]);var o=E(),m=l(o);P(m,()=>i(s),(n,c)=>{O(c(n,{get data(){return _()},get form(){return t.form},get params(){return t.page.params}}),u=>r()[0]=u,()=>r()?.[0])}),d(e,o)};b(k,e=>{t.constructors[1]?e(T):e(V,!1)})}var C=N(k,2);{var q=e=>{var s=tt(),o=U(s);{var m=n=>{var c=X();Y(()=>Z(c,i(w))),d(n,c)};b(o,n=>{i(j)&&n(m)})}W(s),d(e,s)};b(C,e=>{i(f)&&e(q)})}d(a,R),S()}const ct=$(at),dt=[()=>v(()=>import("../nodes/0.BMbfWswK.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),()=>v(()=>import("../nodes/1.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BMbfWswK.js","../chunks/DD0ItAbu.js","../assets/vendor-ui.BHIBfuhK.css","../assets/0.CcgsnGth.css","../nodes/1.BxOyocEb.js","../chunks/5hcUiakN.js","../nodes/2.BWuBOpmL.js","../chunks/Bfbjz8Rd.js","../chunks/Bdj9FDJv.js","../chunks/PPVm8Dsz.js","../assets/2.DxI1SNVc.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as v}from"../chunks/PPVm8Dsz.js";import{p as M,F as g,a7 as Q,Q as B,o as H,l as i,k as h,R as J,f as l,w as b,j as N,b as d,d as S,g as p,c as E,G as P,K as O,i as U,v as W,D as A,z as x,t as X,q as Y,u as Z,a8 as $}from"../chunks/DD0ItAbu.js";const it={};var tt=A('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),et=A("<!> <!>",1);function at(a,t){M(t,!0);let r=g(t,"components",23,()=>[]),_=g(t,"data_0",3,null),y=g(t,"data_1",3,null);Q(()=>t.stores.page.set(t.page)),B(()=>{t.stores,t.page,t.constructors,r(),t.form,_(),y(),t.stores.page.notify()});let f=p(!1),j=p(!1),w=p(null);H(()=>{const e=t.stores.page.subscribe(()=>{i(f)&&(h(j,!0),J().then(()=>{h(w,document.title||"untitled page",!0)}))});return h(f,!0),e});const L=x(()=>t.constructors[1]);var R=et(),k=l(R);{var T=e=>{const s=x(()=>t.constructors[0]);var o=E(),m=l(o);P(m,()=>i(s),(n,c)=>{O(c(n,{get data(){return _()},get form(){return t.form},get params(){return t.page.params},children:(u,st)=>{var D=E(),z=l(D);P(z,()=>i(L),(F,G)=>{O(G(F,{get data(){return y()},get form(){return t.form},get params(){return t.page.params}}),K=>r()[1]=K,()=>r()?.[1])}),d(u,D)},$$slots:{default:!0}}),u=>r()[0]=u,()=>r()?.[0])}),d(e,o)},V=e=>{const s=x(()=>t.constructors[0]);var o=E(),m=l(o);P(m,()=>i(s),(n,c)=>{O(c(n,{get data(){return _()},get form(){return t.form},get params(){return t.page.params}}),u=>r()[0]=u,()=>r()?.[0])}),d(e,o)};b(k,e=>{t.constructors[1]?e(T):e(V,!1)})}var C=N(k,2);{var q=e=>{var s=tt(),o=U(s);{var m=n=>{var c=X();Y(()=>Z(c,i(w))),d(n,c)};b(o,n=>{i(j)&&n(m)})}W(s),d(e,s)};b(C,e=>{i(f)&&e(q)})}d(a,R),S()}const ct=$(at),dt=[()=>v(()=>import("../nodes/0.BMbfWswK.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),()=>v(()=>import("../nodes/1.BxOyocEb.js"),__vite__mapDeps([4,1,2,5]),import.meta.url),()=>v(()=>import("../nodes/2.BWuBOpmL.js"),__vite__mapDeps([6,7,8,9,1,2,10]),import.meta.url)],mt=[],ut={"/":[2]},I={handleError:(({error:a})=>{console.error(a)}),reroute:(()=>{}),transport:{}},rt=Object.fromEntries(Object.entries(I.transport).map(([a,t])=>[a,t.decode])),lt=Object.fromEntries(Object.entries(I.transport).map(([a,t])=>[a,t.encode])),_t=!1,ft=(a,t)=>rt[a](t);export{ft as decode,rt as decoders,ut as dictionary,lt as encoders,_t as hash,I as hooks,it as matchers,dt as nodes,ct as root,mt as server_loads};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as o,a as r}from"../chunks/5hcUiakN.js";export{o as load_css,r as start};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as m,Z as h,f as g,q as v,b as d,d as l,D as _,i as s,v as a,j as x,u as o}from"../chunks/DD0ItAbu.js";import{s as $,p}from"../chunks/
|
|
1
|
+
import{p as m,Z as h,f as g,q as v,b as d,d as l,D as _,i as s,v as a,j as x,u as o}from"../chunks/DD0ItAbu.js";import{s as $,p}from"../chunks/5hcUiakN.js";const b={get error(){return p.error},get status(){return p.status}};$.updated.check;const n=b;var k=_("<h1> </h1> <p> </p>",1);function D(c,i){m(i,!1),h();var r=k(),t=g(r),u=s(t,!0);a(t);var e=x(t,2),f=s(e,!0);a(e),v(()=>{o(u,n.status),o(f,n.error?.message)}),d(c,r),l()}export{D as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1773184009029"}
|
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.Dbvn3qU-.js" rel="modulepreload">
|
|
21
|
+
<link href="/_app/immutable/chunks/5hcUiakN.js" rel="modulepreload">
|
|
22
22
|
<link href="/_app/immutable/chunks/DD0ItAbu.js" rel="modulepreload">
|
|
23
|
-
<link href="/_app/immutable/entry/app.
|
|
23
|
+
<link href="/_app/immutable/entry/app.-fWI13U7.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_1vp4260 = {
|
|
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.Dbvn3qU-.js"),
|
|
40
|
+
import("/_app/immutable/entry/app.-fWI13U7.js")
|
|
41
41
|
]).then(([kit, app]) => {
|
|
42
42
|
kit.start(app, element);
|
|
43
43
|
});
|
package/dist/daemon.js
CHANGED
|
@@ -14528,8 +14528,8 @@ import {
|
|
|
14528
14528
|
unlinkSync
|
|
14529
14529
|
} from "fs";
|
|
14530
14530
|
import { homedir as homedir3 } from "os";
|
|
14531
|
-
import { join as join6 } from "path";
|
|
14532
|
-
var LOG_LEVELS, DEFAULT_CONFIG, Logger, logger;
|
|
14531
|
+
import { basename as basename3, dirname as dirname5, join as join6 } from "path";
|
|
14532
|
+
var LOG_LEVELS, DEFAULT_CONFIG, Logger, envLogFile, envLogDir, loggerConfig, logger;
|
|
14533
14533
|
var init_logger = __esm(() => {
|
|
14534
14534
|
LOG_LEVELS = {
|
|
14535
14535
|
debug: 0,
|
|
@@ -14539,6 +14539,7 @@ var init_logger = __esm(() => {
|
|
|
14539
14539
|
};
|
|
14540
14540
|
DEFAULT_CONFIG = {
|
|
14541
14541
|
logDir: join6(homedir3(), ".agents", ".daemon", "logs"),
|
|
14542
|
+
logFilePath: undefined,
|
|
14542
14543
|
level: "info",
|
|
14543
14544
|
maxFileSize: 10 * 1024 * 1024,
|
|
14544
14545
|
maxFiles: 5,
|
|
@@ -14561,8 +14562,9 @@ var init_logger = __esm(() => {
|
|
|
14561
14562
|
}
|
|
14562
14563
|
ensureLogDir() {
|
|
14563
14564
|
try {
|
|
14564
|
-
|
|
14565
|
-
|
|
14565
|
+
const dir = this.config.logFilePath ? dirname5(this.config.logFilePath) : this.config.logDir;
|
|
14566
|
+
if (!existsSync4(dir)) {
|
|
14567
|
+
mkdirSync2(dir, { recursive: true });
|
|
14566
14568
|
}
|
|
14567
14569
|
} catch (e) {
|
|
14568
14570
|
this.fileOutputEnabled = false;
|
|
@@ -14570,6 +14572,9 @@ var init_logger = __esm(() => {
|
|
|
14570
14572
|
}
|
|
14571
14573
|
}
|
|
14572
14574
|
getLogFileName() {
|
|
14575
|
+
if (this.config.logFilePath) {
|
|
14576
|
+
return this.config.logFilePath;
|
|
14577
|
+
}
|
|
14573
14578
|
const date = new Date().toISOString().split("T")[0];
|
|
14574
14579
|
return join6(this.config.logDir, `signet-${date}.log`);
|
|
14575
14580
|
}
|
|
@@ -14606,9 +14611,21 @@ var init_logger = __esm(() => {
|
|
|
14606
14611
|
return (bMeta.archiveSuffix ?? "").localeCompare(aMeta.archiveSuffix ?? "");
|
|
14607
14612
|
}
|
|
14608
14613
|
listLogFilesNewestFirst() {
|
|
14609
|
-
if (!this.fileOutputEnabled
|
|
14614
|
+
if (!this.fileOutputEnabled) {
|
|
14610
14615
|
return [];
|
|
14611
14616
|
}
|
|
14617
|
+
if (this.config.logFilePath) {
|
|
14618
|
+
if (!existsSync4(this.config.logFilePath))
|
|
14619
|
+
return [];
|
|
14620
|
+
return [
|
|
14621
|
+
{
|
|
14622
|
+
name: basename3(this.config.logFilePath),
|
|
14623
|
+
path: this.config.logFilePath
|
|
14624
|
+
}
|
|
14625
|
+
];
|
|
14626
|
+
}
|
|
14627
|
+
if (!existsSync4(this.config.logDir))
|
|
14628
|
+
return [];
|
|
14612
14629
|
return readdirSync2(this.config.logDir).filter((f) => this.parseLogFileName(f) !== null).map((f) => ({
|
|
14613
14630
|
name: f,
|
|
14614
14631
|
path: join6(this.config.logDir, f)
|
|
@@ -14679,6 +14696,8 @@ var init_logger = __esm(() => {
|
|
|
14679
14696
|
checkRotation() {
|
|
14680
14697
|
if (!this.fileOutputEnabled)
|
|
14681
14698
|
return;
|
|
14699
|
+
if (this.config.logFilePath)
|
|
14700
|
+
return;
|
|
14682
14701
|
try {
|
|
14683
14702
|
if (!existsSync4(this.currentLogFile))
|
|
14684
14703
|
return;
|
|
@@ -14854,7 +14873,12 @@ var init_logger = __esm(() => {
|
|
|
14854
14873
|
}
|
|
14855
14874
|
}
|
|
14856
14875
|
};
|
|
14857
|
-
|
|
14876
|
+
envLogFile = process.env.SIGNET_LOG_FILE?.trim();
|
|
14877
|
+
envLogDir = process.env.SIGNET_LOG_DIR?.trim();
|
|
14878
|
+
loggerConfig = {
|
|
14879
|
+
...envLogFile ? { logFilePath: envLogFile, logDir: dirname5(envLogFile) } : envLogDir ? { logDir: envLogDir } : {}
|
|
14880
|
+
};
|
|
14881
|
+
logger = new Logger(loggerConfig);
|
|
14858
14882
|
});
|
|
14859
14883
|
|
|
14860
14884
|
// ../daemon/src/pipeline/document-worker.ts
|
|
@@ -15130,7 +15154,7 @@ var init_document_worker = __esm(() => {
|
|
|
15130
15154
|
// ../daemon/src/connectors/filesystem.ts
|
|
15131
15155
|
import { readFileSync as readFileSync3 } from "fs";
|
|
15132
15156
|
import { access, stat as stat4, constants } from "fs/promises";
|
|
15133
|
-
import { join as join7, basename as
|
|
15157
|
+
import { join as join7, basename as basename4, resolve as resolve3 } from "path";
|
|
15134
15158
|
var {Glob } = globalThis.Bun;
|
|
15135
15159
|
function parseSettings(raw2) {
|
|
15136
15160
|
const rootPath = typeof raw2.rootPath === "string" ? raw2.rootPath : "";
|
|
@@ -15173,7 +15197,7 @@ async function discoverFiles(settings) {
|
|
|
15173
15197
|
results.push({
|
|
15174
15198
|
absolutePath,
|
|
15175
15199
|
relativePath: rel,
|
|
15176
|
-
name:
|
|
15200
|
+
name: basename4(rel),
|
|
15177
15201
|
mtime: fileStat.mtime,
|
|
15178
15202
|
size: fileStat.size
|
|
15179
15203
|
});
|
|
@@ -15366,7 +15390,7 @@ class FilesystemConnector {
|
|
|
15366
15390
|
const file = {
|
|
15367
15391
|
absolutePath,
|
|
15368
15392
|
relativePath: resourceId,
|
|
15369
|
-
name:
|
|
15393
|
+
name: basename4(resourceId),
|
|
15370
15394
|
mtime: fileStat.mtime,
|
|
15371
15395
|
size: fileStat.size
|
|
15372
15396
|
};
|
|
@@ -16009,7 +16033,7 @@ var init_cross_agent = __esm(() => {
|
|
|
16009
16033
|
// ../daemon/src/db-accessor.ts
|
|
16010
16034
|
import { Database } from "bun:sqlite";
|
|
16011
16035
|
import { copyFileSync, existsSync as existsSync5, mkdirSync as mkdirSync3, readdirSync as readdirSync3, statSync as statSync3, unlinkSync as unlinkSync2 } from "fs";
|
|
16012
|
-
import { basename as
|
|
16036
|
+
import { basename as basename5, dirname as dirname6, join as join8 } from "path";
|
|
16013
16037
|
function configurePragmas(db) {
|
|
16014
16038
|
db.exec("PRAGMA journal_mode = WAL");
|
|
16015
16039
|
db.exec("PRAGMA busy_timeout = 5000");
|
|
@@ -16039,8 +16063,8 @@ function backupBeforeMigration(db, dbPath2, schemaVersion) {
|
|
|
16039
16063
|
const backupDest = `${dbPath2}.bak-v${schemaVersion}-${timestamp}`;
|
|
16040
16064
|
copyFileSync(dbPath2, backupDest);
|
|
16041
16065
|
console.log(`[db-accessor] Pre-migration backup: ${backupDest}`);
|
|
16042
|
-
const dir =
|
|
16043
|
-
const base =
|
|
16066
|
+
const dir = dirname6(dbPath2);
|
|
16067
|
+
const base = basename5(dbPath2);
|
|
16044
16068
|
const backups = readdirSync3(dir).filter((f) => f.startsWith(`${base}.bak-v`)).map((f) => ({ name: f, mtime: statSync3(join8(dir, f)).mtimeMs })).sort((a, b) => b.mtime - a.mtime);
|
|
16045
16069
|
for (const old of backups.slice(MAX_MIGRATION_BACKUPS)) {
|
|
16046
16070
|
try {
|
|
@@ -16053,7 +16077,7 @@ function initDbAccessor(path) {
|
|
|
16053
16077
|
if (accessor) {
|
|
16054
16078
|
throw new Error("DbAccessor already initialised");
|
|
16055
16079
|
}
|
|
16056
|
-
const dir =
|
|
16080
|
+
const dir = dirname6(path);
|
|
16057
16081
|
if (!existsSync5(dir)) {
|
|
16058
16082
|
mkdirSync3(dir, { recursive: true });
|
|
16059
16083
|
}
|
|
@@ -16316,12 +16340,12 @@ function getQueueHealth(db) {
|
|
|
16316
16340
|
const depth = pendingRow?.cnt ?? 0;
|
|
16317
16341
|
const oldestAt = pendingRow?.oldest;
|
|
16318
16342
|
const oldestAgeSec = oldestAt ? Math.max(0, (Date.now() - new Date(oldestAt).getTime()) / 1000) : 0;
|
|
16319
|
-
const
|
|
16343
|
+
const windowStart = new Date(Date.now() - QUEUE_RECENT_WINDOW_MS).toISOString();
|
|
16320
16344
|
const deadRow = db.prepare(`SELECT
|
|
16321
16345
|
SUM(CASE WHEN status = 'dead' THEN 1 ELSE 0 END) AS dead,
|
|
16322
16346
|
SUM(CASE WHEN status IN ('completed','dead') THEN 1 ELSE 0 END) AS total
|
|
16323
16347
|
FROM memory_jobs
|
|
16324
|
-
WHERE updated_at >= ?`).get(
|
|
16348
|
+
WHERE updated_at >= ?`).get(windowStart);
|
|
16325
16349
|
const dead = deadRow?.dead ?? 0;
|
|
16326
16350
|
const completedAndDead = deadRow?.total ?? 0;
|
|
16327
16351
|
const deadRate = completedAndDead > 0 ? dead / completedAndDead : 0;
|
|
@@ -16637,8 +16661,9 @@ function getDiagnostics(db, tracker, updateState, predictorParams) {
|
|
|
16637
16661
|
predictor
|
|
16638
16662
|
};
|
|
16639
16663
|
}
|
|
16640
|
-
var DISABLED_PREDICTOR, BASE_WEIGHTS, PREDICTOR_SCALE;
|
|
16664
|
+
var QUEUE_RECENT_WINDOW_MS, DISABLED_PREDICTOR, BASE_WEIGHTS, PREDICTOR_SCALE;
|
|
16641
16665
|
var init_diagnostics = __esm(() => {
|
|
16666
|
+
QUEUE_RECENT_WINDOW_MS = 60 * 60 * 1000;
|
|
16642
16667
|
DISABLED_PREDICTOR = {
|
|
16643
16668
|
enabled: false,
|
|
16644
16669
|
sidecarAlive: false,
|
|
@@ -16678,6 +16703,12 @@ function clampFraction(raw2, fallback) {
|
|
|
16678
16703
|
return fallback;
|
|
16679
16704
|
return Math.max(0, Math.min(1, raw2));
|
|
16680
16705
|
}
|
|
16706
|
+
function parseOptionalUrl(raw2) {
|
|
16707
|
+
if (typeof raw2 !== "string")
|
|
16708
|
+
return;
|
|
16709
|
+
const trimmed = raw2.trim();
|
|
16710
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
16711
|
+
}
|
|
16681
16712
|
function loadPipelineConfig(yaml) {
|
|
16682
16713
|
const mem = yaml.memory;
|
|
16683
16714
|
const raw2 = mem?.pipelineV2;
|
|
@@ -16738,6 +16769,7 @@ function loadPipelineConfig(yaml) {
|
|
|
16738
16769
|
extraction: {
|
|
16739
16770
|
provider: resolvedProvider,
|
|
16740
16771
|
model: flatProviderWon ? typeof flatModel === "string" ? flatModel : d.extraction.model : typeof extractionRaw?.model === "string" ? extractionRaw.model : flatModelOnly ? flatModel : d.extraction.model,
|
|
16772
|
+
endpoint: parseOptionalUrl(extractionRaw?.endpoint) ?? parseOptionalUrl(extractionRaw?.base_url) ?? parseOptionalUrl(raw2.extractionEndpoint) ?? parseOptionalUrl(raw2.extractionBaseUrl),
|
|
16741
16773
|
timeout: clampPositive(extractionRaw?.timeout ?? raw2.extractionTimeout, 5000, 300000, d.extraction.timeout),
|
|
16742
16774
|
minConfidence: clampFraction(extractionRaw?.minConfidence ?? raw2.minFactConfidenceForWrite, d.extraction.minConfidence),
|
|
16743
16775
|
escalation: {
|
|
@@ -16835,6 +16867,7 @@ function loadPipelineConfig(yaml) {
|
|
|
16835
16867
|
return d.synthesis.provider;
|
|
16836
16868
|
})(),
|
|
16837
16869
|
model: typeof synthesisRaw?.model === "string" ? synthesisRaw.model : d.synthesis.model,
|
|
16870
|
+
endpoint: parseOptionalUrl(synthesisRaw?.endpoint) ?? parseOptionalUrl(synthesisRaw?.base_url),
|
|
16838
16871
|
timeout: clampPositive(synthesisRaw?.timeout, 5000, 300000, d.synthesis.timeout),
|
|
16839
16872
|
maxTokens: clampPositive(synthesisRaw?.maxTokens ?? synthesisRaw?.max_tokens, 1000, 32000, d.synthesis.maxTokens),
|
|
16840
16873
|
idleGapMinutes: clampPositive(synthesisRaw?.idleGapMinutes, 1, 1440, d.synthesis.idleGapMinutes)
|
|
@@ -16926,7 +16959,7 @@ function loadMemoryConfig(agentsDir) {
|
|
|
16926
16959
|
defaults.embedding.provider = emb.provider;
|
|
16927
16960
|
defaults.embedding.model = emb.model ?? defaults.embedding.model;
|
|
16928
16961
|
defaults.embedding.dimensions = Number.parseInt(String(emb.dimensions ?? "768"), 10);
|
|
16929
|
-
const explicitBaseUrl = emb.base_url;
|
|
16962
|
+
const explicitBaseUrl = (typeof emb.base_url === "string" ? emb.base_url : undefined) ?? (typeof emb.endpoint === "string" ? emb.endpoint : undefined);
|
|
16930
16963
|
if (defaults.embedding.provider === "ollama") {
|
|
16931
16964
|
defaults.embedding.base_url = typeof explicitBaseUrl === "string" && explicitBaseUrl.trim().length > 0 ? explicitBaseUrl : DEFAULT_OLLAMA_BASE_URL;
|
|
16932
16965
|
} else if (defaults.embedding.provider === "openai") {
|
|
@@ -16969,6 +17002,7 @@ var init_memory_config = __esm(() => {
|
|
|
16969
17002
|
extraction: {
|
|
16970
17003
|
provider: "claude-code",
|
|
16971
17004
|
model: "haiku",
|
|
17005
|
+
endpoint: undefined,
|
|
16972
17006
|
timeout: 90000,
|
|
16973
17007
|
minConfidence: 0.7,
|
|
16974
17008
|
escalation: {
|
|
@@ -17056,6 +17090,7 @@ var init_memory_config = __esm(() => {
|
|
|
17056
17090
|
enabled: true,
|
|
17057
17091
|
provider: "claude-code",
|
|
17058
17092
|
model: "haiku",
|
|
17093
|
+
endpoint: undefined,
|
|
17059
17094
|
timeout: 120000,
|
|
17060
17095
|
maxTokens: 8000,
|
|
17061
17096
|
idleGapMinutes: 15
|
|
@@ -24323,7 +24358,7 @@ __export(exports_native_embedding, {
|
|
|
24323
24358
|
});
|
|
24324
24359
|
import { mkdirSync as mkdirSync5 } from "fs";
|
|
24325
24360
|
import { homedir as homedir6 } from "os";
|
|
24326
|
-
import { dirname as
|
|
24361
|
+
import { dirname as dirname7, join as join13 } from "path";
|
|
24327
24362
|
import { fileURLToPath as fileURLToPath2, pathToFileURL } from "url";
|
|
24328
24363
|
function isRecord2(value) {
|
|
24329
24364
|
return typeof value === "object" && value !== null;
|
|
@@ -24354,7 +24389,7 @@ async function loadTransformersBindings() {
|
|
|
24354
24389
|
const loadTransformersWebRuntime = async () => {
|
|
24355
24390
|
const packageJsonUrl = resolveImportMetaSpecifier("@huggingface/transformers/package.json");
|
|
24356
24391
|
const packageJsonPath = fileURLToPath2(packageJsonUrl);
|
|
24357
|
-
const webRuntimePath = join13(
|
|
24392
|
+
const webRuntimePath = join13(dirname7(packageJsonPath), "dist", "transformers.web.js");
|
|
24358
24393
|
return import(pathToFileURL(webRuntimePath).href);
|
|
24359
24394
|
};
|
|
24360
24395
|
const importCandidates = [
|
|
@@ -24862,7 +24897,7 @@ __export(exports_predictor_state, {
|
|
|
24862
24897
|
});
|
|
24863
24898
|
import { existsSync as existsSync9, mkdirSync as mkdirSync6, readFileSync as readFileSync7, writeFileSync as writeFileSync3 } from "fs";
|
|
24864
24899
|
import { homedir as homedir7 } from "os";
|
|
24865
|
-
import { dirname as
|
|
24900
|
+
import { dirname as dirname8, join as join14 } from "path";
|
|
24866
24901
|
function statePath(agentId) {
|
|
24867
24902
|
const safeId = agentId.replace(/[/\\]/g, "_").replace(/\.\./g, "_");
|
|
24868
24903
|
const agentsDir = process.env.SIGNET_PATH || join14(homedir7(), ".agents");
|
|
@@ -24907,7 +24942,7 @@ function updatePredictorState(agentId, update) {
|
|
|
24907
24942
|
};
|
|
24908
24943
|
const path = statePath(agentId);
|
|
24909
24944
|
try {
|
|
24910
|
-
const dir =
|
|
24945
|
+
const dir = dirname8(path);
|
|
24911
24946
|
if (!existsSync9(dir)) {
|
|
24912
24947
|
mkdirSync6(dir, { recursive: true });
|
|
24913
24948
|
}
|
|
@@ -29421,8 +29456,12 @@ async function generateWithTracking(provider3, prompt, opts) {
|
|
|
29421
29456
|
const text = await provider3.generate(prompt, opts);
|
|
29422
29457
|
return { text, usage: null };
|
|
29423
29458
|
}
|
|
29459
|
+
function trimTrailingSlash(url) {
|
|
29460
|
+
return url.endsWith("/") ? url.slice(0, -1) : url;
|
|
29461
|
+
}
|
|
29424
29462
|
function createOllamaProvider(config) {
|
|
29425
|
-
const
|
|
29463
|
+
const merged = { ...DEFAULT_OLLAMA_CONFIG, ...config };
|
|
29464
|
+
const cfg = { ...merged, baseUrl: trimTrailingSlash(merged.baseUrl) };
|
|
29426
29465
|
async function callOllama(prompt, opts) {
|
|
29427
29466
|
const timeoutMs = opts?.timeoutMs ?? cfg.defaultTimeoutMs;
|
|
29428
29467
|
const controller = new AbortController;
|
|
@@ -29937,7 +29976,7 @@ function resolveOpenCodeBin() {
|
|
|
29937
29976
|
return null;
|
|
29938
29977
|
}
|
|
29939
29978
|
async function ensureOpenCodeServer(port) {
|
|
29940
|
-
const healthUrl = `http://
|
|
29979
|
+
const healthUrl = `http://127.0.0.1:${port}/global/health`;
|
|
29941
29980
|
if (openCodeChild?.port === port) {
|
|
29942
29981
|
try {
|
|
29943
29982
|
const res = await fetch(healthUrl, { signal: AbortSignal.timeout(2000) });
|
|
@@ -30085,7 +30124,12 @@ function extractOpenCodeText(data) {
|
|
|
30085
30124
|
`).trim();
|
|
30086
30125
|
}
|
|
30087
30126
|
function createOpenCodeProvider(config) {
|
|
30088
|
-
const
|
|
30127
|
+
const merged = { ...DEFAULT_OPENCODE_CONFIG, ...config };
|
|
30128
|
+
const cfg = {
|
|
30129
|
+
...merged,
|
|
30130
|
+
baseUrl: trimTrailingSlash(merged.baseUrl),
|
|
30131
|
+
ollamaFallbackBaseUrl: trimTrailingSlash(merged.ollamaFallbackBaseUrl)
|
|
30132
|
+
};
|
|
30089
30133
|
const slashIdx = cfg.model.indexOf("/");
|
|
30090
30134
|
const providerID = slashIdx > 0 ? cfg.model.slice(0, slashIdx) : "anthropic";
|
|
30091
30135
|
const modelID = slashIdx > 0 ? cfg.model.slice(slashIdx + 1) : cfg.model;
|
|
@@ -30096,6 +30140,7 @@ function createOpenCodeProvider(config) {
|
|
|
30096
30140
|
return ollamaFallbackProvider;
|
|
30097
30141
|
ollamaFallbackProvider = createOllamaProvider({
|
|
30098
30142
|
model: cfg.ollamaFallbackModel,
|
|
30143
|
+
baseUrl: cfg.ollamaFallbackBaseUrl,
|
|
30099
30144
|
defaultTimeoutMs: cfg.defaultTimeoutMs
|
|
30100
30145
|
});
|
|
30101
30146
|
return ollamaFallbackProvider;
|
|
@@ -30122,7 +30167,7 @@ function createOpenCodeProvider(config) {
|
|
|
30122
30167
|
let inputTokens = null;
|
|
30123
30168
|
let outputTokens = null;
|
|
30124
30169
|
try {
|
|
30125
|
-
const res = await fetch(
|
|
30170
|
+
const res = await fetch(`${cfg.ollamaFallbackBaseUrl}/api/generate`, {
|
|
30126
30171
|
method: "POST",
|
|
30127
30172
|
headers: { "Content-Type": "application/json" },
|
|
30128
30173
|
body: JSON.stringify({
|
|
@@ -30375,7 +30420,7 @@ var init_provider = __esm(() => {
|
|
|
30375
30420
|
})() : DEFAULT_MAX_CONCURRENT_SUBPROCESSES);
|
|
30376
30421
|
DEFAULT_OLLAMA_CONFIG = {
|
|
30377
30422
|
model: "qwen3:4b",
|
|
30378
|
-
baseUrl: "http://
|
|
30423
|
+
baseUrl: "http://127.0.0.1:11434",
|
|
30379
30424
|
defaultTimeoutMs: 90000
|
|
30380
30425
|
};
|
|
30381
30426
|
DEFAULT_CLAUDE_CODE_CONFIG = {
|
|
@@ -30401,11 +30446,12 @@ var init_provider = __esm(() => {
|
|
|
30401
30446
|
workingDirectory: homedir8()
|
|
30402
30447
|
};
|
|
30403
30448
|
DEFAULT_OPENCODE_CONFIG = {
|
|
30404
|
-
baseUrl: "http://
|
|
30449
|
+
baseUrl: "http://127.0.0.1:4096",
|
|
30405
30450
|
model: "anthropic/claude-haiku-4-5-20251001",
|
|
30406
30451
|
defaultTimeoutMs: 60000,
|
|
30407
30452
|
enableOllamaFallback: true,
|
|
30408
|
-
ollamaFallbackModel: "qwen3:4b"
|
|
30453
|
+
ollamaFallbackModel: "qwen3:4b",
|
|
30454
|
+
ollamaFallbackBaseUrl: "http://127.0.0.1:11434"
|
|
30409
30455
|
};
|
|
30410
30456
|
});
|
|
30411
30457
|
|
|
@@ -34327,6 +34373,7 @@ async function resolveProvider(cfg) {
|
|
|
34327
34373
|
const p2 = cfg.pipelineV2.synthesis.provider;
|
|
34328
34374
|
const model = cfg.pipelineV2.synthesis.model;
|
|
34329
34375
|
const timeout = cfg.pipelineV2.synthesis.timeout;
|
|
34376
|
+
const endpoint = cfg.pipelineV2.synthesis.endpoint;
|
|
34330
34377
|
switch (p2) {
|
|
34331
34378
|
case "anthropic": {
|
|
34332
34379
|
let apiKey = process.env.ANTHROPIC_API_KEY;
|
|
@@ -34344,9 +34391,18 @@ async function resolveProvider(cfg) {
|
|
|
34344
34391
|
case "claude-code":
|
|
34345
34392
|
return createClaudeCodeProvider({ model: model || "haiku", defaultTimeoutMs: timeout });
|
|
34346
34393
|
case "opencode":
|
|
34347
|
-
return createOpenCodeProvider({
|
|
34394
|
+
return createOpenCodeProvider({
|
|
34395
|
+
model: model || "anthropic/claude-haiku-4-5-20251001",
|
|
34396
|
+
baseUrl: endpoint ?? "http://127.0.0.1:4096",
|
|
34397
|
+
ollamaFallbackBaseUrl: "http://127.0.0.1:11434",
|
|
34398
|
+
defaultTimeoutMs: timeout
|
|
34399
|
+
});
|
|
34348
34400
|
default:
|
|
34349
|
-
return createOllamaProvider({
|
|
34401
|
+
return createOllamaProvider({
|
|
34402
|
+
model: model || "qwen3:4b",
|
|
34403
|
+
...endpoint ? { baseUrl: endpoint } : {},
|
|
34404
|
+
defaultTimeoutMs: timeout
|
|
34405
|
+
});
|
|
34350
34406
|
}
|
|
34351
34407
|
}
|
|
34352
34408
|
function startSummaryWorker(accessor2) {
|
|
@@ -34360,7 +34416,7 @@ function startSummaryWorker(accessor2) {
|
|
|
34360
34416
|
if (stopped)
|
|
34361
34417
|
return;
|
|
34362
34418
|
const cfg = loadMemoryConfig(AGENTS_DIR3);
|
|
34363
|
-
if (!cfg.pipelineV2.enabled
|
|
34419
|
+
if (!cfg.pipelineV2.enabled || cfg.pipelineV2.shadowMode) {
|
|
34364
34420
|
scheduleTick(POLL_INTERVAL_MS);
|
|
34365
34421
|
return;
|
|
34366
34422
|
}
|
|
@@ -34707,7 +34763,7 @@ function parseRawExtractionOutput(rawOutput) {
|
|
|
34707
34763
|
}
|
|
34708
34764
|
return { facts, entities, warnings };
|
|
34709
34765
|
}
|
|
34710
|
-
async function extractFactsAndEntities(input, provider3) {
|
|
34766
|
+
async function extractFactsAndEntities(input, provider3, opts) {
|
|
34711
34767
|
const trimmed = input.trim().replace(/\s+/g, " ");
|
|
34712
34768
|
if (trimmed.length < 20) {
|
|
34713
34769
|
return {
|
|
@@ -34721,7 +34777,9 @@ async function extractFactsAndEntities(input, provider3) {
|
|
|
34721
34777
|
const prompt = buildExtractionPrompt(truncated);
|
|
34722
34778
|
let rawOutput;
|
|
34723
34779
|
try {
|
|
34724
|
-
rawOutput = await provider3.generate(prompt
|
|
34780
|
+
rawOutput = await provider3.generate(prompt, {
|
|
34781
|
+
timeoutMs: opts?.timeoutMs
|
|
34782
|
+
});
|
|
34725
34783
|
} catch (e) {
|
|
34726
34784
|
const msg = e instanceof Error ? e.message : String(e);
|
|
34727
34785
|
logger.warn("pipeline", "Extraction LLM call failed", { error: msg });
|
|
@@ -35408,19 +35466,56 @@ function writeLastSynthesisTime(timestamp) {
|
|
|
35408
35466
|
});
|
|
35409
35467
|
}
|
|
35410
35468
|
}
|
|
35469
|
+
function parseLastEndTimestamp(row) {
|
|
35470
|
+
if (typeof row !== "object" || row === null || !("last_end" in row)) {
|
|
35471
|
+
return 0;
|
|
35472
|
+
}
|
|
35473
|
+
const value = row.last_end;
|
|
35474
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
35475
|
+
return 0;
|
|
35476
|
+
}
|
|
35477
|
+
const ts = Date.parse(value);
|
|
35478
|
+
return Number.isNaN(ts) ? 0 : ts;
|
|
35479
|
+
}
|
|
35480
|
+
function isExpectedSessionActivityLookupError(error, table) {
|
|
35481
|
+
if (!(error instanceof Error))
|
|
35482
|
+
return false;
|
|
35483
|
+
const message = error.message.toLowerCase();
|
|
35484
|
+
return message.includes(`no such table: ${table}`) || message.includes("dbaccessor not initialised") || message.includes("dbaccessor is closed");
|
|
35485
|
+
}
|
|
35411
35486
|
function getLastSessionEndTime() {
|
|
35412
35487
|
try {
|
|
35413
|
-
const
|
|
35488
|
+
const checkpointRow = getDbAccessor().withReadDb((db) => {
|
|
35414
35489
|
return db.prepare(`
|
|
35415
35490
|
SELECT MAX(created_at) as last_end
|
|
35416
35491
|
FROM session_checkpoints
|
|
35417
35492
|
WHERE trigger = 'session_end'
|
|
35418
35493
|
`).get();
|
|
35419
35494
|
});
|
|
35420
|
-
|
|
35421
|
-
|
|
35422
|
-
|
|
35423
|
-
|
|
35495
|
+
const checkpointTs = parseLastEndTimestamp(checkpointRow);
|
|
35496
|
+
if (checkpointTs > 0) {
|
|
35497
|
+
return checkpointTs;
|
|
35498
|
+
}
|
|
35499
|
+
} catch (error) {
|
|
35500
|
+
if (!isExpectedSessionActivityLookupError(error, "session_checkpoints")) {
|
|
35501
|
+
logger.error("synthesis", "Failed to query session_checkpoints for synthesis scheduling", error instanceof Error ? error : new Error(String(error)));
|
|
35502
|
+
throw error;
|
|
35503
|
+
}
|
|
35504
|
+
}
|
|
35505
|
+
try {
|
|
35506
|
+
const summaryRow = getDbAccessor().withReadDb((db) => {
|
|
35507
|
+
return db.prepare(`
|
|
35508
|
+
SELECT MAX(completed_at) as last_end
|
|
35509
|
+
FROM summary_jobs
|
|
35510
|
+
WHERE status = 'completed'
|
|
35511
|
+
`).get();
|
|
35512
|
+
});
|
|
35513
|
+
return parseLastEndTimestamp(summaryRow);
|
|
35514
|
+
} catch (error) {
|
|
35515
|
+
if (!isExpectedSessionActivityLookupError(error, "summary_jobs")) {
|
|
35516
|
+
logger.error("synthesis", "Failed to query summary_jobs for synthesis scheduling", error instanceof Error ? error : new Error(String(error)));
|
|
35517
|
+
throw error;
|
|
35518
|
+
}
|
|
35424
35519
|
return 0;
|
|
35425
35520
|
}
|
|
35426
35521
|
}
|
|
@@ -35713,11 +35808,11 @@ Return ONLY the JSON object, no other text.
|
|
|
35713
35808
|
Text:
|
|
35714
35809
|
${truncated}`;
|
|
35715
35810
|
}
|
|
35716
|
-
async function runLevel2Extraction(content, provider3, maxEntities) {
|
|
35811
|
+
async function runLevel2Extraction(content, provider3, maxEntities, timeoutMs) {
|
|
35717
35812
|
const prompt = buildLevel2Prompt(content, maxEntities);
|
|
35718
35813
|
let rawOutput;
|
|
35719
35814
|
try {
|
|
35720
|
-
rawOutput = await provider3.generate(prompt);
|
|
35815
|
+
rawOutput = await provider3.generate(prompt, { timeoutMs });
|
|
35721
35816
|
} catch (e) {
|
|
35722
35817
|
const msg = e instanceof Error ? e.message : String(e);
|
|
35723
35818
|
logger.warn("pipeline", "Level 2 extraction LLM call failed", {
|
|
@@ -35793,7 +35888,7 @@ function applyLevel3Filter(extraction, accessor2, agentId) {
|
|
|
35793
35888
|
}
|
|
35794
35889
|
return { facts: keptFacts, entities: keptEntities, warnings };
|
|
35795
35890
|
}
|
|
35796
|
-
async function escalate(content, extraction, provider3, accessor2, agentId, thresholds) {
|
|
35891
|
+
async function escalate(content, extraction, provider3, accessor2, agentId, thresholds, opts) {
|
|
35797
35892
|
const originalEntityCount = extraction.entities.length;
|
|
35798
35893
|
const originalFactCount = extraction.facts.length;
|
|
35799
35894
|
const needed = checkEscalationNeeded(extraction, thresholds);
|
|
@@ -35805,7 +35900,7 @@ async function escalate(content, extraction, provider3, accessor2, agentId, thre
|
|
|
35805
35900
|
originalFacts: originalFactCount,
|
|
35806
35901
|
threshold: thresholds.maxNewEntitiesPerChunk
|
|
35807
35902
|
});
|
|
35808
|
-
const level2 = await runLevel2Extraction(content, provider3, thresholds.level2MaxEntities);
|
|
35903
|
+
const level2 = await runLevel2Extraction(content, provider3, thresholds.level2MaxEntities, opts?.timeoutMs);
|
|
35809
35904
|
const level2Needed = checkEscalationNeeded(level2, thresholds);
|
|
35810
35905
|
if (level2Needed === 1) {
|
|
35811
35906
|
return { result: level2, level: 2, originalEntityCount, originalFactCount };
|
|
@@ -36031,7 +36126,9 @@ async function runShadowDecisions(facts, accessor2, provider3, cfg) {
|
|
|
36031
36126
|
const candidateIds = new Set(candidates.map((c2) => c2.id));
|
|
36032
36127
|
const prompt = buildDecisionPrompt(fact, candidates);
|
|
36033
36128
|
try {
|
|
36034
|
-
const output = await provider3.generate(prompt
|
|
36129
|
+
const output = await provider3.generate(prompt, {
|
|
36130
|
+
timeoutMs: cfg.timeoutMs
|
|
36131
|
+
});
|
|
36035
36132
|
const proposal = parseDecision(output, candidateIds, warnings);
|
|
36036
36133
|
if (proposal) {
|
|
36037
36134
|
const targetContent = proposal.targetMemoryId === undefined ? undefined : candidates.find((candidate) => candidate.id === proposal.targetMemoryId)?.content;
|
|
@@ -36672,14 +36769,14 @@ function startWorker(accessor2, provider3, pipelineCfg, decisionCfg, analytics,
|
|
|
36672
36769
|
}
|
|
36673
36770
|
} : provider3;
|
|
36674
36771
|
const extractionStart = Date.now();
|
|
36675
|
-
const rawExtraction = await extractFactsAndEntities(row.content, instrumentedProvider);
|
|
36772
|
+
const rawExtraction = await extractFactsAndEntities(row.content, instrumentedProvider, { timeoutMs: pipelineCfg.extraction.timeout });
|
|
36676
36773
|
const extractionMs = Date.now() - extractionStart;
|
|
36677
36774
|
const escalationThresholds = pipelineCfg.extraction.escalation ?? {
|
|
36678
36775
|
maxNewEntitiesPerChunk: 10,
|
|
36679
36776
|
maxNewAttributesPerEntity: 20,
|
|
36680
36777
|
level2MaxEntities: 5
|
|
36681
36778
|
};
|
|
36682
|
-
const escalated = await escalate(row.content, rawExtraction, instrumentedProvider, accessor2, "default", escalationThresholds);
|
|
36779
|
+
const escalated = await escalate(row.content, rawExtraction, instrumentedProvider, accessor2, "default", escalationThresholds, { timeoutMs: pipelineCfg.extraction.timeout });
|
|
36683
36780
|
const extraction = escalated.result;
|
|
36684
36781
|
telemetry?.record("pipeline.extraction", {
|
|
36685
36782
|
factCount: extraction.facts.length,
|
|
@@ -37038,10 +37135,15 @@ function startPipeline(accessor2, pipelineCfg, embeddingCfg, fetchEmbedding2, se
|
|
|
37038
37135
|
logger.warn("pipeline", "Pipeline already running, skipping start");
|
|
37039
37136
|
return;
|
|
37040
37137
|
}
|
|
37138
|
+
if (!pipelineCfg.enabled) {
|
|
37139
|
+
logger.info("pipeline", "Pipeline disabled; worker start skipped");
|
|
37140
|
+
return;
|
|
37141
|
+
}
|
|
37041
37142
|
const provider3 = getLlmProvider();
|
|
37042
37143
|
const decisionCfg = {
|
|
37043
37144
|
embedding: embeddingCfg,
|
|
37044
37145
|
search: searchCfg,
|
|
37146
|
+
timeoutMs: pipelineCfg.extraction.timeout,
|
|
37045
37147
|
fetchEmbedding: fetchEmbedding2
|
|
37046
37148
|
};
|
|
37047
37149
|
workerHandle = startWorker(accessor2, provider3, pipelineCfg, decisionCfg, analytics, telemetry);
|
|
@@ -90398,7 +90500,7 @@ var init_skills = __esm(() => {
|
|
|
90398
90500
|
|
|
90399
90501
|
// ../daemon/src/pipeline/skill-reconciler.ts
|
|
90400
90502
|
import { existsSync as existsSync19, readdirSync as readdirSync7, readFileSync as readFileSync15 } from "fs";
|
|
90401
|
-
import { join as join28, basename as
|
|
90503
|
+
import { join as join28, basename as basename6, dirname as dirname9 } from "path";
|
|
90402
90504
|
function skillsDir(agentsDir2) {
|
|
90403
90505
|
return join28(agentsDir2, "skills");
|
|
90404
90506
|
}
|
|
@@ -90516,17 +90618,17 @@ function startReconciler(deps) {
|
|
|
90516
90618
|
awaitWriteFinish: { stabilityThreshold: 500 }
|
|
90517
90619
|
});
|
|
90518
90620
|
watcher.on("add", (filePath) => {
|
|
90519
|
-
const skillName =
|
|
90621
|
+
const skillName = basename6(dirname9(filePath));
|
|
90520
90622
|
logger.info("reconciler", "SKILL.md added", { skill: skillName });
|
|
90521
90623
|
reconcileSkill(skillName, filePath, deps);
|
|
90522
90624
|
});
|
|
90523
90625
|
watcher.on("change", (filePath) => {
|
|
90524
|
-
const skillName =
|
|
90626
|
+
const skillName = basename6(dirname9(filePath));
|
|
90525
90627
|
logger.info("reconciler", "SKILL.md changed", { skill: skillName });
|
|
90526
90628
|
reconcileSkill(skillName, filePath, deps);
|
|
90527
90629
|
});
|
|
90528
90630
|
watcher.on("unlink", (filePath) => {
|
|
90529
|
-
const skillName =
|
|
90631
|
+
const skillName = basename6(dirname9(filePath));
|
|
90530
90632
|
logger.info("reconciler", "SKILL.md removed", { skill: skillName });
|
|
90531
90633
|
uninstallSkillNode({ skillName }, deps.accessor);
|
|
90532
90634
|
});
|
|
@@ -94726,8 +94828,67 @@ import {
|
|
|
94726
94828
|
writeFileSync as writeFileSync11
|
|
94727
94829
|
} from "fs";
|
|
94728
94830
|
import { homedir as homedir19 } from "os";
|
|
94729
|
-
import { basename as
|
|
94831
|
+
import { basename as basename7, dirname as dirname10, join as join32 } from "path";
|
|
94730
94832
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
94833
|
+
function readEnvTrimmed(key) {
|
|
94834
|
+
const raw2 = process.env[key];
|
|
94835
|
+
if (typeof raw2 !== "string")
|
|
94836
|
+
return;
|
|
94837
|
+
const trimmed = raw2.trim();
|
|
94838
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
94839
|
+
}
|
|
94840
|
+
function normalizeBaseUrl(url2) {
|
|
94841
|
+
if (!url2)
|
|
94842
|
+
return;
|
|
94843
|
+
return url2.endsWith("/") ? url2.slice(0, -1) : url2;
|
|
94844
|
+
}
|
|
94845
|
+
function normalizeLoopbackHost(host) {
|
|
94846
|
+
return host === "localhost" || host === "::1" ? "127.0.0.1" : host;
|
|
94847
|
+
}
|
|
94848
|
+
function parsePort(raw2, fallback) {
|
|
94849
|
+
const parsed = Number.parseInt(raw2 ?? "", 10);
|
|
94850
|
+
return Number.isInteger(parsed) && parsed >= 1 && parsed <= 65535 ? parsed : fallback;
|
|
94851
|
+
}
|
|
94852
|
+
function normalizeRuntimeBaseUrl(url2, fallback) {
|
|
94853
|
+
const base = normalizeBaseUrl(url2) ?? fallback;
|
|
94854
|
+
try {
|
|
94855
|
+
const parsed = new URL(base);
|
|
94856
|
+
if (parsed.hostname === "localhost" || parsed.hostname === "::1") {
|
|
94857
|
+
parsed.hostname = "127.0.0.1";
|
|
94858
|
+
}
|
|
94859
|
+
return normalizeBaseUrl(parsed.toString()) ?? fallback;
|
|
94860
|
+
} catch {
|
|
94861
|
+
return base;
|
|
94862
|
+
}
|
|
94863
|
+
}
|
|
94864
|
+
function isManagedOpenCodeLocalEndpoint(baseUrl) {
|
|
94865
|
+
try {
|
|
94866
|
+
const parsed = new URL(baseUrl);
|
|
94867
|
+
const isLoopbackHost = parsed.hostname === "127.0.0.1" || parsed.hostname === "localhost" || parsed.hostname === "::1";
|
|
94868
|
+
if (!isLoopbackHost)
|
|
94869
|
+
return false;
|
|
94870
|
+
if (parsed.protocol !== "http:")
|
|
94871
|
+
return false;
|
|
94872
|
+
const port = parsed.port.length > 0 ? Number.parseInt(parsed.port, 10) : 80;
|
|
94873
|
+
return port === 4096;
|
|
94874
|
+
} catch {
|
|
94875
|
+
return false;
|
|
94876
|
+
}
|
|
94877
|
+
}
|
|
94878
|
+
function redactUrlForLogs(url2) {
|
|
94879
|
+
if (!url2)
|
|
94880
|
+
return;
|
|
94881
|
+
try {
|
|
94882
|
+
const parsed = new URL(url2);
|
|
94883
|
+
parsed.username = "";
|
|
94884
|
+
parsed.password = "";
|
|
94885
|
+
parsed.search = "";
|
|
94886
|
+
parsed.hash = "";
|
|
94887
|
+
return normalizeBaseUrl(parsed.toString()) ?? url2;
|
|
94888
|
+
} catch {
|
|
94889
|
+
return url2;
|
|
94890
|
+
}
|
|
94891
|
+
}
|
|
94731
94892
|
function hasMemoriesSessionIdColumn(db) {
|
|
94732
94893
|
if (hasMemoriesSessionIdColumnCache !== null) {
|
|
94733
94894
|
return hasMemoriesSessionIdColumnCache;
|
|
@@ -94824,7 +94985,7 @@ function getVersionFromPackageJson(packageJsonPath) {
|
|
|
94824
94985
|
}
|
|
94825
94986
|
function getDaemonVersion() {
|
|
94826
94987
|
const __filename3 = fileURLToPath4(import.meta.url);
|
|
94827
|
-
const __dirname3 =
|
|
94988
|
+
const __dirname3 = dirname10(__filename3);
|
|
94828
94989
|
const candidates = [
|
|
94829
94990
|
join32(__dirname3, "..", "package.json"),
|
|
94830
94991
|
join32(__dirname3, "..", "..", "signetai", "package.json"),
|
|
@@ -94925,6 +95086,40 @@ function parseIsoDateQuery(raw2) {
|
|
|
94925
95086
|
return;
|
|
94926
95087
|
return date6.toISOString();
|
|
94927
95088
|
}
|
|
95089
|
+
function getConfiguredProviderHints(agentsDir2) {
|
|
95090
|
+
const paths = [
|
|
95091
|
+
join32(agentsDir2, "agent.yaml"),
|
|
95092
|
+
join32(agentsDir2, "AGENT.yaml"),
|
|
95093
|
+
join32(agentsDir2, "config.yaml")
|
|
95094
|
+
];
|
|
95095
|
+
let extraction = null;
|
|
95096
|
+
let synthesis = null;
|
|
95097
|
+
for (const path of paths) {
|
|
95098
|
+
if (!existsSync23(path))
|
|
95099
|
+
continue;
|
|
95100
|
+
try {
|
|
95101
|
+
const yaml = toRecord(parseSimpleYaml(readFileSync19(path, "utf-8")));
|
|
95102
|
+
const mem = toRecord(yaml?.memory);
|
|
95103
|
+
const pipeline3 = toRecord(mem?.pipelineV2);
|
|
95104
|
+
const extractionObj = toRecord(pipeline3?.extraction);
|
|
95105
|
+
const synthesisObj = toRecord(pipeline3?.synthesis);
|
|
95106
|
+
const extractionInFile = typeof pipeline3?.extractionProvider === "string" ? pipeline3.extractionProvider : typeof extractionObj?.provider === "string" ? extractionObj.provider : null;
|
|
95107
|
+
const synthesisInFile = typeof synthesisObj?.provider === "string" ? synthesisObj.provider : null;
|
|
95108
|
+
if (extraction === null && extractionInFile !== null) {
|
|
95109
|
+
extraction = extractionInFile;
|
|
95110
|
+
}
|
|
95111
|
+
if (synthesis === null && synthesisInFile !== null) {
|
|
95112
|
+
synthesis = synthesisInFile;
|
|
95113
|
+
}
|
|
95114
|
+
if (extraction !== null && synthesis !== null) {
|
|
95115
|
+
break;
|
|
95116
|
+
}
|
|
95117
|
+
} catch {
|
|
95118
|
+
continue;
|
|
95119
|
+
}
|
|
95120
|
+
}
|
|
95121
|
+
return { extraction, synthesis };
|
|
95122
|
+
}
|
|
94928
95123
|
function defaultLegacyEmbeddingsResponse(limit, offset, error48) {
|
|
94929
95124
|
return {
|
|
94930
95125
|
embeddings: [],
|
|
@@ -95101,7 +95296,7 @@ async function checkEmbeddingProvider(cfg) {
|
|
|
95101
95296
|
} else {
|
|
95102
95297
|
logger.warn("embedding", `Native provider unavailable: ${nativeStatus.error ?? "unknown"}`);
|
|
95103
95298
|
try {
|
|
95104
|
-
const ollamaRes = await fetch("http://
|
|
95299
|
+
const ollamaRes = await fetch("http://127.0.0.1:11434/api/tags", {
|
|
95105
95300
|
method: "GET",
|
|
95106
95301
|
signal: AbortSignal.timeout(3000)
|
|
95107
95302
|
});
|
|
@@ -95193,7 +95388,7 @@ function parsePrefixes(raw2) {
|
|
|
95193
95388
|
}
|
|
95194
95389
|
function getDashboardPath() {
|
|
95195
95390
|
const __filename3 = fileURLToPath4(import.meta.url);
|
|
95196
|
-
const __dirname3 =
|
|
95391
|
+
const __dirname3 = dirname10(__filename3);
|
|
95197
95392
|
const candidates = [
|
|
95198
95393
|
join32(__dirname3, "..", "..", "cli", "dashboard", "build"),
|
|
95199
95394
|
join32(__dirname3, "..", "..", "..", "cli", "dashboard", "build"),
|
|
@@ -96435,7 +96630,7 @@ async function syncClaudeMemoryFile(filePath) {
|
|
|
96435
96630
|
continue;
|
|
96436
96631
|
syncedClaudeMemories.add(chunkKey);
|
|
96437
96632
|
try {
|
|
96438
|
-
const response = await fetch(`http://${
|
|
96633
|
+
const response = await fetch(`http://${INTERNAL_SELF_HOST}:${PORT}/api/memory/remember`, {
|
|
96439
96634
|
method: "POST",
|
|
96440
96635
|
headers: { "Content-Type": "application/json" },
|
|
96441
96636
|
body: JSON.stringify({
|
|
@@ -96633,7 +96828,7 @@ async function ingestMemoryMarkdown(filePath) {
|
|
|
96633
96828
|
return 0;
|
|
96634
96829
|
}
|
|
96635
96830
|
ingestedMemoryFiles.set(filePath, hash2);
|
|
96636
|
-
const filename =
|
|
96831
|
+
const filename = basename7(filePath, ".md");
|
|
96637
96832
|
const dateMatch = filename.match(/^(\d{4}-\d{2}-\d{2})/);
|
|
96638
96833
|
const date6 = dateMatch ? dateMatch[1] : null;
|
|
96639
96834
|
const chunks = chunkMarkdownHierarchically(content, 512);
|
|
@@ -96642,7 +96837,7 @@ async function ingestMemoryMarkdown(filePath) {
|
|
|
96642
96837
|
const chunk = chunks[i3];
|
|
96643
96838
|
const chunkKey = `openclaw:${filename}:${createHash3("sha256").update(chunk.text).digest("hex").slice(0, 16)}`;
|
|
96644
96839
|
try {
|
|
96645
|
-
const response = await fetch(`http://${
|
|
96840
|
+
const response = await fetch(`http://${INTERNAL_SELF_HOST}:${PORT}/api/memory/remember`, {
|
|
96646
96841
|
method: "POST",
|
|
96647
96842
|
headers: { "Content-Type": "application/json" },
|
|
96648
96843
|
body: JSON.stringify({
|
|
@@ -96775,7 +96970,7 @@ async function cleanup() {
|
|
|
96775
96970
|
async function main() {
|
|
96776
96971
|
logger.info("daemon", "Signet Daemon starting");
|
|
96777
96972
|
logger.info("daemon", "Agents directory", { path: AGENTS_DIR6 });
|
|
96778
|
-
logger.info("daemon", "
|
|
96973
|
+
logger.info("daemon", "Network configured", { port: PORT, host: HOST, bindHost: BIND_HOST });
|
|
96779
96974
|
mkdirSync12(DAEMON_DIR, { recursive: true });
|
|
96780
96975
|
mkdirSync12(LOG_DIR, { recursive: true });
|
|
96781
96976
|
initDbAccessor(MEMORY_DB2);
|
|
@@ -96807,12 +97002,58 @@ async function main() {
|
|
|
96807
97002
|
authBatchForgetLimiter = new AuthRateLimiter(rl.batchForget.windowMs, rl.batchForget.max);
|
|
96808
97003
|
if (rl.admin)
|
|
96809
97004
|
authAdminLimiter = new AuthRateLimiter(rl.admin.windowMs, rl.admin.max);
|
|
97005
|
+
const providerHints = getConfiguredProviderHints(AGENTS_DIR6);
|
|
97006
|
+
const validExtractionProviders = new Set([
|
|
97007
|
+
"ollama",
|
|
97008
|
+
"claude-code",
|
|
97009
|
+
"opencode",
|
|
97010
|
+
"codex",
|
|
97011
|
+
"anthropic"
|
|
97012
|
+
]);
|
|
97013
|
+
const validSynthesisProviders = new Set([
|
|
97014
|
+
"ollama",
|
|
97015
|
+
"claude-code",
|
|
97016
|
+
"opencode",
|
|
97017
|
+
"anthropic"
|
|
97018
|
+
]);
|
|
97019
|
+
providerRuntimeResolution.extraction = {
|
|
97020
|
+
configured: providerHints.extraction,
|
|
97021
|
+
resolved: memoryCfg.pipelineV2.extraction.provider,
|
|
97022
|
+
effective: memoryCfg.pipelineV2.extraction.provider
|
|
97023
|
+
};
|
|
97024
|
+
providerRuntimeResolution.synthesis = {
|
|
97025
|
+
configured: providerHints.synthesis,
|
|
97026
|
+
resolved: memoryCfg.pipelineV2.synthesis.enabled ? memoryCfg.pipelineV2.synthesis.provider : null,
|
|
97027
|
+
effective: memoryCfg.pipelineV2.synthesis.enabled ? memoryCfg.pipelineV2.synthesis.provider : null
|
|
97028
|
+
};
|
|
97029
|
+
if (providerHints.extraction && !validExtractionProviders.has(providerHints.extraction)) {
|
|
97030
|
+
logger.warn("config", "Unsupported extraction provider configured, using resolved fallback", {
|
|
97031
|
+
configured: providerHints.extraction,
|
|
97032
|
+
resolved: memoryCfg.pipelineV2.extraction.provider
|
|
97033
|
+
});
|
|
97034
|
+
}
|
|
97035
|
+
if (providerHints.synthesis && memoryCfg.pipelineV2.synthesis.enabled && !validSynthesisProviders.has(providerHints.synthesis)) {
|
|
97036
|
+
logger.warn("config", "Unsupported synthesis provider configured, using resolved fallback", {
|
|
97037
|
+
configured: providerHints.synthesis,
|
|
97038
|
+
resolved: memoryCfg.pipelineV2.synthesis.provider
|
|
97039
|
+
});
|
|
97040
|
+
}
|
|
96810
97041
|
let effectiveExtractionProvider = memoryCfg.pipelineV2.extraction.provider;
|
|
97042
|
+
const extractionOllamaBaseUrl = normalizeRuntimeBaseUrl(memoryCfg.pipelineV2.extraction.endpoint, "http://127.0.0.1:11434");
|
|
97043
|
+
const extractionOllamaFallbackBaseUrl = memoryCfg.pipelineV2.extraction.provider === "opencode" ? "http://127.0.0.1:11434" : extractionOllamaBaseUrl;
|
|
97044
|
+
const extractionOpenCodeBaseUrl = normalizeRuntimeBaseUrl(memoryCfg.pipelineV2.extraction.endpoint, "http://127.0.0.1:4096");
|
|
97045
|
+
const extractionOpenCodeShouldManage = isManagedOpenCodeLocalEndpoint(extractionOpenCodeBaseUrl);
|
|
96811
97046
|
if (effectiveExtractionProvider === "opencode") {
|
|
96812
|
-
|
|
96813
|
-
|
|
96814
|
-
|
|
96815
|
-
|
|
97047
|
+
if (extractionOpenCodeShouldManage) {
|
|
97048
|
+
const serverReady = await ensureOpenCodeServer(4096);
|
|
97049
|
+
if (!serverReady) {
|
|
97050
|
+
logger.warn("config", "OpenCode server not available, falling back to ollama for extraction");
|
|
97051
|
+
effectiveExtractionProvider = "ollama";
|
|
97052
|
+
}
|
|
97053
|
+
} else {
|
|
97054
|
+
logger.info("config", "Using external OpenCode endpoint for extraction", {
|
|
97055
|
+
baseUrl: redactUrlForLogs(extractionOpenCodeBaseUrl)
|
|
97056
|
+
});
|
|
96816
97057
|
}
|
|
96817
97058
|
} else if (effectiveExtractionProvider === "claude-code") {
|
|
96818
97059
|
try {
|
|
@@ -96853,7 +97094,6 @@ async function main() {
|
|
|
96853
97094
|
effectiveExtractionProvider = "ollama";
|
|
96854
97095
|
}
|
|
96855
97096
|
}
|
|
96856
|
-
logger.info("config", "Extraction provider", { provider: effectiveExtractionProvider });
|
|
96857
97097
|
let anthropicApiKey;
|
|
96858
97098
|
const needsAnthropicForSynthesis = memoryCfg.pipelineV2.synthesis.enabled && memoryCfg.pipelineV2.synthesis.provider === "anthropic";
|
|
96859
97099
|
if (effectiveExtractionProvider === "anthropic" || needsAnthropicForSynthesis) {
|
|
@@ -96876,12 +97116,32 @@ async function main() {
|
|
|
96876
97116
|
if (effectiveExtractionProvider === "ollama" && memoryCfg.pipelineV2.extraction.provider !== "ollama") {
|
|
96877
97117
|
effectiveExtractionModel = undefined;
|
|
96878
97118
|
}
|
|
97119
|
+
providerRuntimeResolution.extraction = {
|
|
97120
|
+
configured: providerHints.extraction,
|
|
97121
|
+
resolved: memoryCfg.pipelineV2.extraction.provider,
|
|
97122
|
+
effective: effectiveExtractionProvider
|
|
97123
|
+
};
|
|
97124
|
+
if (providerHints.extraction && providerHints.extraction !== effectiveExtractionProvider) {
|
|
97125
|
+
logger.warn("config", "Extraction provider resolved differently than configured", {
|
|
97126
|
+
configured: providerHints.extraction,
|
|
97127
|
+
resolved: memoryCfg.pipelineV2.extraction.provider,
|
|
97128
|
+
effective: effectiveExtractionProvider
|
|
97129
|
+
});
|
|
97130
|
+
}
|
|
97131
|
+
logger.info("config", "Extraction provider", {
|
|
97132
|
+
configured: providerHints.extraction,
|
|
97133
|
+
resolved: memoryCfg.pipelineV2.extraction.provider,
|
|
97134
|
+
effective: effectiveExtractionProvider,
|
|
97135
|
+
endpoint: redactUrlForLogs(effectiveExtractionProvider === "ollama" ? extractionOllamaFallbackBaseUrl : effectiveExtractionProvider === "opencode" ? extractionOpenCodeBaseUrl : undefined)
|
|
97136
|
+
});
|
|
96879
97137
|
const llmProvider = effectiveExtractionProvider === "anthropic" && anthropicApiKey ? createAnthropicProvider({
|
|
96880
97138
|
model: effectiveExtractionModel || "haiku",
|
|
96881
97139
|
apiKey: anthropicApiKey,
|
|
96882
97140
|
defaultTimeoutMs: memoryCfg.pipelineV2.extraction.timeout
|
|
96883
97141
|
}) : effectiveExtractionProvider === "opencode" ? createOpenCodeProvider({
|
|
96884
97142
|
model: effectiveExtractionModel || "anthropic/claude-haiku-4-5-20251001",
|
|
97143
|
+
baseUrl: extractionOpenCodeBaseUrl,
|
|
97144
|
+
ollamaFallbackBaseUrl: "http://127.0.0.1:11434",
|
|
96885
97145
|
defaultTimeoutMs: memoryCfg.pipelineV2.extraction.timeout
|
|
96886
97146
|
}) : effectiveExtractionProvider === "claude-code" ? createClaudeCodeProvider({
|
|
96887
97147
|
model: effectiveExtractionModel || "haiku",
|
|
@@ -96891,16 +97151,27 @@ async function main() {
|
|
|
96891
97151
|
defaultTimeoutMs: memoryCfg.pipelineV2.extraction.timeout
|
|
96892
97152
|
}) : createOllamaProvider({
|
|
96893
97153
|
model: effectiveExtractionModel || "qwen3:4b",
|
|
97154
|
+
baseUrl: extractionOllamaFallbackBaseUrl,
|
|
96894
97155
|
defaultTimeoutMs: memoryCfg.pipelineV2.extraction.timeout
|
|
96895
97156
|
});
|
|
96896
97157
|
initLlmProvider(llmProvider);
|
|
96897
97158
|
if (memoryCfg.pipelineV2.synthesis.enabled) {
|
|
96898
97159
|
let effectiveSynthesisProvider = memoryCfg.pipelineV2.synthesis.provider;
|
|
97160
|
+
const synthesisOllamaBaseUrl = normalizeRuntimeBaseUrl(memoryCfg.pipelineV2.synthesis.endpoint, "http://127.0.0.1:11434");
|
|
97161
|
+
const synthesisOllamaFallbackBaseUrl = memoryCfg.pipelineV2.synthesis.provider === "opencode" ? "http://127.0.0.1:11434" : synthesisOllamaBaseUrl;
|
|
97162
|
+
const synthesisOpenCodeBaseUrl = normalizeRuntimeBaseUrl(memoryCfg.pipelineV2.synthesis.endpoint, "http://127.0.0.1:4096");
|
|
97163
|
+
const synthesisOpenCodeShouldManage = isManagedOpenCodeLocalEndpoint(synthesisOpenCodeBaseUrl);
|
|
96899
97164
|
if (effectiveSynthesisProvider === "opencode") {
|
|
96900
|
-
|
|
96901
|
-
|
|
96902
|
-
|
|
96903
|
-
|
|
97165
|
+
if (synthesisOpenCodeShouldManage) {
|
|
97166
|
+
const serverReady = await ensureOpenCodeServer(4096);
|
|
97167
|
+
if (!serverReady) {
|
|
97168
|
+
logger.warn("config", "OpenCode server not available for synthesis, falling back to ollama");
|
|
97169
|
+
effectiveSynthesisProvider = "ollama";
|
|
97170
|
+
}
|
|
97171
|
+
} else {
|
|
97172
|
+
logger.info("config", "Using external OpenCode endpoint for synthesis", {
|
|
97173
|
+
baseUrl: redactUrlForLogs(synthesisOpenCodeBaseUrl)
|
|
97174
|
+
});
|
|
96904
97175
|
}
|
|
96905
97176
|
} else if (effectiveSynthesisProvider === "anthropic") {
|
|
96906
97177
|
if (!anthropicApiKey) {
|
|
@@ -96925,7 +97196,24 @@ async function main() {
|
|
|
96925
97196
|
effectiveSynthesisProvider = "ollama";
|
|
96926
97197
|
}
|
|
96927
97198
|
}
|
|
96928
|
-
|
|
97199
|
+
providerRuntimeResolution.synthesis = {
|
|
97200
|
+
configured: providerHints.synthesis,
|
|
97201
|
+
resolved: memoryCfg.pipelineV2.synthesis.provider,
|
|
97202
|
+
effective: effectiveSynthesisProvider
|
|
97203
|
+
};
|
|
97204
|
+
if (providerHints.synthesis && providerHints.synthesis !== effectiveSynthesisProvider) {
|
|
97205
|
+
logger.warn("config", "Synthesis provider resolved differently than configured", {
|
|
97206
|
+
configured: providerHints.synthesis,
|
|
97207
|
+
resolved: memoryCfg.pipelineV2.synthesis.provider,
|
|
97208
|
+
effective: effectiveSynthesisProvider
|
|
97209
|
+
});
|
|
97210
|
+
}
|
|
97211
|
+
logger.info("config", "Synthesis provider", {
|
|
97212
|
+
configured: providerHints.synthesis,
|
|
97213
|
+
resolved: memoryCfg.pipelineV2.synthesis.provider,
|
|
97214
|
+
effective: effectiveSynthesisProvider,
|
|
97215
|
+
endpoint: redactUrlForLogs(effectiveSynthesisProvider === "ollama" ? synthesisOllamaFallbackBaseUrl : effectiveSynthesisProvider === "opencode" ? synthesisOpenCodeBaseUrl : undefined)
|
|
97216
|
+
});
|
|
96929
97217
|
let effectiveSynthesisModel = memoryCfg.pipelineV2.synthesis.model;
|
|
96930
97218
|
if (effectiveSynthesisProvider === "ollama" && memoryCfg.pipelineV2.synthesis.provider !== "ollama") {
|
|
96931
97219
|
effectiveSynthesisModel = undefined;
|
|
@@ -96936,16 +97224,24 @@ async function main() {
|
|
|
96936
97224
|
defaultTimeoutMs: memoryCfg.pipelineV2.synthesis.timeout
|
|
96937
97225
|
}) : effectiveSynthesisProvider === "opencode" ? createOpenCodeProvider({
|
|
96938
97226
|
model: effectiveSynthesisModel || "anthropic/claude-haiku-4-5-20251001",
|
|
97227
|
+
baseUrl: synthesisOpenCodeBaseUrl,
|
|
97228
|
+
ollamaFallbackBaseUrl: "http://127.0.0.1:11434",
|
|
96939
97229
|
defaultTimeoutMs: memoryCfg.pipelineV2.synthesis.timeout
|
|
96940
97230
|
}) : effectiveSynthesisProvider === "claude-code" ? createClaudeCodeProvider({
|
|
96941
97231
|
model: effectiveSynthesisModel || "haiku",
|
|
96942
97232
|
defaultTimeoutMs: memoryCfg.pipelineV2.synthesis.timeout
|
|
96943
97233
|
}) : createOllamaProvider({
|
|
96944
97234
|
model: effectiveSynthesisModel || "qwen3:4b",
|
|
97235
|
+
baseUrl: synthesisOllamaFallbackBaseUrl,
|
|
96945
97236
|
defaultTimeoutMs: memoryCfg.pipelineV2.synthesis.timeout
|
|
96946
97237
|
});
|
|
96947
97238
|
initSynthesisProvider(synthesisProvider);
|
|
96948
97239
|
} else {
|
|
97240
|
+
providerRuntimeResolution.synthesis = {
|
|
97241
|
+
configured: providerHints.synthesis,
|
|
97242
|
+
resolved: null,
|
|
97243
|
+
effective: null
|
|
97244
|
+
};
|
|
96949
97245
|
logger.info("config", "Synthesis disabled");
|
|
96950
97246
|
}
|
|
96951
97247
|
let telemetryCollector;
|
|
@@ -96979,7 +97275,7 @@ async function main() {
|
|
|
96979
97275
|
} catch {}
|
|
96980
97276
|
}, 300000);
|
|
96981
97277
|
}
|
|
96982
|
-
if (memoryCfg.pipelineV2.enabled
|
|
97278
|
+
if (memoryCfg.pipelineV2.enabled) {
|
|
96983
97279
|
startPipeline(getDbAccessor(), memoryCfg.pipelineV2, memoryCfg.embedding, fetchEmbedding, memoryCfg.search, providerTracker, analyticsCollector, telemetryCollector);
|
|
96984
97280
|
} else {
|
|
96985
97281
|
startRetentionWorker(getDbAccessor(), DEFAULT_RETENTION);
|
|
@@ -97075,6 +97371,8 @@ async function main() {
|
|
|
97075
97371
|
env: {
|
|
97076
97372
|
...process.env,
|
|
97077
97373
|
SIGNET_PORT: String(PORT),
|
|
97374
|
+
SIGNET_HOST: HOST,
|
|
97375
|
+
SIGNET_BIND: BIND_HOST,
|
|
97078
97376
|
SIGNET_PATH: AGENTS_DIR6
|
|
97079
97377
|
}
|
|
97080
97378
|
});
|
|
@@ -97089,7 +97387,7 @@ async function main() {
|
|
|
97089
97387
|
serve({
|
|
97090
97388
|
fetch: app.fetch,
|
|
97091
97389
|
port: PORT,
|
|
97092
|
-
hostname:
|
|
97390
|
+
hostname: BIND_HOST
|
|
97093
97391
|
}, (info) => {
|
|
97094
97392
|
logger.info("daemon", "Server listening", {
|
|
97095
97393
|
address: info.address,
|
|
@@ -97126,7 +97424,7 @@ async function main() {
|
|
|
97126
97424
|
}
|
|
97127
97425
|
});
|
|
97128
97426
|
}
|
|
97129
|
-
var AGENTS_DIR6, DAEMON_DIR, PID_FILE, LOG_DIR, MEMORY_DB2, SCRIPTS_DIR, PORT, HOST, providerTracker, analyticsCollector, repairLimiter, telemetryRef, embeddingTrackerHandle = null, predictorClientRef = null, skillReconcilerHandle = null, heartbeatTimer, checkpointPruneTimer, diagnosticsCache = null, DIAGNOSTICS_CACHE_TTL_MS = 2000, projectionInFlight, projectionErrors, PROJECTION_ERROR_TTL_MS = 30000, hasMemoriesSessionIdColumnCache = null, authConfig, authSecret = null, authForgetLimiter, authModifyLimiter, authBatchForgetLimiter, authAdminLimiter, authCrossAgentMessageLimiter, CURRENT_VERSION, cachedEmbeddingStatus = null, statusCacheTime = 0, STATUS_CACHE_TTL = 30000, TYPE_HINTS2, app, MAX_MUTATION_BATCH = 200, FORGET_CONFIRM_THRESHOLD = 25, SOFT_DELETE_RETENTION_DAYS = 30, SOFT_DELETE_RETENTION_MS, ACTOR_TYPES, harnessLastSeen, AGENT_MESSAGE_TYPES, MAX_CROSS_AGENT_MESSAGE_CHARS = 65536, greetingCache = null, dashboardPath, watcher = null, gitConfig, gitSyncTimer = null, lastGitSync = null, gitSyncInProgress = false, commitPending = false, commitTimer = null, COMMIT_DEBOUNCE_MS = 5000, pendingChanges, syncPending = false, syncTimer = null, SYNC_DEBOUNCE_MS = 2000, syncedClaudeMemories, ingestedMemoryFiles;
|
|
97427
|
+
var AGENTS_DIR6, DAEMON_DIR, PID_FILE, LOG_DIR, MEMORY_DB2, SCRIPTS_DIR, PORT, HOST, BIND_HOST, INTERNAL_SELF_HOST, providerRuntimeResolution, providerTracker, analyticsCollector, repairLimiter, telemetryRef, embeddingTrackerHandle = null, predictorClientRef = null, skillReconcilerHandle = null, heartbeatTimer, checkpointPruneTimer, diagnosticsCache = null, DIAGNOSTICS_CACHE_TTL_MS = 2000, projectionInFlight, projectionErrors, PROJECTION_ERROR_TTL_MS = 30000, hasMemoriesSessionIdColumnCache = null, authConfig, authSecret = null, authForgetLimiter, authModifyLimiter, authBatchForgetLimiter, authAdminLimiter, authCrossAgentMessageLimiter, CURRENT_VERSION, cachedEmbeddingStatus = null, statusCacheTime = 0, STATUS_CACHE_TTL = 30000, TYPE_HINTS2, app, MAX_MUTATION_BATCH = 200, FORGET_CONFIRM_THRESHOLD = 25, SOFT_DELETE_RETENTION_DAYS = 30, SOFT_DELETE_RETENTION_MS, ACTOR_TYPES, harnessLastSeen, AGENT_MESSAGE_TYPES, MAX_CROSS_AGENT_MESSAGE_CHARS = 65536, greetingCache = null, dashboardPath, watcher = null, gitConfig, gitSyncTimer = null, lastGitSync = null, gitSyncInProgress = false, commitPending = false, commitTimer = null, COMMIT_DEBOUNCE_MS = 5000, pendingChanges, syncPending = false, syncTimer = null, SYNC_DEBOUNCE_MS = 2000, syncedClaudeMemories, ingestedMemoryFiles;
|
|
97130
97428
|
var init_daemon = __esm(() => {
|
|
97131
97429
|
init_dist();
|
|
97132
97430
|
init_serve_static();
|
|
@@ -97184,8 +97482,22 @@ var init_daemon = __esm(() => {
|
|
|
97184
97482
|
LOG_DIR = join32(DAEMON_DIR, "logs");
|
|
97185
97483
|
MEMORY_DB2 = join32(AGENTS_DIR6, "memory", "memories.db");
|
|
97186
97484
|
SCRIPTS_DIR = join32(AGENTS_DIR6, "scripts");
|
|
97187
|
-
PORT =
|
|
97188
|
-
HOST =
|
|
97485
|
+
PORT = parsePort(readEnvTrimmed("SIGNET_PORT"), 3850);
|
|
97486
|
+
HOST = normalizeLoopbackHost(readEnvTrimmed("SIGNET_HOST") ?? "127.0.0.1");
|
|
97487
|
+
BIND_HOST = normalizeLoopbackHost(readEnvTrimmed("SIGNET_BIND") ?? HOST);
|
|
97488
|
+
INTERNAL_SELF_HOST = BIND_HOST === "0.0.0.0" || BIND_HOST === "::" ? "127.0.0.1" : BIND_HOST;
|
|
97489
|
+
providerRuntimeResolution = {
|
|
97490
|
+
extraction: {
|
|
97491
|
+
configured: null,
|
|
97492
|
+
resolved: "claude-code",
|
|
97493
|
+
effective: "claude-code"
|
|
97494
|
+
},
|
|
97495
|
+
synthesis: {
|
|
97496
|
+
configured: null,
|
|
97497
|
+
resolved: null,
|
|
97498
|
+
effective: null
|
|
97499
|
+
}
|
|
97500
|
+
};
|
|
97189
97501
|
providerTracker = createProviderTracker();
|
|
97190
97502
|
analyticsCollector = createAnalyticsCollector();
|
|
97191
97503
|
repairLimiter = createRateLimiter();
|
|
@@ -97700,7 +98012,7 @@ var init_daemon = __esm(() => {
|
|
|
97700
98012
|
const importance2 = body.importance ?? parsedPrefixes.importance;
|
|
97701
98013
|
const pinned2 = body.pinned ?? parsedPrefixes.pinned ? 1 : 0;
|
|
97702
98014
|
const tags2 = body.tags ?? parsedPrefixes.tags;
|
|
97703
|
-
const pipelineEnqueueEnabled2 = pipelineCfg.enabled
|
|
98015
|
+
const pipelineEnqueueEnabled2 = pipelineCfg.enabled;
|
|
97704
98016
|
const groupId = crypto.randomUUID();
|
|
97705
98017
|
const now4 = new Date().toISOString();
|
|
97706
98018
|
const chunkIds = [];
|
|
@@ -97831,7 +98143,7 @@ var init_daemon = __esm(() => {
|
|
|
97831
98143
|
}
|
|
97832
98144
|
const normalizedContentForInsert = normalizedContent.normalizedContent.length > 0 ? normalizedContent.normalizedContent : normalizedContent.hashBasis;
|
|
97833
98145
|
const contentHash2 = normalizedContent.contentHash;
|
|
97834
|
-
const pipelineEnqueueEnabled = pipelineCfg.enabled
|
|
98146
|
+
const pipelineEnqueueEnabled = pipelineCfg.enabled;
|
|
97835
98147
|
try {
|
|
97836
98148
|
const result = getDbAccessor().withWriteTx((db) => {
|
|
97837
98149
|
if (sourceId) {
|
|
@@ -97970,7 +98282,7 @@ var init_daemon = __esm(() => {
|
|
|
97970
98282
|
});
|
|
97971
98283
|
app.post("/api/memory/save", async (c2) => {
|
|
97972
98284
|
const body = await c2.req.json().catch(() => ({}));
|
|
97973
|
-
return fetch(`http://${
|
|
98285
|
+
return fetch(`http://${INTERNAL_SELF_HOST}:${PORT}/api/memory/remember`, {
|
|
97974
98286
|
method: "POST",
|
|
97975
98287
|
headers: { "Content-Type": "application/json" },
|
|
97976
98288
|
body: JSON.stringify(body)
|
|
@@ -97978,7 +98290,7 @@ var init_daemon = __esm(() => {
|
|
|
97978
98290
|
});
|
|
97979
98291
|
app.post("/api/hook/remember", async (c2) => {
|
|
97980
98292
|
const body = await c2.req.json().catch(() => ({}));
|
|
97981
|
-
return fetch(`http://${
|
|
98293
|
+
return fetch(`http://${INTERNAL_SELF_HOST}:${PORT}/api/memory/remember`, {
|
|
97982
98294
|
method: "POST",
|
|
97983
98295
|
headers: { "Content-Type": "application/json" },
|
|
97984
98296
|
body: JSON.stringify(body)
|
|
@@ -100597,6 +100909,9 @@ var init_daemon = __esm(() => {
|
|
|
100597
100909
|
});
|
|
100598
100910
|
app.get("/api/status", (c2) => {
|
|
100599
100911
|
const config2 = loadMemoryConfig(AGENTS_DIR6);
|
|
100912
|
+
const configuredLogFile = readEnvTrimmed("SIGNET_LOG_FILE");
|
|
100913
|
+
const configuredLogDir = readEnvTrimmed("SIGNET_LOG_DIR") ?? LOG_DIR;
|
|
100914
|
+
const datedLogFile = join32(configuredLogDir, `signet-${new Date().toISOString().slice(0, 10)}.log`);
|
|
100600
100915
|
let health;
|
|
100601
100916
|
try {
|
|
100602
100917
|
const report = getCachedDiagnosticsReport();
|
|
@@ -100624,9 +100939,15 @@ var init_daemon = __esm(() => {
|
|
|
100624
100939
|
startedAt: new Date(Date.now() - process.uptime() * 1000).toISOString(),
|
|
100625
100940
|
port: PORT,
|
|
100626
100941
|
host: HOST,
|
|
100942
|
+
bindHost: BIND_HOST,
|
|
100627
100943
|
agentsDir: AGENTS_DIR6,
|
|
100628
100944
|
memoryDb: existsSync23(MEMORY_DB2),
|
|
100629
100945
|
pipelineV2: config2.pipelineV2,
|
|
100946
|
+
providerResolution: providerRuntimeResolution,
|
|
100947
|
+
logging: {
|
|
100948
|
+
logDir: configuredLogFile ? dirname10(configuredLogFile) : configuredLogDir,
|
|
100949
|
+
logFile: configuredLogFile ?? datedLogFile
|
|
100950
|
+
},
|
|
100630
100951
|
activeSessions: activeSessionCount(),
|
|
100631
100952
|
bypassedSessions: getBypassedSessionKeys().size,
|
|
100632
100953
|
agentCreatedAt,
|
package/dist/mcp-stdio.js
CHANGED
|
@@ -29198,7 +29198,7 @@ async function createMcpServer(opts) {
|
|
|
29198
29198
|
}
|
|
29199
29199
|
|
|
29200
29200
|
// ../daemon/src/mcp-stdio.ts
|
|
29201
|
-
var DAEMON_URL = process.env.SIGNET_DAEMON_URL ?? `http://${process.env.SIGNET_HOST ?? "
|
|
29201
|
+
var DAEMON_URL = process.env.SIGNET_DAEMON_URL ?? `http://${process.env.SIGNET_HOST ?? "127.0.0.1"}:${process.env.SIGNET_PORT ?? "3850"}`;
|
|
29202
29202
|
var server = await createMcpServer({
|
|
29203
29203
|
daemonUrl: DAEMON_URL,
|
|
29204
29204
|
version: "0.1.0",
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as o,a as r}from"../chunks/R1uOjb-r.js";export{o as load_css,r as start};
|