fuli-context 0.12.2 → 0.12.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/README.md +10 -3
- package/README.zh-CN.md +9 -2
- package/dist/web/assets/{AboutPage-Dized8Uz.js → AboutPage-DKsgqteA.js} +1 -1
- package/dist/web/assets/{AgentConversations-Ccy41mEA.js → AgentConversations-BnFsfRj3.js} +1 -1
- package/dist/web/assets/{AgentHand-UzVhbKUC.js → AgentHand-B5lezlek.js} +1 -1
- package/dist/web/assets/{AgentName-DJpvkub2.js → AgentName-C-V41xs0.js} +1 -1
- package/dist/web/assets/AgentProfilePage-DjgqtOdz.js +1 -0
- package/dist/web/assets/AgentsDirectoryPage-IgN5QEdW.js +1 -0
- package/dist/web/assets/{AgentsDirectoryPage-Cv-vxw2C.css → AgentsDirectoryPage-kc3EgeGO.css} +1 -1
- package/dist/web/assets/{ConnectionsPage-uXcabab_.js → ConnectionsPage-CXtNiTEF.js} +1 -1
- package/dist/web/assets/EmployeeRecruitDialog-o6eyMw2g.js +1 -0
- package/dist/web/assets/EmployeeWorkbenchPage-4EnGLauW.js +3 -0
- package/dist/web/assets/{KnowledgeEditDialog-HmiqLC-Y.js → KnowledgeEditDialog-BlBd6Xql.js} +1 -1
- package/dist/web/assets/{KnowledgeInspector-Cj2yK4Qh.js → KnowledgeInspector-Dl7SAgaY.js} +1 -1
- package/dist/web/assets/{KnowledgeOrganizerPage-DT3BROZm.js → KnowledgeOrganizerPage-CpH4x6UA.js} +1 -1
- package/dist/web/assets/KnowledgePage-C-gFr7ln.js +1 -0
- package/dist/web/assets/{KnowledgeWorkspace-DA_dqVRG.js → KnowledgeWorkspace-4q_HfXas.js} +1 -1
- package/dist/web/assets/{NotFoundPage-x_Yd59mm.js → NotFoundPage-DtmfJSGx.js} +1 -1
- package/dist/web/assets/{OverviewPage-3eZjQ26v.js → OverviewPage-C1zw_8_6.js} +1 -1
- package/dist/web/assets/PersonalProfilePage-B0_zIINs.css +1 -0
- package/dist/web/assets/{PersonalProfilePage-CDQk096L.js → PersonalProfilePage-tQyS7qsa.js} +1 -1
- package/dist/web/assets/PersonalProjectsPage-Cgd_bjeK.js +1 -0
- package/dist/web/assets/{ProjectAgentFirstTask-BkRJ0zwO.js → ProjectAgentFirstTask-Caf7c6F_.js} +1 -1
- package/dist/web/assets/{ProjectAgentsPage-BuNNqSEy.js → ProjectAgentsPage-BOGkN5ZN.js} +1 -1
- package/dist/web/assets/{ProjectScopePicker-CiDxM2Yx.js → ProjectScopePicker-NyqcG6Iz.js} +1 -1
- package/dist/web/assets/{PublicProjectsPage-ByOT559r.js → PublicProjectsPage-CYwQLZmy.js} +1 -1
- package/dist/web/assets/{ReviewPage-C0Vdr9uq.js → ReviewPage-EyuAtIOq.js} +1 -1
- package/dist/web/assets/{RoundtablesPage-L3ShEWS3.js → RoundtablesPage-JVBXsJrs.js} +1 -1
- package/dist/web/assets/SettingsPage-BARo0Ds0.css +1 -0
- package/dist/web/assets/SettingsPage-Dfi7kl9c.js +1 -0
- package/dist/web/assets/{SharedJefaReportPage-Bg6lIk3E.js → SharedJefaReportPage-DFy5Ty7o.js} +1 -1
- package/dist/web/assets/{UiButton-x8hiHNRM.js → UiButton-neeym_gA.js} +1 -1
- package/dist/web/assets/{UiDialog-mjletK0y.js → UiDialog-BFVoqFnc.js} +1 -1
- package/dist/web/assets/{UiDisclosure-_IxeiexW.js → UiDisclosure-B-T7BmB5.js} +1 -1
- package/dist/web/assets/{UiSegmented-WFfz9Evl.js → UiSegmented-D_kyRKDw.js} +1 -1
- package/dist/web/assets/{UiSelect-K29jnV-1.js → UiSelect-DDyct4mf.js} +1 -1
- package/dist/web/assets/{WritingTastePage-DCULB-d2.js → WritingTastePage-BPRq6kJ6.js} +1 -1
- package/dist/web/assets/{agent-pins-DS4mNsNt.js → agent-pins-6LRHTMF6.js} +1 -1
- package/dist/web/assets/agent-profile-UgNiXgpU.css +1 -0
- package/dist/web/assets/{attention-store-CA5y8j1R.js → attention-store-BGHyzWfv.js} +1 -1
- package/dist/web/assets/avatars-z6ANYG_r.js +1 -0
- package/dist/web/assets/{catalog-D0VEfOAV.js → catalog-kb-cA8t6.js} +1 -1
- package/dist/web/assets/{client-DnwnUBQV.js → client-DodUFQDp.js} +1 -1
- package/dist/web/assets/{console-Cw7TzOSC.js → console-C2Lfifq-.js} +1 -1
- package/dist/web/assets/{conversation-launcher-settings-Yc13viwr.js → conversation-launcher-settings-CowfVz7l.js} +1 -1
- package/dist/web/assets/{i18n-oJFlt8hW.js → i18n-B4Fp9Oa5.js} +1 -1
- package/dist/web/assets/{identity-DSGS4CZc.js → identity-DG_za-J7.js} +1 -1
- package/dist/web/assets/index-DsExj49_.css +1 -0
- package/dist/web/assets/index-RxlM8aQV.js +5 -0
- package/dist/web/assets/{judgment-types-DR931cZ7.js → judgment-types-DRqrjStd.js} +1 -1
- package/dist/web/assets/{model-BJ-UF4cs.js → model-C0eHDNsF.js} +1 -1
- package/dist/web/assets/{personal-profile-graph-SOK0BR0w.js → personal-profile-graph-CHY3WYhi.js} +1 -1
- package/dist/web/assets/project-team-api-Dfm8C4B8.js +1 -0
- package/dist/web/assets/{shared-report-CiX64ZiD.js → shared-report-8JFvD9TZ.js} +1 -1
- package/dist/web/assets/tonborg-avatar-DyxAdTD6.webp +0 -0
- package/dist/web/assets/{useAgentRoster-B84mzZIg.js → useAgentRoster-QDbOwtLj.js} +1 -1
- package/dist/web/assets/{useApi-CROJJdhE-7gt0QyQ5.js → useApi-CROJJdhE-IuC5qwny.js} +1 -1
- package/dist/web/assets/{vue-router-CCvPGaLD.js → vue-router-nZMhR3dI.js} +1 -1
- package/dist/web/index.html +16 -15
- package/graph-provider/fuli_graph/project_agent_task_models.py +1 -0
- package/graph-provider/fuli_graph/system_agents.py +27 -3
- package/graph-provider/pyproject.toml +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/src/cli/command-registry.js +2 -1
- package/src/cli/setup-command.js +16 -2
- package/src/cli/update-command.js +54 -39
- package/src/cli/update-installation.js +54 -0
- package/src/cli.js +1 -2
- package/src/employees/catalog/tonborg.json +1 -1
- package/src/http/api-router.js +28 -1
- package/src/local-runtime/lifecycle.js +1 -0
- package/src/setup/graph-runtime.js +1 -1
- package/src/setup/options.js +1 -0
- package/src/system/settings-apply-worker.js +6 -0
- package/src/system/settings-apply.js +116 -0
- package/src/system/system-service.js +25 -5
- package/dist/web/assets/AgentProfilePage-CFViQ8kj.js +0 -1
- package/dist/web/assets/AgentsDirectoryPage-CBFTg_IE.js +0 -1
- package/dist/web/assets/EmployeeRecruitDialog-D8Hvhc-M.js +0 -1
- package/dist/web/assets/EmployeeWorkbenchPage-TBl_HNj6.js +0 -3
- package/dist/web/assets/KnowledgePage-C4J4VueL.js +0 -1
- package/dist/web/assets/PersonalProfilePage-DrMDAAdy.css +0 -1
- package/dist/web/assets/PersonalProjectsPage-CJxp4Wyz.js +0 -1
- package/dist/web/assets/SettingsPage-BE8pWbI6.css +0 -1
- package/dist/web/assets/SettingsPage-McYuinGz.js +0 -1
- package/dist/web/assets/agent-profile-Bh3MJGvb.css +0 -1
- package/dist/web/assets/index-BfHCcUL2.css +0 -1
- package/dist/web/assets/index-CxNER7Oo.js +0 -5
- package/dist/web/assets/project-team-api-C_0qJk_B.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,B as t,D as n,E as r,F as i,Q as a,X as o,et as s,j as c,k as l,rt as u,v as d}from"./i18n-oJFlt8hW.js";import{a as f,c as p,d as m,f as h,g,i as _,l as v,n as y,o as b,p as ee,r as x,s as S,t as C,u as w}from"./useApi-CROJJdhE-7gt0QyQ5.js";var T=typeof document<`u`,E=/#/g,te=/&/g,ne=/\//g,re=/=/g,D=/\?/g,O=/\+/g,ie=/%5B/g,k=/%5D/g,ae=/%5E/g,oe=/%60/g,A=/%7B/g,se=/%7C/g,j=/%7D/g,M=/%20/g;function N(e){return e==null?``:encodeURI(``+e).replace(se,`|`).replace(ie,`[`).replace(k,`]`)}function ce(e){return N(e).replace(A,`{`).replace(j,`}`).replace(ae,`^`)}function P(e){return N(e).replace(O,`%2B`).replace(M,`+`).replace(E,`%23`).replace(te,`%26`).replace(oe,"`").replace(A,`{`).replace(j,`}`).replace(ae,`^`)}function F(e){return P(e).replace(re,`%3D`)}function le(e){return N(e).replace(E,`%23`).replace(D,`%3F`)}function ue(e){return le(e).replace(ne,`%2F`)}function I(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{}return``+e}var L=/\/$/,R=e=>e.replace(L,``);function z(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return c=s>=0&&c>s?-1:c,c>=0&&(r=t.slice(0,c),a=t.slice(c,s>0?s:t.length),i=e(a.slice(1))),s>=0&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=G(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:I(o)}}function de(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function B(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function fe(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&V(t.matched[r],n.matched[i])&&H(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function V(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function H(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!U(e[n],t[n]))return!1;return!0}function U(e,t){return _(e)?W(e,t):_(t)?W(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function W(e,t){return _(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function G(e,t){if(e.startsWith(`/`))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o<r.length;o++)if(s=r[o],s!==`.`)if(s===`..`)a>1&&a--;else break;return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}var K={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0};function q(e){if(!e)if(T){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),R(e)}var J=/^[^#]+#/;function Y(e,t){return e.replace(J,`#`)+t}function X(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}var Z=()=>({left:window.scrollX,top:window.scrollY});function pe(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=X(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function me(e,t){return(history.state?history.state.position-t:-1)+e}var he=new Map;function ge(e,t){he.set(e,t)}function _e(e){let t=he.get(e);return he.delete(e),t}function ve(e){return typeof e==`string`||e&&typeof e==`object`}function ye(e){return typeof e==`string`||typeof e==`symbol`}function be(e){let t={};if(e===``||e===`?`)return t;let n=(e[0]===`?`?e.slice(1):e).split(`&`);for(let e=0;e<n.length;++e){let r=n[e].replace(O,` `),i=r.indexOf(`=`),a=I(i<0?r:r.slice(0,i)),o=i<0?null:I(r.slice(i+1));if(a in t){let e=t[a];_(e)||(e=t[a]=[e]),e.push(o)}else t[a]=o}return t}function xe(e){let t=``;for(let n in e){let r=e[n];if(n=F(n),r==null){r!==void 0&&(t+=(t.length?`&`:``)+n);continue}(_(r)?r.map(e=>e&&P(e)):[r&&P(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function Se(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=_(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}function Q(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function $(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(x(4,{from:n,to:t})):e instanceof Error?c(e):ve(e)?c(x(2,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function Ce(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(!(t!==`beforeRouteEnter`&&!o.instances[e]))if(S(s)){let c=(s.__vccOpts||s)[t];c&&a.push($(c,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=f(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=(s.__vccOpts||s)[t];return c&&$(c,n,r,o,e,i)()}))}}return a}function we(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;o<a;o++){let a=t.matched[o];a&&(e.matched.find(e=>V(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>V(e,s))||i.push(s))}return[n,r,i]}var Te=()=>location.protocol+`//`+location.host;function Ee(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),B(n,``)}return B(n,e)+r+i}function De(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=Ee(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:`pop`,direction:u?u>0?`forward`:`back`:``})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){if(document.visibilityState===`hidden`){let{history:e}=window;if(!e.state)return;e.replaceState(y({},e.state,{scroll:Z()}),``)}}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u),document.removeEventListener(`visibilitychange`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),document.addEventListener(`visibilitychange`,u),{pauseListeners:c,listen:l,destroy:d}}function Oe(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?Z():null}}function ke(e){let{history:t,location:n}=window,r={value:Ee(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:Te()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,y({},t.state,Oe(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=y({},i.value,t.state,{forward:e,scroll:Z()});a(o.current,o,!0),a(e,y({},Oe(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function Ae(e){e=q(e);let t=ke(e),n=De(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=y({location:``,base:e,go:r,createHref:Y.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}var je={type:0,value:``},Me=/[a-zA-Z0-9_]/;function Ne(e){if(!e)return[[]];if(e===`/`)return[[je]];if(!e.startsWith(`/`))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=0,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===0?a.push({type:0,value:l}):n===1||n===2||n===3?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;s<e.length;)switch(c=e[s++],n){case 0:c===`\\`?(r=n,n=4):c===`/`?(l&&d(),o()):c===`:`?(d(),n=1):f();break;case 4:f(),n=r;break;case 1:c===`(`?n=2:Me.test(c)?f():(d(),n=0,c!==`*`&&c!==`?`&&c!==`+`&&s--);break;case 2:c===`)`?u[u.length-1]==`\\`?u=u.slice(0,-1)+c:n=3:u+=c;break;case 3:d(),n=0,c!==`*`&&c!==`?`&&c!==`+`&&s--,u=``;break;default:t(`Unknown state`);break}return n===2&&t(`Unfinished custom RegExp for param "${l}"`),d(),o(),i}var Pe=`[^/]+?`,Fe={sensitive:!1,strict:!1,start:!0,end:!0},Ie=/[.+*?^${}()[\]/\\]/g;function Le(e,t){let n=y({},Fe,t),r=[],i=n.start?`^`:``,a=[];for(let t of e){let e=t.length?[]:[90];n.strict&&!t.length&&(i+=`/`);for(let r=0;r<t.length;r++){let o=t[r],s=40+(n.sensitive?.25:0);if(o.type===0)r||(i+=`/`),i+=o.value.replace(Ie,`\\$&`),s+=40;else if(o.type===1){let{value:e,repeatable:n,optional:c,regexp:l}=o;a.push({name:e,repeatable:n,optional:c});let u=l||Pe;if(u!==Pe){s+=10;try{RegExp(`(${u})`)}catch(t){throw Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let d=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(d=c&&t.length<2?`(?:/${d})`:`/`+d),c&&(d+=`?`),i+=d,s+=20,c&&(s+=-8),n&&(s+=-20),u===`.*`&&(s+=-50)}e.push(s)}r.push(e)}if(n.strict&&n.end){let e=r.length-1;r[e][r[e].length-1]+=.7000000000000001}n.strict||(i+=`/?`),n.end?i+=`$`:n.strict&&!i.endsWith(`/`)&&(i+=`(?:/|$)`);let o=new RegExp(i,n.sensitive?``:`i`);function s(e){let t=e.match(o),n={};if(!t)return null;for(let e=1;e<t.length;e++){let r=t[e]||``,i=a[e-1];n[i.name]=r&&i.repeatable?r.split(`/`):r}return n}function c(t){let n=``,r=!1;for(let i of e){(!r||!n.endsWith(`/`))&&(n+=`/`),r=!1;for(let e of i)if(e.type===0)n+=e.value;else if(e.type===1){let{value:a,repeatable:o,optional:s}=e,c=a in t?t[a]:``;if(_(c)&&!o)throw Error(`Provided param "${a}" is an array but it is not repeatable (* or + modifiers)`);let l=_(c)?c.join(`/`):c;if(!l)if(s)i.length<2&&(n.endsWith(`/`)?n=n.slice(0,-1):r=!0);else throw Error(`Missing required param "${a}"`);n+=l}}return n||`/`}return{re:o,score:r,keys:a,parse:s,stringify:c}}function Re(e,t){let n=0;for(;n<e.length&&n<t.length;){let r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===80?-1:1:e.length>t.length?t.length===1&&t[0]===80?1:-1:0}function ze(e,t){let n=0,r=e.score,i=t.score;for(;n<r.length&&n<i.length;){let e=Re(r[n],i[n]);if(e)return e;n++}if(Math.abs(i.length-r.length)===1){if(Be(r))return 1;if(Be(i))return-1}return i.length-r.length}function Be(e){let t=e[e.length-1];return e.length>0&&t[t.length-1]<0}var Ve={strict:!1,end:!0,sensitive:!1};function He(e,t,n){let r=y(Le(Ne(e.path),n),{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Ue(e,t){let n=[],r=new Map;t=v(Ve,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=Ge(e);s.aliasOf=r&&r.record;let l=v(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(Ge(y({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&u[0]!==`/`){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=He(t,n,l),r?r.alias.push(d):(f||=d,f!==d&&f.alias.push(d),i&&e.name&&!qe(d)&&o(e.name)),Ze(d)&&c(d),s.children){let e=s.children;for(let t=0;t<e.length;t++)a(e[t],d,r&&r.children[t])}r||=d}return f?()=>{o(f)}:w}function o(e){if(ye(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=Ye(e,n);n.splice(t,0,e),e.record.name&&!qe(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw x(1,{location:e});s=i.record.name,a=y(We(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&We(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name,i.keys.forEach(e=>{e.optional&&!a[e.name]&&delete a[e.name]}));else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw x(1,{location:e,currentLocation:t});s=i.record.name,a=y({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:Je(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function We(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Ge(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Ke(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Ke(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function qe(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Je(e){return e.reduce((e,t)=>y(e,t.meta),{})}function Ye(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;ze(e,t[i])<0?r=i:n=i+1}let i=Xe(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function Xe(e){let t=e;for(;t=t.parent;)if(Ze(t)&&ze(e,t)===0)return t}function Ze({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Qe(e){let t=l(h),n=l(m),r=d(()=>{let n=u(e.to);return t.resolve(n)}),i=d(()=>{let{matched:e}=r.value,{length:t}=e,i=e[t-1],a=n.matched;if(!i||!a.length)return-1;let o=a.findIndex(V.bind(null,i));if(o>-1)return o;let s=rt(e[t-2]);return t>1&&rt(i)===s&&a[a.length-1].path!==s?a.findIndex(V.bind(null,e[t-2])):o}),a=d(()=>i.value>-1&&nt(n.params,r.value.params)),o=d(()=>i.value>-1&&i.value===n.matched.length-1&&H(n.params,r.value.params));function s(n={}){if(tt(n)){let n=t[u(e.replace)?`replace`:`push`](u(e.to)).catch(w);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:r,href:d(()=>r.value.href),isActive:a,isExactActive:o,navigate:s}}function $e(e){return e.length===1?e[0]:e}var et=r({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:Qe,setup(e,{slots:t}){let r=o(Qe(e)),{options:i}=l(h),a=d(()=>({[it(e.activeClass,i.linkActiveClass,`router-link-active`)]:r.isActive,[it(e.exactActiveClass,i.linkExactActiveClass,`router-link-exact-active`)]:r.isExactActive}));return()=>{let i=t.default&&$e(t.default(r));return e.custom?i:n(`a`,{"aria-current":r.isExactActive?e.ariaCurrentValue:null,href:r.href,onClick:r.navigate,class:a.value},i)}}});function tt(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function nt(e,t){for(let n in t){let r=t[n],i=e[n];if(typeof r==`string`){if(r!==i)return!1}else if(!_(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}return!0}function rt(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var it=(e,t,n)=>e??t??n,at=r({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:r,slots:o}){let s=l(ee),c=d(()=>e.route||s.value),f=l(g,0),m=d(()=>{let e=u(f),{matched:t}=c.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),h=d(()=>c.value.matched[m.value]);i(g,d(()=>m.value+1)),i(p,h),i(ee,c);let _=a();return t(()=>[_.value,h.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!V(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let t=c.value,i=e.name,a=h.value,s=a&&a.components[i];if(!s)return ot(o.default,{Component:s,route:t});let l=a.props[i],u=n(s,y({},l?l===!0?t.params:typeof l==`function`?l(t):l:null,r,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(a.instances[i]=null)},ref:_}));return ot(o.default,{Component:u,route:t})||u}}});function ot(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var st=at;function ct(t){let n=Ue(t.routes,t),r=t.parseQuery||be,i=t.stringifyQuery||xe,a=t.history,o=Q(),l=Q(),d=Q(),f=s(K),p=K;T&&t.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let g=C.bind(null,e=>``+e),v=C.bind(null,ue),S=C.bind(null,I);function E(e,t){let r,i;return ye(e)?(r=n.getRecordMatcher(e),i=t):i=e,n.addRoute(i,r)}function te(e){let t=n.getRecordMatcher(e);t&&n.removeRoute(t)}function ne(){return n.getRoutes().map(e=>e.record)}function re(e){return!!n.getRecordMatcher(e)}function D(e,t){if(t=y({},t||f.value),typeof e==`string`){let i=z(r,e,t.path),o=n.resolve({path:i.path},t),s=a.createHref(i.fullPath);return y(i,o,{params:S(o.params),redirectedFrom:void 0,href:s})}let o;if(e.path!=null)o=y({},e,{path:z(r,e.path,t.path).path});else{let n=y({},e.params);for(let e in n)n[e]??delete n[e];o=y({},e,{params:v(n)}),t.params=v(t.params)}let s=n.resolve(o,t),c=e.hash||``;s.params=g(S(s.params));let l=de(i,y({},e,{hash:ce(c),path:s.path})),u=a.createHref(l);return y({fullPath:l,hash:c,query:i===xe?Se(e.query):e.query||{}},s,{redirectedFrom:void 0,href:u})}function O(e){return typeof e==`string`?z(r,e,f.value.path):y({},e)}function ie(e,t){if(p!==e)return x(8,{from:t,to:e})}function k(e){return A(e)}function ae(e){return k(y(O(e),{replace:!0}))}function oe(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=O(i):{path:i},i.params={}),y({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function A(e,t){let n=p=D(e),r=f.value,a=e.state,o=e.force,s=e.replace===!0,c=oe(n,r);if(c)return A(y(O(c),{state:typeof c==`object`?y({},a,c.state):a,force:o,replace:s}),t||n);let l=n;l.redirectedFrom=t;let u;return!o&&fe(i,r,n)&&(u=x(16,{to:l,from:r}),W(r,r,!0,!1)),(u?Promise.resolve(u):M(l,r)).catch(e=>b(e)?b(e,2)?e:U(e):V(e,l,r)).then(e=>{if(e){if(b(e,2))return A(y({replace:s},O(e.to),{state:typeof e.to==`object`?y({},a,e.to.state):a,force:o}),t||l)}else e=P(l,r,!0,s,a);return N(l,r,e),e})}function se(e,t){let n=ie(e,t);return n?Promise.reject(n):Promise.resolve()}function j(e){let t=J.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function M(e,t){let n,[r,i,a]=we(e,t);n=Ce(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push($(r,e,t))});let s=se.bind(null,e,t);return n.push(s),X(n).then(()=>{n=[];for(let r of o.list())n.push($(r,e,t));return n.push(s),X(n)}).then(()=>{n=Ce(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push($(r,e,t))});return n.push(s),X(n)}).then(()=>{n=[];for(let r of a)if(r.beforeEnter)if(_(r.beforeEnter))for(let i of r.beforeEnter)n.push($(i,e,t));else n.push($(r.beforeEnter,e,t));return n.push(s),X(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=Ce(a,`beforeRouteEnter`,e,t,j),n.push(s),X(n))).then(()=>{n=[];for(let r of l.list())n.push($(r,e,t));return n.push(s),X(n)}).catch(e=>b(e,8)?e:Promise.reject(e))}function N(e,t,n){d.list().forEach(r=>j(()=>r(e,t,n)))}function P(e,t,n,r,i){let o=ie(e,t);if(o)return o;let s=t===K,c=T?history.state:{};n&&(r||s?a.replace(e.fullPath,y({scroll:s&&c&&c.scroll},i)):a.push(e.fullPath,i)),f.value=e,W(e,t,n,s),U()}let F;function le(){F||=a.listen((e,t,n)=>{if(!Y.listening)return;let r=D(e),i=oe(r,Y.currentRoute.value);if(i){A(y(i,{replace:!0,force:!0}),r).catch(w);return}p=r;let o=f.value;T&&ge(me(o.fullPath,n.delta),Z()),M(r,o).catch(e=>b(e,12)?e:b(e,2)?(A(y(O(e.to),{force:!0}),r).then(e=>{b(e,20)&&!n.delta&&n.type===`pop`&&a.go(-1,!1)}).catch(w),Promise.reject()):(n.delta&&a.go(-n.delta,!1),V(e,r,o))).then(e=>{e||=P(r,o,!1),e&&(n.delta&&!b(e,8)?a.go(-n.delta,!1):n.type===`pop`&&b(e,20)&&a.go(-1,!1)),N(r,o,e)}).catch(w)})}let L=Q(),R=Q(),B;function V(e,t,n){U(e);let r=R.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function H(){return B&&f.value!==K?Promise.resolve():new Promise((e,t)=>{L.add([e,t])})}function U(e){return B||(B=!e,le(),L.list().forEach(([t,n])=>e?n(e):t()),L.reset()),e}function W(e,n,r,i){let{scrollBehavior:a}=t;if(!T||!a)return Promise.resolve();let o=!r&&_e(me(e.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return c().then(()=>a(e,n,o)).then(t=>e===f.value&&t&&pe(t)).catch(t=>e===f.value&&V(t,e,n))}let G=e=>a.go(e),q,J=new Set,Y={currentRoute:f,listening:!0,addRoute:E,removeRoute:te,clearRoutes:n.clearRoutes,hasRoute:re,getRoutes:ne,resolve:D,options:t,push:k,replace:ae,go:G,back:()=>G(-1),forward:()=>G(1),beforeEach:o.add,beforeResolve:l.add,afterEach:d.add,onError:R.add,isReady:H,install(t){t.component(`RouterLink`,et),t.component(`RouterView`,st),t.config.globalProperties.$router=Y,Object.defineProperty(t.config.globalProperties,"$route",{enumerable:!0,get:()=>u(f)}),T&&!q&&f.value===K&&(q=!0,k(a.location).catch(e=>{}));let n={};for(let e in K)Object.defineProperty(n,e,{get:()=>f.value[e],enumerable:!0});t.provide(h,Y),t.provide(m,e(n)),t.provide(ee,f);let r=t.unmount;J.add(t),t.unmount=function(){J.delete(t),J.size<1&&(p=K,F&&F(),F=null,f.value=K,q=!1,B=!1),r()}}};function X(e){return e.reduce((e,t)=>e.then(()=>j(t)),Promise.resolve())}return Y}export{Ae as i,st as n,ct as r,et as t};
|
|
1
|
+
import{$ as e,B as t,D as n,E as r,F as i,Q as a,X as o,et as s,j as c,k as l,rt as u,v as d}from"./i18n-B4Fp9Oa5.js";import{a as f,c as p,d as m,f as h,g,i as _,l as v,n as y,o as b,p as ee,r as x,s as S,t as C,u as w}from"./useApi-CROJJdhE-IuC5qwny.js";var T=typeof document<`u`,E=/#/g,te=/&/g,ne=/\//g,re=/=/g,D=/\?/g,O=/\+/g,ie=/%5B/g,k=/%5D/g,ae=/%5E/g,oe=/%60/g,A=/%7B/g,se=/%7C/g,j=/%7D/g,M=/%20/g;function N(e){return e==null?``:encodeURI(``+e).replace(se,`|`).replace(ie,`[`).replace(k,`]`)}function ce(e){return N(e).replace(A,`{`).replace(j,`}`).replace(ae,`^`)}function P(e){return N(e).replace(O,`%2B`).replace(M,`+`).replace(E,`%23`).replace(te,`%26`).replace(oe,"`").replace(A,`{`).replace(j,`}`).replace(ae,`^`)}function F(e){return P(e).replace(re,`%3D`)}function le(e){return N(e).replace(E,`%23`).replace(D,`%3F`)}function ue(e){return le(e).replace(ne,`%2F`)}function I(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{}return``+e}var L=/\/$/,R=e=>e.replace(L,``);function z(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return c=s>=0&&c>s?-1:c,c>=0&&(r=t.slice(0,c),a=t.slice(c,s>0?s:t.length),i=e(a.slice(1))),s>=0&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=G(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:I(o)}}function de(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function B(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function fe(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&V(t.matched[r],n.matched[i])&&H(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function V(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function H(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!U(e[n],t[n]))return!1;return!0}function U(e,t){return _(e)?W(e,t):_(t)?W(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function W(e,t){return _(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function G(e,t){if(e.startsWith(`/`))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o<r.length;o++)if(s=r[o],s!==`.`)if(s===`..`)a>1&&a--;else break;return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}var K={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0};function q(e){if(!e)if(T){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),R(e)}var J=/^[^#]+#/;function Y(e,t){return e.replace(J,`#`)+t}function X(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}var Z=()=>({left:window.scrollX,top:window.scrollY});function pe(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=X(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function me(e,t){return(history.state?history.state.position-t:-1)+e}var he=new Map;function ge(e,t){he.set(e,t)}function _e(e){let t=he.get(e);return he.delete(e),t}function ve(e){return typeof e==`string`||e&&typeof e==`object`}function ye(e){return typeof e==`string`||typeof e==`symbol`}function be(e){let t={};if(e===``||e===`?`)return t;let n=(e[0]===`?`?e.slice(1):e).split(`&`);for(let e=0;e<n.length;++e){let r=n[e].replace(O,` `),i=r.indexOf(`=`),a=I(i<0?r:r.slice(0,i)),o=i<0?null:I(r.slice(i+1));if(a in t){let e=t[a];_(e)||(e=t[a]=[e]),e.push(o)}else t[a]=o}return t}function xe(e){let t=``;for(let n in e){let r=e[n];if(n=F(n),r==null){r!==void 0&&(t+=(t.length?`&`:``)+n);continue}(_(r)?r.map(e=>e&&P(e)):[r&&P(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function Se(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=_(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}function Q(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function $(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(x(4,{from:n,to:t})):e instanceof Error?c(e):ve(e)?c(x(2,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function Ce(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(!(t!==`beforeRouteEnter`&&!o.instances[e]))if(S(s)){let c=(s.__vccOpts||s)[t];c&&a.push($(c,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=f(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=(s.__vccOpts||s)[t];return c&&$(c,n,r,o,e,i)()}))}}return a}function we(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;o<a;o++){let a=t.matched[o];a&&(e.matched.find(e=>V(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>V(e,s))||i.push(s))}return[n,r,i]}var Te=()=>location.protocol+`//`+location.host;function Ee(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),B(n,``)}return B(n,e)+r+i}function De(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=Ee(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:`pop`,direction:u?u>0?`forward`:`back`:``})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){if(document.visibilityState===`hidden`){let{history:e}=window;if(!e.state)return;e.replaceState(y({},e.state,{scroll:Z()}),``)}}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u),document.removeEventListener(`visibilitychange`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),document.addEventListener(`visibilitychange`,u),{pauseListeners:c,listen:l,destroy:d}}function Oe(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?Z():null}}function ke(e){let{history:t,location:n}=window,r={value:Ee(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:Te()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,y({},t.state,Oe(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=y({},i.value,t.state,{forward:e,scroll:Z()});a(o.current,o,!0),a(e,y({},Oe(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function Ae(e){e=q(e);let t=ke(e),n=De(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=y({location:``,base:e,go:r,createHref:Y.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}var je={type:0,value:``},Me=/[a-zA-Z0-9_]/;function Ne(e){if(!e)return[[]];if(e===`/`)return[[je]];if(!e.startsWith(`/`))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=0,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===0?a.push({type:0,value:l}):n===1||n===2||n===3?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;s<e.length;)switch(c=e[s++],n){case 0:c===`\\`?(r=n,n=4):c===`/`?(l&&d(),o()):c===`:`?(d(),n=1):f();break;case 4:f(),n=r;break;case 1:c===`(`?n=2:Me.test(c)?f():(d(),n=0,c!==`*`&&c!==`?`&&c!==`+`&&s--);break;case 2:c===`)`?u[u.length-1]==`\\`?u=u.slice(0,-1)+c:n=3:u+=c;break;case 3:d(),n=0,c!==`*`&&c!==`?`&&c!==`+`&&s--,u=``;break;default:t(`Unknown state`);break}return n===2&&t(`Unfinished custom RegExp for param "${l}"`),d(),o(),i}var Pe=`[^/]+?`,Fe={sensitive:!1,strict:!1,start:!0,end:!0},Ie=/[.+*?^${}()[\]/\\]/g;function Le(e,t){let n=y({},Fe,t),r=[],i=n.start?`^`:``,a=[];for(let t of e){let e=t.length?[]:[90];n.strict&&!t.length&&(i+=`/`);for(let r=0;r<t.length;r++){let o=t[r],s=40+(n.sensitive?.25:0);if(o.type===0)r||(i+=`/`),i+=o.value.replace(Ie,`\\$&`),s+=40;else if(o.type===1){let{value:e,repeatable:n,optional:c,regexp:l}=o;a.push({name:e,repeatable:n,optional:c});let u=l||Pe;if(u!==Pe){s+=10;try{RegExp(`(${u})`)}catch(t){throw Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let d=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(d=c&&t.length<2?`(?:/${d})`:`/`+d),c&&(d+=`?`),i+=d,s+=20,c&&(s+=-8),n&&(s+=-20),u===`.*`&&(s+=-50)}e.push(s)}r.push(e)}if(n.strict&&n.end){let e=r.length-1;r[e][r[e].length-1]+=.7000000000000001}n.strict||(i+=`/?`),n.end?i+=`$`:n.strict&&!i.endsWith(`/`)&&(i+=`(?:/|$)`);let o=new RegExp(i,n.sensitive?``:`i`);function s(e){let t=e.match(o),n={};if(!t)return null;for(let e=1;e<t.length;e++){let r=t[e]||``,i=a[e-1];n[i.name]=r&&i.repeatable?r.split(`/`):r}return n}function c(t){let n=``,r=!1;for(let i of e){(!r||!n.endsWith(`/`))&&(n+=`/`),r=!1;for(let e of i)if(e.type===0)n+=e.value;else if(e.type===1){let{value:a,repeatable:o,optional:s}=e,c=a in t?t[a]:``;if(_(c)&&!o)throw Error(`Provided param "${a}" is an array but it is not repeatable (* or + modifiers)`);let l=_(c)?c.join(`/`):c;if(!l)if(s)i.length<2&&(n.endsWith(`/`)?n=n.slice(0,-1):r=!0);else throw Error(`Missing required param "${a}"`);n+=l}}return n||`/`}return{re:o,score:r,keys:a,parse:s,stringify:c}}function Re(e,t){let n=0;for(;n<e.length&&n<t.length;){let r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===80?-1:1:e.length>t.length?t.length===1&&t[0]===80?1:-1:0}function ze(e,t){let n=0,r=e.score,i=t.score;for(;n<r.length&&n<i.length;){let e=Re(r[n],i[n]);if(e)return e;n++}if(Math.abs(i.length-r.length)===1){if(Be(r))return 1;if(Be(i))return-1}return i.length-r.length}function Be(e){let t=e[e.length-1];return e.length>0&&t[t.length-1]<0}var Ve={strict:!1,end:!0,sensitive:!1};function He(e,t,n){let r=y(Le(Ne(e.path),n),{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Ue(e,t){let n=[],r=new Map;t=v(Ve,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=Ge(e);s.aliasOf=r&&r.record;let l=v(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(Ge(y({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&u[0]!==`/`){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=He(t,n,l),r?r.alias.push(d):(f||=d,f!==d&&f.alias.push(d),i&&e.name&&!qe(d)&&o(e.name)),Ze(d)&&c(d),s.children){let e=s.children;for(let t=0;t<e.length;t++)a(e[t],d,r&&r.children[t])}r||=d}return f?()=>{o(f)}:w}function o(e){if(ye(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=Ye(e,n);n.splice(t,0,e),e.record.name&&!qe(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw x(1,{location:e});s=i.record.name,a=y(We(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&We(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name,i.keys.forEach(e=>{e.optional&&!a[e.name]&&delete a[e.name]}));else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw x(1,{location:e,currentLocation:t});s=i.record.name,a=y({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:Je(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function We(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Ge(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Ke(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Ke(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function qe(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Je(e){return e.reduce((e,t)=>y(e,t.meta),{})}function Ye(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;ze(e,t[i])<0?r=i:n=i+1}let i=Xe(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function Xe(e){let t=e;for(;t=t.parent;)if(Ze(t)&&ze(e,t)===0)return t}function Ze({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Qe(e){let t=l(h),n=l(m),r=d(()=>{let n=u(e.to);return t.resolve(n)}),i=d(()=>{let{matched:e}=r.value,{length:t}=e,i=e[t-1],a=n.matched;if(!i||!a.length)return-1;let o=a.findIndex(V.bind(null,i));if(o>-1)return o;let s=rt(e[t-2]);return t>1&&rt(i)===s&&a[a.length-1].path!==s?a.findIndex(V.bind(null,e[t-2])):o}),a=d(()=>i.value>-1&&nt(n.params,r.value.params)),o=d(()=>i.value>-1&&i.value===n.matched.length-1&&H(n.params,r.value.params));function s(n={}){if(tt(n)){let n=t[u(e.replace)?`replace`:`push`](u(e.to)).catch(w);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:r,href:d(()=>r.value.href),isActive:a,isExactActive:o,navigate:s}}function $e(e){return e.length===1?e[0]:e}var et=r({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:Qe,setup(e,{slots:t}){let r=o(Qe(e)),{options:i}=l(h),a=d(()=>({[it(e.activeClass,i.linkActiveClass,`router-link-active`)]:r.isActive,[it(e.exactActiveClass,i.linkExactActiveClass,`router-link-exact-active`)]:r.isExactActive}));return()=>{let i=t.default&&$e(t.default(r));return e.custom?i:n(`a`,{"aria-current":r.isExactActive?e.ariaCurrentValue:null,href:r.href,onClick:r.navigate,class:a.value},i)}}});function tt(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function nt(e,t){for(let n in t){let r=t[n],i=e[n];if(typeof r==`string`){if(r!==i)return!1}else if(!_(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}return!0}function rt(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var it=(e,t,n)=>e??t??n,at=r({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:r,slots:o}){let s=l(ee),c=d(()=>e.route||s.value),f=l(g,0),m=d(()=>{let e=u(f),{matched:t}=c.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),h=d(()=>c.value.matched[m.value]);i(g,d(()=>m.value+1)),i(p,h),i(ee,c);let _=a();return t(()=>[_.value,h.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!V(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let t=c.value,i=e.name,a=h.value,s=a&&a.components[i];if(!s)return ot(o.default,{Component:s,route:t});let l=a.props[i],u=n(s,y({},l?l===!0?t.params:typeof l==`function`?l(t):l:null,r,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(a.instances[i]=null)},ref:_}));return ot(o.default,{Component:u,route:t})||u}}});function ot(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var st=at;function ct(t){let n=Ue(t.routes,t),r=t.parseQuery||be,i=t.stringifyQuery||xe,a=t.history,o=Q(),l=Q(),d=Q(),f=s(K),p=K;T&&t.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let g=C.bind(null,e=>``+e),v=C.bind(null,ue),S=C.bind(null,I);function E(e,t){let r,i;return ye(e)?(r=n.getRecordMatcher(e),i=t):i=e,n.addRoute(i,r)}function te(e){let t=n.getRecordMatcher(e);t&&n.removeRoute(t)}function ne(){return n.getRoutes().map(e=>e.record)}function re(e){return!!n.getRecordMatcher(e)}function D(e,t){if(t=y({},t||f.value),typeof e==`string`){let i=z(r,e,t.path),o=n.resolve({path:i.path},t),s=a.createHref(i.fullPath);return y(i,o,{params:S(o.params),redirectedFrom:void 0,href:s})}let o;if(e.path!=null)o=y({},e,{path:z(r,e.path,t.path).path});else{let n=y({},e.params);for(let e in n)n[e]??delete n[e];o=y({},e,{params:v(n)}),t.params=v(t.params)}let s=n.resolve(o,t),c=e.hash||``;s.params=g(S(s.params));let l=de(i,y({},e,{hash:ce(c),path:s.path})),u=a.createHref(l);return y({fullPath:l,hash:c,query:i===xe?Se(e.query):e.query||{}},s,{redirectedFrom:void 0,href:u})}function O(e){return typeof e==`string`?z(r,e,f.value.path):y({},e)}function ie(e,t){if(p!==e)return x(8,{from:t,to:e})}function k(e){return A(e)}function ae(e){return k(y(O(e),{replace:!0}))}function oe(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=O(i):{path:i},i.params={}),y({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function A(e,t){let n=p=D(e),r=f.value,a=e.state,o=e.force,s=e.replace===!0,c=oe(n,r);if(c)return A(y(O(c),{state:typeof c==`object`?y({},a,c.state):a,force:o,replace:s}),t||n);let l=n;l.redirectedFrom=t;let u;return!o&&fe(i,r,n)&&(u=x(16,{to:l,from:r}),W(r,r,!0,!1)),(u?Promise.resolve(u):M(l,r)).catch(e=>b(e)?b(e,2)?e:U(e):V(e,l,r)).then(e=>{if(e){if(b(e,2))return A(y({replace:s},O(e.to),{state:typeof e.to==`object`?y({},a,e.to.state):a,force:o}),t||l)}else e=P(l,r,!0,s,a);return N(l,r,e),e})}function se(e,t){let n=ie(e,t);return n?Promise.reject(n):Promise.resolve()}function j(e){let t=J.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function M(e,t){let n,[r,i,a]=we(e,t);n=Ce(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push($(r,e,t))});let s=se.bind(null,e,t);return n.push(s),X(n).then(()=>{n=[];for(let r of o.list())n.push($(r,e,t));return n.push(s),X(n)}).then(()=>{n=Ce(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push($(r,e,t))});return n.push(s),X(n)}).then(()=>{n=[];for(let r of a)if(r.beforeEnter)if(_(r.beforeEnter))for(let i of r.beforeEnter)n.push($(i,e,t));else n.push($(r.beforeEnter,e,t));return n.push(s),X(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=Ce(a,`beforeRouteEnter`,e,t,j),n.push(s),X(n))).then(()=>{n=[];for(let r of l.list())n.push($(r,e,t));return n.push(s),X(n)}).catch(e=>b(e,8)?e:Promise.reject(e))}function N(e,t,n){d.list().forEach(r=>j(()=>r(e,t,n)))}function P(e,t,n,r,i){let o=ie(e,t);if(o)return o;let s=t===K,c=T?history.state:{};n&&(r||s?a.replace(e.fullPath,y({scroll:s&&c&&c.scroll},i)):a.push(e.fullPath,i)),f.value=e,W(e,t,n,s),U()}let F;function le(){F||=a.listen((e,t,n)=>{if(!Y.listening)return;let r=D(e),i=oe(r,Y.currentRoute.value);if(i){A(y(i,{replace:!0,force:!0}),r).catch(w);return}p=r;let o=f.value;T&&ge(me(o.fullPath,n.delta),Z()),M(r,o).catch(e=>b(e,12)?e:b(e,2)?(A(y(O(e.to),{force:!0}),r).then(e=>{b(e,20)&&!n.delta&&n.type===`pop`&&a.go(-1,!1)}).catch(w),Promise.reject()):(n.delta&&a.go(-n.delta,!1),V(e,r,o))).then(e=>{e||=P(r,o,!1),e&&(n.delta&&!b(e,8)?a.go(-n.delta,!1):n.type===`pop`&&b(e,20)&&a.go(-1,!1)),N(r,o,e)}).catch(w)})}let L=Q(),R=Q(),B;function V(e,t,n){U(e);let r=R.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function H(){return B&&f.value!==K?Promise.resolve():new Promise((e,t)=>{L.add([e,t])})}function U(e){return B||(B=!e,le(),L.list().forEach(([t,n])=>e?n(e):t()),L.reset()),e}function W(e,n,r,i){let{scrollBehavior:a}=t;if(!T||!a)return Promise.resolve();let o=!r&&_e(me(e.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return c().then(()=>a(e,n,o)).then(t=>e===f.value&&t&&pe(t)).catch(t=>e===f.value&&V(t,e,n))}let G=e=>a.go(e),q,J=new Set,Y={currentRoute:f,listening:!0,addRoute:E,removeRoute:te,clearRoutes:n.clearRoutes,hasRoute:re,getRoutes:ne,resolve:D,options:t,push:k,replace:ae,go:G,back:()=>G(-1),forward:()=>G(1),beforeEach:o.add,beforeResolve:l.add,afterEach:d.add,onError:R.add,isReady:H,install(t){t.component(`RouterLink`,et),t.component(`RouterView`,st),t.config.globalProperties.$router=Y,Object.defineProperty(t.config.globalProperties,"$route",{enumerable:!0,get:()=>u(f)}),T&&!q&&f.value===K&&(q=!0,k(a.location).catch(e=>{}));let n={};for(let e in K)Object.defineProperty(n,e,{get:()=>f.value[e],enumerable:!0});t.provide(h,Y),t.provide(m,e(n)),t.provide(ee,f);let r=t.unmount;J.add(t),t.unmount=function(){J.delete(t),J.size<1&&(p=K,F&&F(),F=null,f.value=K,q=!1,B=!1),r()}}};function X(e){return e.reduce((e,t)=>e.then(()=>j(t)),Promise.resolve())}return Y}export{Ae as i,st as n,ct as r,et as t};
|
package/dist/web/index.html
CHANGED
|
@@ -9,29 +9,30 @@
|
|
|
9
9
|
/>
|
|
10
10
|
<link rel="icon" type="image/png" href="/assets/fuli-logo-ER1wQ8Kk.png" />
|
|
11
11
|
<title>复利 · Context Graph</title>
|
|
12
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/i18n-
|
|
12
|
+
<script type="module" crossorigin src="/assets/index-RxlM8aQV.js"></script>
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/i18n-B4Fp9Oa5.js">
|
|
14
14
|
<link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-BDNMzG2s.js">
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/client-
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/console-
|
|
17
|
-
<link rel="modulepreload" crossorigin href="/assets/UiButton-
|
|
18
|
-
<link rel="modulepreload" crossorigin href="/assets/useApi-CROJJdhE-
|
|
19
|
-
<link rel="modulepreload" crossorigin href="/assets/vue-router-
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/client-DodUFQDp.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/console-C2Lfifq-.js">
|
|
17
|
+
<link rel="modulepreload" crossorigin href="/assets/UiButton-neeym_gA.js">
|
|
18
|
+
<link rel="modulepreload" crossorigin href="/assets/useApi-CROJJdhE-IuC5qwny.js">
|
|
19
|
+
<link rel="modulepreload" crossorigin href="/assets/vue-router-nZMhR3dI.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/fuli-logo-Bu9WBuQe.js">
|
|
21
|
-
<link rel="modulepreload" crossorigin href="/assets/UiDialog-
|
|
22
|
-
<link rel="modulepreload" crossorigin href="/assets/UiSelect-
|
|
23
|
-
<link rel="modulepreload" crossorigin href="/assets/attention-store-
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/assets/AgentHand-
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/UiDisclosure-
|
|
21
|
+
<link rel="modulepreload" crossorigin href="/assets/UiDialog-BFVoqFnc.js">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/assets/UiSelect-DDyct4mf.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/assets/attention-store-BGHyzWfv.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/AgentHand-B5lezlek.js">
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/assets/UiDisclosure-B-T7BmB5.js">
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/assets/avatars-z6ANYG_r.js">
|
|
26
27
|
<link rel="modulepreload" crossorigin href="/assets/profile-model-BQO4zNs9.js">
|
|
27
28
|
<link rel="modulepreload" crossorigin href="/assets/task-evidence-DTiPCs7r.js">
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/useAgentRoster-
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/agent-pins-
|
|
29
|
+
<link rel="modulepreload" crossorigin href="/assets/useAgentRoster-QDbOwtLj.js">
|
|
30
|
+
<link rel="modulepreload" crossorigin href="/assets/agent-pins-6LRHTMF6.js">
|
|
30
31
|
<link rel="modulepreload" crossorigin href="/assets/paths-CDREouhi.js">
|
|
31
32
|
<link rel="stylesheet" crossorigin href="/assets/client-CIuQ1icy.css">
|
|
32
33
|
<link rel="stylesheet" crossorigin href="/assets/UiSelect-Bv6R0yr1.css">
|
|
33
34
|
<link rel="stylesheet" crossorigin href="/assets/AgentHand-Y83Oo36U.css">
|
|
34
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
35
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DsExj49_.css">
|
|
35
36
|
</head>
|
|
36
37
|
<body>
|
|
37
38
|
<div id="app"></div>
|
|
@@ -17,6 +17,7 @@ SYSTEM_HR_AGENT_ID = 'employee.bole'
|
|
|
17
17
|
SYSTEM_JUDGMENT_AGENT_ID = 'employee.tonborg'
|
|
18
18
|
# Upgrade only the former built-in copy; custom responsibilities are user data.
|
|
19
19
|
LEGACY_HR_RESPONSIBILITY = 'HR:维护 Agent 人员分布与工作状态,按需招募并保留招募记录。'
|
|
20
|
+
LEGACY_JUDGMENT_RESPONSIBILITY = '判断官:依照用户偏好审核日常事项、建议客户端和模型,保留判断依据与反馈。'
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
def coordinator_profile() -> ProjectAgentProfile:
|
|
@@ -55,7 +56,7 @@ def judgment_profile() -> ProjectAgentProfile:
|
|
|
55
56
|
return ProjectAgentProfile(
|
|
56
57
|
name='Tonborg',
|
|
57
58
|
occupation_emoji='⚖️',
|
|
58
|
-
responsibility='
|
|
59
|
+
responsibility='决策员:依照用户偏好审核日常事项、建议客户端和模型,保留判断依据与反馈。',
|
|
59
60
|
agent_type='durable',
|
|
60
61
|
work_kinds=['judgment', 'knowledge-review', 'executor-selection'],
|
|
61
62
|
capabilities=['判断审核', '执行器选择', '判断反馈', 'fuli.employee:tonborg'],
|
|
@@ -91,8 +92,12 @@ async def ensure_system_identity(driver, provider_id, space_id, agent_id):
|
|
|
91
92
|
upgrade_responsibility = False
|
|
92
93
|
if rows and rows[0]['profile_json']:
|
|
93
94
|
stored = json.loads(rows[0]['profile_json'])
|
|
94
|
-
upgrade_responsibility = (
|
|
95
|
-
|
|
95
|
+
upgrade_responsibility = (
|
|
96
|
+
(agent_id == SYSTEM_HR_AGENT_ID
|
|
97
|
+
and stored.get('responsibility') == LEGACY_HR_RESPONSIBILITY)
|
|
98
|
+
or (agent_id == SYSTEM_JUDGMENT_AGENT_ID
|
|
99
|
+
and stored.get('responsibility') == LEGACY_JUDGMENT_RESPONSIBILITY)
|
|
100
|
+
)
|
|
96
101
|
if upgrade_responsibility:
|
|
97
102
|
stored['responsibility'] = default.responsibility
|
|
98
103
|
profile = ProjectAgentProfile.model_validate(
|
|
@@ -134,6 +139,25 @@ async def ensure_system_identity(driver, provider_id, space_id, agent_id):
|
|
|
134
139
|
agent_type=profile.agent_type,
|
|
135
140
|
now=now,
|
|
136
141
|
)
|
|
142
|
+
if agent_id == SYSTEM_JUDGMENT_AGENT_ID:
|
|
143
|
+
# Active project duties may still contain the former built-in copy.
|
|
144
|
+
# Keep custom duties and ended assignments as the user recorded them.
|
|
145
|
+
await driver.execute_query(
|
|
146
|
+
'''
|
|
147
|
+
MATCH (:FuliSpace {id: $space_id, kind: 'personal'})-
|
|
148
|
+
[:CONTAINS_PROJECT]->(:FuliPersonalProject)-
|
|
149
|
+
[:HAS_PROJECT_AGENT_ASSIGNMENT]->(assignment:FuliProjectAgentAssignment)-
|
|
150
|
+
[:ASSIGNED_AGENT]->(:FuliProjectAgent {id: $id})
|
|
151
|
+
WHERE assignment.status = 'active'
|
|
152
|
+
AND assignment.responsibility = $legacy_responsibility
|
|
153
|
+
SET assignment.responsibility = $responsibility,
|
|
154
|
+
assignment.revision = coalesce(assignment.revision, 0) + 1,
|
|
155
|
+
assignment.updated_at = $now
|
|
156
|
+
''',
|
|
157
|
+
space_id=space_id, id=node_id,
|
|
158
|
+
legacy_responsibility=LEGACY_JUDGMENT_RESPONSIBILITY,
|
|
159
|
+
responsibility=default.responsibility, now=now,
|
|
160
|
+
)
|
|
137
161
|
|
|
138
162
|
|
|
139
163
|
async def retire_legacy_coordinator(driver, space_id):
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fuli-context",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "fuli-context",
|
|
9
|
-
"version": "0.12.
|
|
9
|
+
"version": "0.12.4",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@a2a-js/sdk": "1.3.0",
|
package/package.json
CHANGED
|
@@ -26,7 +26,8 @@ Install and Agent connection:
|
|
|
26
26
|
peer status|host|invite|join|share|revoke|off [--data-dir DIR] (LAN roundtable Beta: pair devices and share project leads)
|
|
27
27
|
remote-mcp --personal-project-id ID --bearer-token-file FILE [--port PORT] [--data-dir DIR] [--source-application claude|cursor|other] [--allowed-origin HTTPS_ORIGIN] [--allowed-host HOST] [--max-sessions N] [--session-idle-ttl-seconds N]
|
|
28
28
|
employee install BUILT_PACKAGE_DIRECTORY [--replace] [--runtime-config FILE]
|
|
29
|
-
update [setup options]
|
|
29
|
+
update [setup options] (already latest: no restart; otherwise refresh existing connections only)
|
|
30
|
+
setup --connected-only [setup options] (repair existing connections without adding clients)
|
|
30
31
|
uninstall [--yes] [--data-dir DIR]
|
|
31
32
|
|
|
32
33
|
Graph data portability:
|
package/src/cli/setup-command.js
CHANGED
|
@@ -20,7 +20,11 @@ export async function runSetupCommand(args, dependencies = {}) {
|
|
|
20
20
|
const selectAgents = dependencies.selectAgents ?? promptAgentSelection;
|
|
21
21
|
const write = dependencies.write ?? writeLine;
|
|
22
22
|
let plan = planSetup(options, dependencies);
|
|
23
|
-
if (
|
|
23
|
+
if (options.connectedOnly) {
|
|
24
|
+
plan = applyAgentSelection(plan, plan.agents.filter((agent) =>
|
|
25
|
+
['current', 'outdated'].includes(agent.integrationDetails?.mcp)
|
|
26
|
+
).map(({ id }) => id));
|
|
27
|
+
} else if (shouldPromptForAgentSelection(plan, options)) {
|
|
24
28
|
const detected = plan.agents.filter(({ available }) => available);
|
|
25
29
|
plan = applyAgentSelection(plan, await selectAgents(detected));
|
|
26
30
|
}
|
|
@@ -36,7 +40,7 @@ export async function runSetupCommand(args, dependencies = {}) {
|
|
|
36
40
|
onProgress: write
|
|
37
41
|
});
|
|
38
42
|
write(formatSetupResult(result, plan));
|
|
39
|
-
return result;
|
|
43
|
+
return { ...result, exitCode: result.status === 'partial' ? 1 : 0 };
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
export function formatSetupPreview(plan, options) {
|
|
@@ -78,6 +82,12 @@ export function formatSetupPreview(plan, options) {
|
|
|
78
82
|
'Recommendation: native mode avoids shared VM memory on this low-memory Mac; ' +
|
|
79
83
|
'select it with --runtime-mode native');
|
|
80
84
|
}
|
|
85
|
+
if (options.connectedOnly) {
|
|
86
|
+
for (const agent of available.filter((agent) => agent.selected === false && agent.skillPath &&
|
|
87
|
+
['current', 'outdated'].includes(agent.integrationDetails?.skills))) {
|
|
88
|
+
lines.push(`${agent.label}: skipped because there is no Fuli MCP entry; existing Skills were left unchanged. Run fuli setup to reconnect.`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
81
91
|
return lines.join('\n');
|
|
82
92
|
}
|
|
83
93
|
|
|
@@ -109,6 +119,10 @@ export function formatSetupResult(result, plan) {
|
|
|
109
119
|
: `${agent.label}: connected`);
|
|
110
120
|
for (const step of agent.nextSteps ?? []) lines.push(`${agent.label}: ${step}`);
|
|
111
121
|
}
|
|
122
|
+
if (result.agents.some((agent) => agent.status === 'connected' &&
|
|
123
|
+
!agent.restartRequired && !agent.newTaskRequired)) {
|
|
124
|
+
lines.push('After a package upgrade, reconnect Fuli in already-open clients or restart the clients, then open a new task. Existing MCP processes are not replaced automatically.');
|
|
125
|
+
}
|
|
112
126
|
const dataDir = plan?.paths?.dataDir;
|
|
113
127
|
lines.push('Other MCP clients: run fuli connect and merge the fuli entry into your MCP settings.');
|
|
114
128
|
if (dataDir) lines.push(`For this installation, use --data-dir ${JSON.stringify(dataDir)}.`);
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
import { quoteShellArgument } from './shell-argument.js';
|
|
11
11
|
import { parseUpdateOptions } from '../setup/options.js';
|
|
12
12
|
import { runLocalRuntimeCommand } from './local-runtime-command.js';
|
|
13
|
+
import { formatUpdateInstallation, inspectUpdateInstallation, updateEnvironment } from './update-installation.js';
|
|
13
14
|
import {
|
|
14
15
|
compareSemanticVersions,
|
|
15
16
|
parseSemanticVersion
|
|
@@ -21,9 +22,10 @@ const LATEST_PACKAGE = `${FULI_PACKAGE_NAME}@latest`;
|
|
|
21
22
|
|
|
22
23
|
export async function runUpdateCommand(args = [], dependencies = {}) {
|
|
23
24
|
const options = parseUpdateOptions(args);
|
|
24
|
-
const env = dependencies.env ?? process.env;
|
|
25
25
|
const platform = dependencies.platform ?? process.platform;
|
|
26
26
|
const nodePath = dependencies.nodePath ?? process.execPath;
|
|
27
|
+
const originalEnv = dependencies.env ?? process.env;
|
|
28
|
+
const env = updateEnvironment(originalEnv, nodePath, platform);
|
|
27
29
|
const npmCommand = dependencies.npmCommand ??
|
|
28
30
|
(platform === 'win32' ? 'npm.cmd' : 'npm');
|
|
29
31
|
const confirm = dependencies.confirm ?? confirmInTerminal;
|
|
@@ -36,13 +38,17 @@ export async function runUpdateCommand(args = [], dependencies = {}) {
|
|
|
36
38
|
(() => queryLatestVersion(npmCommand, runCaptured, env));
|
|
37
39
|
|
|
38
40
|
write(formatUpdatePreview(options));
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
41
|
+
const inspectInstallation = dependencies.inspectInstallation ?? inspectUpdateInstallation;
|
|
42
|
+
const installation = inspectInstallation({ env: originalEnv, platform });
|
|
43
|
+
write(formatUpdateInstallation(installation, { nodePath, npmCommand }));
|
|
44
44
|
const latestVersion = resolveLatestVersion();
|
|
45
|
-
|
|
45
|
+
const comparison = compareSemanticVersions(latestVersion, FULI_VERSION);
|
|
46
|
+
if (comparison === 0) {
|
|
47
|
+
const result = { status: 'current', previousVersion: FULI_VERSION, version: FULI_VERSION };
|
|
48
|
+
write(formatUpdateResult(result));
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
if (comparison < 0) {
|
|
46
52
|
const result = {
|
|
47
53
|
status: 'ahead',
|
|
48
54
|
previousVersion: FULI_VERSION,
|
|
@@ -53,6 +59,22 @@ export async function runUpdateCommand(args = [], dependencies = {}) {
|
|
|
53
59
|
return result;
|
|
54
60
|
}
|
|
55
61
|
|
|
62
|
+
const globalRootResult = runCaptured(npmCommand, ['root', '--global'], { env });
|
|
63
|
+
if (!processSucceeded(globalRootResult)) {
|
|
64
|
+
throw new Error(`Could not locate the npm installation target (${describeProcessFailure(globalRootResult)}). Local services were not stopped.`);
|
|
65
|
+
}
|
|
66
|
+
const globalRoot = String(globalRootResult.stdout ?? '').trim();
|
|
67
|
+
const cliPath = resolveGlobalCliPath(globalRoot, platform);
|
|
68
|
+
if (!cliPath) throw new Error('npm returned an invalid global directory. Local services were not stopped.');
|
|
69
|
+
const recoveryCommand = formatSetupRecoveryCommand(args, platform, [nodePath, cliPath]);
|
|
70
|
+
write(`Update target: ${cliPath}`);
|
|
71
|
+
if (installation.cliPath && installation.cliPath !== cliPath) {
|
|
72
|
+
write('The running CLI path differs from the npm target. This command updates the npm target above.');
|
|
73
|
+
}
|
|
74
|
+
if (!options.yes && !await confirm()) {
|
|
75
|
+
write('Cancelled. No changes were made.');
|
|
76
|
+
return { status: 'cancelled' };
|
|
77
|
+
}
|
|
56
78
|
const stopArgs = options.dataDir ? ['--data-dir', options.dataDir] : [];
|
|
57
79
|
const stopped = await stopRuntime('stop', stopArgs, { env, write });
|
|
58
80
|
if (stopped.status === 'partial') {
|
|
@@ -75,61 +97,53 @@ export async function runUpdateCommand(args = [], dependencies = {}) {
|
|
|
75
97
|
throw new Error([
|
|
76
98
|
`Global package installation failed (${describeProcessFailure(installed)}). ` +
|
|
77
99
|
'Knowledge data was not deleted.',
|
|
78
|
-
|
|
100
|
+
'Local services were stopped and have not been restarted.',
|
|
101
|
+
`Run npm install --global ${selectedPackage}, then run ${recoveryCommand}.`
|
|
79
102
|
].join('\n'));
|
|
80
103
|
}
|
|
81
104
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
throw postInstallError(
|
|
85
|
-
`Could not locate the global npm directory (${describeProcessFailure(globalRootResult)})`,
|
|
86
|
-
args,
|
|
87
|
-
platform
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
const globalRoot = String(globalRootResult.stdout ?? '').trim();
|
|
91
|
-
const cliPath = resolveGlobalCliPath(globalRoot, platform);
|
|
92
|
-
if (!cliPath || !fileExists(cliPath)) {
|
|
93
|
-
throw postInstallError('The new CLI file is missing; reinstall the global package', args, platform);
|
|
105
|
+
if (!fileExists(cliPath)) {
|
|
106
|
+
throw postInstallError('The new CLI file is missing; reinstall the global package', recoveryCommand);
|
|
94
107
|
}
|
|
95
108
|
|
|
96
109
|
const versionResult = runCaptured(nodePath, [cliPath, '--version'], { env });
|
|
97
110
|
if (!processSucceeded(versionResult)) {
|
|
98
111
|
throw postInstallError(
|
|
99
112
|
`The new CLI could not start (${describeProcessFailure(versionResult)})`,
|
|
100
|
-
|
|
101
|
-
platform
|
|
113
|
+
recoveryCommand
|
|
102
114
|
);
|
|
103
115
|
}
|
|
104
116
|
const version = String(versionResult.stdout ?? '').trim();
|
|
105
|
-
if (!version) throw postInstallError('The new CLI returned no version',
|
|
117
|
+
if (!version) throw postInstallError('The new CLI returned no version', recoveryCommand);
|
|
106
118
|
if (compareSemanticVersions(version, latestVersion) !== 0) {
|
|
107
119
|
throw postInstallError(
|
|
108
120
|
`The new CLI version ${version} does not match the npm latest version ${latestVersion} ` +
|
|
109
121
|
'confirmed before the update',
|
|
110
|
-
|
|
111
|
-
platform
|
|
122
|
+
recoveryCommand
|
|
112
123
|
);
|
|
113
124
|
}
|
|
114
125
|
|
|
115
126
|
write('Refreshing local services, Agent integrations, and Skills with the new CLI...');
|
|
116
|
-
const setupArgs = ['setup', '--yes', ...args.filter((arg) =>
|
|
127
|
+
const setupArgs = ['setup', '--yes', '--connected-only', ...args.filter((arg) =>
|
|
128
|
+
arg !== '--yes' && arg !== '--connected-only')];
|
|
117
129
|
const setupResult = runInherited(nodePath, [cliPath, ...setupArgs], { env });
|
|
118
130
|
if (!processSucceeded(setupResult)) {
|
|
119
131
|
throw postInstallError(
|
|
120
132
|
`The new version was installed, but setup did not complete ` +
|
|
121
133
|
`(${describeProcessFailure(setupResult)})`,
|
|
122
|
-
|
|
123
|
-
platform
|
|
134
|
+
recoveryCommand
|
|
124
135
|
);
|
|
125
136
|
}
|
|
126
137
|
|
|
127
138
|
const result = {
|
|
128
|
-
status:
|
|
139
|
+
status: 'updated',
|
|
129
140
|
previousVersion: FULI_VERSION,
|
|
130
141
|
version
|
|
131
142
|
};
|
|
132
143
|
write(formatUpdateResult(result));
|
|
144
|
+
if (options.skipAgents) {
|
|
145
|
+
write('Existing conversations may still use the previous MCP process. Reconnect Fuli in your client or restart the client, then open a new task. Running conversations were not restarted automatically.');
|
|
146
|
+
}
|
|
133
147
|
return result;
|
|
134
148
|
}
|
|
135
149
|
|
|
@@ -138,8 +152,8 @@ export function formatUpdatePreview(options) {
|
|
|
138
152
|
'Ready to update Fuli',
|
|
139
153
|
`npm package: ${LATEST_PACKAGE}`,
|
|
140
154
|
options.noStart
|
|
141
|
-
? '
|
|
142
|
-
: '
|
|
155
|
+
? 'If an upgrade is available: stop the local UI safely and keep it stopped'
|
|
156
|
+
: 'If an upgrade is available: stop local services safely and restart with the new version',
|
|
143
157
|
options.dataDir
|
|
144
158
|
? `Data: preserve ${options.dataDir}`
|
|
145
159
|
: 'Data: preserve the current default data directory',
|
|
@@ -149,7 +163,7 @@ export function formatUpdatePreview(options) {
|
|
|
149
163
|
: options.adaptiveMemory ? 'enable' : 'disable'}`,
|
|
150
164
|
`Agent integrations and Skills: ${options.skipAgents
|
|
151
165
|
? 'skip refresh as requested'
|
|
152
|
-
: 'refresh through setup in the new version'}`
|
|
166
|
+
: 'refresh through setup in the new version; only already connected clients'}`
|
|
153
167
|
].join('\n');
|
|
154
168
|
}
|
|
155
169
|
|
|
@@ -162,7 +176,7 @@ export function formatUpdateResult(result) {
|
|
|
162
176
|
].join('');
|
|
163
177
|
}
|
|
164
178
|
if (result.status === 'current') {
|
|
165
|
-
return `Fuli is already at the latest version (${result.version});
|
|
179
|
+
return `Fuli is already at the latest version (${result.version}); no installation or service restart needed. To repair existing integrations, run fuli setup --yes --connected-only.`;
|
|
166
180
|
}
|
|
167
181
|
return `Fuli updated from ${result.previousVersion} to ${result.version}.`;
|
|
168
182
|
}
|
|
@@ -173,10 +187,10 @@ export function resolveGlobalCliPath(globalRoot, platform = process.platform) {
|
|
|
173
187
|
return path.join(globalRoot.trim(), FULI_PACKAGE_NAME, 'src', 'cli.js');
|
|
174
188
|
}
|
|
175
189
|
|
|
176
|
-
function postInstallError(message,
|
|
190
|
+
function postInstallError(message, recoveryCommand) {
|
|
177
191
|
return new Error([
|
|
178
192
|
`${message}. Knowledge data was not deleted.`,
|
|
179
|
-
`Run again: ${
|
|
193
|
+
`Run again: ${recoveryCommand}`
|
|
180
194
|
].join('\n'));
|
|
181
195
|
}
|
|
182
196
|
|
|
@@ -204,11 +218,12 @@ function queryLatestVersion(npmCommand, runCaptured, env) {
|
|
|
204
218
|
return version;
|
|
205
219
|
}
|
|
206
220
|
|
|
207
|
-
function formatSetupRecoveryCommand(args, platform) {
|
|
221
|
+
function formatSetupRecoveryCommand(args, platform, launcher) {
|
|
208
222
|
const forwarded = args
|
|
209
|
-
.filter((arg) => arg !== '--yes')
|
|
223
|
+
.filter((arg) => arg !== '--yes' && arg !== '--connected-only')
|
|
210
224
|
.map((arg) => formatCommandArgument(arg, platform));
|
|
211
|
-
return [
|
|
225
|
+
return [...launcher.map((arg) => formatCommandArgument(arg, platform)),
|
|
226
|
+
'setup', '--yes', '--connected-only', ...forwarded].join(' ');
|
|
212
227
|
}
|
|
213
228
|
|
|
214
229
|
function formatCommandArgument(value, platform) {
|
|
@@ -238,7 +253,7 @@ function describeProcessFailure(result) {
|
|
|
238
253
|
// (CVE-2024-27980). Only fixed, shell-inert arguments may take that path.
|
|
239
254
|
export function batchFileSpawnOptions(command, args) {
|
|
240
255
|
if (!/\.(?:cmd|bat)$/i.test(command)) return {};
|
|
241
|
-
const unsafe = args.find((arg) => !/^[\w
|
|
256
|
+
const unsafe = args.find((arg) => !/^[\w@./:=+-]+$/.test(arg));
|
|
242
257
|
if (unsafe !== undefined) throw new TypeError(`Refusing to pass a shell-sensitive argument to ${command}`);
|
|
243
258
|
return { shell: true };
|
|
244
259
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { existsSync, readFileSync, realpathSync } from 'node:fs';
|
|
2
|
+
import { posix, win32 } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { FULI_PACKAGE_NAME, FULI_VERSION } from '../package-metadata.js';
|
|
5
|
+
|
|
6
|
+
export function updateEnvironment(env, nodePath, platform = process.platform) {
|
|
7
|
+
const path = platform === 'win32' ? win32 : posix;
|
|
8
|
+
const key = platform === 'win32'
|
|
9
|
+
? Object.keys(env).find((name) => name.toLowerCase() === 'path') ?? 'PATH'
|
|
10
|
+
: 'PATH';
|
|
11
|
+
return { ...env, [key]: [path.dirname(nodePath), env[key]].filter(Boolean).join(path.delimiter) };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function inspectUpdateInstallation({ env = process.env, platform = process.platform } = {}) {
|
|
15
|
+
const path = platform === 'win32' ? win32 : posix;
|
|
16
|
+
const pathKey = Object.keys(env).find((name) => name.toLowerCase() === 'path') ?? 'PATH';
|
|
17
|
+
const directories = [...new Set((env[pathKey] ?? '').split(path.delimiter).filter(Boolean))];
|
|
18
|
+
const launchers = [];
|
|
19
|
+
for (const directory of directories) {
|
|
20
|
+
for (const name of platform === 'win32' ? ['fl.cmd', 'fuli.cmd', 'fl', 'fuli'] : ['fl', 'fuli']) {
|
|
21
|
+
const launcher = path.join(directory, name);
|
|
22
|
+
if (!existsSync(launcher)) continue;
|
|
23
|
+
let version = null;
|
|
24
|
+
let target = launcher;
|
|
25
|
+
try {
|
|
26
|
+
target = realpathSync(launcher);
|
|
27
|
+
// Read only the manifest for a recognized Fuli entry point; never execute PATH candidates.
|
|
28
|
+
if (path.basename(target) === 'cli.js' && path.basename(path.dirname(target)) === 'src') {
|
|
29
|
+
const manifest = JSON.parse(readFileSync(path.join(path.dirname(target), '..', 'package.json'), 'utf8'));
|
|
30
|
+
if (manifest.name === FULI_PACKAGE_NAME) version = manifest.version;
|
|
31
|
+
}
|
|
32
|
+
} catch { /* Broken or unreadable candidates remain visible with an unknown version. */ }
|
|
33
|
+
launchers.push({ path: launcher, target, version });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return { cliPath: fileURLToPath(new URL('../cli.js', import.meta.url)), launchers };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function formatUpdateInstallation(installation, { nodePath, npmCommand }) {
|
|
40
|
+
const groups = new Map();
|
|
41
|
+
for (const launcher of installation.launchers) {
|
|
42
|
+
const group = groups.get(launcher.target) ?? { paths: [], version: launcher.version };
|
|
43
|
+
group.paths.push(launcher.path);
|
|
44
|
+
groups.set(launcher.target, group);
|
|
45
|
+
}
|
|
46
|
+
return [
|
|
47
|
+
`Running Fuli: ${FULI_VERSION} (${installation.cliPath})`,
|
|
48
|
+
`Node: ${nodePath}`,
|
|
49
|
+
`npm: ${npmCommand} (current Node directory first in PATH)`,
|
|
50
|
+
...[...groups].map(([target, { paths, version }]) =>
|
|
51
|
+
`PATH launchers: ${paths.join(', ')} -> ${target} (${version ?? 'version unknown; wrapper not executed'})`),
|
|
52
|
+
'If a PATH launcher belongs to another installation, it will keep its own version.'
|
|
53
|
+
].join('\n');
|
|
54
|
+
}
|
package/src/cli.js
CHANGED
|
@@ -32,8 +32,7 @@ export async function main(argv = process.argv.slice(2), env = process.env) {
|
|
|
32
32
|
}
|
|
33
33
|
if (command === 'setup') {
|
|
34
34
|
assertSupportedNodeVersion();
|
|
35
|
-
|
|
36
|
-
return;
|
|
35
|
+
return runSetupCommand(commandArgs, { env });
|
|
37
36
|
}
|
|
38
37
|
if (command === 'connect') {
|
|
39
38
|
assertSupportedNodeVersion();
|