feat: 动态插件系统 M0-M3(两层能力模型 + pi 原生契约 + Obsidian 式 SDK)
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user