feat: 动态插件系统 M0-M3(两层能力模型 + pi 原生契约 + Obsidian 式 SDK)

This commit is contained in:
Rick Ye
2026-09-10 02:15:55 +08:00
parent 2b69a9aa13
commit 367f3f5c5b
37 changed files with 2009 additions and 5773 deletions
+29
View File
@@ -0,0 +1,29 @@
/**
* 内联槽位的数据类型(B2 状态胶囊 / B5 工具栏按钮)。
* 契约原则:内联 UI 一律"数据 + 深链",不注册组件——外置插件只有
* iframe 页有能力渲染自己的 React;宿主统一按数据渲染这些小 UI。
*/
/** 深链:点击行为 = 打开某个视图('chat' 或插件 id)并携带参数 */
export interface OpenViewAction {
view: string
params?: unknown
}
/** 状态胶囊条目(TitleBar 胶囊区 / 聊天区浮动胶囊共用一份数据) */
export interface StatusItem {
text: string
tone?: 'default' | 'accent' | 'warn' | 'danger'
/** 点击行为:深链;缺省不可点击 */
openView?: OpenViewAction
}
/** 输入区工具行按钮 */
export interface ToolbarButtonDef {
id: string
title: string
/** svg 字符串(16-20px 线条风格,宿主按 currentColor 渲染) */
icon?: string
/** 点击行为:深链;缺省不可点击 */
openView?: OpenViewAction
}