@yeaft/webchat-agent 1.0.562 → 1.0.565
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/local-runtime/version.json +1 -1
- package/local-runtime/web/app.bundle.js +27 -19
- package/local-runtime/web/app.bundle.js.gz +0 -0
- package/local-runtime/web/index.html +2 -2
- package/local-runtime/web/style.bundle.css +1 -1
- package/local-runtime/web/style.bundle.css.gz +0 -0
- package/package.json +1 -1
- package/yeaft/web-bridge.js +13 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.0.
|
|
1
|
+
{"version":"1.0.565"}
|
|
@@ -311,34 +311,42 @@ They will restart after upgrading. {skipped} other Agent(s) will be skipped beca
|
|
|
311
311
|
<div class="folder-picker-dialog" ref="dialog" role="dialog" aria-modal="true" :aria-label="$t('modal.folderPicker.title')">
|
|
312
312
|
<header class="folder-picker-header">
|
|
313
313
|
<h3>{{ $t('modal.folderPicker.title') }}</h3>
|
|
314
|
-
<button class="btn-ghost" type="button" @click="$emit('close')" :aria-label="$t('common.close')"
|
|
314
|
+
<button class="btn btn-ghost folder-picker-icon" type="button" @click="$emit('close')" :aria-label="$t('common.close')" :title="$t('common.close')">
|
|
315
|
+
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true"><path d="m6 6 12 12M18 6 6 18"/></svg>
|
|
316
|
+
</button>
|
|
315
317
|
</header>
|
|
316
318
|
<div class="folder-picker-path">
|
|
317
|
-
<div class="folder-picker-navigation">
|
|
318
|
-
<button class="btn-secondary" type="button" @click="navigate('')">{{ $t('modal.folderPicker.root') }}</button>
|
|
319
|
-
<button class="btn-ghost" type="button" @click="navigate(parentPath)" :disabled="!state.path || state.path === parentPath">{{ $t('modal.folderPicker.parentDir') }}</button>
|
|
320
|
-
</div>
|
|
321
319
|
<div class="folder-picker-address">
|
|
322
|
-
<input ref="pathInput" class="folder-picker-input" type="text" :value="state.draft"
|
|
320
|
+
<input ref="pathInput" class="resume-input folder-picker-input" type="text" :value="state.draft"
|
|
323
321
|
:aria-label="$t('modal.folderPicker.path')" :placeholder="$t('modal.folderPicker.path')"
|
|
324
322
|
autocomplete="off" autocapitalize="off" spellcheck="false"
|
|
325
323
|
@input="$emit('edit-path', $event.target.value)" @keydown.enter.prevent.stop="go" />
|
|
326
|
-
<button class="btn-secondary" type="button" @click="go" :disabled="!state.draft.trim()"
|
|
324
|
+
<button class="btn btn-secondary folder-picker-icon" type="button" @click="go" :disabled="!state.draft.trim()" :aria-label="$t('modal.folderPicker.go')" :title="$t('modal.folderPicker.go')">
|
|
325
|
+
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14m-6-6 6 6-6 6"/></svg>
|
|
326
|
+
</button>
|
|
327
|
+
</div>
|
|
328
|
+
<div class="folder-picker-navigation">
|
|
329
|
+
<button class="btn btn-ghost folder-picker-root" type="button" @click="navigate('')">
|
|
330
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 4-3 10v5a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1v-5L19 4Z"/><path d="M2 14h20M6 17h.01M10 17h.01"/></svg>
|
|
331
|
+
{{ $t('modal.folderPicker.root') }}
|
|
332
|
+
</button>
|
|
333
|
+
<button class="btn btn-ghost folder-picker-icon" type="button" @click="navigate(parentPath)" :disabled="!state.path || state.path === parentPath" :aria-label="$t('modal.folderPicker.parentDir')" :title="$t('modal.folderPicker.parentDir')">
|
|
334
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 19V5m-6 6 6-6 6 6"/></svg>
|
|
335
|
+
</button>
|
|
336
|
+
<nav class="folder-picker-breadcrumbs" :aria-label="$t('modal.folderPicker.ancestors')">
|
|
337
|
+
<template v-for="(crumb, index) in breadcrumbs" :key="crumb.path">
|
|
338
|
+
<span v-if="index" aria-hidden="true">/</span>
|
|
339
|
+
<button class="btn btn-ghost" type="button" @click="navigate(crumb.path)" :aria-current="index === breadcrumbs.length - 1 ? 'location' : undefined" :title="crumb.path">{{ crumb.label }}</button>
|
|
340
|
+
</template>
|
|
341
|
+
</nav>
|
|
327
342
|
</div>
|
|
328
|
-
<nav class="folder-picker-breadcrumbs" :aria-label="$t('modal.folderPicker.ancestors')">
|
|
329
|
-
<template v-for="(crumb, index) in breadcrumbs" :key="crumb.path">
|
|
330
|
-
<span v-if="index" aria-hidden="true">\u203A</span>
|
|
331
|
-
<button class="btn-ghost" type="button" @click="navigate(crumb.path)" :aria-current="index === breadcrumbs.length - 1 ? 'location' : undefined" :title="crumb.path">{{ crumb.label }}</button>
|
|
332
|
-
</template>
|
|
333
|
-
<span v-if="!breadcrumbs.length">{{ state.path || $t('modal.folderPicker.root') }}</span>
|
|
334
|
-
</nav>
|
|
335
343
|
</div>
|
|
336
344
|
<div class="folder-picker-list" ref="list" tabindex="0" :aria-label="$t('modal.folderPicker.directories')" :aria-busy="state.loading" @keydown="onListKeydown">
|
|
337
345
|
<div class="folder-picker-state" v-if="state.loading" role="status"><span class="spinner-mini"></span> {{ $t('common.loading') }}</div>
|
|
338
346
|
<div class="folder-picker-state folder-picker-error" v-else-if="state.error" role="alert">
|
|
339
347
|
<span>{{ $t('modal.folderPicker.' + state.error) }}</span>
|
|
340
348
|
<span v-if="state.errorDetail" class="folder-picker-error-detail">{{ state.errorDetail }}</span>
|
|
341
|
-
<button class="btn-secondary" type="button" @click="navigate(state.path)">{{ $t('common.retry') }}</button>
|
|
349
|
+
<button class="btn btn-secondary" type="button" @click="navigate(state.path)">{{ $t('common.retry') }}</button>
|
|
342
350
|
</div>
|
|
343
351
|
<template v-else>
|
|
344
352
|
<button v-for="entry in state.entries" :key="entry.name" class="folder-picker-item" type="button" @click="enter(entry)">
|
|
@@ -351,8 +359,8 @@ They will restart after upgrading. {skipped} other Agent(s) will be skipped beca
|
|
|
351
359
|
<footer class="folder-picker-footer">
|
|
352
360
|
<p>{{ $t('modal.folderPicker.navigationHint') }}</p>
|
|
353
361
|
<div>
|
|
354
|
-
<button class="btn-secondary" type="button" @click="$emit('close')">{{ $t('common.cancel') }}</button>
|
|
355
|
-
<button class="btn-primary" type="button" @click="$emit('confirm')" :disabled="!state.canConfirm">{{ $t('modal.folderPicker.selectCurrent') }}</button>
|
|
362
|
+
<button class="btn btn-secondary" type="button" @click="$emit('close')">{{ $t('common.cancel') }}</button>
|
|
363
|
+
<button class="btn btn-primary" type="button" @click="$emit('confirm')" :disabled="!state.canConfirm">{{ $t('modal.folderPicker.selectCurrent') }}</button>
|
|
356
364
|
</div>
|
|
357
365
|
</footer>
|
|
358
366
|
</div>
|
|
@@ -8337,7 +8345,7 @@ ${String(e||"").trim()}
|
|
|
8337
8345
|
@navigate="loadFolderPickerDir" @edit-path="folderPickerEditPath"
|
|
8338
8346
|
@confirm="confirmFolderPicker" @close="closeFolderPicker" />
|
|
8339
8347
|
</Teleport>
|
|
8340
|
-
`}});var Zv,Jv=V(()=>{io();nl();Zv={name:"PluginCenterPage",emits:["close"],data(){return{saving:!1,error:"",selection:null,savedSelection:null,searchQuery:"",activeCategory:"all",configLoading:!1,configLoadError:"",configLoadedAgentId:null,configLoadGeneration:0,refreshGeneration:0,saveGeneration:0,skillMutationLoading:!1,skillMutationError:"",skillScope:"user",showSkillForm:!1,skillForm:{name:"",description:"",trigger:"",content:""}}},computed:{store(){try{return window.Pinia?.useChatStore?.()||null}catch{return null}},agents(){return(this.store?.agents||[]).filter(e=>e?.online)},agentId(){return this.store?.pluginCenterAgentId||this.store?.currentAgent||null},selectedAgent(){return this.agents.find(e=>e.id===this.agentId)||null},agentSupportsPlugins(){return Gn(this.selectedAgent)},agentSupportsManagedSkills(){return oo(this.selectedAgent)},skillManagementUnavailableMessage(){return this.selectedAgent?.capabilityMetadataProvided===!0?this.$t("yeaft.plugins.skillManagementUpgradeRequired"):this.$t("yeaft.plugins.skillManagementVersionUnknown")},activeSession(){return this.store?.activePluginSession?.()||{sessionId:"",agentId:"",workDir:""}},projectSkillAvailable(){return this.activeSession.agentId===this.agentId&&!!this.activeSession.sessionId&&!!this.activeSession.workDir},configRecord(){return this.store?.pluginConfigByAgent?.[this.agentId]||null},catalogWorkDir(){return this.projectSkillAvailable?this.activeSession.workDir:""},catalogRecord(){let e=this.store?.pluginCatalogKey?.(this.agentId,this.catalogWorkDir);return e&&this.store?.pluginCatalogByKey?.[e]||null},catalog(){return this.catalogRecord?.catalog||{tools:[],skills:[],skillSources:[],mcpServers:[]}},managedSkillSources(){return Array.isArray(this.catalog.skillSources)?this.catalog.skillSources.filter(e=>e?.managed):[]},loading(){return this.agentSupportsPlugins&&(!this.catalogRecord||!!this.catalogRecord.loading)},configReady(){return!!this.agentId&&this.agentSupportsPlugins&&this.configLoadedAgentId===this.agentId&&!this.configLoading&&!this.configLoadError},hasCatalog(){return this.catalog.tools.length+this.catalog.skills.length+this.catalog.mcpServers.length>0},hasExplicitSelection(){return!!this.selection&&Object.keys(this.selection).length>0},enabledCount(){return this.hasExplicitSelection?["tools","skills","mcpServers"].reduce((e,t)=>e+(Array.isArray(this.selection[t])?this.selection[t].length:this.catalog[t].length),0):this.catalog.tools.length+this.catalog.skills.length+this.catalog.mcpServers.length},totalCount(){return this.catalog.tools.length+this.catalog.skills.length+this.catalog.mcpServers.length},categoryDefinitions(){return[{id:"all",label:this.$t("yeaft.plugins.all"),count:this.totalCount},{id:"tools",label:this.$t("yeaft.plugins.tools"),count:this.catalog.tools.length},{id:"skills",label:this.$t("yeaft.plugins.skills"),count:this.catalog.skills.length},{id:"mcpServers",label:this.$t("yeaft.plugins.mcpServers"),count:this.catalog.mcpServers.length}]},normalizedSearchQuery(){return this.searchQuery.trim().toLocaleLowerCase()},filteredCatalog(){let e=t=>{if(!this.normalizedSearchQuery)return!0;let s=[t?.id,t?.name,t?.label,t?.description];return Number.isFinite(t?.toolCount)&&s.push(String(t.toolCount)),s.filter(Boolean).some(n=>String(n).toLocaleLowerCase().includes(this.normalizedSearchQuery))};return{tools:this.catalog.tools.filter(e),skills:this.catalog.skills.filter(e),mcpServers:this.catalog.mcpServers.filter(e)}},visibleCategories(){return["tools","skills","mcpServers"].filter(e=>(this.activeCategory==="all"||this.activeCategory===e)&&this.filteredCatalog[e].length>0)},hasSearchResults(){return this.visibleCategories.length>0},visibleResultCount(){return this.visibleCategories.reduce((e,t)=>e+this.filteredCatalog[t].length,0)},isDirty(){return JSON.stringify(this.normalizedSelection(this.selection))!==JSON.stringify(this.normalizedSelection(this.savedSelection))},statusSummary(){return this.hasExplicitSelection?this.$t("yeaft.plugins.selectedSummary",{count:this.enabledCount}):this.$t("yeaft.plugins.allAvailable")}},watch:{catalogWorkDir(e,t){e===t||!this.agentId||!this.agentSupportsPlugins||this.store?.loadPluginCatalog?.(this.agentId,e).catch(()=>{})},agentId:{immediate:!0,handler(e){if(++this.configLoadGeneration,++this.refreshGeneration,++this.saveGeneration,this.saving=!1,this.error="",!e){this.selection=null,this.savedSelection=null,this.searchQuery="",this.activeCategory="all",this.configLoading=!1,this.configLoadError="",this.configLoadedAgentId=null;return}if(this.searchQuery="",this.activeCategory="all",!this.agentSupportsPlugins){this.selection=null,this.savedSelection=null,this.configLoading=!1,this.configLoadError=this.$t("yeaft.plugins.upgradeRequired"),this.configLoadedAgentId=null;return}this.loadConfig(e),this.store?.loadPluginCatalog?.(e,this.catalogWorkDir).catch(()=>{})}}},methods:{loadConfig(e=this.agentId,t=++this.configLoadGeneration){if(!e)return;if(++this.refreshGeneration,++this.saveGeneration,this.saving=!1,this.selection=null,this.savedSelection=null,this.configLoadedAgentId=null,this.configLoading=!1,this.configLoadError="",!this.agentSupportsPlugins){this.configLoadError=this.$t("yeaft.plugins.upgradeRequired");return}if(this.configRecord?.loaded&&!this.configRecord?.error){this.selection=this.copySelection(this.configRecord.plugins),this.savedSelection=this.copySelection(this.configRecord.plugins),this.configLoadedAgentId=e;return}let s=this.store?.loadPluginConfig?.(e);this.configLoading=!0,Promise.resolve(s).then(n=>{if(!(t!==this.configLoadGeneration||e!==this.agentId)){if(n?.error){this.configLoadError=n.error;return}this.selection=this.copySelection(n?.plugins),this.savedSelection=this.copySelection(n?.plugins),this.configLoadedAgentId=e}}).catch(n=>{t!==this.configLoadGeneration||e!==this.agentId||(this.configLoadError=n?.message||String(n))}).finally(()=>{t===this.configLoadGeneration&&e===this.agentId&&(this.configLoading=!1)})},copySelection(e={}){let t={};for(let s of["tools","skills","mcpServers"])Array.isArray(e?.[s])&&(t[s]=[...e[s]]);return t},normalizedSelection(e={}){let t={};for(let s of["tools","skills","mcpServers"])Array.isArray(e?.[s])&&(t[s]=[...e[s]].sort());return t},pluginName(e,t){return e==="skills"&&(t?.name||t?.label)||t?.id},enabled(e,t){let s=this.pluginName(e,t);return!this.selection||!Array.isArray(this.selection[e])?!0:this.selection[e].includes(s)},toggle(e,t,s){if(!this.configReady||this.saving)return;let n=this.pluginName(e,t);if(!n)return;let r=this.selection||{},i=new Set(Array.isArray(r[e])?r[e]:this.catalog[e].map(o=>this.pluginName(e,o)));s?i.add(n):i.delete(n),this.selection={...r,[e]:[...i]}},useAll(){!this.configReady||this.saving||(this.selection={},this.error="")},async refresh(){if(!this.agentId||!this.agentSupportsPlugins)return;let e=this.agentId,t=this.configLoadGeneration,s=++this.refreshGeneration,n=()=>e===this.agentId&&t===this.configLoadGeneration&&s===this.refreshGeneration;this.error="";try{let r=await this.store?.loadPluginCatalog?.(e,this.catalogWorkDir);n()&&r?.error&&(this.error=r.error)}catch(r){n()&&(this.error=r?.message||String(r))}},async save(){if(this.saving||!this.agentId||!this.agentSupportsPlugins||!this.configReady)return;let e=this.agentId,t=this.configLoadGeneration,s=++this.saveGeneration,n=this.copySelection(this.selection||{}),r=()=>e===this.agentId&&t===this.configLoadGeneration&&s===this.saveGeneration;this.saving=!0,this.error="";try{let i=await this.store?.savePluginConfig?.(n,e);if(!r())return;if(i?.error)this.error=i.error;else{let o=this.copySelection(i?.plugins??n);this.selection=o,this.savedSelection=this.copySelection(o)}}catch(i){r()&&(this.error=i?.message||String(i))}finally{r()&&(this.saving=!1)}},resetSkillForm(){this.skillForm.name="",this.skillForm.description="",this.skillForm.trigger="",this.skillForm.content="",this.skillMutationError=""},async refreshCatalogForSkillScope(){await this.store?.loadPluginCatalog?.(this.agentId,this.catalogWorkDir)},async createSkill(){if(!(this.skillMutationLoading||!this.agentSupportsManagedSkills)){if(this.skillScope==="project"&&!this.projectSkillAvailable){this.skillMutationError=this.$t("yeaft.plugins.projectScopeUnavailable");return}this.skillMutationLoading=!0,this.skillMutationError="";try{let e=await this.store?.mutateManagedSkill?.({action:"create",scope:this.skillScope,skill:{...this.skillForm},sessionId:this.skillScope==="project"?this.activeSession.sessionId:""},this.agentId);if(e?.error){this.skillMutationError=e.error;return}let t=typeof e?.result?.name=="string"?e.result.name.trim():"";t&&Array.isArray(this.selection?.skills)&&(this.selection={...this.selection,skills:[...new Set([...this.selection.skills,t])]}),this.resetSkillForm(),this.showSkillForm=!1,await this.refreshCatalogForSkillScope()}catch(e){this.skillMutationError=e?.message||String(e)}finally{this.skillMutationLoading=!1}}},async removeSkill(e){if(!e?.managed||this.skillMutationLoading||!this.agentSupportsManagedSkills)return;let t=e.tier==="project"?"project":"user";if(t==="project"&&!this.projectSkillAvailable){this.skillMutationError=this.$t("yeaft.plugins.projectScopeUnavailable");return}if(confirm(this.$t("yeaft.plugins.confirmRemoveSkill",{name:e.label}))){this.skillMutationLoading=!0,this.skillMutationError="";try{let s=await this.store?.mutateManagedSkill?.({action:"remove",scope:t,name:e.name||e.label,sessionId:t==="project"?this.activeSession.sessionId:""},this.agentId);s?.error?this.skillMutationError=s.error:await this.refreshCatalogForSkillScope()}catch(s){this.skillMutationError=s?.message||String(s)}finally{this.skillMutationLoading=!1}}},selectAgent(e){!e||e===this.agentId||(this.store.pluginCenterAgentId=e)}},template:`
|
|
8348
|
+
`}});var Zv,Jv=V(()=>{io();nl();Zv={name:"PluginCenterPage",emits:["close"],data(){return{saving:!1,error:"",selection:null,savedSelection:null,searchQuery:"",activeCategory:"all",configLoading:!1,configLoadError:"",configLoadedAgentId:null,configLoadGeneration:0,refreshGeneration:0,saveGeneration:0,skillMutationLoading:!1,skillMutationError:"",skillScope:"user",showSkillForm:!1,skillForm:{name:"",description:"",trigger:"",content:""}}},computed:{store(){try{return window.Pinia?.useChatStore?.()||null}catch{return null}},agents(){return(this.store?.agents||[]).filter(e=>e?.online)},agentId(){return this.store?.pluginCenterAgentId||this.store?.currentAgent||null},selectedAgent(){return this.agents.find(e=>e.id===this.agentId)||null},agentSupportsPlugins(){return Gn(this.selectedAgent)},agentSupportsManagedSkills(){return oo(this.selectedAgent)},skillManagementUnavailableMessage(){return this.selectedAgent?.capabilityMetadataProvided===!0?this.$t("yeaft.plugins.skillManagementUpgradeRequired"):this.$t("yeaft.plugins.skillManagementVersionUnknown")},activeSession(){return this.store?.activePluginSession?.()||{sessionId:"",agentId:"",workDir:""}},projectSkillAvailable(){return this.activeSession.agentId===this.agentId&&!!this.activeSession.sessionId&&!!this.activeSession.workDir},configRecord(){return this.store?.pluginConfigByAgent?.[this.agentId]||null},catalogWorkDir(){return this.projectSkillAvailable?this.activeSession.workDir:""},catalogRecord(){let e=this.store?.pluginCatalogKey?.(this.agentId,this.catalogWorkDir);return e&&this.store?.pluginCatalogByKey?.[e]||null},catalog(){return this.catalogRecord?.catalog||{tools:[],skills:[],skillSources:[],mcpServers:[]}},managedSkillSources(){return Array.isArray(this.catalog.skillSources)?this.catalog.skillSources.filter(e=>e?.managed):[]},loading(){return this.agentSupportsPlugins&&(!this.catalogRecord||!!this.catalogRecord.loading)},configReady(){return!!this.agentId&&this.agentSupportsPlugins&&this.configLoadedAgentId===this.agentId&&!this.configLoading&&!this.configLoadError},hasCatalog(){return this.catalog.tools.length+this.catalog.skills.length+this.catalog.mcpServers.length>0},hasExplicitSelection(){return!!this.selection&&Object.keys(this.selection).length>0},enabledCount(){return this.hasExplicitSelection?["tools","skills","mcpServers"].reduce((e,t)=>e+(Array.isArray(this.selection[t])?this.selection[t].length:this.catalog[t].length),0):this.catalog.tools.length+this.catalog.skills.length+this.catalog.mcpServers.length},totalCount(){return this.catalog.tools.length+this.catalog.skills.length+this.catalog.mcpServers.length},categoryDefinitions(){return[{id:"all",label:this.$t("yeaft.plugins.all"),count:this.totalCount},{id:"tools",label:this.$t("yeaft.plugins.tools"),count:this.catalog.tools.length},{id:"skills",label:this.$t("yeaft.plugins.skills"),count:this.catalog.skills.length},{id:"mcpServers",label:this.$t("yeaft.plugins.mcpServers"),count:this.catalog.mcpServers.length}]},normalizedSearchQuery(){return this.searchQuery.trim().toLocaleLowerCase()},filteredCatalog(){let e=t=>{if(!this.normalizedSearchQuery)return!0;let s=[t?.id,t?.name,t?.label,t?.description];return Number.isFinite(t?.toolCount)&&s.push(String(t.toolCount)),s.filter(Boolean).some(n=>String(n).toLocaleLowerCase().includes(this.normalizedSearchQuery))};return{tools:this.catalog.tools.filter(e),skills:this.catalog.skills.filter(e),mcpServers:this.catalog.mcpServers.filter(e)}},visibleCategories(){return["tools","skills","mcpServers"].filter(e=>(this.activeCategory==="all"||this.activeCategory===e)&&this.filteredCatalog[e].length>0)},hasSearchResults(){return this.visibleCategories.length>0},visibleResultCount(){return this.visibleCategories.reduce((e,t)=>e+this.filteredCatalog[t].length,0)},isDirty(){return JSON.stringify(this.normalizedSelection(this.selection))!==JSON.stringify(this.normalizedSelection(this.savedSelection))},statusSummary(){if(!this.agentId)return this.$t("yeaft.plugins.noAgent");if(!this.agentSupportsPlugins)return this.$t("yeaft.plugins.upgradeRequired");if(this.loading||this.configLoading)return this.$t("yeaft.plugins.loading");let e=this.catalogRecord?.error||this.configLoadError;return e?this.$t("yeaft.plugins.loadError",{error:e}):this.hasCatalog?this.hasExplicitSelection?this.$t("yeaft.plugins.selectedSummary",{count:this.enabledCount}):this.$t("yeaft.plugins.allAvailable"):this.$t("yeaft.plugins.empty")}},watch:{catalogWorkDir(e,t){e===t||!this.agentId||!this.agentSupportsPlugins||this.store?.loadPluginCatalog?.(this.agentId,e).catch(()=>{})},agentId:{immediate:!0,handler(e){if(++this.configLoadGeneration,++this.refreshGeneration,++this.saveGeneration,this.saving=!1,this.error="",!e){this.selection=null,this.savedSelection=null,this.searchQuery="",this.activeCategory="all",this.configLoading=!1,this.configLoadError="",this.configLoadedAgentId=null;return}if(this.searchQuery="",this.activeCategory="all",!this.agentSupportsPlugins){this.selection=null,this.savedSelection=null,this.configLoading=!1,this.configLoadError=this.$t("yeaft.plugins.upgradeRequired"),this.configLoadedAgentId=null;return}this.loadConfig(e),this.store?.loadPluginCatalog?.(e,this.catalogWorkDir).catch(()=>{})}}},methods:{loadConfig(e=this.agentId,t=++this.configLoadGeneration){if(!e)return;if(++this.refreshGeneration,++this.saveGeneration,this.saving=!1,this.selection=null,this.savedSelection=null,this.configLoadedAgentId=null,this.configLoading=!1,this.configLoadError="",!this.agentSupportsPlugins){this.configLoadError=this.$t("yeaft.plugins.upgradeRequired");return}if(this.configRecord?.loaded&&!this.configRecord?.error){this.selection=this.copySelection(this.configRecord.plugins),this.savedSelection=this.copySelection(this.configRecord.plugins),this.configLoadedAgentId=e;return}let s=this.store?.loadPluginConfig?.(e);this.configLoading=!0,Promise.resolve(s).then(n=>{if(!(t!==this.configLoadGeneration||e!==this.agentId)){if(n?.error){this.configLoadError=n.error;return}this.selection=this.copySelection(n?.plugins),this.savedSelection=this.copySelection(n?.plugins),this.configLoadedAgentId=e}}).catch(n=>{t!==this.configLoadGeneration||e!==this.agentId||(this.configLoadError=n?.message||String(n))}).finally(()=>{t===this.configLoadGeneration&&e===this.agentId&&(this.configLoading=!1)})},copySelection(e={}){let t={};for(let s of["tools","skills","mcpServers"])Array.isArray(e?.[s])&&(t[s]=[...e[s]]);return t},normalizedSelection(e={}){let t={};for(let s of["tools","skills","mcpServers"])Array.isArray(e?.[s])&&(t[s]=[...e[s]].sort());return t},pluginName(e,t){return e==="skills"&&(t?.name||t?.label)||t?.id},enabled(e,t){let s=this.pluginName(e,t);return!this.selection||!Array.isArray(this.selection[e])?!0:this.selection[e].includes(s)},toggle(e,t,s){if(!this.configReady||this.saving)return;let n=this.pluginName(e,t);if(!n)return;let r=this.selection||{},i=new Set(Array.isArray(r[e])?r[e]:this.catalog[e].map(o=>this.pluginName(e,o)));s?i.add(n):i.delete(n),this.selection={...r,[e]:[...i]}},useAll(){!this.configReady||this.saving||(this.selection={},this.error="")},async refresh(){if(!this.agentId||!this.agentSupportsPlugins)return;let e=this.agentId,t=this.configLoadGeneration,s=++this.refreshGeneration,n=()=>e===this.agentId&&t===this.configLoadGeneration&&s===this.refreshGeneration;this.error="";try{let r=await this.store?.loadPluginCatalog?.(e,this.catalogWorkDir);n()&&r?.error&&(this.error=r.error)}catch(r){n()&&(this.error=r?.message||String(r))}},async save(){if(this.saving||!this.agentId||!this.agentSupportsPlugins||!this.configReady)return;let e=this.agentId,t=this.configLoadGeneration,s=++this.saveGeneration,n=this.copySelection(this.selection||{}),r=()=>e===this.agentId&&t===this.configLoadGeneration&&s===this.saveGeneration;this.saving=!0,this.error="";try{let i=await this.store?.savePluginConfig?.(n,e);if(!r())return;if(i?.error)this.error=i.error;else{let o=this.copySelection(i?.plugins??n);this.selection=o,this.savedSelection=this.copySelection(o)}}catch(i){r()&&(this.error=i?.message||String(i))}finally{r()&&(this.saving=!1)}},resetSkillForm(){this.skillForm.name="",this.skillForm.description="",this.skillForm.trigger="",this.skillForm.content="",this.skillMutationError=""},async refreshCatalogForSkillScope(){await this.store?.loadPluginCatalog?.(this.agentId,this.catalogWorkDir)},async createSkill(){if(!(this.skillMutationLoading||!this.agentSupportsManagedSkills)){if(this.skillScope==="project"&&!this.projectSkillAvailable){this.skillMutationError=this.$t("yeaft.plugins.projectScopeUnavailable");return}this.skillMutationLoading=!0,this.skillMutationError="";try{let e=await this.store?.mutateManagedSkill?.({action:"create",scope:this.skillScope,skill:{...this.skillForm},sessionId:this.skillScope==="project"?this.activeSession.sessionId:""},this.agentId);if(e?.error){this.skillMutationError=e.error;return}let t=typeof e?.result?.name=="string"?e.result.name.trim():"";t&&Array.isArray(this.selection?.skills)&&(this.selection={...this.selection,skills:[...new Set([...this.selection.skills,t])]}),this.resetSkillForm(),this.showSkillForm=!1,await this.refreshCatalogForSkillScope()}catch(e){this.skillMutationError=e?.message||String(e)}finally{this.skillMutationLoading=!1}}},async removeSkill(e){if(!e?.managed||this.skillMutationLoading||!this.agentSupportsManagedSkills)return;let t=e.tier==="project"?"project":"user";if(t==="project"&&!this.projectSkillAvailable){this.skillMutationError=this.$t("yeaft.plugins.projectScopeUnavailable");return}if(confirm(this.$t("yeaft.plugins.confirmRemoveSkill",{name:e.label}))){this.skillMutationLoading=!0,this.skillMutationError="";try{let s=await this.store?.mutateManagedSkill?.({action:"remove",scope:t,name:e.name||e.label,sessionId:t==="project"?this.activeSession.sessionId:""},this.agentId);s?.error?this.skillMutationError=s.error:await this.refreshCatalogForSkillScope()}catch(s){this.skillMutationError=s?.message||String(s)}finally{this.skillMutationLoading=!1}}},selectAgent(e){!e||e===this.agentId||(this.store.pluginCenterAgentId=e)}},template:`
|
|
8341
8349
|
<section class="plugin-center-page" :aria-label="$t('yeaft.plugins.title')">
|
|
8342
8350
|
<header class="plugin-center-header">
|
|
8343
8351
|
<div class="plugin-center-heading">
|
|
@@ -8383,7 +8391,7 @@ ${String(e||"").trim()}
|
|
|
8383
8391
|
<h2>{{ selectedAgent?.name || selectedAgent?.id || $t('yeaft.plugins.noAgent') }}</h2>
|
|
8384
8392
|
<p>{{ statusSummary }}</p>
|
|
8385
8393
|
</div>
|
|
8386
|
-
<div class="plugin-center-overview-stats">
|
|
8394
|
+
<div v-if="configReady && !loading && !catalogRecord?.error && hasCatalog" class="plugin-center-overview-stats">
|
|
8387
8395
|
<span class="plugin-center-enabled-count"><strong>{{ enabledCount }}</strong> / {{ totalCount }}</span>
|
|
8388
8396
|
<span>{{ $t('yeaft.plugins.enabledLabel') }}</span>
|
|
8389
8397
|
</div>
|
|
Binary file
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<title>Yeaft</title>
|
|
7
7
|
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect width='32' height='32' rx='8' fill='%232c2c2c'/><path d='M16 22V13M16 13L10 8M16 13L22 8' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' fill='none'/><circle cx='10' cy='8' r='2.4' fill='white'/><circle cx='22' cy='8' r='2.4' fill='white'/><circle cx='16' cy='22' r='2.4' fill='white'/></svg>">
|
|
8
8
|
<link rel="stylesheet" href="vendor/katex/katex.min.css?v=b0d91614">
|
|
9
|
-
<link rel="stylesheet" href="style.bundle.css?v=
|
|
9
|
+
<link rel="stylesheet" href="style.bundle.css?v=4d8fe790">
|
|
10
10
|
<script src="vendor.bundle.js?v=b4d2c175"></script>
|
|
11
11
|
<script defer src="jszip.min.js"></script>
|
|
12
12
|
<script defer src="docx-preview.min.js"></script>
|
|
@@ -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=
|
|
20
|
+
<script type="module" src="app.bundle.js?v=db93c41c"></script>
|
|
21
21
|
</body>
|
|
22
22
|
</html>
|