style: 插件页去掉「商店」概念——userData 来源并入全局展示
This commit is contained in:
@@ -58,7 +58,7 @@ const TAB_META: Record<Tab, { title: string; desc: string }> = {
|
|||||||
corePlugins: { title: '核心插件', desc: '内置的第一方功能插件,官方维护' },
|
corePlugins: { title: '核心插件', desc: '内置的第一方功能插件,官方维护' },
|
||||||
model: { title: '模型设置', desc: '' },
|
model: { title: '模型设置', desc: '' },
|
||||||
prompt: { title: '系统提示词', desc: '' },
|
prompt: { title: '系统提示词', desc: '' },
|
||||||
plugins: { title: '插件', desc: '第三方扩展插件(商店 / 项目 / 全局目录),按需启停。' },
|
plugins: { title: '插件', desc: '第三方扩展插件(全局 / 项目目录),按需启停。' },
|
||||||
skills: { title: '技能', desc: 'SKILL.md 技能包,Agent 自动按需加载。' },
|
skills: { title: '技能', desc: 'SKILL.md 技能包,Agent 自动按需加载。' },
|
||||||
commands: { title: '命令', desc: '聊天中 / 触发的自定义命令模板。' }
|
commands: { title: '命令', desc: '聊天中 / 触发的自定义命令模板。' }
|
||||||
}
|
}
|
||||||
@@ -713,10 +713,10 @@ function ExternalPluginPanel({
|
|||||||
alive = false
|
alive = false
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
// 全局作用域 = 商店目录 + 全局扩展目录;项目作用域 = 当前工作区 .pi/extensions
|
// 全局作用域 = 全局扩展目录(含应用外置目录,统一按全局展示);项目作用域 = 当前工作区 .pi/extensions
|
||||||
const scoped = external.filter((p) => (scope === 'project' ? p.origin === 'project' : p.origin !== 'project'))
|
const scoped = external.filter((p) => (scope === 'project' ? p.origin === 'project' : p.origin !== 'project'))
|
||||||
const scopedDirs = (scope === 'user' ? [...dirs.user, ...dirs.global] : dirs.project).filter(Boolean)
|
const scopedDirs = (scope === 'user' ? dirs.global : dirs.project).filter(Boolean)
|
||||||
const scopedHints = scope === 'user' ? ['商店', '全局'] : ['项目']
|
const scopedHints = scope === 'user' ? ['全局'] : ['项目']
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex min-h-0 flex-col">
|
<div className="flex min-h-0 flex-col">
|
||||||
@@ -757,9 +757,7 @@ function ExternalPluginPanel({
|
|||||||
</div>
|
</div>
|
||||||
{devBuild && (
|
{devBuild && (
|
||||||
<div className="text-[11.5px] text-ink-3">
|
<div className="text-[11.5px] text-ink-3">
|
||||||
把含 manifest.json 的插件目录放入
|
把含 manifest.json 的插件目录放入全局(~/.pi/agent/extensions)即可自动识别
|
||||||
{scope === 'user' ? '商店(userData/plugins)或全局(~/.pi/agent/extensions)' : '项目 .pi/extensions'}
|
|
||||||
即可自动识别
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@@ -773,7 +771,7 @@ function ExternalPluginPanel({
|
|||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<span className="text-[12.5px] font-medium text-ink">{p.manifest.name}</span>
|
<span className="text-[12.5px] font-medium text-ink">{p.manifest.name}</span>
|
||||||
<span className="rounded-control bg-hover px-1.5 py-0.5 text-[10px] text-ink-3">
|
<span className="rounded-control bg-hover px-1.5 py-0.5 text-[10px] text-ink-3">
|
||||||
{scope === 'user' ? (p.origin === 'user' ? '商店' : '全局') : '项目'} v{p.manifest.version}
|
{scope === 'user' ? '全局' : '项目'} v{p.manifest.version}
|
||||||
</span>
|
</span>
|
||||||
<span className="ml-auto text-[11px] text-ink-3">{p.enabled ? '已启用' : '已停用'}</span>
|
<span className="ml-auto text-[11px] text-ink-3">{p.enabled ? '已启用' : '已停用'}</span>
|
||||||
<button
|
<button
|
||||||
|
|||||||
@@ -367,7 +367,7 @@ import type { PluginManifest, StatusItem, ToolbarButtonDef } from '@aso/plugin-s
|
|||||||
export interface PluginInfo {
|
export interface PluginInfo {
|
||||||
manifest: PluginManifest
|
manifest: PluginManifest
|
||||||
source: 'builtin' | 'external'
|
source: 'builtin' | 'external'
|
||||||
/** 外置来源目录类别(仅 external):user=商店目录 / project=项目 .pi/extensions / global=全局扩展目录 */
|
/** 外置来源目录类别(仅 external):user=应用外置目录 / project=项目 .pi/extensions / global=全局扩展目录 */
|
||||||
origin?: 'user' | 'project' | 'global'
|
origin?: 'user' | 'project' | 'global'
|
||||||
enabled: boolean
|
enabled: boolean
|
||||||
/** 有主进程工厂(pi 工具/事件/内联 UI 注册能力) */
|
/** 有主进程工厂(pi 工具/事件/内联 UI 注册能力) */
|
||||||
|
|||||||
Reference in New Issue
Block a user