fuli-context 0.7.6 → 0.7.7
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 +69 -13
- package/README.zh-CN.md +60 -14
- package/dist/web/assets/{AboutPage-sLV9WChi.js → AboutPage-BcZeFcHe.js} +1 -1
- package/dist/web/assets/{ConnectionsPage-BWn4ywGJ.js → ConnectionsPage-xAQYl1SQ.js} +1 -1
- package/dist/web/assets/EmployeeRecruitDialog-CbPAmhy7.js +1 -0
- package/dist/web/assets/EmployeeRecruitDialog-CfFlyKSh.css +1 -0
- package/dist/web/assets/EmployeeWorkbenchPage-BQvTLoc8.css +1 -0
- package/dist/web/assets/EmployeeWorkbenchPage-DF3EL0Ui.js +1 -0
- package/dist/web/assets/KnowledgeEditDialog-UnnBDt0I.js +1 -0
- package/dist/web/assets/{KnowledgeEditDialog-DWUV_NPp.css → KnowledgeEditDialog-iv-dgUeD.css} +1 -1
- package/dist/web/assets/{KnowledgeInspector-CRQWOaos.js → KnowledgeInspector-BqPJH5Rr.js} +1 -1
- package/dist/web/assets/{KnowledgeOrganizerPage-Dfj3vIpU.js → KnowledgeOrganizerPage-CyvRflXM.js} +1 -1
- package/dist/web/assets/KnowledgePage-59eczTqe.js +1 -0
- package/dist/web/assets/{KnowledgeWorkspace-ChEB5Bwk.js → KnowledgeWorkspace-CfIjhOog.js} +1 -1
- package/dist/web/assets/{OverviewPage-Cd66M0RT.js → OverviewPage-Xyfm5xkZ.js} +1 -1
- package/dist/web/assets/{PersonalProfilePage-RCFHL0Wz.js → PersonalProfilePage-DB9mByB3.js} +1 -1
- package/dist/web/assets/PersonalProjectsPage-_-YXVi5O.js +1 -0
- package/dist/web/assets/ProjectAgentsPage-C3vW6wmk.css +1 -0
- package/dist/web/assets/ProjectAgentsPage-DeeQByPX.js +11 -0
- package/dist/web/assets/{PublicProjectsPage-mstPEjHe.js → PublicProjectsPage-BEZ1YPs3.js} +1 -1
- package/dist/web/assets/{ReviewPage-6Y1SmfZy.js → ReviewPage-CQYGwFBH.js} +1 -1
- package/dist/web/assets/SearchableSelect-D27H0MoP.js +1 -0
- package/dist/web/assets/{SettingsPage--LdTMUm7.js → SettingsPage-BlEZ03Yi.js} +1 -1
- package/dist/web/assets/{WritingTastePage-CIpKswvs.js → WritingTastePage-DvRt_nmP.js} +1 -1
- package/dist/web/assets/catalog-DFvIaHVS.js +1 -0
- package/dist/web/assets/{console-BT1P2Db4.js → console-tOxOl8Vq.js} +1 -1
- package/dist/web/assets/conversation-launcher-settings-DuFSpPAo.js +1 -0
- package/dist/web/assets/{i18n-js6gfc7j.js → i18n-CgBHZthI.js} +3 -3
- package/dist/web/assets/{identity-CfDfanpa.js → identity-CFo_Uw1H.js} +1 -1
- package/dist/web/assets/index-CJc5ppXH.css +1 -0
- package/dist/web/assets/index-yCi3cz2l.js +2 -0
- package/dist/web/assets/{model-DJkLAJsg.js → model-BtnVr7fX.js} +1 -1
- package/dist/web/assets/{useApi-CROJJdhE-BdSti7Y2.js → useApi-CROJJdhE-B6MHm_Av.js} +1 -1
- package/dist/web/assets/{vue-router-Kk67EaCP.js → vue-router-CzHm-y-x.js} +1 -1
- package/dist/web/index.html +7 -6
- package/docs/employee-agents.md +99 -0
- package/docs/project-agent-memory.md +479 -0
- package/graph-provider/fuli_graph/knowledge_audit_models.py +171 -0
- package/graph-provider/fuli_graph/model_base.py +5 -0
- package/graph-provider/fuli_graph/model_validation.py +32 -0
- package/graph-provider/fuli_graph/models.py +26 -170
- package/graph-provider/fuli_graph/project_agent_context_models.py +29 -0
- package/graph-provider/fuli_graph/project_agent_executor_models.py +35 -7
- package/graph-provider/fuli_graph/project_agent_memory_models.py +79 -0
- package/graph-provider/fuli_graph/project_agent_memory_routes.py +46 -0
- package/graph-provider/fuli_graph/project_agent_models.py +9 -0
- package/graph-provider/fuli_graph/project_agent_recruitment_values.py +48 -0
- package/graph-provider/fuli_graph/project_agent_routes.py +21 -1
- package/graph-provider/fuli_graph/project_agent_task_models.py +217 -29
- package/graph-provider/fuli_graph/runtime.py +37 -1
- package/graph-provider/fuli_graph/store.py +6 -0
- package/graph-provider/fuli_graph/store_project_agent_context.py +65 -0
- package/graph-provider/fuli_graph/store_project_agent_executor_learning.py +175 -11
- package/graph-provider/fuli_graph/store_project_agent_executor_routing.py +33 -10
- package/graph-provider/fuli_graph/store_project_agent_executors.py +181 -14
- package/graph-provider/fuli_graph/store_project_agent_memory.py +174 -0
- package/graph-provider/fuli_graph/store_project_agent_task_activity.py +423 -0
- package/graph-provider/fuli_graph/store_project_agent_task_persistence.py +152 -0
- package/graph-provider/fuli_graph/store_project_agent_task_reads.py +187 -21
- package/graph-provider/fuli_graph/store_project_agent_task_recruitment.py +748 -162
- package/graph-provider/fuli_graph/store_project_agent_task_staffing.py +230 -18
- package/graph-provider/fuli_graph/store_project_agent_tasks.py +261 -468
- package/graph-provider/fuli_graph/store_project_agents.py +214 -46
- package/graph-provider/fuli_graph/store_task_contexts.py +217 -0
- package/graph-provider/fuli_graph/store_transactions.py +40 -0
- package/graph-provider/fuli_graph/task_context_models.py +50 -0
- package/graph-provider/fuli_graph/task_context_routes.py +31 -0
- package/graph-provider/fuli_graph/workflow_observation_models.py +1 -1
- package/graph-provider/pyproject.toml +1 -1
- package/npm-shrinkwrap.json +8 -8
- package/package.json +5 -2
- package/skills/capturing-session-knowledge/SKILL.md +18 -6
- package/src/adaptive-runtime/executor-pool.js +46 -5
- package/src/adaptive-runtime/graph-services.js +10 -3
- package/src/adaptive-runtime/lease-client.js +66 -14
- package/src/adaptive-runtime/runtime-broker.js +24 -9
- package/src/agent-tools/employee-definitions.js +43 -0
- package/src/agent-tools/graph-definitions.js +25 -6
- package/src/agent-tools/graph-handlers.js +11 -0
- package/src/agent-tools/project-agent-definitions.js +35 -4
- package/src/agent-tools/project-agent-memory-definitions.js +36 -0
- package/src/agent-tools.js +6 -2
- package/src/agents/codex/lifecycle-hook.js +107 -0
- package/src/agents/codex/lifecycle-hooks.js +231 -0
- package/src/agents/cursor/lifecycle-hook.js +133 -0
- package/src/agents/cursor/lifecycle-hooks.js +50 -0
- package/src/agents/lifecycle-message.js +19 -0
- package/src/app/agent-request-context.js +23 -0
- package/src/cli/command-registry.js +2 -0
- package/src/cli/employee-command.js +17 -0
- package/src/cli/remote-mcp-command.js +282 -0
- package/src/cli/setup-command.js +5 -0
- package/src/cli.js +10 -0
- package/src/employees/catalog/jefa.json +21 -0
- package/src/employees/install-package.js +77 -0
- package/src/employees/management-policy.js +88 -0
- package/src/employees/manifest.js +53 -0
- package/src/employees/package-registry.js +107 -0
- package/src/employees/project-selection.js +50 -0
- package/src/employees/recruitment.js +199 -0
- package/src/employees/service.js +83 -0
- package/src/employees/task-entry.js +39 -0
- package/src/graphiti/agent-knowledge-workflows.js +135 -25
- package/src/graphiti/federated-application.js +78 -35
- package/src/graphiti/project-agent-control-plane.js +20 -3
- package/src/graphiti/project-agent-mapping.js +155 -5
- package/src/graphiti/project-agent-memory.js +115 -0
- package/src/graphiti/project-agent-task-entry.js +126 -0
- package/src/graphiti/project-agent-workflows.js +30 -14
- package/src/graphiti/provider-client.js +66 -4
- package/src/http/api-router.js +25 -5
- package/src/http/employee-api-router.js +64 -0
- package/src/http/error-mapping.js +4 -0
- package/src/http/graph-api-router.js +2 -0
- package/src/http/request-policy.js +6 -3
- package/src/http/static-handler.js +4 -3
- package/src/mcp/create-mcp-server.js +98 -37
- package/src/mcp/direct-call.js +38 -0
- package/src/mcp/instructions.js +8 -7
- package/src/mcp/provider-task-context-registry.js +74 -0
- package/src/mcp/remote-http-server.js +761 -0
- package/src/mcp/session-id.js +29 -3
- package/src/mcp/task-context-registry.js +88 -29
- package/src/mcp/tool-annotations.js +10 -2
- package/src/mcp/tool-result.js +8 -3
- package/src/mcp-server.js +20 -8
- package/src/native-runtime/runtime.js +58 -8
- package/src/server.js +76 -28
- package/src/setup/agent-installation-status.js +38 -6
- package/src/setup/agents.js +20 -8
- package/src/setup/claude-code-config.js +55 -13
- package/src/setup/codex-bootstrap.js +11 -10
- package/src/setup/codex-config.js +74 -7
- package/src/setup/config-backup.js +18 -2
- package/src/setup/cursor-config.js +22 -5
- package/src/setup/setup.js +30 -22
- package/src/storage/json-file.js +11 -3
- package/dist/web/assets/KnowledgeEditDialog-CZ5ziPrD.js +0 -1
- package/dist/web/assets/KnowledgePage-BRYC9S5Y.js +0 -1
- package/dist/web/assets/PersonalProjectsPage-DEh8XWby.js +0 -1
- package/dist/web/assets/ProjectAgentsPage-Crh7PrXa.css +0 -1
- package/dist/web/assets/ProjectAgentsPage-DPnaH-TR.js +0 -11
- package/dist/web/assets/SearchableSelect-D3HM8YF8.js +0 -1
- package/dist/web/assets/conversation-launcher-settings-DrJEotdf.js +0 -1
- package/dist/web/assets/index-BnH5mcZx.css +0 -1
- package/dist/web/assets/index-GqJf1xqg.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,B as t,C as n,I as r,L as ee,N as i,O as a,Y as o,a as s,et as c,g as l,h as u,j as d,k as f,m as p,n as m,p as h,rt as g,tt as te,u as _,v,y}from"./i18n-CgBHZthI.js";var b=[`data-select-id`],x=[`value`,`name`,`required`,`disabled`],S=[`value`,`disabled`],C=[`aria-expanded`,`aria-controls`,`aria-label`,`disabled`],w={class:`searchable-select-current`},T={class:`searchable-select-current-label`},E={key:0,class:`searchable-select-current-meta`},D=[`hidden`],O={key:0,class:`searchable-select-search`},ne=[`placeholder`,`aria-label`],re=[`id`],ie=[`aria-selected`,`disabled`,`onClick`,`onKeydown`],ae={class:`searchable-select-option-copy`},oe={key:0},se={key:1,class:`searchable-select-empty`},k=n({__name:`SearchableSelect`,props:{modelValue:{},options:{},label:{},controlId:{default:void 0},placeholder:{default:void 0},searchPlaceholder:{default:void 0},searchable:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},name:{default:void 0}},emits:[`update:modelValue`,`change`],setup(n,{emit:k}){let A=n,j=k,M=o(null),N=o(null),P=o(null),F=o(null),I=o(!1),L=o(!1),R=o(``),z=r().replace(/[^A-Za-z0-9_-]/g,``),B=u(()=>A.label),V=u(()=>A.placeholder??s(`common.searchableSelect.placeholder`)),H=u(()=>A.searchPlaceholder??s(`common.searchableSelect.searchPlaceholder`)),U=u(()=>`${A.controlId||`searchable-select-${z}`}-options`),W=u(()=>A.options.find(({value:e})=>e===A.modelValue)??null),G=u(()=>A.searchable??A.options.length>5),K=u(()=>{let e=m(),t=R.value.trim().toLocaleLowerCase(e);return t?A.options.filter(n=>[n.label,n.value,n.meta,n.search].filter(Boolean).join(` `).toLocaleLowerCase(e).includes(t)):A.options});ee(()=>A.disabled,e=>{e&&J()}),e(()=>{document.addEventListener(`pointerdown`,X)}),f(()=>{document.removeEventListener(`pointerdown`,X)});async function ce(){I.value?J():await q()}async function q(){A.disabled||(R.value=``,pe(),I.value=!0,await a(),G.value?P.value?.focus():fe()?.focus())}function J({restoreFocus:e=!1}={}){I.value=!1,L.value=!1,R.value=``,e&&a(()=>N.value?.focus())}function Y(e){A.disabled||e.disabled||(j(`update:modelValue`,e.value),j(`change`,e.value),J({restoreFocus:!0}))}function le(e){[`ArrowDown`,`Enter`,` `].includes(e.key)&&(e.preventDefault(),q())}function ue(e){if(e.key===`Escape`){e.preventDefault(),J({restoreFocus:!0});return}if(e.key===`ArrowDown`){e.preventDefault(),$()?.focus();return}e.key===`Enter`&&(e.preventDefault(),$()?.click())}function de(e,t){if(e.key===`Enter`||e.key===` `){e.preventDefault(),Y(t);return}if(e.key===`Escape`){e.preventDefault(),J({restoreFocus:!0});return}if(![`ArrowDown`,`ArrowUp`,`Home`,`End`].includes(e.key))return;e.preventDefault();let n=Q(),r=n.indexOf(e.currentTarget);n[e.key===`Home`?0:e.key===`End`?n.length-1:e.key===`ArrowDown`?Math.min(n.length-1,r+1):Math.max(0,r-1)]?.focus()}function X(e){I.value&&!M.value?.contains(e.target)&&J()}function Z(e){let t=e.relatedTarget;t&&M.value?.contains(t)||queueMicrotask(()=>{I.value&&!M.value?.contains(document.activeElement)&&J()})}function Q(){return[...F.value?.querySelectorAll(`.searchable-select-option:not(:disabled)`)??[]]}function $(){return Q()[0]??null}function fe(){return Q().find(e=>e.getAttribute(`aria-selected`)===`true`)??$()}function pe(){let e=N.value?.getBoundingClientRect();L.value=!!(e&&window.innerHeight-e.bottom<270&&e.top>270)}return(e,r)=>(d(),y(`div`,{ref_key:`root`,ref:M,class:te([`searchable-select`,{open:I.value,"open-up":L.value,disabled:n.disabled}]),"data-select-id":n.controlId,onFocusout:Z},[l(`select`,{class:`searchable-select-native`,value:n.modelValue,name:n.name,required:n.required,disabled:n.disabled,tabindex:`-1`,"aria-hidden":`true`},[(d(!0),y(p,null,i(n.options,e=>(d(),y(`option`,{key:e.value,value:e.value,disabled:e.disabled},g(e.label),9,S))),128))],8,x),l(`button`,{ref_key:`trigger`,ref:N,type:`button`,class:`searchable-select-trigger`,role:`combobox`,"aria-haspopup":`listbox`,"aria-expanded":I.value,"aria-controls":U.value,"aria-label":B.value,disabled:n.disabled,onPointerdown:r[0]||=h(()=>{},[`stop`]),onClick:h(ce,[`stop`]),onKeydown:le},[l(`span`,w,[l(`span`,T,g(W.value?.label||V.value),1),W.value?.meta?(d(),y(`small`,E,g(W.value.meta),1)):v(``,!0)]),r[3]||=l(`i`,{class:`searchable-select-arrow`,"aria-hidden":`true`},null,-1)],40,C),l(`div`,{class:`searchable-select-panel`,hidden:!I.value},[G.value?(d(),y(`div`,O,[t(l(`input`,{ref_key:`searchInput`,ref:P,"onUpdate:modelValue":r[1]||=e=>R.value=e,type:`search`,autocomplete:`off`,placeholder:H.value,"aria-label":c(s)(`common.searchableSelect.searchAria`,{label:B.value}),onKeydown:ue},null,40,ne),[[_,R.value]])])):v(``,!0),l(`div`,{id:U.value,ref_key:`optionsList`,ref:F,class:`searchable-select-options`,role:`listbox`},[(d(!0),y(p,null,i(K.value,e=>(d(),y(`button`,{key:e.value,type:`button`,class:`searchable-select-option`,role:`option`,"aria-selected":e.value===n.modelValue,disabled:e.disabled,onMousedown:r[2]||=h(()=>{},[`prevent`]),onClick:t=>Y(e),onKeydown:t=>de(t,e)},[l(`span`,ae,[l(`strong`,null,g(e.label),1),e.meta?(d(),y(`small`,oe,g(e.meta),1)):v(``,!0)]),r[4]||=l(`i`,{class:`searchable-select-check`,"aria-hidden":`true`},null,-1)],40,ie))),128))],8,re),K.value.length===0?(d(),y(`p`,se,g(c(s)(`common.searchableSelect.noMatches`)),1)):v(``,!0)],8,D)],42,b))}});export{k as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,B as t,C as n,L as r,N as i,S as a,Y as o,a as s,et as c,g as l,h as u,i as d,j as f,k as ee,m as p,n as te,nt as m,p as ne,rt as h,s as g,u as _,v,x as re,y}from"./i18n-js6gfc7j.js";import{o as ie,r as b,t as ae}from"./console-BT1P2Db4.js";import{t as x}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as S}from"./SearchableSelect-D3HM8YF8.js";import{o as oe,r as se,t as C}from"./conversation-launcher-settings-DrJEotdf.js";var ce=[`aria-label`],le={class:`settings-content`},ue={key:0,class:`settings-top-status`,role:`status`},de={key:0},fe={key:1},pe={class:`settings-card resource-card`},me={class:`section-heading`},he={key:0},ge=[`disabled`],_e={key:0,class:`settings-error`,role:`alert`},ve={class:`resource-totals`},ye={class:`resource-breakdowns`},w={class:`resource-group`},T={class:`resource-group`},E={class:`resource-notes`},D={key:0},O={key:1},k={key:2,class:`settings-skeleton`,"aria-hidden":`true`},A={class:`settings-card ports-card`},j={class:`section-heading`},M={key:0,class:`restart-chip`},N={class:`port-section`},P={class:`port-grid`},be=[`onUpdate:modelValue`],xe={class:`port-section development-section`},Se={id:`conversation-launchers`,class:`settings-card conversation-launcher-card`},Ce={class:`conversation-launcher-list`},we={class:`conversation-launcher-heading`},Te={class:`conversation-launcher-switch`},Ee=[`onUpdate:modelValue`],De={key:0,class:`conversation-launcher-note`},Oe={key:1,class:`conversation-launcher-fields`},ke=[`onUpdate:modelValue`],Ae={class:`conversation-launcher-template`},je=[`onUpdate:modelValue`],Me={class:`settings-card behavior-card`},Ne={class:`setting-list`},Pe={class:`setting-row`},Fe=[`checked`],Ie={class:`setting-row`},Le=[`checked`],Re={class:`setting-row`},ze={class:`setting-row select-row`},Be={class:`setting-row select-row`},Ve={class:`setting-row select-row`},He={key:0,class:`settings-error`,role:`alert`},Ue={key:2,class:`settings-error`,role:`alert`},F=x(n({__name:`SettingsPage`,setup(n){let x=ae(),F=o(null),I=o(null),L=o(null),R=o(!0),z=o(!1),B=o(!1),V=o(``),H=o(``),U=o(!1),W=null,We=[`console`,`personalProvider`,`personalNeo4jHttp`,`personalNeo4jBolt`],G=u({get:()=>te(),set:e=>d(e)}),K=[5,10,30,60],Ge=se,Ke=u(()=>[{value:`zh-CN`,label:s(`settings.behavior.zh`)},{value:`en-US`,label:s(`settings.behavior.en`)}]),qe=u(()=>K.map(e=>({value:String(e),label:s(`settings.resources.refreshUnit`,{seconds:e})}))),Je=u(()=>[{value:`native`,label:s(`settings.behavior.runtimeModes.native`)},{value:`container`,label:s(`settings.behavior.runtimeModes.container`)}]),Ye=u(()=>[{value:`any`,label:s(`settings.conversationLaunchers.idFormats.any`)},{value:`uuid`,label:s(`settings.conversationLaunchers.idFormats.uuid`)}]),Xe=u(()=>x.state?.capturePolicy?.enabled!==!1),Ze=u(()=>x.state?.agentAccessPolicy?.enabled!==!1),Qe=u(()=>Math.max(1,...L.value?.memory.components.map(({bytes:e})=>e)??[1])),$e=u(()=>Math.max(1,...L.value?.disk.components.map(({bytes:e})=>e)??[1])),et=u(()=>I.value?.graphRuntimeMode===`container`&&Number.isFinite(L.value?.memory.hostTotalBytes)&&Number(L.value?.memory.hostTotalBytes)<=16*1024**3);e(async()=>{x.runtimeStatus===`idle`&&x.refresh(),await Promise.all([q(),J()]),R.value=!1}),ee(Y),r(()=>I.value?.resourceRefreshSeconds,()=>nt());async function q(){try{let e=await b(`/api/system/settings`);F.value=e,I.value=structuredClone(e.configured),C(e.configured.conversationLaunchers),V.value=``}catch(e){V.value=e instanceof Error?e.message:s(`settings.loadError`)}}async function J(){if(!(B.value||document.visibilityState===`hidden`)){B.value=!0;try{L.value=await b(`/api/system/resources`),H.value=``}catch(e){H.value=e instanceof Error?e.message:s(`settings.resources.unavailable`)}finally{B.value=!1}}}async function tt(){if(!(!I.value||z.value)){z.value=!0,U.value=!1;try{let e=await ie(`/api/system/settings`,I.value);F.value=e,I.value=structuredClone(e.configured),C(e.configured.conversationLaunchers),U.value=!0,V.value=``,window.setTimeout(()=>{U.value=!1},2400)}catch(e){V.value=e instanceof Error?e.message:s(`settings.saveError`)}finally{z.value=!1}}}function nt(){Y();let e=I.value?.resourceRefreshSeconds;e&&(W=setInterval(()=>void J(),e*1e3))}function Y(){W&&clearInterval(W),W=null}function rt(e){x.updateCapturePolicy(e.currentTarget.checked)}function it(e){x.updateAgentAccessPolicy(e.currentTarget.checked)}function at(e){(e===`zh-CN`||e===`en-US`)&&d(e)}function ot(e){let t=K.find(t=>String(t)===e);t===void 0||!I.value||(I.value.resourceRefreshSeconds=t)}function st(e){!I.value||e!==`native`&&e!==`container`||(I.value.graphRuntimeMode=e)}function ct(e){let t=s(`settings.conversationLaunchers.applications.${e}`);return t===`settings.conversationLaunchers.applications.${e}`?oe(e):t}function lt(e){return F.value?.active.ports[e]??`—`}function X(e){let t=`settings.resources.components.${e.id}`,n=s(t);return n===t?e.label:n}function Z(e){if(!Number.isFinite(e))return`—`;let t=Number(e),n=[`B`,`KiB`,`MiB`,`GiB`,`TiB`],r=t,i=0;for(;r>=1024&&i<n.length-1;)r/=1024,i+=1;let a=i===0||r>=100?0:r>=10?1:2;return`${r.toFixed(a)} ${n[i]}`}function Q(e,t){return`${Math.max(3,Math.round(e/t*100))}%`}function $(e){return e?new Intl.DateTimeFormat(G.value,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`}).format(new Date(e)):`—`}return(e,n)=>(f(),y(`section`,{class:`view settings-view`,"aria-label":c(s)(`settings.aria`)},[l(`div`,le,[U.value||F.value?.restartRequired?(f(),y(`div`,ue,[U.value?(f(),y(`strong`,de,h(c(s)(`settings.saved`)),1)):v(``,!0),F.value?.restartRequired?(f(),y(`span`,fe,h(c(s)(`settings.restartCopy`)),1)):v(``,!0)])):v(``,!0),l(`section`,pe,[l(`header`,me,[l(`div`,null,[l(`h3`,null,h(c(s)(`settings.resources.title`)),1),L.value?(f(),y(`p`,he,h(c(s)(`settings.resources.measuredAt`,{time:$(L.value.sampledAt)})),1)):v(``,!0)]),l(`button`,{class:`quiet-button`,type:`button`,disabled:B.value,onClick:J},h(c(s)(`common.actions.refresh`)),9,ge)]),H.value?(f(),y(`p`,_e,h(H.value),1)):L.value?(f(),y(p,{key:1},[l(`div`,ve,[l(`article`,null,[l(`span`,null,h(c(s)(`settings.resources.memory`)),1),l(`strong`,null,h(Z(L.value.memory.usedBytes)),1),l(`small`,null,h(c(s)(`settings.resources.available`,{value:Z(L.value.memory.hostFreeBytes)})),1)]),l(`article`,null,[l(`span`,null,h(c(s)(`settings.resources.disk`)),1),l(`strong`,null,h(Z(L.value.disk.usedBytes)),1),l(`small`,null,h(c(s)(`settings.resources.available`,{value:Z(L.value.disk.hostFreeBytes)})),1)])]),l(`div`,ye,[l(`div`,w,[l(`h4`,null,h(c(s)(`settings.resources.memory`)),1),(f(!0),y(p,null,i(L.value.memory.components,e=>(f(),y(`div`,{key:e.id,class:`resource-row`},[l(`div`,null,[l(`span`,null,h(X(e)),1),l(`strong`,null,h(Z(e.bytes)),1)]),l(`i`,null,[l(`b`,{style:m({width:Q(e.bytes,Qe.value)})},null,4)])]))),128))]),l(`div`,T,[l(`h4`,null,h(c(s)(`settings.resources.disk`)),1),(f(!0),y(p,null,i(L.value.disk.components,e=>(f(),y(`div`,{key:e.id,class:`resource-row`},[l(`div`,null,[l(`span`,null,h(X(e)),1),l(`strong`,null,h(Z(e.bytes)),1)]),l(`i`,null,[l(`b`,{style:m({width:Q(e.bytes,$e.value)})},null,4)])]))),128))])]),l(`div`,E,[l(`span`,null,h(c(s)(`settings.resources.diskMeasuredAt`,{time:$(L.value.disk.measuredAt)})),1),L.value.status===`partial`?(f(),y(`span`,D,h(c(s)(`settings.resources.partial`)),1)):v(``,!0),L.value.disk.temporaryBytes?(f(),y(`span`,O,h(c(s)(`settings.resources.temporary`,{value:Z(L.value.disk.temporaryBytes)})),1)):v(``,!0),l(`span`,null,h(c(s)(L.value.exclusions.includes(`shared-container-vm-overhead`)?`settings.resources.exclusionsContainer`:`settings.resources.exclusionsNative`)),1)])],64)):(f(),y(`div`,k))]),I.value?(f(),y(`form`,{key:1,id:`settings-form`,class:`settings-form`,onSubmit:ne(tt,[`prevent`])},[l(`section`,A,[l(`header`,j,[l(`h3`,null,h(c(s)(`settings.ports.title`)),1),F.value?.restartRequired?(f(),y(`span`,M,h(c(s)(`settings.restartRequired`)),1)):v(``,!0)]),l(`div`,N,[l(`h4`,null,h(c(s)(`settings.ports.personal`)),1),l(`div`,P,[(f(),y(p,null,i(We,e=>l(`label`,{key:e},[l(`span`,null,h(c(s)(`settings.ports.${e}`)),1),t(l(`input`,{"onUpdate:modelValue":t=>I.value.ports[e]=t,type:`number`,min:`1`,max:`65535`,required:``},null,8,be),[[_,I.value.ports[e],void 0,{number:!0}]]),l(`small`,null,h(c(s)(`settings.ports.active`,{port:lt(e)})),1)])),64))])]),l(`div`,xe,[l(`div`,null,[l(`h4`,null,h(c(s)(`settings.ports.development`)),1),l(`span`,null,h(c(s)(`settings.ports.developing`)),1)]),l(`p`,null,h(c(s)(`settings.ports.developmentMeta`)),1)])]),l(`section`,Se,[l(`h3`,null,h(c(s)(`settings.conversationLaunchers.title`)),1),l(`div`,Ce,[(f(!0),y(p,null,i(c(Ge),e=>(f(),y(`article`,{key:e,class:`conversation-launcher-row`},[l(`div`,we,[l(`span`,null,[l(`strong`,null,h(ct(e)),1),l(`small`,null,h(c(s)(`settings.conversationLaunchers.sourceId`,{id:e})),1)]),l(`label`,Te,[l(`span`,null,h(c(s)(`settings.conversationLaunchers.enabled`)),1),t(l(`input`,{"onUpdate:modelValue":t=>I.value.conversationLaunchers[e].enabled=t,type:`checkbox`,role:`switch`},null,8,Ee),[[g,I.value.conversationLaunchers[e].enabled]])])]),I.value.conversationLaunchers[e].enabled&&e===`codex`?(f(),y(`small`,De,h(c(s)(`settings.conversationLaunchers.idFormatMeta`)),1)):v(``,!0),I.value.conversationLaunchers[e].enabled?(f(),y(`div`,Oe,[l(`label`,null,[l(`span`,null,h(c(s)(`settings.conversationLaunchers.idFormat`)),1),a(S,{modelValue:I.value.conversationLaunchers[e].idFormat,"onUpdate:modelValue":t=>I.value.conversationLaunchers[e].idFormat=t,class:`launcher-select`,"control-id":`settings-conversation-${e}-id-format`,options:Ye.value,label:c(s)(`settings.conversationLaunchers.idFormat`)},null,8,[`modelValue`,`onUpdate:modelValue`,`control-id`,`options`,`label`])]),l(`label`,null,[l(`span`,null,h(c(s)(`settings.conversationLaunchers.appName`)),1),t(l(`input`,{"onUpdate:modelValue":t=>I.value.conversationLaunchers[e].appName=t,type:`text`,maxlength:`64`,required:``},null,8,ke),[[_,I.value.conversationLaunchers[e].appName,void 0,{trim:!0}]])]),l(`label`,Ae,[l(`span`,null,[re(h(c(s)(`settings.conversationLaunchers.urlTemplate`))+` `,1),n[1]||=l(`small`,null,[l(`code`,null,`{id}`)],-1)]),t(l(`input`,{"onUpdate:modelValue":t=>I.value.conversationLaunchers[e].urlTemplate=t,type:`text`,maxlength:`1024`,spellcheck:`false`,required:``},null,8,je),[[_,I.value.conversationLaunchers[e].urlTemplate,void 0,{trim:!0}]])])])):v(``,!0)]))),128))])]),l(`section`,Me,[l(`h3`,null,h(c(s)(`settings.behavior.title`)),1),l(`div`,Ne,[l(`label`,Pe,[l(`span`,null,[l(`strong`,null,h(c(s)(`settings.behavior.capture`)),1),l(`small`,null,h(c(s)(`settings.behavior.captureMeta`)),1)]),l(`input`,{type:`checkbox`,role:`switch`,checked:Xe.value,onChange:rt},null,40,Fe)]),l(`label`,Ie,[l(`span`,null,[l(`strong`,null,h(c(s)(`settings.behavior.agentAccess`)),1),l(`small`,null,h(c(s)(`settings.behavior.agentAccessMeta`)),1)]),l(`input`,{type:`checkbox`,role:`switch`,checked:Ze.value,onChange:it},null,40,Le)]),l(`label`,Re,[l(`span`,null,[l(`strong`,null,h(c(s)(`settings.behavior.lanAccess`)),1),l(`small`,null,h(c(s)(`settings.behavior.lanAccessMeta`)),1)]),t(l(`input`,{"onUpdate:modelValue":n[0]||=e=>I.value.lanAccess=e,type:`checkbox`,role:`switch`},null,512),[[g,I.value.lanAccess]])]),l(`div`,ze,[l(`span`,null,[l(`strong`,null,h(c(s)(`settings.behavior.runtimeMode`)),1),l(`small`,null,h(et.value?c(s)(`settings.behavior.runtimeRecommendation`):c(s)(`settings.behavior.runtimeModeMeta`,{mode:c(s)(`settings.behavior.runtimeModes.${F.value?.active.graphRuntimeMode??I.value.graphRuntimeMode}`)})),1)]),a(S,{class:`settings-select`,"control-id":`settings-runtime-mode`,"model-value":I.value.graphRuntimeMode,options:Je.value,label:c(s)(`settings.behavior.runtimeMode`),"onUpdate:modelValue":st},null,8,[`model-value`,`options`,`label`])]),l(`div`,Be,[l(`span`,null,[l(`strong`,null,h(c(s)(`settings.behavior.language`)),1)]),a(S,{class:`settings-select`,"control-id":`settings-language`,"model-value":G.value,options:Ke.value,label:c(s)(`settings.behavior.language`),"onUpdate:modelValue":at},null,8,[`model-value`,`options`,`label`])]),l(`div`,Ve,[l(`span`,null,[l(`strong`,null,h(c(s)(`settings.resources.refresh`)),1)]),a(S,{class:`settings-select`,"control-id":`settings-refresh-interval`,"model-value":String(I.value.resourceRefreshSeconds),options:qe.value,label:c(s)(`settings.resources.refresh`),"onUpdate:modelValue":ot},null,8,[`model-value`,`options`,`label`])])])]),V.value?(f(),y(`p`,He,h(V.value),1)):v(``,!0)],32)):R.value?v(``,!0):(f(),y(`p`,Ue,h(V.value||c(s)(`settings.loadError`)),1))])],8,ce))}}),[[`__scopeId`,`data-v-63730e70`]]);export{F as default};
|
|
1
|
+
import{A as e,B as t,C as n,L as r,N as i,S as a,Y as o,a as s,et as c,g as l,h as u,i as d,j as f,k as ee,m as p,n as te,nt as m,p as ne,rt as h,s as g,u as _,v,x as re,y}from"./i18n-CgBHZthI.js";import{o as ie,r as b,t as ae}from"./console-tOxOl8Vq.js";import{t as x}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as S}from"./SearchableSelect-D27H0MoP.js";import{o as oe,r as se,t as C}from"./conversation-launcher-settings-DuFSpPAo.js";var ce=[`aria-label`],le={class:`settings-content`},ue={key:0,class:`settings-top-status`,role:`status`},de={key:0},fe={key:1},pe={class:`settings-card resource-card`},me={class:`section-heading`},he={key:0},ge=[`disabled`],_e={key:0,class:`settings-error`,role:`alert`},ve={class:`resource-totals`},ye={class:`resource-breakdowns`},w={class:`resource-group`},T={class:`resource-group`},E={class:`resource-notes`},D={key:0},O={key:1},k={key:2,class:`settings-skeleton`,"aria-hidden":`true`},A={class:`settings-card ports-card`},j={class:`section-heading`},M={key:0,class:`restart-chip`},N={class:`port-section`},P={class:`port-grid`},be=[`onUpdate:modelValue`],xe={class:`port-section development-section`},Se={id:`conversation-launchers`,class:`settings-card conversation-launcher-card`},Ce={class:`conversation-launcher-list`},we={class:`conversation-launcher-heading`},Te={class:`conversation-launcher-switch`},Ee=[`onUpdate:modelValue`],De={key:0,class:`conversation-launcher-note`},Oe={key:1,class:`conversation-launcher-fields`},ke=[`onUpdate:modelValue`],Ae={class:`conversation-launcher-template`},je=[`onUpdate:modelValue`],Me={class:`settings-card behavior-card`},Ne={class:`setting-list`},Pe={class:`setting-row`},Fe=[`checked`],Ie={class:`setting-row`},Le=[`checked`],Re={class:`setting-row`},ze={class:`setting-row select-row`},Be={class:`setting-row select-row`},Ve={class:`setting-row select-row`},He={key:0,class:`settings-error`,role:`alert`},Ue={key:2,class:`settings-error`,role:`alert`},F=x(n({__name:`SettingsPage`,setup(n){let x=ae(),F=o(null),I=o(null),L=o(null),R=o(!0),z=o(!1),B=o(!1),V=o(``),H=o(``),U=o(!1),W=null,We=[`console`,`personalProvider`,`personalNeo4jHttp`,`personalNeo4jBolt`],G=u({get:()=>te(),set:e=>d(e)}),K=[5,10,30,60],Ge=se,Ke=u(()=>[{value:`zh-CN`,label:s(`settings.behavior.zh`)},{value:`en-US`,label:s(`settings.behavior.en`)}]),qe=u(()=>K.map(e=>({value:String(e),label:s(`settings.resources.refreshUnit`,{seconds:e})}))),Je=u(()=>[{value:`native`,label:s(`settings.behavior.runtimeModes.native`)},{value:`container`,label:s(`settings.behavior.runtimeModes.container`)}]),Ye=u(()=>[{value:`any`,label:s(`settings.conversationLaunchers.idFormats.any`)},{value:`uuid`,label:s(`settings.conversationLaunchers.idFormats.uuid`)}]),Xe=u(()=>x.state?.capturePolicy?.enabled!==!1),Ze=u(()=>x.state?.agentAccessPolicy?.enabled!==!1),Qe=u(()=>Math.max(1,...L.value?.memory.components.map(({bytes:e})=>e)??[1])),$e=u(()=>Math.max(1,...L.value?.disk.components.map(({bytes:e})=>e)??[1])),et=u(()=>I.value?.graphRuntimeMode===`container`&&Number.isFinite(L.value?.memory.hostTotalBytes)&&Number(L.value?.memory.hostTotalBytes)<=16*1024**3);e(async()=>{x.runtimeStatus===`idle`&&x.refresh(),await Promise.all([q(),J()]),R.value=!1}),ee(Y),r(()=>I.value?.resourceRefreshSeconds,()=>nt());async function q(){try{let e=await b(`/api/system/settings`);F.value=e,I.value=structuredClone(e.configured),C(e.configured.conversationLaunchers),V.value=``}catch(e){V.value=e instanceof Error?e.message:s(`settings.loadError`)}}async function J(){if(!(B.value||document.visibilityState===`hidden`)){B.value=!0;try{L.value=await b(`/api/system/resources`),H.value=``}catch(e){H.value=e instanceof Error?e.message:s(`settings.resources.unavailable`)}finally{B.value=!1}}}async function tt(){if(!(!I.value||z.value)){z.value=!0,U.value=!1;try{let e=await ie(`/api/system/settings`,I.value);F.value=e,I.value=structuredClone(e.configured),C(e.configured.conversationLaunchers),U.value=!0,V.value=``,window.setTimeout(()=>{U.value=!1},2400)}catch(e){V.value=e instanceof Error?e.message:s(`settings.saveError`)}finally{z.value=!1}}}function nt(){Y();let e=I.value?.resourceRefreshSeconds;e&&(W=setInterval(()=>void J(),e*1e3))}function Y(){W&&clearInterval(W),W=null}function rt(e){x.updateCapturePolicy(e.currentTarget.checked)}function it(e){x.updateAgentAccessPolicy(e.currentTarget.checked)}function at(e){(e===`zh-CN`||e===`en-US`)&&d(e)}function ot(e){let t=K.find(t=>String(t)===e);t===void 0||!I.value||(I.value.resourceRefreshSeconds=t)}function st(e){!I.value||e!==`native`&&e!==`container`||(I.value.graphRuntimeMode=e)}function ct(e){let t=s(`settings.conversationLaunchers.applications.${e}`);return t===`settings.conversationLaunchers.applications.${e}`?oe(e):t}function lt(e){return F.value?.active.ports[e]??`—`}function X(e){let t=`settings.resources.components.${e.id}`,n=s(t);return n===t?e.label:n}function Z(e){if(!Number.isFinite(e))return`—`;let t=Number(e),n=[`B`,`KiB`,`MiB`,`GiB`,`TiB`],r=t,i=0;for(;r>=1024&&i<n.length-1;)r/=1024,i+=1;let a=i===0||r>=100?0:r>=10?1:2;return`${r.toFixed(a)} ${n[i]}`}function Q(e,t){return`${Math.max(3,Math.round(e/t*100))}%`}function $(e){return e?new Intl.DateTimeFormat(G.value,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`}).format(new Date(e)):`—`}return(e,n)=>(f(),y(`section`,{class:`view settings-view`,"aria-label":c(s)(`settings.aria`)},[l(`div`,le,[U.value||F.value?.restartRequired?(f(),y(`div`,ue,[U.value?(f(),y(`strong`,de,h(c(s)(`settings.saved`)),1)):v(``,!0),F.value?.restartRequired?(f(),y(`span`,fe,h(c(s)(`settings.restartCopy`)),1)):v(``,!0)])):v(``,!0),l(`section`,pe,[l(`header`,me,[l(`div`,null,[l(`h3`,null,h(c(s)(`settings.resources.title`)),1),L.value?(f(),y(`p`,he,h(c(s)(`settings.resources.measuredAt`,{time:$(L.value.sampledAt)})),1)):v(``,!0)]),l(`button`,{class:`quiet-button`,type:`button`,disabled:B.value,onClick:J},h(c(s)(`common.actions.refresh`)),9,ge)]),H.value?(f(),y(`p`,_e,h(H.value),1)):L.value?(f(),y(p,{key:1},[l(`div`,ve,[l(`article`,null,[l(`span`,null,h(c(s)(`settings.resources.memory`)),1),l(`strong`,null,h(Z(L.value.memory.usedBytes)),1),l(`small`,null,h(c(s)(`settings.resources.available`,{value:Z(L.value.memory.hostFreeBytes)})),1)]),l(`article`,null,[l(`span`,null,h(c(s)(`settings.resources.disk`)),1),l(`strong`,null,h(Z(L.value.disk.usedBytes)),1),l(`small`,null,h(c(s)(`settings.resources.available`,{value:Z(L.value.disk.hostFreeBytes)})),1)])]),l(`div`,ye,[l(`div`,w,[l(`h4`,null,h(c(s)(`settings.resources.memory`)),1),(f(!0),y(p,null,i(L.value.memory.components,e=>(f(),y(`div`,{key:e.id,class:`resource-row`},[l(`div`,null,[l(`span`,null,h(X(e)),1),l(`strong`,null,h(Z(e.bytes)),1)]),l(`i`,null,[l(`b`,{style:m({width:Q(e.bytes,Qe.value)})},null,4)])]))),128))]),l(`div`,T,[l(`h4`,null,h(c(s)(`settings.resources.disk`)),1),(f(!0),y(p,null,i(L.value.disk.components,e=>(f(),y(`div`,{key:e.id,class:`resource-row`},[l(`div`,null,[l(`span`,null,h(X(e)),1),l(`strong`,null,h(Z(e.bytes)),1)]),l(`i`,null,[l(`b`,{style:m({width:Q(e.bytes,$e.value)})},null,4)])]))),128))])]),l(`div`,E,[l(`span`,null,h(c(s)(`settings.resources.diskMeasuredAt`,{time:$(L.value.disk.measuredAt)})),1),L.value.status===`partial`?(f(),y(`span`,D,h(c(s)(`settings.resources.partial`)),1)):v(``,!0),L.value.disk.temporaryBytes?(f(),y(`span`,O,h(c(s)(`settings.resources.temporary`,{value:Z(L.value.disk.temporaryBytes)})),1)):v(``,!0),l(`span`,null,h(c(s)(L.value.exclusions.includes(`shared-container-vm-overhead`)?`settings.resources.exclusionsContainer`:`settings.resources.exclusionsNative`)),1)])],64)):(f(),y(`div`,k))]),I.value?(f(),y(`form`,{key:1,id:`settings-form`,class:`settings-form`,onSubmit:ne(tt,[`prevent`])},[l(`section`,A,[l(`header`,j,[l(`h3`,null,h(c(s)(`settings.ports.title`)),1),F.value?.restartRequired?(f(),y(`span`,M,h(c(s)(`settings.restartRequired`)),1)):v(``,!0)]),l(`div`,N,[l(`h4`,null,h(c(s)(`settings.ports.personal`)),1),l(`div`,P,[(f(),y(p,null,i(We,e=>l(`label`,{key:e},[l(`span`,null,h(c(s)(`settings.ports.${e}`)),1),t(l(`input`,{"onUpdate:modelValue":t=>I.value.ports[e]=t,type:`number`,min:`1`,max:`65535`,required:``},null,8,be),[[_,I.value.ports[e],void 0,{number:!0}]]),l(`small`,null,h(c(s)(`settings.ports.active`,{port:lt(e)})),1)])),64))])]),l(`div`,xe,[l(`div`,null,[l(`h4`,null,h(c(s)(`settings.ports.development`)),1),l(`span`,null,h(c(s)(`settings.ports.developing`)),1)]),l(`p`,null,h(c(s)(`settings.ports.developmentMeta`)),1)])]),l(`section`,Se,[l(`h3`,null,h(c(s)(`settings.conversationLaunchers.title`)),1),l(`div`,Ce,[(f(!0),y(p,null,i(c(Ge),e=>(f(),y(`article`,{key:e,class:`conversation-launcher-row`},[l(`div`,we,[l(`span`,null,[l(`strong`,null,h(ct(e)),1),l(`small`,null,h(c(s)(`settings.conversationLaunchers.sourceId`,{id:e})),1)]),l(`label`,Te,[l(`span`,null,h(c(s)(`settings.conversationLaunchers.enabled`)),1),t(l(`input`,{"onUpdate:modelValue":t=>I.value.conversationLaunchers[e].enabled=t,type:`checkbox`,role:`switch`},null,8,Ee),[[g,I.value.conversationLaunchers[e].enabled]])])]),I.value.conversationLaunchers[e].enabled&&e===`codex`?(f(),y(`small`,De,h(c(s)(`settings.conversationLaunchers.idFormatMeta`)),1)):v(``,!0),I.value.conversationLaunchers[e].enabled?(f(),y(`div`,Oe,[l(`label`,null,[l(`span`,null,h(c(s)(`settings.conversationLaunchers.idFormat`)),1),a(S,{modelValue:I.value.conversationLaunchers[e].idFormat,"onUpdate:modelValue":t=>I.value.conversationLaunchers[e].idFormat=t,class:`launcher-select`,"control-id":`settings-conversation-${e}-id-format`,options:Ye.value,label:c(s)(`settings.conversationLaunchers.idFormat`)},null,8,[`modelValue`,`onUpdate:modelValue`,`control-id`,`options`,`label`])]),l(`label`,null,[l(`span`,null,h(c(s)(`settings.conversationLaunchers.appName`)),1),t(l(`input`,{"onUpdate:modelValue":t=>I.value.conversationLaunchers[e].appName=t,type:`text`,maxlength:`64`,required:``},null,8,ke),[[_,I.value.conversationLaunchers[e].appName,void 0,{trim:!0}]])]),l(`label`,Ae,[l(`span`,null,[re(h(c(s)(`settings.conversationLaunchers.urlTemplate`))+` `,1),n[1]||=l(`small`,null,[l(`code`,null,`{id}`)],-1)]),t(l(`input`,{"onUpdate:modelValue":t=>I.value.conversationLaunchers[e].urlTemplate=t,type:`text`,maxlength:`1024`,spellcheck:`false`,required:``},null,8,je),[[_,I.value.conversationLaunchers[e].urlTemplate,void 0,{trim:!0}]])])])):v(``,!0)]))),128))])]),l(`section`,Me,[l(`h3`,null,h(c(s)(`settings.behavior.title`)),1),l(`div`,Ne,[l(`label`,Pe,[l(`span`,null,[l(`strong`,null,h(c(s)(`settings.behavior.capture`)),1),l(`small`,null,h(c(s)(`settings.behavior.captureMeta`)),1)]),l(`input`,{type:`checkbox`,role:`switch`,checked:Xe.value,onChange:rt},null,40,Fe)]),l(`label`,Ie,[l(`span`,null,[l(`strong`,null,h(c(s)(`settings.behavior.agentAccess`)),1),l(`small`,null,h(c(s)(`settings.behavior.agentAccessMeta`)),1)]),l(`input`,{type:`checkbox`,role:`switch`,checked:Ze.value,onChange:it},null,40,Le)]),l(`label`,Re,[l(`span`,null,[l(`strong`,null,h(c(s)(`settings.behavior.lanAccess`)),1),l(`small`,null,h(c(s)(`settings.behavior.lanAccessMeta`)),1)]),t(l(`input`,{"onUpdate:modelValue":n[0]||=e=>I.value.lanAccess=e,type:`checkbox`,role:`switch`},null,512),[[g,I.value.lanAccess]])]),l(`div`,ze,[l(`span`,null,[l(`strong`,null,h(c(s)(`settings.behavior.runtimeMode`)),1),l(`small`,null,h(et.value?c(s)(`settings.behavior.runtimeRecommendation`):c(s)(`settings.behavior.runtimeModeMeta`,{mode:c(s)(`settings.behavior.runtimeModes.${F.value?.active.graphRuntimeMode??I.value.graphRuntimeMode}`)})),1)]),a(S,{class:`settings-select`,"control-id":`settings-runtime-mode`,"model-value":I.value.graphRuntimeMode,options:Je.value,label:c(s)(`settings.behavior.runtimeMode`),"onUpdate:modelValue":st},null,8,[`model-value`,`options`,`label`])]),l(`div`,Be,[l(`span`,null,[l(`strong`,null,h(c(s)(`settings.behavior.language`)),1)]),a(S,{class:`settings-select`,"control-id":`settings-language`,"model-value":G.value,options:Ke.value,label:c(s)(`settings.behavior.language`),"onUpdate:modelValue":at},null,8,[`model-value`,`options`,`label`])]),l(`div`,Ve,[l(`span`,null,[l(`strong`,null,h(c(s)(`settings.resources.refresh`)),1)]),a(S,{class:`settings-select`,"control-id":`settings-refresh-interval`,"model-value":String(I.value.resourceRefreshSeconds),options:qe.value,label:c(s)(`settings.resources.refresh`),"onUpdate:modelValue":ot},null,8,[`model-value`,`options`,`label`])])])]),V.value?(f(),y(`p`,He,h(V.value),1)):v(``,!0)],32)):R.value?v(``,!0):(f(),y(`p`,Ue,h(V.value||c(s)(`settings.loadError`)),1))])],8,ce))}}),[[`__scopeId`,`data-v-63730e70`]]);export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e,L as t,N as n,S as r,Y as i,_ as a,a as o,et as s,g as c,h as l,j as u,m as d,rt as f,tt as p,v as m,x as h,y as g,z as _}from"./i18n-
|
|
1
|
+
import{C as e,L as t,N as n,S as r,Y as i,_ as a,a as o,et as s,g as c,h as l,j as u,m as d,rt as f,tt as p,v as m,x as h,y as g,z as _}from"./i18n-CgBHZthI.js";import{r as v,t as y}from"./console-tOxOl8Vq.js";import{t as b}from"./vue-router-CzHm-y-x.js";import{t as x}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{a as S,i as C,n as w,t as ee}from"./KnowledgeEditDialog-UnnBDt0I.js";import{u as te,x as ne}from"./model-BtnVr7fX.js";var re={class:`view writing-taste-view`},ie={key:1,class:`writing-taste-unavailable`},ae={class:`writing-taste-hero__copy`},T={class:`writing-taste-status`},E={class:`writing-taste-hero__score`,"aria-hidden":`true`},D=[`aria-label`],O={"aria-hidden":`true`},k={class:`writing-taste-rules`},A={key:0,class:`writing-taste-rule-list`},j={class:`writing-taste-rule__status`},M={key:0,class:`conflict`},N={class:`writing-taste-rule__body`},P={key:0},F={key:1},I={key:0},L={key:0,class:`writing-taste-rule__actions`},R=[`onClick`],z=[`onClick`],B={key:1,class:`writing-taste-empty`},oe={key:0,class:`writing-taste-agent-preview`},V={key:0},H=x(e({__name:`WritingTastePage`,setup(e){let x=y(),H=i(null),U=i(null),W=i(!1),G=i(null),K=i(null),q=i(!1),J=0,se=C(l(()=>W.value&&!H.value)),Y=l(()=>ne(U.value)),X=l(()=>new Map(Y.value.map(e=>[`${e.itemKind}:${e.id}`,e]))),ce=l(()=>H.value?.status===`active`?o(`writingTaste.page.activeTitle`):H.value?.status===`preview_ready`?o(`writingTaste.page.previewTitle`):o(`writingTaste.page.collectingTitle`)),Z=l(()=>H.value?.status===`active`?o(`writingTaste.page.activeCopy`):H.value?.status===`preview_ready`?o(`writingTaste.page.previewCopy`):o(`writingTaste.page.collectingCopy`));t(()=>x.activePersonalSpace?.id,e=>{e&&Q(e)},{immediate:!0});async function Q(e=x.activePersonalSpace?.id){if(!e)return;let t=++J;W.value=!0;try{let n=new URLSearchParams({personalSpaceId:e,limit:`500`}),r=new URLSearchParams({spaceId:e,limit:`500`}),[i,a]=await Promise.all([v(`/api/writing-taste-profile?${n}`),v(`/api/graph?${r}`)]);if(t!==J)return;H.value=me(i)?i:null,U.value=he(a)?a:null,pe()}catch(e){if(t!==J)return;H.value=null,U.value=null,x.reportError(e)}finally{t===J&&(W.value=!1)}}function $(e){return X.value.get(`${e.item_kind}:${e.item_id}`)??null}function le(e){G.value=$(e)}function ue(e){K.value=$(e)}function de(e){if(e.preference_scope!==`project`||!e.preference_project_id)return o(`writingTaste.page.globalScope`);let t=x.state?.personalProjects?.find(({project_id:t})=>t===e.preference_project_id);return o(`writingTaste.page.projectScope`,{project:t?.profile.name??e.preference_project_id})}function fe(e){return e.key===`conflicts`?o(`writingTaste.criteria.conflictsProgress`,{current:e.current}):o(`writingTaste.criteria.progress`,{current:e.current,target:e.target})}function pe(){G.value&&=X.value.get(`${G.value.itemKind}:${G.value.id}`)??null,K.value&&=X.value.get(`${K.value.itemKind}:${K.value.id}`)??null}function me(e){if(!e||typeof e!=`object`)return!1;let t=e;return[`collecting`,`preview_ready`,`active`].includes(t.status??``)&&!!t.readiness&&Array.isArray(t.rules)}function he(e){if(!e||typeof e!=`object`)return!1;let t=e;return Array.isArray(t.nodes)&&Array.isArray(t.edges)}return(e,t)=>(u(),g(`section`,re,[r(s(b),{class:`writing-taste-back`,to:`/preferences`},{default:_(()=>[t[5]||=c(`span`,{"aria-hidden":`true`},`←`,-1),h(` `+f(s(o)(`writingTaste.page.back`)),1)]),_:1}),s(se)?(u(),a(S,{key:0,label:s(o)(`writingTaste.page.loading`)},null,8,[`label`])):H.value?(u(),g(d,{key:2},[c(`header`,{class:p([`writing-taste-hero`,`status-${H.value.status}`])},[c(`div`,ae,[c(`span`,T,[t[6]||=c(`i`,{"aria-hidden":`true`},null,-1),h(` `+f(s(o)(`writingTaste.status.${H.value.status}`)),1)]),c(`h2`,null,f(ce.value),1),c(`p`,null,f(Z.value),1)]),c(`div`,E,[c(`strong`,null,f(H.value.readiness.rule_count),1),c(`span`,null,`/ `+f(H.value.readiness.thresholds.rule_count),1),c(`small`,null,f(s(o)(`writingTaste.criteria.rules`)),1)])],2),c(`section`,{class:`writing-taste-readiness`,"aria-label":s(o)(`writingTaste.page.readinessAria`)},[(u(!0),g(d,null,n(H.value.readiness.criteria,e=>(u(),g(`article`,{key:e.key,class:p({met:e.met})},[c(`span`,O,f(e.met?`✓`:`·`),1),c(`div`,null,[c(`strong`,null,f(s(o)(`writingTaste.criteria.${e.key}`)),1),c(`small`,null,f(fe(e)),1)])],2))),128))],8,D),c(`section`,k,[c(`header`,null,[c(`h2`,null,f(s(o)(`writingTaste.page.rulesTitle`)),1),c(`span`,null,f(H.value.rules.length),1)]),H.value.rules.length?(u(),g(`div`,A,[(u(!0),g(d,null,n(H.value.rules,e=>(u(),g(`article`,{key:`${e.item_kind}:${e.item_id}`,class:p([`writing-taste-rule`,{"has-conflict":e.has_conflict,"is-hypothesis":e.evidence_status===`Working hypothesis`}])},[c(`div`,j,[c(`span`,{class:p(e.evidence_status.replaceAll(` `,`-`).toLowerCase())},f(s(o)(`writingTaste.evidenceStatus.${e.evidence_status}`)),3),c(`span`,null,f(de(e)),1),e.has_conflict?(u(),g(`span`,M,f(s(o)(`writingTaste.page.conflict`)),1)):m(``,!0)]),c(`div`,N,[c(`h3`,null,f(e.title),1),c(`p`,null,f(e.instruction),1),e.reason?(u(),g(`small`,P,f(e.reason),1)):m(``,!0),e.contexts.length?(u(),g(`small`,F,f(s(o)(`writingTaste.page.contexts`,{contexts:e.contexts.join(`、`)})),1)):m(``,!0)]),c(`footer`,null,[c(`div`,null,[c(`span`,null,f(s(o)(`writingTaste.page.evidence`,{evidence:e.evidence_count})),1),c(`span`,null,f(s(o)(`writingTaste.page.sessions`,{sessions:e.session_count})),1),e.updated_at?(u(),g(`span`,I,f(s(o)(`writingTaste.page.updated`,{time:s(te)(e.updated_at)})),1)):m(``,!0)]),$(e)?(u(),g(`div`,L,[c(`button`,{class:`secondary-action`,type:`button`,onClick:t=>ue(e)},f(s(o)(`writingTaste.page.edit`)),9,R),e.evidence_status===`Confirmed`?m(``,!0):(u(),g(`button`,{key:0,class:`primary-action`,type:`button`,onClick:t=>le(e)},f(s(o)(`writingTaste.page.confirm`)),9,z))])):m(``,!0)])],2))),128))])):(u(),g(`div`,B,f(s(o)(`writingTaste.page.rulesEmpty`)),1))]),H.value.ready&&H.value.agent_markdown?(u(),g(`section`,oe,[c(`div`,null,[c(`h2`,null,f(s(o)(`writingTaste.page.agentPreviewTitle`)),1),c(`p`,null,f(s(o)(`writingTaste.page.agentPreviewCopy`)),1)]),c(`button`,{class:`secondary-action`,type:`button`,onClick:t[0]||=e=>q.value=!q.value},f(q.value?s(o)(`writingTaste.page.hideAgentPreview`):s(o)(`writingTaste.page.showAgentPreview`)),1),q.value?(u(),g(`pre`,V,f(H.value.agent_markdown),1)):m(``,!0)])):m(``,!0)],64)):(u(),g(`div`,ie,f(s(o)(`writingTaste.page.profileUnavailable`)),1)),r(ee,{item:K.value,"personal-space-id":s(x).activePersonalSpace?.id??``,"personal-project-id":null,projects:s(x).state?.personalProjects??[],"replacement-items":Y.value,onClose:t[1]||=e=>K.value=null,onSaved:t[2]||=e=>Q()},null,8,[`item`,`personal-space-id`,`projects`,`replacement-items`]),r(w,{item:G.value,"personal-space-id":s(x).activePersonalSpace?.id??``,"personal-project-id":null,onClose:t[3]||=e=>G.value=null,onSaved:t[4]||=e=>Q()},null,8,[`item`,`personal-space-id`])]))}}),[[`__scopeId`,`data-v-c14a3671`]]);export{H as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Y as e,a as t}from"./i18n-CgBHZthI.js";import{r as n}from"./console-tOxOl8Vq.js";function r(e){let t=/^employee\.([a-z][a-z0-9-]{0,63})$/.exec(e.agentId)?.[1];return t&&e.profile.capabilities.includes(`fuli.employee:${t}`)?t:null}var i=e([]),a=e(!1),o=e(``),s=``,c=null,l=0;function u(e){if(e===s&&c)return c;let t=++l;return e!==s&&(i.value=[]),s=e,o.value=``,e?(a.value=!0,c=n(`/api/employee-templates?${new URLSearchParams({personalSpaceId:e})}`).then(e=>{t===l&&(i.value=Array.isArray(e.templates)?e.templates:[])}).catch(e=>{t===l&&(i.value=[],o.value=d(e))}).finally(()=>{t===l&&(a.value=!1,c=null)}),c):(i.value=[],a.value=!1,Promise.resolve())}function d(e){let n=e instanceof Error?e.message:``;try{let e=JSON.parse(n);return e.code&&[`runtime_unavailable`,`assignment_required`,`project_not_found`,`identity_conflict`,`reactivation_required`,`assignment_scope_conflict`,`assignment_update_incomplete`].includes(e.code)?t(`employees.errors.${e.code}`):e.error||t(`employees.loadError`)}catch{return n||t(`employees.loadError`)}}export{i as a,r as i,a as n,u as o,d as r,o as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,E as t,G as n,H as r,K as i,L as a,O as o,Q as s,T as c,U as l,V as u,W as d,Y as f,Z as p,a as m,h,q as g}from"./i18n-
|
|
1
|
+
import{$ as e,E as t,G as n,H as r,K as i,L as a,O as o,Q as s,T as c,U as l,V as u,W as d,Y as f,Z as p,a as m,h,q as g}from"./i18n-CgBHZthI.js";var _=typeof window<`u`,v,y=e=>v=e,b=Symbol();function x(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var S=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null};function C(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function w(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){k(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function T(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function E(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(t)}}var D=typeof navigator==`object`?navigator:{userAgent:``},O=/Macintosh/.test(D.userAgent)&&/AppleWebKit/.test(D.userAgent)&&!/Safari/.test(D.userAgent),k=_?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!O?A:`msSaveOrOpenBlob`in D?j:M:()=>{};function A(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?E(r):T(r.href)?w(e,t,n):(r.target=`_blank`,E(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){E(r)},0))}function j(e,t=`download`,n){if(typeof e==`string`)if(T(e))w(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){E(t)})}else navigator.msSaveOrOpenBlob(C(e,n),t)}function M(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return w(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(S.HTMLElement))||`safari`in S,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||O)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:ee}=Object;function N(){let e=u(!0),t=e.run(()=>f({})),r=[],i=[],a=n({install(e){y(a),a._a=e,e.provide(b,a),e.config.globalProperties.$pinia=a,i.forEach(e=>r.push(e)),i=[]},use(e){return this._a?r.push(e):i.push(e),this},_p:r,_a:null,_e:e,_s:new Map,state:t});return a}var P=()=>{};function F(e,t,n,a=P){e.add(t);let o=()=>{e.delete(t)&&a()};return!n&&r()&&i(o),o}function I(e,...t){e.forEach(e=>{e(...t)})}var L=e=>e(),R=Symbol(),z=Symbol();function B(e,t){e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(let n in t){if(!Object.hasOwn(t,n))continue;let r=t[n],i=e[n];x(i)&&x(r)&&Object.hasOwn(e,n)&&!d(r)&&!l(r)?e[n]=B(i,r):e[n]=r}return e}var V=Symbol();function H(e){return!e||typeof e!=`object`||!Object.hasOwn(e,V)}var{assign:U}=Object;function W(e){return!!(d(e)&&e.effect)}function G(t,r,i,a){let{state:o,actions:s,getters:c}=r,l=i.state.value[t],u;function d(){return l||(i.state.value[t]=o?o():{}),U(e(i.state.value[t]),s,Object.keys(c||{}).reduce((e,r)=>(e[r]=n(h(()=>{y(i);let e=i._s.get(t);return c[r].call(e,e)})),e),{}))}return u=K(t,d,r,i,a,!0),u}function K(e,t,n={},r,i,c){let f,p=U({actions:{}},n),m={deep:!0},h,_,v=new Set,b=new Set,x=r.state.value[e];!c&&!x&&(r.state.value[e]={});let S;function C(t){let n;h=_=!1,typeof t==`function`?(t(r.state.value[e]),n={type:`patch function`,storeId:e,events:void 0}):(B(r.state.value[e],t),n={type:`patch object`,payload:t,storeId:e,events:void 0});let i=S=Symbol();o().then(()=>{S===i&&(h=!0)}),_=!0,I(v,n,r.state.value[e])}let w=c?function(){let{state:e}=n,t=e?e():{};this.$patch(e=>{U(e,t)})}:P;function T(){f.stop(),v.clear(),b.clear(),r._s.delete(e)}let E=(t,n=``)=>{if(R in t)return t[z]=n,t;let i=function(){y(r);let n=Array.from(arguments),a=new Set,o=new Set;function s(e){a.add(e)}function c(e){o.add(e)}I(b,{args:n,name:i[z],store:D,after:s,onError:c});let l;try{l=t.apply(this&&this.$id===e?this:D,n)}catch(e){throw I(o,e),e}return l instanceof Promise?l.then(e=>(I(a,e),e)).catch(e=>(I(o,e),Promise.reject(e))):(I(a,l),l)};return i[R]=!0,i[z]=n,i},D=g({_p:r,$id:e,$onAction:F.bind(null,b),$patch:C,$reset:w,$subscribe(t,n={}){if(v.has(t))return P;let i=F(v,t,n.detached,()=>o()),o=f.run(()=>a(()=>r.state.value[e],r=>{(n.flush===`sync`?_:h)&&t({storeId:e,type:`direct`,events:void 0},r)},U({},m,n)));return i},$dispose:T});r._s.set(e,D);let O=(r._a&&r._a.runWithContext||L)(()=>r._e.run(()=>(f=u()).run(()=>t({action:E}))));for(let t in O){let n=O[t];d(n)&&!W(n)||l(n)?c||(x&&H(n)&&(d(n)?n.value=x[t]:B(n,x[t])),r.state.value[e][t]=n):typeof n==`function`&&(O[t]=E(n,t),p.actions[t]=n)}return U(D,O),U(s(D),O),Object.defineProperty(D,"$state",{get:()=>r.state.value[e],set:e=>{C(t=>{U(t,e)})}}),r._p.forEach(e=>{let t=f.run(()=>e({store:D,app:r._a,pinia:r,options:p}));U(D,t)}),x&&c&&n.hydrate&&n.hydrate(D.$state,x),h=!0,_=!0,D}function q(e,n,r){let i,a=typeof n==`function`;i=a?r:n;function o(r,o){let s=c();return r||=s?t(b,null):null,r&&y(r),r=v,r._s.has(e)||(a?K(e,n,i,r):G(e,i,r)),r._s.get(e)}return o.$id=e,o}var J=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};async function Y(e,t){let n=await fetch(e,t);if(!n.ok)throw new J((await n.text()).trim()||m(`common.errors.requestFailed`,{status:n.status}),n.status);return n.json()}function X(e,t){return Y(e,t)}function Z(e,t){return Y(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})}function Q(e,t){return Y(e,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})}function $(e,t){return Y(e,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(t)})}function te(e){return Y(e,{method:`DELETE`})}var ne=q(`console`,()=>{let e=p(null),t=f(`idle`),n=f(null),r=h(()=>{let t=e.value;return t?t.personalSpaces.find(({id:e})=>e===t.activePersonalSpaceId)??t.personalSpaces[0]??null:null}),i=h(()=>e.value?.mode===`connected`?`ready`:e.value?.mode===`degraded`?`error`:`disconnected`);async function a(){t.value=`loading`;try{e.value=await X(`/api/state`),t.value=`ready`}catch(e){t.value=`error`,u(e)}}async function o(t){try{let n=await $(`/api/capture-policy`,{enabled:t});e.value&&={...e.value,capturePolicy:n},l(m(t?`console.captureNotices.enabled`:`console.captureNotices.disabled`))}catch(e){u(e)}}async function s(t){try{let n=await $(`/api/agent-access-policy`,{enabled:t});e.value&&={...e.value,agentAccessPolicy:n},l(m(t?`console.agentAccess.enabledNotice`:`console.agentAccess.disabledNotice`))}catch(e){u(e)}}function c(t){return e.value?.capabilities?.[t]===!0}function l(e){n.value={message:e,tone:`success`}}function u(e){n.value={message:e instanceof Error?e.message:m(`common.errors.operationFailed`),tone:`error`}}function d(){n.value=null}return{state:e,runtimeStatus:t,feedback:n,activePersonalSpace:r,publicRuntimeStatus:i,refresh:a,updateCapturePolicy:o,updateAgentAccessPolicy:s,hasCapability:c,notify:l,reportError:u,clearFeedback:d}});export{Z as a,$ as i,te as n,Q as o,X as r,N as s,ne as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as e,Z as t,a as n}from"./i18n-CgBHZthI.js";import{r}from"./console-tOxOl8Vq.js";var i=[`codex`,`claude`,`claude_code`,`cursor`,`gemini_cli`,`kiro`,`other`],a={codex:`Codex`,claude:`Claude`,claude_code:`Claude Code`,cursor:`Cursor`,gemini_cli:`Gemini CLI`,kiro:`Kiro`,other:`Other Agent`},o=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,s=/^[^\u0000-\u001f\u007f]{1,512}$/,c=new Set([`about`,`blob`,`data`,`file`,`javascript`]),l={codex:{enabled:!0,idFormat:`uuid`,appName:`Codex`,urlTemplate:`codex://threads/{id}`},claude:{enabled:!1,idFormat:`any`,appName:`Claude`,urlTemplate:``},claude_code:{enabled:!1,idFormat:`any`,appName:`Claude Code`,urlTemplate:``},cursor:{enabled:!1,idFormat:`any`,appName:`Cursor`,urlTemplate:``},gemini_cli:{enabled:!1,idFormat:`any`,appName:`Gemini CLI`,urlTemplate:``},kiro:{enabled:!1,idFormat:`any`,appName:`Kiro`,urlTemplate:``},other:{enabled:!1,idFormat:`any`,appName:`Other Agent`,urlTemplate:``}};function u(e={}){let t=e.source_application?.trim().toLocaleLowerCase().replaceAll(`-`,`_`).replaceAll(` `,`_`);if(t&&a[t])return t;let n=`${e.source_kind??``} ${e.source_description??``}`.toLocaleLowerCase();return n.includes(`claude`)?`claude_code`:n.includes(`cursor`)?`cursor`:n.includes(`gemini`)?`gemini_cli`:n.includes(`kiro`)?`kiro`:n.includes(`codex`)?`codex`:`other`}function d(e){let t=u(e);return t===`other`?n(`knowledge.domain.actors.otherAgent`):a[t]}function f(e){return a[e]}function p(e={},t=l){if(m(e,t)!==`available`)return null;let n=t[u(e)],r=e.session_id.trim();return n.urlTemplate.replace(`{id}`,encodeURIComponent(r))}function m(e={},t=l){let n=t[u(e)];return n?.enabled?_(e.session_id?.trim()??``,n.idFormat)?v(n.urlTemplate)?`available`:`invalid_template`:`invalid_id`:`disabled`}function h(e={},t=l){let n=t[u(e)];return n?.enabled&&n.appName.trim()?n.appName.trim():null}async function g(e={},t=globalThis.navigator?.clipboard){return!e.session_id||!t?.writeText?!1:(await t.writeText(e.session_id),!0)}function _(e,t){return s.test(e)?t===`any`||o.test(e):!1}function v(e){if(e.split(`{id}`).length!==2||/\s/.test(e))return!1;let t=/^([a-z][a-z0-9+.-]*):/i.exec(e)?.[1]?.toLocaleLowerCase();return!!t&&!c.has(t)}var y=t(w(l)),b=null;function x(){return C(),e(y)}function S(e){y.value=w(e)}function C({force:e=!1}={}){return!e&&b||(b=r(`/api/system/settings`).then(e=>{S(e.configured.conversationLaunchers)}).catch(()=>void 0)),b}function w(e){return Object.fromEntries(i.map(t=>[t,{...l[t],...e?.[t]??{}}]))}export{d as a,p as c,g as i,x as n,f as o,i as r,h as s,S as t};
|