@yeaft/webchat-agent 1.0.646 → 1.0.647

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.
@@ -1 +1 @@
1
- {"version":"1.0.646"}
1
+ {"version":"1.0.647"}
@@ -7670,7 +7670,7 @@ ${String(e||"").trim()}
7670
7670
  @confirm="confirmFolderPicker" @close="closeFolderPicker" />
7671
7671
  </form>
7672
7672
  </div>
7673
- `}});var Hk,lc,Tp=N(()=>{qs();ma();Ft();Li();Ac();Hk=["skills","mcpServers","tools"],lc={name:"PluginCenterPage",components:{NavigationIcon:Mt},emits:["close","toggle-sidebar"],data(){return{disposed:!1,skillDetail:null,skillDetailLoading:!1,skillDetailError:"",skillDetailUnsupported:!1,skillDetailSequence:0,searchQuery:"",activeCategory:"all",enabledOnly:!1,searchOpen:!1,menu:null,detailKey:null,listScrollTop:0,formBackground:[],formOpener:null,showSkillForm:!1,skillScope:"user",skillMutationLoading:!1,skillMutationError:"",skillForm:{name:"",description:"",trigger:"",content:""}}},computed:{store(){try{return window.Pinia?.useChatStore?.()||null}catch{return null}},agents(){return Wi(this.store)},agentId(){return this.store?.pluginCenterAgentId||this.store?.currentAgent||null},selectedAgent(){return this.agents.find(e=>e.id===this.agentId)||null},online(){return!!this.selectedAgent?.online&&(!this.store?.connectionState||this.store.connectionState==="connected")},agentSupportsPlugins(){return!!this.selectedAgent&&Fr(this.selectedAgent)},agentSupportsManagedSkills(){return!!this.selectedAgent&&aa(this.selectedAgent)},activeSession(){return this.store?.activePluginSession?.()||{}},projectSkillAvailable(){return this.activeSession.agentId===this.agentId&&!!this.activeSession.sessionId&&!!this.activeSession.workDir},catalogWorkDir(){return this.projectSkillAvailable?this.activeSession.workDir:""},configRecord(){return this.store?.pluginConfigByAgent?.[this.agentId]||{}},selection(){return this.configRecord.draft??this.configRecord.plugins??{}},configReady(){return this.online&&this.agentSupportsPlugins&&this.configRecord.loaded&&!this.configRecord.loading&&!(this.configRecord.error&&this.configRecord.errorOperation==="load")},catalogRecord(){let e=this.store?.pluginCatalogKey?.(this.agentId,this.catalogWorkDir);return this.store?.pluginCatalogByKey?.[e]||{}},catalog(){return{tools:[],skills:[],skillSources:[],mcpServers:[],...this.catalogRecord.catalog}},loading(){return this.online&&this.agentSupportsPlugins&&(!this.catalogRecord.loaded&&!this.catalogRecord.error||this.catalogRecord.loading||this.configRecord.loading)},loadError(){return this.catalogRecord.error||(this.configRecord.errorOperation==="load"?this.configRecord.error:"")||""},categories(){return["all",...Hk].map(e=>({id:e,label:this.$t("yeaft.plugins."+e)}))},entries(){return Hk.flatMap(e=>this.catalog[e].map(t=>({...t,field:e,key:`${e}:${t.id}`,label:t.label||t.name||t.id})))},visibleEntries(){let e=this.searchQuery.trim().toLocaleLowerCase();return this.entries.filter(t=>(this.activeCategory==="all"||this.activeCategory===t.field)&&(!this.enabledOnly||this.enabled(t))&&(!e||[t.id,t.label,t.description].some(s=>String(s||"").toLocaleLowerCase().includes(e))))},detail(){return this.entries.find(e=>e.key===this.detailKey)||null},skillCommand(){return this.detail?`/skill:${this.pluginName(this.detail)} ${this.$t("yeaft.plugins.skillExampleTask")}`:""},detailDescription(){if(!this.detail)return"";if(this.detail.field!=="skills")return this.itemDescription(this.detail);let e=String(this.skillDetail?.description||this.detail.description||"").trim();return["|",">"].includes(e)?"":e},detailSources(){return this.detail?.field==="skills"?this.catalog.skillSources.filter(e=>(e.name||e.label)===this.pluginName(this.detail)):[]},skillFormDirty(){return Object.values(this.skillForm).some(e=>e.trim())},saveErrors(){return Object.entries(this.store?.pluginConfigByAgent||{}).filter(([,e])=>e.errorOperation==="save"&&e.error)}},watch:{agentId:{immediate:!0,handler(){this.detailKey=null,this.menu=null,this.load()}},catalogWorkDir(){this.detailKey=null,this.load()},online(e,t){e&&!t&&(this.load(!0),this.loadSkillDetail()),e||(this.skillDetailSequence++,this.skillDetail=null,this.skillDetailLoading=!1,this.skillDetailError="",this.skillDetailUnsupported=!1)},detailKey(){this.loadSkillDetail()},showSkillForm(e){e?(this.formOpener=document.activeElement,this.$nextTick(()=>{this.disposed||!this.showSkillForm||(this.formBackground=[...document.body.children].filter(t=>!t.classList.contains("plugin-center-form-overlay")),this.formBackground.forEach(t=>{t.inert=!0}))})):(this.restoreFormBackground(),this.$nextTick(()=>this.formOpener?.isConnected&&this.formOpener.focus()))},activeCategory(){this.detailKey=null},searchQuery(){this.detailKey=null}},mounted(){document.addEventListener("pointerdown",this.closePopups),document.addEventListener("keydown",this.onKeydown),window.addEventListener("beforeunload",this.beforeUnload)},beforeUnmount(){this.disposed=!0,this.restoreFormBackground(),document.removeEventListener("pointerdown",this.closePopups),document.removeEventListener("keydown",this.onKeydown),window.removeEventListener("beforeunload",this.beforeUnload)},methods:{operationFence(){return{store:this.store,generation:Number(this.store?.pluginStateGeneration||0),agentId:this.agentId,workDir:this.catalogWorkDir}},operationCurrent(e){return!this.disposed&&this.store?.pluginCenterOpen&&e.store===this.store&&e.generation===Number(this.store?.pluginStateGeneration||0)&&e.agentId===this.agentId&&e.workDir===this.catalogWorkDir},restoreFormBackground(){this.formBackground.forEach(e=>{e.inert=!1}),this.formBackground=[]},async load(e=!1){if(this.disposed||!this.store?.pluginCenterOpen||!this.agentId||!this.online||!this.agentSupportsPlugins)return;let t=this.agentId,s=this.catalogWorkDir;await Promise.all([this.store.loadPluginConfig(t),e||!this.catalogRecord.loaded?this.store.loadPluginCatalog(t,s):Promise.resolve()]),!this.disposed&&t===this.agentId&&s===this.catalogWorkDir&&this.loadSkillDetail()},async loadSkillDetail(){let e=++this.skillDetailSequence;if(this.skillDetail=null,this.skillDetailError="",this.skillDetailUnsupported=!1,this.skillDetailLoading=!1,this.detail?.field!=="skills"||!this.online)return;let t=this.operationFence(),s=this.detailKey,n=this.pluginName(this.detail);this.skillDetailLoading=!0;try{let r=await this.store.loadPluginSkillDetail(n,this.agentId,this.catalogWorkDir);if(e!==this.skillDetailSequence||s!==this.detailKey||!this.operationCurrent(t)||!this.online||r?.stale)return;this.skillDetail=r?.skillDetail||null,this.skillDetailError=r?.error||"",this.skillDetailUnsupported=r?.unsupported===!0}catch(r){e===this.skillDetailSequence&&this.operationCurrent(t)&&(this.skillDetailError=r?.message||String(r))}finally{e===this.skillDetailSequence&&(this.skillDetailLoading=!1)}},pluginName(e){return e.field==="skills"&&(e.name||e.label)||e.id},enabled(e){return!Array.isArray(this.selection[e.field])||this.selection[e.field].includes(this.pluginName(e))},toggle(e){this.configReady&&this.store.setPluginEnabled(e.field,this.pluginName(e),!this.enabled(e),this.catalog[e.field].map(t=>this.pluginName({...t,field:e.field})),this.agentId)},itemSaving(e){let t=this.configRecord.plugins?.[e.field],s=!Array.isArray(t)||t.includes(this.pluginName(e));return this.configRecord.saving&&s!==this.enabled(e)},itemDescription(e){return e.field==="mcpServers"?this.$t("yeaft.plugins.mcpDescription",{count:e.toolCount||0}):e.description||this.$t(e.field==="skills"?"yeaft.plugins.skillDescription":"yeaft.plugins.toolDescription")},itemSource(e){return e.field==="mcpServers"?this.$t(e.ready===!0?"yeaft.plugins.connected":e.ready===!1?"yeaft.plugins.notConnected":"yeaft.plugins.connectionUnknown"):e.field==="tools"?this.$t("yeaft.plugins.bundled"):e.tier?this.$t("yeaft.plugins.skillTier."+e.tier):this.$t("yeaft.plugins.agentLabel")},itemIcon(e){return e.field==="skills"?"activity":e.field==="mcpServers"?"globe":"file"},agentName(e){return this.agents.find(s=>s.id===e)?.name||e},async selectAgent(e){if(e===this.agentId){this.menu=null;return}let t=this.operationFence();!await this.closeSkillForm()||!this.operationCurrent(t)||(this.store.pluginCenterAgentId=e)},toggleMenu(e){this.menu=this.menu===e?null:e,this.menu&&this.$nextTick(()=>this.$refs[e+"Menu"]?.querySelector("button")?.focus())},closePopups(e){e.target.closest(".plugin-center-menu-host")||(this.menu=null)},onKeydown(e){if(!(e.key!=="Escape"||e.defaultPrevented||sl().open))if(this.menu){let t=this.menu;this.menu=null,this.$refs[t+"Trigger"]?.focus()}else this.searchOpen?this.closeSearch():this.showSkillForm&&this.closeSkillForm()},menuKeydown(e){if(!["ArrowDown","ArrowUp","Home","End"].includes(e.key))return;let t=[...e.currentTarget.querySelectorAll("button:not(:disabled)")],s=t.indexOf(document.activeElement),n=e.key==="Home"?0:e.key==="End"?t.length-1:(s+(e.key==="ArrowDown"?1:-1)+t.length)%t.length;e.preventDefault(),t[n]?.focus()},openSearch(){this.searchOpen=!0,this.menu=null,this.$nextTick(()=>this.$refs.mobileSearch?.focus())},closeSearch(){this.searchOpen=!1,this.$nextTick(()=>this.$refs.searchTrigger?.focus())},openDetail(e){this.listScrollTop=this.$refs.content?.scrollTop||0,this.detailKey=e.key,this.menu=null,this.$nextTick(()=>{!this.disposed&&this.$refs.content&&(this.$refs.content.scrollTop=0,this.$refs.detailTitle?.focus())})},backToList(){let e=this.detailKey;this.detailKey=null,this.$nextTick(()=>{this.disposed||!this.$refs.content||(this.$refs.content.scrollTop=this.listScrollTop,[...this.$el.querySelectorAll(".plugin-center-row-main")].find(t=>t.dataset.entry===e)?.focus({preventScroll:!0}))})},resetFilters(){this.searchQuery="",this.activeCategory="all",this.enabledOnly=!1},openSkillForm(){this.menu=null,this.showSkillForm=!0,this.skillMutationError="",this.$nextTick(()=>this.$refs.skillName?.focus())},async closeSkillForm(){if(!this.showSkillForm)return!0;if(this.skillMutationLoading)return!1;if(this.skillFormDirty){let e=this.operationFence(),t=await et(this.$t("yeaft.plugins.discardSkill"));if(!this.operationCurrent(e))return!1;if(!t)return this.formBackground.forEach(s=>{s.inert=!0}),!1}return this.showSkillForm=!1,this.skillMutationError="",this.skillForm={name:"",description:"",trigger:"",content:""},!0},beforeUnload(e){this.showSkillForm&&this.skillFormDirty&&(e.preventDefault(),e.returnValue="")},formKeydown(e){if(e.key!=="Tab")return;let t=[...e.currentTarget.querySelectorAll("button:not(:disabled), input:not(:disabled), textarea:not(:disabled), select:not(:disabled)")],s=t[0],n=t.at(-1);e.shiftKey&&document.activeElement===s?(e.preventDefault(),n?.focus()):!e.shiftKey&&document.activeElement===n&&(e.preventDefault(),s?.focus())},async createSkill(){if(this.disposed||!this.store?.pluginCenterOpen||this.skillMutationLoading||!this.configReady||!this.agentSupportsManagedSkills)return;let e=this.operationFence(),t=this.agentId,s=this.catalogWorkDir,n=this.skillScope;if(!(n==="project"&&!this.projectSkillAvailable)){this.skillMutationLoading=!0,this.skillMutationError="";try{let r=await this.store.mutateManagedSkill({action:"create",scope:n,skill:{...this.skillForm},sessionId:n==="project"?this.activeSession.sessionId:""},t);if(!this.operationCurrent(e))return;if(r?.error||r?.stale){this.skillMutationError=r.error||"";return}r?.result?.name&&Array.isArray(this.selection.skills)&&this.store.setPluginEnabled("skills",r.result.name,!0,[],t),this.skillForm={name:"",description:"",trigger:"",content:""},this.showSkillForm=!1,await this.store.loadPluginCatalog(t,s)}catch(r){this.skillMutationError=r?.message||String(r)}finally{this.skillMutationLoading=!1}}},async removeSkill(e){if(this.disposed||!this.store?.pluginCenterOpen||!e.managed||this.skillMutationLoading||!this.online||!this.agentSupportsManagedSkills)return;let t=this.operationFence(),s=this.agentId,n=this.catalogWorkDir,r=this.activeSession.sessionId,i=e.tier==="project"?"project":"user";if(!(i==="project"&&!this.projectSkillAvailable)&&await et(this.$t("yeaft.plugins.confirmRemoveSkill",{name:e.label}),{destructive:!0})&&!(!this.operationCurrent(t)||!this.online)){this.skillMutationLoading=!0,this.skillMutationError="";try{let o=await this.store.mutateManagedSkill({action:"remove",scope:i,name:e.name||e.label,sessionId:i==="project"?r:""},s);if(!this.operationCurrent(t))return;o?.error||o?.stale?this.skillMutationError=o.error||"":(await this.store.loadPluginCatalog(s,n),this.operationCurrent(t)&&await this.loadSkillDetail())}catch(o){this.skillMutationError=o?.message||String(o)}finally{this.skillMutationLoading=!1}}}},template:`
7673
+ `}});var Hk,lc,Tp=N(()=>{qs();ma();Ft();Li();Ac();Hk=["skills","mcpServers","tools"],lc={name:"PluginCenterPage",components:{NavigationIcon:Mt},emits:["close","toggle-sidebar"],data(){return{disposed:!1,skillDetail:null,skillDetailLoading:!1,skillDetailError:"",skillDetailUnsupported:!1,skillDetailSequence:0,searchQuery:"",activeCategory:"all",enabledOnly:!1,searchOpen:!1,menu:null,detailKey:null,listScrollTop:0,formBackground:[],formOpener:null,showSkillForm:!1,skillScope:"user",skillMutationLoading:!1,skillMutationError:"",skillForm:{name:"",description:"",trigger:"",content:""}}},computed:{store(){try{return window.Pinia?.useChatStore?.()||null}catch{return null}},agents(){return Wi(this.store)},agentId(){return this.store?.pluginCenterAgentId||this.store?.currentAgent||null},selectedAgent(){return this.agents.find(e=>e.id===this.agentId)||null},online(){return!!this.selectedAgent?.online&&(!this.store?.connectionState||this.store.connectionState==="connected")},agentSupportsPlugins(){return!!this.selectedAgent&&Fr(this.selectedAgent)},agentSupportsManagedSkills(){return!!this.selectedAgent&&aa(this.selectedAgent)},activeSession(){return this.store?.activePluginSession?.()||{}},projectSkillAvailable(){return this.activeSession.agentId===this.agentId&&!!this.activeSession.sessionId&&!!this.activeSession.workDir},catalogWorkDir(){return this.projectSkillAvailable?this.activeSession.workDir:""},configRecord(){return this.store?.pluginConfigByAgent?.[this.agentId]||{}},selection(){return this.configRecord.draft??this.configRecord.plugins??{}},configReady(){return this.online&&this.agentSupportsPlugins&&this.configRecord.loaded&&!this.configRecord.loading&&!(this.configRecord.error&&this.configRecord.errorOperation==="load")},catalogRecord(){let e=this.store?.pluginCatalogKey?.(this.agentId,this.catalogWorkDir);return this.store?.pluginCatalogByKey?.[e]||{}},catalog(){return{tools:[],skills:[],skillSources:[],mcpServers:[],...this.catalogRecord.catalog}},loading(){return this.online&&this.agentSupportsPlugins&&(!this.catalogRecord.loaded&&!this.catalogRecord.error||this.catalogRecord.loading||this.configRecord.loading)},loadError(){return this.catalogRecord.error||(this.configRecord.errorOperation==="load"?this.configRecord.error:"")||""},categories(){return["all",...Hk].map(e=>({id:e,label:this.$t("yeaft.plugins."+e)}))},entries(){return Hk.flatMap(e=>this.catalog[e].map(t=>({...t,field:e,key:`${e}:${t.id}`,label:t.label||t.name||t.id})))},visibleEntries(){let e=this.searchQuery.trim().toLocaleLowerCase();return this.entries.filter(t=>(this.activeCategory==="all"||this.activeCategory===t.field)&&(!this.enabledOnly||this.enabled(t))&&(!e||[t.id,t.label,t.description].some(s=>String(s||"").toLocaleLowerCase().includes(e))))},detail(){return this.entries.find(e=>e.key===this.detailKey)||null},skillCommand(){return this.detail?`/skill:${this.pluginName(this.detail)} ${this.$t("yeaft.plugins.skillExampleTask")}`:""},detailDescription(){return this.detail?this.detail.field!=="skills"?this.itemDescription(this.detail):this.skillDescription(this.skillDetail?.description??this.detail.description):""},detailSources(){return this.detail?.field==="skills"?this.catalog.skillSources.filter(e=>(e.name||e.label)===this.pluginName(this.detail)):[]},skillFormDirty(){return Object.values(this.skillForm).some(e=>e.trim())},saveErrors(){return Object.entries(this.store?.pluginConfigByAgent||{}).filter(([,e])=>e.errorOperation==="save"&&e.error)}},watch:{agentId:{immediate:!0,handler(){this.detailKey=null,this.menu=null,this.load()}},catalogWorkDir(){this.detailKey=null,this.load()},online(e,t){e&&!t&&(this.load(!0),this.loadSkillDetail()),e||(this.skillDetailSequence++,this.skillDetail=null,this.skillDetailLoading=!1,this.skillDetailError="",this.skillDetailUnsupported=!1)},detailKey(){this.loadSkillDetail()},showSkillForm(e){e?(this.formOpener=document.activeElement,this.$nextTick(()=>{this.disposed||!this.showSkillForm||(this.formBackground=[...document.body.children].filter(t=>!t.classList.contains("plugin-center-form-overlay")),this.formBackground.forEach(t=>{t.inert=!0}))})):(this.restoreFormBackground(),this.$nextTick(()=>this.formOpener?.isConnected&&this.formOpener.focus()))},activeCategory(){this.detailKey=null},searchQuery(){this.detailKey=null}},mounted(){document.addEventListener("pointerdown",this.closePopups),document.addEventListener("keydown",this.onKeydown),window.addEventListener("beforeunload",this.beforeUnload)},beforeUnmount(){this.disposed=!0,this.restoreFormBackground(),document.removeEventListener("pointerdown",this.closePopups),document.removeEventListener("keydown",this.onKeydown),window.removeEventListener("beforeunload",this.beforeUnload)},methods:{operationFence(){return{store:this.store,generation:Number(this.store?.pluginStateGeneration||0),agentId:this.agentId,workDir:this.catalogWorkDir}},operationCurrent(e){return!this.disposed&&this.store?.pluginCenterOpen&&e.store===this.store&&e.generation===Number(this.store?.pluginStateGeneration||0)&&e.agentId===this.agentId&&e.workDir===this.catalogWorkDir},restoreFormBackground(){this.formBackground.forEach(e=>{e.inert=!1}),this.formBackground=[]},async load(e=!1){if(this.disposed||!this.store?.pluginCenterOpen||!this.agentId||!this.online||!this.agentSupportsPlugins)return;let t=this.agentId,s=this.catalogWorkDir;await Promise.all([this.store.loadPluginConfig(t),e||!this.catalogRecord.loaded?this.store.loadPluginCatalog(t,s):Promise.resolve()]),!this.disposed&&t===this.agentId&&s===this.catalogWorkDir&&this.loadSkillDetail()},async loadSkillDetail(){let e=++this.skillDetailSequence;if(this.skillDetail=null,this.skillDetailError="",this.skillDetailUnsupported=!1,this.skillDetailLoading=!1,this.detail?.field!=="skills"||!this.online)return;let t=this.operationFence(),s=this.detailKey,n=this.pluginName(this.detail);this.skillDetailLoading=!0;try{let r=await this.store.loadPluginSkillDetail(n,this.agentId,this.catalogWorkDir);if(e!==this.skillDetailSequence||s!==this.detailKey||!this.operationCurrent(t)||!this.online||r?.stale)return;this.skillDetail=r?.skillDetail||null,this.skillDetailError=r?.error||"",this.skillDetailUnsupported=r?.unsupported===!0}catch(r){e===this.skillDetailSequence&&this.operationCurrent(t)&&(this.skillDetailError=r?.message||String(r))}finally{e===this.skillDetailSequence&&(this.skillDetailLoading=!1)}},pluginName(e){return e.field==="skills"&&(e.name||e.label)||e.id},enabled(e){return!Array.isArray(this.selection[e.field])||this.selection[e.field].includes(this.pluginName(e))},toggle(e){this.configReady&&this.store.setPluginEnabled(e.field,this.pluginName(e),!this.enabled(e),this.catalog[e.field].map(t=>this.pluginName({...t,field:e.field})),this.agentId)},itemSaving(e){let t=this.configRecord.plugins?.[e.field],s=!Array.isArray(t)||t.includes(this.pluginName(e));return this.configRecord.saving&&s!==this.enabled(e)},skillDescription(e){let t=String(e??"").trim();return/^[|>](?:[+-][1-9]?|[1-9][+-]?)?$/.test(t)?"":t},itemDescription(e){return e.field==="skills"?this.skillDescription(e.description):e.field==="mcpServers"?this.$t("yeaft.plugins.mcpDescription",{count:e.toolCount||0}):e.description||this.$t("yeaft.plugins.toolDescription")},itemSource(e){return e.field==="mcpServers"?this.$t(e.ready===!0?"yeaft.plugins.connected":e.ready===!1?"yeaft.plugins.notConnected":"yeaft.plugins.connectionUnknown"):e.field==="tools"?this.$t("yeaft.plugins.bundled"):e.tier?this.$t("yeaft.plugins.skillTier."+e.tier):this.$t("yeaft.plugins.agentLabel")},itemIcon(e){return e.field==="skills"?"activity":e.field==="mcpServers"?"globe":"file"},agentName(e){return this.agents.find(s=>s.id===e)?.name||e},async selectAgent(e){if(e===this.agentId){this.menu=null;return}let t=this.operationFence();!await this.closeSkillForm()||!this.operationCurrent(t)||(this.store.pluginCenterAgentId=e)},toggleMenu(e){this.menu=this.menu===e?null:e,this.menu&&this.$nextTick(()=>this.$refs[e+"Menu"]?.querySelector("button")?.focus())},closePopups(e){e.target.closest(".plugin-center-menu-host")||(this.menu=null)},onKeydown(e){if(!(e.key!=="Escape"||e.defaultPrevented||sl().open))if(this.menu){let t=this.menu;this.menu=null,this.$refs[t+"Trigger"]?.focus()}else this.searchOpen?this.closeSearch():this.showSkillForm&&this.closeSkillForm()},menuKeydown(e){if(!["ArrowDown","ArrowUp","Home","End"].includes(e.key))return;let t=[...e.currentTarget.querySelectorAll("button:not(:disabled)")],s=t.indexOf(document.activeElement),n=e.key==="Home"?0:e.key==="End"?t.length-1:(s+(e.key==="ArrowDown"?1:-1)+t.length)%t.length;e.preventDefault(),t[n]?.focus()},openSearch(){this.searchOpen=!0,this.menu=null,this.$nextTick(()=>this.$refs.mobileSearch?.focus())},closeSearch(){this.searchOpen=!1,this.$nextTick(()=>this.$refs.searchTrigger?.focus())},openDetail(e){this.listScrollTop=this.$refs.content?.scrollTop||0,this.detailKey=e.key,this.menu=null,this.$nextTick(()=>{!this.disposed&&this.$refs.content&&(this.$refs.content.scrollTop=0,this.$refs.detailTitle?.focus())})},backToList(){let e=this.detailKey;this.detailKey=null,this.$nextTick(()=>{this.disposed||!this.$refs.content||(this.$refs.content.scrollTop=this.listScrollTop,[...this.$el.querySelectorAll(".plugin-center-row-main")].find(t=>t.dataset.entry===e)?.focus({preventScroll:!0}))})},resetFilters(){this.searchQuery="",this.activeCategory="all",this.enabledOnly=!1},openSkillForm(){this.menu=null,this.showSkillForm=!0,this.skillMutationError="",this.$nextTick(()=>this.$refs.skillName?.focus())},async closeSkillForm(){if(!this.showSkillForm)return!0;if(this.skillMutationLoading)return!1;if(this.skillFormDirty){let e=this.operationFence(),t=await et(this.$t("yeaft.plugins.discardSkill"));if(!this.operationCurrent(e))return!1;if(!t)return this.formBackground.forEach(s=>{s.inert=!0}),!1}return this.showSkillForm=!1,this.skillMutationError="",this.skillForm={name:"",description:"",trigger:"",content:""},!0},beforeUnload(e){this.showSkillForm&&this.skillFormDirty&&(e.preventDefault(),e.returnValue="")},formKeydown(e){if(e.key!=="Tab")return;let t=[...e.currentTarget.querySelectorAll("button:not(:disabled), input:not(:disabled), textarea:not(:disabled), select:not(:disabled)")],s=t[0],n=t.at(-1);e.shiftKey&&document.activeElement===s?(e.preventDefault(),n?.focus()):!e.shiftKey&&document.activeElement===n&&(e.preventDefault(),s?.focus())},async createSkill(){if(this.disposed||!this.store?.pluginCenterOpen||this.skillMutationLoading||!this.configReady||!this.agentSupportsManagedSkills)return;let e=this.operationFence(),t=this.agentId,s=this.catalogWorkDir,n=this.skillScope;if(!(n==="project"&&!this.projectSkillAvailable)){this.skillMutationLoading=!0,this.skillMutationError="";try{let r=await this.store.mutateManagedSkill({action:"create",scope:n,skill:{...this.skillForm},sessionId:n==="project"?this.activeSession.sessionId:""},t);if(!this.operationCurrent(e))return;if(r?.error||r?.stale){this.skillMutationError=r.error||"";return}r?.result?.name&&Array.isArray(this.selection.skills)&&this.store.setPluginEnabled("skills",r.result.name,!0,[],t),this.skillForm={name:"",description:"",trigger:"",content:""},this.showSkillForm=!1,await this.store.loadPluginCatalog(t,s)}catch(r){this.skillMutationError=r?.message||String(r)}finally{this.skillMutationLoading=!1}}},async removeSkill(e){if(this.disposed||!this.store?.pluginCenterOpen||!e.managed||this.skillMutationLoading||!this.online||!this.agentSupportsManagedSkills)return;let t=this.operationFence(),s=this.agentId,n=this.catalogWorkDir,r=this.activeSession.sessionId,i=e.tier==="project"?"project":"user";if(!(i==="project"&&!this.projectSkillAvailable)&&await et(this.$t("yeaft.plugins.confirmRemoveSkill",{name:e.label}),{destructive:!0})&&!(!this.operationCurrent(t)||!this.online)){this.skillMutationLoading=!0,this.skillMutationError="";try{let o=await this.store.mutateManagedSkill({action:"remove",scope:i,name:e.name||e.label,sessionId:i==="project"?r:""},s);if(!this.operationCurrent(t))return;o?.error||o?.stale?this.skillMutationError=o.error||"":(await this.store.loadPluginCatalog(s,n),this.operationCurrent(t)&&await this.loadSkillDetail())}catch(o){this.skillMutationError=o?.message||String(o)}finally{this.skillMutationLoading=!1}}}},template:`
7674
7674
  <section class="plugin-center-page" :aria-label="$t('yeaft.plugins.title')">
7675
7675
  <div class="plugin-center-workspace" :inert="showSkillForm || null">
7676
7676
  <header class="plugin-center-header" :aria-label="$t('yeaft.plugins.toolbar')">
@@ -7743,7 +7743,7 @@ ${String(e||"").trim()}
7743
7743
  <div v-else class="plugin-center-catalog">
7744
7744
  <button v-if="enabledOnly" type="button" class="btn-ghost plugin-center-filter" @click="enabledOnly = false">{{ $t('yeaft.plugins.enabledOnly') }}<NavigationIcon name="close" :size="12" /></button>
7745
7745
  <article v-for="item in visibleEntries" :key="item.key" class="plugin-center-row" :data-entry="item.key">
7746
- <button type="button" class="plugin-center-row-main" :data-entry="item.key" :aria-label="$t('yeaft.plugins.viewDetails', { name: item.label })" @click="openDetail(item)"><span class="plugin-center-entry-icon"><NavigationIcon :name="itemIcon(item)" :size="21" /></span><span class="plugin-center-row-copy"><strong>{{ item.label }}</strong><small>{{ itemDescription(item) }}</small></span></button>
7746
+ <button type="button" class="plugin-center-row-main" :data-entry="item.key" :aria-label="$t('yeaft.plugins.viewDetails', { name: item.label })" @click="openDetail(item)"><span class="plugin-center-entry-icon"><NavigationIcon :name="itemIcon(item)" :size="21" /></span><span class="plugin-center-row-copy"><strong>{{ item.label }}</strong><small v-if="itemDescription(item)">{{ itemDescription(item) }}</small></span></button>
7747
7747
  <span class="plugin-center-row-meta"><span>{{ $t('yeaft.plugins.' + item.field) }}</span><span class="plugin-center-origin" :class="{ 'is-connected': item.field === 'mcpServers' && item.ready === true }">{{ itemSource(item) }}</span></span>
7748
7748
  <span class="plugin-center-save-indicator" :class="{ 'is-visible': itemSaving(item) }" role="status" :aria-label="itemSaving(item) ? $t('common.saving') : ''"></span>
7749
7749
  <button type="button" class="plugin-center-switch" role="switch" :aria-checked="enabled(item)" :aria-label="$t('yeaft.plugins.toggleLabel', { name: item.label })" :disabled="!configReady" @click="toggle(item)"><span></span></button>
Binary file
@@ -17,6 +17,6 @@
17
17
  </head>
18
18
  <body>
19
19
  <div id="app"></div>
20
- <script type="module" src="app.bundle.js?v=b1faa743"></script>
20
+ <script type="module" src="app.bundle.js?v=d55dd7dc"></script>
21
21
  </body>
22
22
  </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeaft/webchat-agent",
3
- "version": "1.0.646",
3
+ "version": "1.0.647",
4
4
  "description": "Remote worker agent for Yeaft Web Code Agent — connects the native Yeaft engine, CLI providers, and workbench tools",
5
5
  "main": "index.js",
6
6
  "type": "module",