feat: 外置插件一等公民——entry.renderer 宿主内 React 组件(.pi/extensions 一等插件源 + 开发版门控)

This commit is contained in:
Rick Ye
2026-09-11 00:46:52 +08:00
parent 52f93ddc84
commit 8b94d42930
11 changed files with 291 additions and 53 deletions
+3 -1
View File
@@ -20,7 +20,7 @@ import {
type Skill
} from '@earendil-works/pi-coding-agent'
import { ApprovalService, createApprovalExtension } from './approval'
import { getPluginHost } from '../plugins/plugin-host'
import { EXTERNAL_PLUGINS_ENABLED, getPluginHost } from '../plugins/plugin-host'
import { browserToolNames } from '../tools/browser-tools'
import type {
AgentUiEvent,
@@ -292,6 +292,8 @@ export class AgentService {
const cwd = this.cwd
const agentDir = getAgentDir()
this.settings = this.loadSettings()
// 项目级第三方插件目录随工作区同步(.pi/extensions;目录变更即重扫描插件列表)
getPluginHost().setProjectExtensionsDir(EXTERNAL_PLUGINS_ENABLED ? cwd : null)
// 审批拦截只需注册一次(create 会随工作区切换多次执行)
if (!this.approvalsRegistered) {
this.approvalsRegistered = true