@vetta-org/plugin-sdk 0.3.16 → 0.3.17

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.
@@ -1 +1 @@
1
- {"version":3,"file":"official.js","sourceRoot":"","sources":["../src/official.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginPermission } from \"./permissions.js\";\n\nexport interface PluginOfficialGeneralSettings {\n\tworkspacePath: string;\n\tdefaultExecutionMode?: \"sandbox\" | \"full-access\";\n\tnotificationsEnabled: boolean;\n\tdebugMode: boolean;\n\tsandbox: unknown;\n}\n\nexport type PluginOfficialGeneralSettingsUpdate =\n\t| { operation: \"set-notifications\"; enabled: boolean }\n\t| { operation: \"set-execution-mode\"; mode: \"sandbox\" | \"full-access\" }\n\t| { operation: \"set-workspace\"; path: string };\n\nexport interface PluginOfficialExperimentalSettings {\n\tvettaCli: boolean;\n\tpromptPrediction: boolean;\n\tagentSkills: boolean;\n}\n\nexport interface PluginOfficialImageGenerationSettings {\n\ttextToImageProviderId?: string;\n\ttextToImageModelId?: string;\n\timageToImageProviderId?: string;\n\timageToImageModelId?: string;\n}\n\nexport type PluginOfficialImageGenerationSettingsUpdate = {\n\ttextToImageProviderId?: string | null;\n\ttextToImageModelId?: string | null;\n\timageToImageProviderId?: string | null;\n\timageToImageModelId?: string | null;\n};\n\nexport interface PluginOfficialDownloadItem {\n\tid: string;\n\turl: string;\n\tfilename: string;\n\tpath: string;\n\ttotalBytes: number;\n\treceivedBytes: number;\n\tstatus: \"queued\" | \"downloading\" | \"paused\" | \"completed\" | \"failed\" | \"canceled\";\n\terror?: string;\n\tcreatedAt: number;\n\tcompletedAt?: number;\n\tspeedBytesPerSec?: number;\n}\n\nexport interface PluginOfficialUpdaterState {\n\tphase: \"idle\" | \"checking\" | \"available\" | \"downloading\" | \"ready\" | \"installing\" | \"error\";\n\tcurrentVersion: string;\n\tlatestVersion?: string;\n\treleaseNote?: string;\n\tprogress?: number;\n\tdownloadedBytes?: number;\n\ttotalBytes?: number;\n\tassetFileName?: string;\n\terror?: string;\n}\n\nexport type PluginOfficialWebhookKind = \"feishu\" | \"dingtalk\";\n\nexport interface PluginOfficialWebhookEndpoint {\n\tid: string;\n\tkind: PluginOfficialWebhookKind;\n\tname: string;\n\tenabled: boolean;\n\tcreatedAt: string;\n\tupdatedAt: string;\n\turlMask?: string;\n\thasSignSecret?: boolean;\n}\n\nexport interface PluginOfficialWebhookProvider {\n\tkind: PluginOfficialWebhookKind;\n\tdisplayName: string;\n\ticonClass?: string;\n}\n\nexport interface PluginOfficialWebhookCreateInput {\n\tkind: PluginOfficialWebhookKind;\n\tname: string;\n\twebhookUrl: string;\n\tsignSecret?: string;\n\tenabled?: boolean;\n}\n\nexport interface PluginOfficialWebhookUpdateInput {\n\tname?: string;\n\tenabled?: boolean;\n\twebhookUrl?: string;\n\tsignSecret?: string;\n}\n\nexport interface PluginOfficialWebhookMessage {\n\ttitle?: string;\n\ttext: string;\n\tlevel?: \"info\" | \"warn\" | \"error\" | \"success\";\n}\n\nexport interface PluginOfficialWebhookSendResult {\n\tok: boolean;\n\terror?: string;\n}\n\nexport interface PluginOfficialSkillInfo {\n\tname: string;\n\talias?: string;\n\tdescription: string;\n\tsource: string;\n\ttype: \"skill\";\n}\n\nexport type PluginOfficialInstalledSkill = {\n\tname: string;\n\tversion: string;\n\tinstalledAt: string;\n\tsource: \"market\" | \"custom\";\n\tenabled: boolean;\n\ttype?: \"skill\";\n\talias?: string;\n\tmarketDescription?: string;\n\tdescription?: string;\n};\n\nexport interface PluginOfficialShortcutBinding {\n\tid: string;\n\tdefaultShortcut: string;\n\tshortcut: string;\n\tisDefault: boolean;\n}\n\nexport interface PluginOfficialQuickPanelSettings {\n\ttrigger: \"none\" | \"mod\" | \"alt\" | \"shift\";\n\tpostSendBehavior: \"foreground\" | \"background\";\n}\n\nexport interface PluginOfficialImStatus {\n\tenabled: boolean;\n\ttransport: string;\n\tagentModel: { provider: string; model: string; reasoningLevel?: string } | null;\n\twechatBound: boolean;\n\tfeishuAppId: string | null;\n\truntime: unknown;\n}\n\nexport interface PluginOfficialImLog {\n\tlevel: string;\n\tmsg: string;\n\ttime: string;\n\tfields?: Record<string, unknown>;\n}\n\n/**\n * MCP 配置落点。省略时只操作全局 `~/.vetta/agent/mcp.json`;\n * `scope: \"project\"` 必须同时给出项目根 `cwd`,读写 `<cwd>/.vetta/mcp.json`。\n * 只给 `cwd` 时读操作会把项目一并纳入,写操作仍默认全局。\n */\nexport interface PluginOfficialMcpTarget {\n\tscope?: \"global\" | \"project\";\n\tcwd?: string;\n}\n\nexport interface PluginOfficialMcpServerSummary {\n\tname: string;\n\ttype: \"http\" | \"sse\" | \"stdio\";\n\tdisabled: boolean;\n\tcommand?: string;\n\turl?: string;\n\t/** 仅在传了 `scope` 或 `cwd` 时返回。 */\n\tscope?: \"global\" | \"project\";\n\t/** 来自项目根 `.mcp.json`:Vetta 只读取,不会改写。 */\n\treadOnly?: boolean;\n}\n\nexport interface PluginOfficialMcpServerDetail {\n\tname: string;\n\ttype?: \"http\" | \"sse\" | \"stdio\";\n\tcommand?: string;\n\targs?: string[];\n\tenv?: Record<string, string>;\n\tcwd?: string;\n\turl?: string;\n\theaders?: Record<string, string>;\n\tdisabled?: boolean;\n\tautoApprove?: string[];\n\tstartupTimeout?: number;\n\tdebug?: boolean;\n\tscope?: \"global\" | \"project\";\n\treadOnly?: boolean;\n}\n\nexport type PluginOfficialMcpUpsertData =\n\t| {\n\t\t\ttype?: \"stdio\";\n\t\t\tcommand?: string;\n\t\t\targs?: string[];\n\t\t\tenv?: Record<string, string>;\n\t\t\tcwd?: string;\n\t\t\tdisabled?: boolean;\n\t\t\tautoApprove?: string[];\n\t\t\tstartupTimeout?: number;\n\t\t\tdebug?: boolean;\n\t }\n\t| {\n\t\t\t/** `sse` 是旧式 HTTP+SSE 传输,仅为兼容仍在使用它的服务器。 */\n\t\t\ttype: \"http\" | \"sse\";\n\t\t\turl?: string;\n\t\t\theaders?: Record<string, string>;\n\t\t\tdisabled?: boolean;\n\t\t\tautoApprove?: string[];\n\t\t\tstartupTimeout?: number;\n\t\t\tdebug?: boolean;\n\t };\n\nexport type PluginOfficialExecutionMode = \"inherit\" | \"sandbox\" | \"full-access\";\n\nexport interface PluginOfficialSelectedSkill {\n\tname: string;\n\talias?: string;\n\ttype: \"skill\";\n}\n\nexport interface PluginOfficialBatchProjectCreateData {\n\tname: string;\n\tprompt: string;\n\tmodelKey?: string;\n\tfolders: string[];\n\tconcurrency: number;\n\texecutionMode?: PluginOfficialExecutionMode;\n\tartifactPatterns?: string[];\n\tnotifyEnabled?: boolean;\n\ttimeoutMinutes?: number;\n\tskill?: PluginOfficialSelectedSkill;\n}\n\nexport interface PluginOfficialBatchProjectUpdateData {\n\tname?: string;\n\tprompt?: string;\n\tmodelKey?: string;\n\tconcurrency?: number;\n\texecutionMode?: PluginOfficialExecutionMode;\n\tartifactPatterns?: string[];\n\tnotifyEnabled?: boolean;\n\ttimeoutMinutes?: number;\n\tnewFolders?: string[];\n\tskill?: PluginOfficialSelectedSkill | null;\n}\n\n/** 「重复」:精确到分钟,按本机时区;星期 0 = 周日;interval 为固定间隔;custom 为 5 段 cron。 */\nexport type PluginOfficialSchedulerSchedule =\n\t| { kind: \"once\"; at: number }\n\t| { kind: \"hourly\"; minute: number }\n\t| { kind: \"daily\"; hour: number; minute: number }\n\t| { kind: \"weekly\"; weekdays: number[]; hour: number; minute: number }\n\t| { kind: \"monthly\"; days: Array<number | \"last\">; hour: number; minute: number }\n\t/** 从 startAt(毫秒时间戳)起每 everyMinutes 分钟一次,1–10080。 */\n\t| { kind: \"interval\"; everyMinutes: number; startAt: number }\n\t| { kind: \"custom\"; cron: string };\n\n/**\n * 运行会话策略:projectCwd 为会话所属项目的路径,省略即落在默认「对话」里。\n * same-session 的 sessionPath 为 null 表示首次执行时新建一个会话,之后一直复用。\n */\nexport type PluginOfficialSchedulerRunTarget =\n\t| { mode: \"new-session\"; projectCwd?: string }\n\t| { mode: \"same-session\"; projectCwd?: string; sessionPath: string | null };\n\n/** 省略即「跟随默认模型」。 */\nexport interface PluginOfficialSchedulerModel {\n\tkey: string;\n\treasoning?: string;\n}\n\nexport interface PluginOfficialSchedulerNotification {\n\twebhookIds: string[];\n\twhen: \"always\" | \"success\" | \"failure\";\n\t/** 支持 {{name}} {{status}} {{startedAt}} {{duration}} {{reply}} {{error}}。 */\n\ttemplate: string;\n}\n\nexport interface PluginOfficialSchedulerTaskCreateData {\n\tname: string;\n\tprompt: string;\n\tschedule: PluginOfficialSchedulerSchedule;\n\trunTarget: PluginOfficialSchedulerRunTarget;\n\tmodel?: PluginOfficialSchedulerModel;\n\tnotification?: PluginOfficialSchedulerNotification;\n\tenabled?: boolean;\n}\n\nexport interface PluginOfficialSchedulerTaskUpdateData {\n\tname?: string;\n\tprompt?: string;\n\tschedule?: PluginOfficialSchedulerSchedule;\n\trunTarget?: PluginOfficialSchedulerRunTarget;\n\tmodel?: PluginOfficialSchedulerModel | null;\n\tnotification?: PluginOfficialSchedulerNotification | null;\n\tenabled?: boolean;\n}\n\nexport interface PluginOfficialModelSummary {\n\tid: string;\n\tname?: string;\n\tapi?: string;\n\treasoning?: boolean;\n}\n\nexport interface PluginOfficialProviderSummary {\n\tid: string;\n\tdisplayName: string;\n\tbaseUrl?: string;\n\tapi?: string;\n\thasApiKey: boolean;\n\t/** 图标 symbol;配合 `ProviderIcon` 解析为内置图标,无则不画图标。 */\n\ticon?: string;\n\t/**\n\t * true = 来自登录后服务端下发的远程目录(如 Vetta Go),凭据是账号登录态而非本地\n\t * API Key,因此不会出现在本地模型配置里,也不可用 `upsertProvider` / `removeProvider` 改。\n\t */\n\tremote?: boolean;\n\tmodelCount: number;\n\tmodels: PluginOfficialModelSummary[];\n}\n\nexport interface PluginOfficialProviderDetail {\n\tbaseUrl?: string;\n\tapiKey?: string;\n\tapi?: string;\n\tdisplayName?: string;\n\tauthHeader?: boolean;\n\theaders?: Record<string, string>;\n\tmodels?: Array<{\n\t\tid: string;\n\t\tname?: string;\n\t\tapi?: string;\n\t\treasoning?: boolean;\n\t\tcontextWindow?: number;\n\t\tmaxTokens?: number;\n\t}>;\n}\n\nexport interface PluginOfficialProviderUpsertData {\n\tbaseUrl?: string;\n\tapiKey?: string;\n\tapi?: string;\n\tdisplayName?: string;\n\tauthHeader?: boolean;\n\theaders?: Record<string, string>;\n\tmodels?: Array<{\n\t\tid: string;\n\t\tname?: string;\n\t\tapi?: string;\n\t\treasoning?: boolean;\n\t\tcontextWindow?: number;\n\t\tmaxTokens?: number;\n\t}>;\n}\n\nexport interface PluginOfficialProjectEntry {\n\tpath: string;\n\tname?: string;\n}\n\nexport interface PluginOfficialPluginSummary {\n\tid: string;\n\tname: string;\n\tversion: string;\n\tactiveVersion: string;\n\tpendingVersion?: string;\n\tenabled: boolean;\n\trequired: boolean;\n\tsource: string;\n\tpermissions: string[];\n\tdescription?: string;\n\trootPath?: string;\n\tdevWatch?: unknown;\n}\n\nexport interface PluginOfficialPluginChangedEvent {\n\treason?: string;\n\tpluginId?: string;\n}\n\nexport interface PluginOfficialSaveCopyOptions {\n\tdefaultFileName?: string;\n\ttitle?: string;\n\tfilters?: Array<{ name: string; extensions: string[] }>;\n}\n\n/** `official.dialog.openFiles` 的选项。 */\nexport interface PluginOfficialOpenFilesOptions {\n\ttitle?: string;\n\tfilters?: Array<{ name: string; extensions: string[] }>;\n\t/** 允许多选,默认单选。 */\n\tmultiple?: boolean;\n\t/** 单个文件的字节上限,超过则抛错。默认 64MB。 */\n\tmaxBytes?: number;\n}\n\n/** 用户在文件对话框里选中的一个文件,内容随选择一起回传。 */\nexport interface PluginOfficialOpenedFile {\n\tpath: string;\n\tname: string;\n\t/** base64 编码的文件内容。 */\n\tdata: string;\n}\n\nexport interface PluginOfficialKnowledgeBase {\n\tid: string;\n\tname: string;\n\tupdatedAt: number;\n\tisDefault: boolean;\n\tnodes: unknown[];\n}\n\nexport interface PluginOfficialKnowledgeProcessingSettings {\n\tenabled?: boolean;\n\tpollIntervalMinutes?: number;\n\tprocessingModelKey?: string;\n\tprocessingModelReasoningLevel?: string;\n\tagentConcurrency?: number;\n\tocrConcurrency?: number;\n}\n\n/** 由 `official.sessions.create` 新建的后台会话句柄。 */\nexport interface PluginOfficialSessionHandle {\n\t/** 进程内 runtime id,用于 prompt / abort / subscribe。重启后失效。 */\n\tsessionId: string;\n\t/** 会话文件绝对路径,跨重启稳定,用于持久化与跳转。 */\n\tsessionPath: string;\n\t/** 实际运行目录(「对话」项目会落到 per-session 子目录,见 ADR-0007)。 */\n\tcwd?: string;\n}\n\n/** 会话运行态变化广播(按 sessionPath 标识,跨重启稳定)。 */\nexport interface PluginOfficialSessionRunningEvent {\n\tsessionPath: string;\n\trunning: boolean;\n\tsessionId?: string;\n}\n\n/**\n * 会话文件此刻允许做什么。\n *\n * 同一份会话文件可能正被另一个运行时占用、或已不可读,宿主自己点会话时就是按这几\n * 位分流的(可续聊 / 只读查看 / 完全打不开)。插件在跳转前必须先看它,否则会把用户\n * 送进一个打不开的会话,且失败发生在导航之后、很难解释。\n */\nexport interface PluginOfficialSessionAccess {\n\t/** 能否读取历史。为 false 时连只读查看都不行。 */\n\treadHistory: boolean;\n\t/** 能否在对话页续聊。 */\n\tinteractiveResume: boolean;\n\trename: boolean;\n\tdelete: boolean;\n}\n\n/** 会话历史条目(`official.sessions.list` 返回),按 `modifiedAt` 倒序。 */\nexport interface PluginOfficialSessionSummary {\n\tpath: string;\n\tcwd?: string;\n\tfirstMessage?: string;\n\tmodifiedAt?: number;\n\taccess: PluginOfficialSessionAccess;\n}\n\n/**\n * 导航目标。多数目标只要 `target`;`target: \"new-session\"` 这类带参数的目标另需\n * `cwd`(项目绝对路径),缺了会被宿主拒绝而不是跳到一个空页面。\n */\nexport interface PluginOfficialNavigationOpenInput {\n\ttarget: string;\n\ttab?: string;\n\tsection?: string;\n\t/** 仅 `target: \"new-session\"` 使用:要新建会话的项目目录。 */\n\tcwd?: string;\n\t/**\n\t * 仅 `target: \"new-session\"` 使用:预置到输入框的草稿文本,不发送,用户可继续编辑。\n\t *\n\t * 用输入框的文本形态书写行内 token(`@skill:名字` / `@mcp:名字` / `@/abs/path`),\n\t * 宿主会把它们渲染成对应的 badge。在导航发生**之前**写入该 cwd 的新会话草稿位,\n\t * 所以不会被新会话页自己的草稿恢复覆盖;该 cwd 上已有的未发送草稿会被替换。\n\t */\n\tdraft?: string;\n}\n\n/** 仅宿主验证为官方来源的插件可以调用;普通插件调用时由宿主拒绝。 */\nexport interface PluginOfficialApi {\n\tgeneral: {\n\t\tgetSettings(): Promise<PluginOfficialGeneralSettings>;\n\t\tsetSettings(input: PluginOfficialGeneralSettingsUpdate): Promise<PluginOfficialGeneralSettingsUpdate>;\n\t};\n\tagent: {\n\t\tgetExperimental(): Promise<PluginOfficialExperimentalSettings>;\n\t\tsetExperimental(input: Partial<PluginOfficialExperimentalSettings>): Promise<PluginOfficialExperimentalSettings>;\n\t\tgetImageGeneration(): Promise<PluginOfficialImageGenerationSettings>;\n\t\tsetImageGeneration(\n\t\t\tinput: PluginOfficialImageGenerationSettingsUpdate,\n\t\t): Promise<PluginOfficialImageGenerationSettings>;\n\t};\n\tdownloads: {\n\t\tlist(): Promise<PluginOfficialDownloadItem[]>;\n\t\tcancel(id: string): Promise<void>;\n\t};\n\tupdater: {\n\t\tgetState(): Promise<PluginOfficialUpdaterState>;\n\t\tgetCurrentVersion(): Promise<string>;\n\t\tcheck(): Promise<PluginOfficialUpdaterState>;\n\t\tdownload(): Promise<PluginOfficialUpdaterState>;\n\t\tinstall(): Promise<void>;\n\t\tdismiss(): Promise<void>;\n\t\tcancel(): Promise<void>;\n\t};\n\twebhook: {\n\t\tlist(): Promise<PluginOfficialWebhookEndpoint[]>;\n\t\tlistProviders(): Promise<PluginOfficialWebhookProvider[]>;\n\t\tcreate(input: PluginOfficialWebhookCreateInput): Promise<PluginOfficialWebhookEndpoint>;\n\t\tupdate(id: string, input: PluginOfficialWebhookUpdateInput): Promise<PluginOfficialWebhookEndpoint>;\n\t\tsetEnabled(id: string, enabled: boolean): Promise<PluginOfficialWebhookEndpoint>;\n\t\tdelete(id: string): Promise<void>;\n\t\ttest(id: string): Promise<PluginOfficialWebhookSendResult>;\n\t\tsend(id: string, message: PluginOfficialWebhookMessage): Promise<PluginOfficialWebhookSendResult>;\n\t};\n\tskills: {\n\t\tlist(cwd?: string): Promise<PluginOfficialSkillInfo[]>;\n\t\tgetManifest(): Promise<Record<string, PluginOfficialInstalledSkill>>;\n\t\tsetEnabled(name: string, enabled: boolean): Promise<{ name: string; enabled: boolean }>;\n\t\tuninstall(name: string, type?: \"skill\"): Promise<void>;\n\t\t/**\n\t\t * 从能力市场按 slug 安装 skill(产品文案:能力)。\n\t\t * 下载在主进程完成;密钥类凭证不经过此 API。\n\t\t */\n\t\tinstallFromMarket(\n\t\t\ttype: \"skill\",\n\t\t\tslug: string,\n\t\t): Promise<{ name: string; type: \"skill\"; version: string; updated: boolean }>;\n\t};\n\tshortcuts: {\n\t\tlistAvailableActions(): Array<{ id: string; defaultShortcut: string }>;\n\t\tget(): Promise<{ bindings: PluginOfficialShortcutBinding[]; quickPanel: PluginOfficialQuickPanelSettings }>;\n\t\tsetBinding(id: string, shortcut: string): Promise<{ bindings: PluginOfficialShortcutBinding[] }>;\n\t\tresetBinding(id: string): Promise<{ bindings: PluginOfficialShortcutBinding[]; shortcut: string }>;\n\t\tresetAllBindings(): Promise<{ bindings: PluginOfficialShortcutBinding[] }>;\n\t\tsetQuickPanelTrigger(trigger: PluginOfficialQuickPanelSettings[\"trigger\"]): Promise<PluginOfficialQuickPanelSettings>;\n\t\tsetQuickPanelBehavior(\n\t\t\tbehavior: PluginOfficialQuickPanelSettings[\"postSendBehavior\"],\n\t\t): Promise<PluginOfficialQuickPanelSettings>;\n\t};\n\tim: {\n\t\tgetStatus(): Promise<PluginOfficialImStatus>;\n\t\tgetLogs(limit?: number): Promise<PluginOfficialImLog[]>;\n\t\tsetEnabled(enabled: boolean): Promise<{ status: unknown }>;\n\t\trestart(): Promise<{ status: unknown }>;\n\t\tsetAgentModel(\n\t\t\tmodelKey: string | null,\n\t\t\treasoningLevel?: string,\n\t\t): Promise<{ status: unknown }>;\n\t\tassertModelKeyExists(modelKey: string): Promise<void>;\n\t\t/**\n\t\t * 写入飞书凭证。Agent 应省略 appSecret 等密钥,由审批弹窗让用户手填。\n\t\t * 空字符串密钥字段表示保持现有值不改。\n\t\t */\n\t\tsetFeishuConfig(input: {\n\t\t\tenabled?: boolean;\n\t\t\tappId?: string;\n\t\t\tappSecret?: string;\n\t\t\tverificationToken?: string;\n\t\t\tencryptKey?: string;\n\t\t\tbaseUrl?: string;\n\t\t}): Promise<{ ok: boolean; error?: string }>;\n\t};\n\tmcp: {\n\t\tlist(target?: PluginOfficialMcpTarget): Promise<PluginOfficialMcpServerSummary[]>;\n\t\tget(name: string, target?: PluginOfficialMcpTarget): Promise<PluginOfficialMcpServerDetail>;\n\t\tlistNames(target?: PluginOfficialMcpTarget): Promise<string[]>;\n\t\tupsert(\n\t\t\tname: string,\n\t\t\tdata: PluginOfficialMcpUpsertData,\n\t\t\ttarget?: PluginOfficialMcpTarget,\n\t\t): Promise<PluginOfficialMcpServerDetail>;\n\t\tsetEnabled(name: string, enabled: boolean, target?: PluginOfficialMcpTarget): Promise<void>;\n\t\tremove(name: string, target?: PluginOfficialMcpTarget): Promise<void>;\n\t};\n\tmodels: {\n\t\t/**\n\t\t * 用户当前可选的全部模型:本地配置的 provider **加上**登录后服务端下发的远程目录\n\t\t * (Vetta Go 等,`remote: true`)。同一个 `provider/modelId` 以本地为准。\n\t\t * 与宿主输入栏模型选择器同一口径。\n\t\t */\n\t\tlist(): Promise<{ defaultModel: string | null; providers: PluginOfficialProviderSummary[] }>;\n\t\tget(provider?: string): Promise<unknown>;\n\t\tprobe(provider: string, model: string): Promise<{ ok: boolean; message?: string; error?: string }>;\n\t\tlistProviderIds(): Promise<string[]>;\n\t\tassertModelKeyExists(modelKey: string, operation?: string): Promise<void>;\n\t\tsetDefault(modelKey: string): Promise<{ defaultModel: string }>;\n\t\tupsertProvider(provider: string, data: PluginOfficialProviderUpsertData): Promise<PluginOfficialProviderDetail>;\n\t\t/** Removes the provider when present. Repeated removal is an idempotent no-op. */\n\t\tremoveProvider(provider: string): Promise<void>;\n\t};\n\tprojects: {\n\t\tlist(): Promise<{\n\t\t\tworkspacePath: string;\n\t\t\tprojects: PluginOfficialProjectEntry[];\n\t\t\tarchivedProjects: PluginOfficialProjectEntry[];\n\t\t}>;\n\t\tlistSessions(cwd: string): Promise<unknown[]>;\n\t\tlistRuntimeProjects(): Promise<unknown[]>;\n\t\tcreate(name: string, path?: string): Promise<PluginOfficialProjectEntry>;\n\t\topen(path: string, name?: string): Promise<PluginOfficialProjectEntry>;\n\t\trename(path: string, name: string): Promise<PluginOfficialProjectEntry>;\n\t\tarchive(path: string): Promise<void>;\n\t\tunarchive(path: string): Promise<void>;\n\t\tremove(path: string): Promise<void>;\n\t};\n\tplugins: {\n\t\tlist(): Promise<PluginOfficialPluginSummary[]>;\n\t\tget(id: string): Promise<PluginOfficialPluginSummary>;\n\t\tsetEnabled(id: string, enabled: boolean): Promise<PluginOfficialPluginSummary>;\n\t\tinstallFromUrl(\n\t\t\turl: string,\n\t\t\toptions?: { initiator?: \"plugin-cli\" },\n\t\t): Promise<PluginOfficialPluginSummary>;\n\t\tinstallFromPath(\n\t\t\tpath: string,\n\t\t\toptions?: {\n\t\t\t\tinitiator?: \"plugin-cli\" | \"plugin-workbench\";\n\t\t\t\tgrantedPermissions?: string[];\n\t\t\t\tenable?: boolean;\n\t\t\t\tsource?: \"archive\" | \"npm\";\n\t\t\t\texpectedSha256?: string;\n\t\t\t\texpectedId?: string;\n\t\t\t\texpectedVersion?: string;\n\t\t\t\tnpm?: {\n\t\t\t\t\tpackageName: string;\n\t\t\t\t\trequestedSpec: string;\n\t\t\t\t\tresolvedVersion: string;\n\t\t\t\t\tintegrity?: string;\n\t\t\t\t};\n\t\t\t},\n\t\t): Promise<PluginOfficialPluginSummary>;\n\t\tuninstall(id: string): Promise<void>;\n\t\treload(id: string): Promise<PluginOfficialPluginSummary>;\n\t\tgrantPermissions(id: string, permissions: PluginPermission[]): Promise<PluginOfficialPluginSummary>;\n\t\tstartDevWatch(id: string, projectDir: string): Promise<PluginOfficialPluginSummary>;\n\t\tstopDevWatch(id: string): Promise<void>;\n\t\tonChanged(handler: (event?: PluginOfficialPluginChangedEvent) => void): () => void;\n\t};\n\tdialog: {\n\t\tsaveCopy(sourcePath: string, options?: PluginOfficialSaveCopyOptions): Promise<string | null>;\n\t\t/**\n\t\t * 打开原生文件选择框,并把选中文件的**内容**一起返回。\n\t\t *\n\t\t * 插件的 `ctx.fs` 只能读已授权的项目根,因此「选个文件再自己去读」这条路走不通;\n\t\t * 这个接口不放宽任何目录授权,插件能看到的只有用户这次亲手选中的文件。\n\t\t * 用户取消时返回空数组。\n\t\t */\n\t\topenFiles(options?: PluginOfficialOpenFilesOptions): Promise<PluginOfficialOpenedFile[]>;\n\t};\n\tshell: {\n\t\t/**\n\t\t * 在系统文件管理器里定位并选中这个路径。\n\t\t *\n\t\t * 与 `ui.openExternal` 分工:那个只放行 http/https,用来把链接交给浏览器;\n\t\t * 这个只做「显示这个本地路径」,不能用来拉起任意协议。\n\t\t */\n\t\tshowItemInFolder(path: string): Promise<void>;\n\t};\n\tknowledge: {\n\t\tlist(): Promise<PluginOfficialKnowledgeBase[]>;\n\t\tfileStatuses(): Promise<Record<string, unknown>>;\n\t\tisProcessing(): Promise<boolean>;\n\t\tgetProcessing(): Promise<PluginOfficialKnowledgeProcessingSettings>;\n\t\tcreate(name: string): Promise<void>;\n\t\trename(name: string, newName: string): Promise<void>;\n\t\tdelete(name: string): Promise<void>;\n\t\taddFiles(kbId: string, paths: string[], move?: boolean): Promise<void>;\n\t\tdeleteEntry(kbId: string, relPath: string): Promise<void>;\n\t\tscanNow(): Promise<{ skipped: boolean; reason?: string }>;\n\t\tretryFailed(): Promise<{ skipped: boolean; reason?: string }>;\n\t\tsetProcessing(\n\t\t\tdata: Partial<{\n\t\t\t\tenabled: boolean;\n\t\t\t\tpollIntervalMinutes: 3 | 5 | 10 | 30;\n\t\t\t\tprocessingModelKey: string | null;\n\t\t\t\tprocessingModelReasoningLevel: string | null;\n\t\t\t\tagentConcurrency: number;\n\t\t\t\tocrConcurrency: number;\n\t\t\t}>,\n\t\t): Promise<PluginOfficialKnowledgeProcessingSettings>;\n\t};\n\tbatchTasks: {\n\t\tlistProjects(): Promise<unknown[]>;\n\t\tgetProject(projectId: string): Promise<unknown>;\n\t\tlistProjectIds(): Promise<string[]>;\n\t\tcreateProject(data: PluginOfficialBatchProjectCreateData): Promise<unknown>;\n\t\tupdateProject(projectId: string, data: PluginOfficialBatchProjectUpdateData): Promise<unknown>;\n\t\tdeleteProject(projectId: string): Promise<unknown>;\n\t\trunTask(projectId: string, taskId: string): Promise<unknown>;\n\t\tretryTask(projectId: string, taskId: string): Promise<unknown>;\n\t\tstopTask(projectId: string, taskId: string): Promise<unknown>;\n\t\tdeleteTask(projectId: string, taskId: string): Promise<unknown>;\n\t\tresumeTask(projectId: string, taskId: string): Promise<unknown>;\n\t\tresumeTaskWithText(projectId: string, taskId: string, text: string): Promise<unknown>;\n\t\tdeleteTaskSession(projectId: string, taskId: string): Promise<unknown>;\n\t\tbatchDelete(projectId: string): Promise<unknown>;\n\t\tbatchStart(projectId: string): Promise<unknown>;\n\t\tbatchStop(projectId: string): Promise<unknown>;\n\t\tbatchReset(projectId: string): Promise<unknown>;\n\t\tbatchResetFailed(projectId: string, taskIds: string[]): Promise<unknown>;\n\t};\n\tscheduler: {\n\t\tlistTasks(): Promise<unknown[]>;\n\t\tgetTask(taskId: string): Promise<unknown>;\n\t\tlistTaskIds(): Promise<string[]>;\n\t\tgetHistory(taskId: string): Promise<unknown[]>;\n\t\tcreateTask(data: PluginOfficialSchedulerTaskCreateData): Promise<unknown>;\n\t\tupdateTask(taskId: string, data: PluginOfficialSchedulerTaskUpdateData): Promise<unknown>;\n\t\tdeleteTask(taskId: string): Promise<unknown>;\n\t\tsetEnabled(taskId: string, enabled: boolean): Promise<unknown>;\n\t\trunNow(taskId: string): Promise<unknown>;\n\t\tabort(taskId: string): Promise<unknown>;\n\t};\n\tappearance: {\n\t\thelp(): Promise<unknown>;\n\t\tget(): Promise<unknown>;\n\t\tset(input: {\n\t\t\tmode?: \"light\" | \"dark\" | \"auto\";\n\t\t\tthemeId?: string;\n\t\t}): Promise<unknown>;\n\t\tsetLanguage(language: \"zh\" | \"en\"): Promise<unknown>;\n\t\tlistThemeIds(): string[];\n\t};\n\t/**\n\t * 后台会话编排。会话本体跑在主进程,创建后即使宿主停留在别的页面也会继续执行,\n\t * 因此系统插件可以据此做「多任务并发派单」类工作台(如看板)。\n\t */\n\tsessions: {\n\t\t/**\n\t\t * 在 `cwd` 下新建一个会话;不发送任何 prompt。\n\t\t *\n\t\t * 传 `modelKey`(`provider/modelId`)时写入该会话的模型设置,后续无论是插件\n\t\t * 继续 `prompt`、还是用户在对话页手动接着聊,都用这个模型;不传则跟随宿主全局默认。\n\t\t */\n\t\tcreate(input: { cwd: string; title?: string; modelKey?: string }): Promise<PluginOfficialSessionHandle>;\n\t\t/**\n\t\t * 向会话发起一轮对话。streaming 中会进入该会话的输入队列(ADR-0060)。\n\t\t *\n\t\t * `options.modelKey` 只钉住**这一轮**用哪个模型(不改会话设置);要让整个会话\n\t\t * 都用某个模型,在 `create` 时传 `modelKey`。\n\t\t */\n\t\tprompt(\n\t\t\tsessionId: string,\n\t\t\ttext: string,\n\t\t\toptions?: { modelKey?: string },\n\t\t): Promise<{ status: \"sent\" | \"queued\" | \"failed\"; error?: { message: string } }>;\n\t\t/** 中止会话当前回合。 */\n\t\tabort(sessionId: string): Promise<void>;\n\t\t/** 重命名会话(写入会话文件标题),用于把看板卡片标题同步到会话列表。 */\n\t\trename(sessionPath: string, name: string): Promise<void>;\n\t\t/** 列出某目录下的历史会话。 */\n\t\tlist(cwd: string): Promise<PluginOfficialSessionSummary[]>;\n\t\t/** 当前处于 agent loop 中的会话文件路径快照。 */\n\t\tlistRunning(): Promise<string[]>;\n\t\t/**\n\t\t * 当前有会话在跑的项目 cwd(去重)。\n\t\t *\n\t\t * 需要「这个项目忙不忙」时用它,不要拿 `listRunning()` 的路径去比对 cwd:会话文件\n\t\t * 默认落在按 cwd 编码的分片目录里,那个编码不可逆且会让不同项目撞进同一分片。\n\t\t */\n\t\tlistRunningCwds(): Promise<string[]>;\n\t\t/** 订阅运行态翻转;返回取消订阅函数。 */\n\t\tonRunningChanged(handler: (event: PluginOfficialSessionRunningEvent) => void): () => void;\n\t\t/** 把宿主导航到该会话的对话页。 */\n\t\topen(input: { cwd: string; sessionPath: string }): Promise<void>;\n\t};\n\tnavigation: {\n\t\thelp(): unknown;\n\t\tresolveOpen(input: PluginOfficialNavigationOpenInput): {\n\t\t\thashPath: string;\n\t\t\tresolved: unknown;\n\t\t};\n\t\topen(input: PluginOfficialNavigationOpenInput): Promise<unknown>;\n\t};\n}\n"]}
1
+ {"version":3,"file":"official.js","sourceRoot":"","sources":["../src/official.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginPermission } from \"./permissions.js\";\n\nexport interface PluginOfficialGeneralSettings {\n\tworkspacePath: string;\n\tdefaultExecutionMode?: \"sandbox\" | \"full-access\";\n\tnotificationsEnabled: boolean;\n\tdebugMode: boolean;\n\tsandbox: unknown;\n}\n\nexport type PluginOfficialGeneralSettingsUpdate =\n\t| { operation: \"set-notifications\"; enabled: boolean }\n\t| { operation: \"set-execution-mode\"; mode: \"sandbox\" | \"full-access\" }\n\t| { operation: \"set-workspace\"; path: string };\n\nexport interface PluginOfficialExperimentalSettings {\n\tvettaCli: boolean;\n\tpromptPrediction: boolean;\n\tagentSkills: boolean;\n}\n\nexport interface PluginOfficialImageGenerationSettings {\n\ttextToImageProviderId?: string;\n\ttextToImageModelId?: string;\n\timageToImageProviderId?: string;\n\timageToImageModelId?: string;\n}\n\nexport type PluginOfficialImageGenerationSettingsUpdate = {\n\ttextToImageProviderId?: string | null;\n\ttextToImageModelId?: string | null;\n\timageToImageProviderId?: string | null;\n\timageToImageModelId?: string | null;\n};\n\nexport interface PluginOfficialDownloadItem {\n\tid: string;\n\turl: string;\n\tfilename: string;\n\tpath: string;\n\ttotalBytes: number;\n\treceivedBytes: number;\n\tstatus: \"queued\" | \"downloading\" | \"paused\" | \"completed\" | \"failed\" | \"canceled\";\n\terror?: string;\n\tcreatedAt: number;\n\tcompletedAt?: number;\n\tspeedBytesPerSec?: number;\n}\n\nexport interface PluginOfficialUpdaterState {\n\tphase: \"idle\" | \"checking\" | \"available\" | \"downloading\" | \"ready\" | \"installing\" | \"error\";\n\tcurrentVersion: string;\n\tlatestVersion?: string;\n\treleaseNote?: string;\n\tprogress?: number;\n\tdownloadedBytes?: number;\n\ttotalBytes?: number;\n\tassetFileName?: string;\n\terror?: string;\n}\n\nexport type PluginOfficialWebhookKind = \"feishu\" | \"dingtalk\";\n\nexport interface PluginOfficialWebhookEndpoint {\n\tid: string;\n\tkind: PluginOfficialWebhookKind;\n\tname: string;\n\tenabled: boolean;\n\tcreatedAt: string;\n\tupdatedAt: string;\n\turlMask?: string;\n\thasSignSecret?: boolean;\n}\n\nexport interface PluginOfficialWebhookProvider {\n\tkind: PluginOfficialWebhookKind;\n\tdisplayName: string;\n\ticonClass?: string;\n}\n\nexport interface PluginOfficialWebhookCreateInput {\n\tkind: PluginOfficialWebhookKind;\n\tname: string;\n\twebhookUrl: string;\n\tsignSecret?: string;\n\tenabled?: boolean;\n}\n\nexport interface PluginOfficialWebhookUpdateInput {\n\tname?: string;\n\tenabled?: boolean;\n\twebhookUrl?: string;\n\tsignSecret?: string;\n}\n\nexport interface PluginOfficialWebhookMessage {\n\ttitle?: string;\n\ttext: string;\n\tlevel?: \"info\" | \"warn\" | \"error\" | \"success\";\n}\n\nexport interface PluginOfficialWebhookSendResult {\n\tok: boolean;\n\terror?: string;\n}\n\nexport interface PluginOfficialSkillInfo {\n\tname: string;\n\talias?: string;\n\tdescription: string;\n\tsource: string;\n\ttype: \"skill\";\n}\n\nexport type PluginOfficialInstalledSkill = {\n\tname: string;\n\tversion: string;\n\tinstalledAt: string;\n\tsource: \"market\" | \"custom\";\n\tenabled: boolean;\n\ttype?: \"skill\";\n\talias?: string;\n\tmarketDescription?: string;\n\tdescription?: string;\n};\n\nexport interface PluginOfficialShortcutBinding {\n\tid: string;\n\tdefaultShortcut: string;\n\tshortcut: string;\n\tisDefault: boolean;\n}\n\nexport interface PluginOfficialImStatus {\n\tenabled: boolean;\n\ttransport: string;\n\tagentModel: { provider: string; model: string; reasoningLevel?: string } | null;\n\twechatBound: boolean;\n\tfeishuAppId: string | null;\n\truntime: unknown;\n}\n\nexport interface PluginOfficialImLog {\n\tlevel: string;\n\tmsg: string;\n\ttime: string;\n\tfields?: Record<string, unknown>;\n}\n\n/**\n * MCP 配置落点。省略时只操作全局 `~/.vetta/agent/mcp.json`;\n * `scope: \"project\"` 必须同时给出项目根 `cwd`,读写 `<cwd>/.vetta/mcp.json`。\n * 只给 `cwd` 时读操作会把项目一并纳入,写操作仍默认全局。\n */\nexport interface PluginOfficialMcpTarget {\n\tscope?: \"global\" | \"project\";\n\tcwd?: string;\n}\n\nexport interface PluginOfficialMcpServerSummary {\n\tname: string;\n\ttype: \"http\" | \"sse\" | \"stdio\";\n\tdisabled: boolean;\n\tcommand?: string;\n\turl?: string;\n\t/** 仅在传了 `scope` 或 `cwd` 时返回。 */\n\tscope?: \"global\" | \"project\";\n\t/** 来自项目根 `.mcp.json`:Vetta 只读取,不会改写。 */\n\treadOnly?: boolean;\n}\n\nexport interface PluginOfficialMcpServerDetail {\n\tname: string;\n\ttype?: \"http\" | \"sse\" | \"stdio\";\n\tcommand?: string;\n\targs?: string[];\n\tenv?: Record<string, string>;\n\tcwd?: string;\n\turl?: string;\n\theaders?: Record<string, string>;\n\tdisabled?: boolean;\n\tautoApprove?: string[];\n\tstartupTimeout?: number;\n\tdebug?: boolean;\n\tscope?: \"global\" | \"project\";\n\treadOnly?: boolean;\n}\n\nexport type PluginOfficialMcpUpsertData =\n\t| {\n\t\t\ttype?: \"stdio\";\n\t\t\tcommand?: string;\n\t\t\targs?: string[];\n\t\t\tenv?: Record<string, string>;\n\t\t\tcwd?: string;\n\t\t\tdisabled?: boolean;\n\t\t\tautoApprove?: string[];\n\t\t\tstartupTimeout?: number;\n\t\t\tdebug?: boolean;\n\t }\n\t| {\n\t\t\t/** `sse` 是旧式 HTTP+SSE 传输,仅为兼容仍在使用它的服务器。 */\n\t\t\ttype: \"http\" | \"sse\";\n\t\t\turl?: string;\n\t\t\theaders?: Record<string, string>;\n\t\t\tdisabled?: boolean;\n\t\t\tautoApprove?: string[];\n\t\t\tstartupTimeout?: number;\n\t\t\tdebug?: boolean;\n\t };\n\nexport type PluginOfficialExecutionMode = \"inherit\" | \"sandbox\" | \"full-access\";\n\nexport interface PluginOfficialSelectedSkill {\n\tname: string;\n\talias?: string;\n\ttype: \"skill\";\n}\n\nexport interface PluginOfficialBatchProjectCreateData {\n\tname: string;\n\tprompt: string;\n\tmodelKey?: string;\n\tfolders: string[];\n\tconcurrency: number;\n\texecutionMode?: PluginOfficialExecutionMode;\n\tartifactPatterns?: string[];\n\tnotifyEnabled?: boolean;\n\ttimeoutMinutes?: number;\n\tskill?: PluginOfficialSelectedSkill;\n}\n\nexport interface PluginOfficialBatchProjectUpdateData {\n\tname?: string;\n\tprompt?: string;\n\tmodelKey?: string;\n\tconcurrency?: number;\n\texecutionMode?: PluginOfficialExecutionMode;\n\tartifactPatterns?: string[];\n\tnotifyEnabled?: boolean;\n\ttimeoutMinutes?: number;\n\tnewFolders?: string[];\n\tskill?: PluginOfficialSelectedSkill | null;\n}\n\n/** 「重复」:精确到分钟,按本机时区;星期 0 = 周日;interval 为固定间隔;custom 为 5 段 cron。 */\nexport type PluginOfficialSchedulerSchedule =\n\t| { kind: \"once\"; at: number }\n\t| { kind: \"hourly\"; minute: number }\n\t| { kind: \"daily\"; hour: number; minute: number }\n\t| { kind: \"weekly\"; weekdays: number[]; hour: number; minute: number }\n\t| { kind: \"monthly\"; days: Array<number | \"last\">; hour: number; minute: number }\n\t/** 从 startAt(毫秒时间戳)起每 everyMinutes 分钟一次,1–10080。 */\n\t| { kind: \"interval\"; everyMinutes: number; startAt: number }\n\t| { kind: \"custom\"; cron: string };\n\n/**\n * 运行会话策略:projectCwd 为会话所属项目的路径,省略即落在默认「对话」里。\n * same-session 的 sessionPath 为 null 表示首次执行时新建一个会话,之后一直复用。\n */\nexport type PluginOfficialSchedulerRunTarget =\n\t| { mode: \"new-session\"; projectCwd?: string }\n\t| { mode: \"same-session\"; projectCwd?: string; sessionPath: string | null };\n\n/** 省略即「跟随默认模型」。 */\nexport interface PluginOfficialSchedulerModel {\n\tkey: string;\n\treasoning?: string;\n}\n\nexport interface PluginOfficialSchedulerNotification {\n\twebhookIds: string[];\n\twhen: \"always\" | \"success\" | \"failure\";\n\t/** 支持 {{name}} {{status}} {{startedAt}} {{duration}} {{reply}} {{error}}。 */\n\ttemplate: string;\n}\n\nexport interface PluginOfficialSchedulerTaskCreateData {\n\tname: string;\n\tprompt: string;\n\tschedule: PluginOfficialSchedulerSchedule;\n\trunTarget: PluginOfficialSchedulerRunTarget;\n\tmodel?: PluginOfficialSchedulerModel;\n\tnotification?: PluginOfficialSchedulerNotification;\n\tenabled?: boolean;\n}\n\nexport interface PluginOfficialSchedulerTaskUpdateData {\n\tname?: string;\n\tprompt?: string;\n\tschedule?: PluginOfficialSchedulerSchedule;\n\trunTarget?: PluginOfficialSchedulerRunTarget;\n\tmodel?: PluginOfficialSchedulerModel | null;\n\tnotification?: PluginOfficialSchedulerNotification | null;\n\tenabled?: boolean;\n}\n\nexport interface PluginOfficialModelSummary {\n\tid: string;\n\tname?: string;\n\tapi?: string;\n\treasoning?: boolean;\n}\n\nexport interface PluginOfficialProviderSummary {\n\tid: string;\n\tdisplayName: string;\n\tbaseUrl?: string;\n\tapi?: string;\n\thasApiKey: boolean;\n\t/** 图标 symbol;配合 `ProviderIcon` 解析为内置图标,无则不画图标。 */\n\ticon?: string;\n\t/**\n\t * true = 来自登录后服务端下发的远程目录(如 Vetta Go),凭据是账号登录态而非本地\n\t * API Key,因此不会出现在本地模型配置里,也不可用 `upsertProvider` / `removeProvider` 改。\n\t */\n\tremote?: boolean;\n\tmodelCount: number;\n\tmodels: PluginOfficialModelSummary[];\n}\n\nexport interface PluginOfficialProviderDetail {\n\tbaseUrl?: string;\n\tapiKey?: string;\n\tapi?: string;\n\tdisplayName?: string;\n\tauthHeader?: boolean;\n\theaders?: Record<string, string>;\n\tmodels?: Array<{\n\t\tid: string;\n\t\tname?: string;\n\t\tapi?: string;\n\t\treasoning?: boolean;\n\t\tcontextWindow?: number;\n\t\tmaxTokens?: number;\n\t}>;\n}\n\nexport interface PluginOfficialProviderUpsertData {\n\tbaseUrl?: string;\n\tapiKey?: string;\n\tapi?: string;\n\tdisplayName?: string;\n\tauthHeader?: boolean;\n\theaders?: Record<string, string>;\n\tmodels?: Array<{\n\t\tid: string;\n\t\tname?: string;\n\t\tapi?: string;\n\t\treasoning?: boolean;\n\t\tcontextWindow?: number;\n\t\tmaxTokens?: number;\n\t}>;\n}\n\nexport interface PluginOfficialProjectEntry {\n\tpath: string;\n\tname?: string;\n}\n\nexport interface PluginOfficialPluginSummary {\n\tid: string;\n\tname: string;\n\tversion: string;\n\tactiveVersion: string;\n\tpendingVersion?: string;\n\tenabled: boolean;\n\trequired: boolean;\n\tsource: string;\n\tpermissions: string[];\n\tdescription?: string;\n\trootPath?: string;\n\tdevWatch?: unknown;\n}\n\nexport interface PluginOfficialPluginChangedEvent {\n\treason?: string;\n\tpluginId?: string;\n}\n\nexport interface PluginOfficialSaveCopyOptions {\n\tdefaultFileName?: string;\n\ttitle?: string;\n\tfilters?: Array<{ name: string; extensions: string[] }>;\n}\n\n/** `official.dialog.openFiles` 的选项。 */\nexport interface PluginOfficialOpenFilesOptions {\n\ttitle?: string;\n\tfilters?: Array<{ name: string; extensions: string[] }>;\n\t/** 允许多选,默认单选。 */\n\tmultiple?: boolean;\n\t/** 单个文件的字节上限,超过则抛错。默认 64MB。 */\n\tmaxBytes?: number;\n}\n\n/** 用户在文件对话框里选中的一个文件,内容随选择一起回传。 */\nexport interface PluginOfficialOpenedFile {\n\tpath: string;\n\tname: string;\n\t/** base64 编码的文件内容。 */\n\tdata: string;\n}\n\nexport interface PluginOfficialKnowledgeBase {\n\tid: string;\n\tname: string;\n\tupdatedAt: number;\n\tisDefault: boolean;\n\tnodes: unknown[];\n}\n\nexport interface PluginOfficialKnowledgeProcessingSettings {\n\tenabled?: boolean;\n\tpollIntervalMinutes?: number;\n\tprocessingModelKey?: string;\n\tprocessingModelReasoningLevel?: string;\n\tagentConcurrency?: number;\n\tocrConcurrency?: number;\n}\n\n/** 由 `official.sessions.create` 新建的后台会话句柄。 */\nexport interface PluginOfficialSessionHandle {\n\t/** 进程内 runtime id,用于 prompt / abort / subscribe。重启后失效。 */\n\tsessionId: string;\n\t/** 会话文件绝对路径,跨重启稳定,用于持久化与跳转。 */\n\tsessionPath: string;\n\t/** 实际运行目录(「对话」项目会落到 per-session 子目录,见 ADR-0007)。 */\n\tcwd?: string;\n}\n\n/** 会话运行态变化广播(按 sessionPath 标识,跨重启稳定)。 */\nexport interface PluginOfficialSessionRunningEvent {\n\tsessionPath: string;\n\trunning: boolean;\n\tsessionId?: string;\n}\n\n/**\n * 会话文件此刻允许做什么。\n *\n * 同一份会话文件可能正被另一个运行时占用、或已不可读,宿主自己点会话时就是按这几\n * 位分流的(可续聊 / 只读查看 / 完全打不开)。插件在跳转前必须先看它,否则会把用户\n * 送进一个打不开的会话,且失败发生在导航之后、很难解释。\n */\nexport interface PluginOfficialSessionAccess {\n\t/** 能否读取历史。为 false 时连只读查看都不行。 */\n\treadHistory: boolean;\n\t/** 能否在对话页续聊。 */\n\tinteractiveResume: boolean;\n\trename: boolean;\n\tdelete: boolean;\n}\n\n/** 会话历史条目(`official.sessions.list` 返回),按 `modifiedAt` 倒序。 */\nexport interface PluginOfficialSessionSummary {\n\tpath: string;\n\tcwd?: string;\n\tfirstMessage?: string;\n\tmodifiedAt?: number;\n\taccess: PluginOfficialSessionAccess;\n}\n\n/**\n * 导航目标。多数目标只要 `target`;`target: \"new-session\"` 这类带参数的目标另需\n * `cwd`(项目绝对路径),缺了会被宿主拒绝而不是跳到一个空页面。\n */\nexport interface PluginOfficialNavigationOpenInput {\n\ttarget: string;\n\ttab?: string;\n\tsection?: string;\n\t/** 仅 `target: \"new-session\"` 使用:要新建会话的项目目录。 */\n\tcwd?: string;\n\t/**\n\t * 仅 `target: \"new-session\"` 使用:预置到输入框的草稿文本,不发送,用户可继续编辑。\n\t *\n\t * 用输入框的文本形态书写行内 token(`@skill:名字` / `@mcp:名字` / `@/abs/path`),\n\t * 宿主会把它们渲染成对应的 badge。在导航发生**之前**写入该 cwd 的新会话草稿位,\n\t * 所以不会被新会话页自己的草稿恢复覆盖;该 cwd 上已有的未发送草稿会被替换。\n\t */\n\tdraft?: string;\n}\n\n/** 仅宿主验证为官方来源的插件可以调用;普通插件调用时由宿主拒绝。 */\nexport interface PluginOfficialApi {\n\tgeneral: {\n\t\tgetSettings(): Promise<PluginOfficialGeneralSettings>;\n\t\tsetSettings(input: PluginOfficialGeneralSettingsUpdate): Promise<PluginOfficialGeneralSettingsUpdate>;\n\t};\n\tagent: {\n\t\tgetExperimental(): Promise<PluginOfficialExperimentalSettings>;\n\t\tsetExperimental(input: Partial<PluginOfficialExperimentalSettings>): Promise<PluginOfficialExperimentalSettings>;\n\t\tgetImageGeneration(): Promise<PluginOfficialImageGenerationSettings>;\n\t\tsetImageGeneration(\n\t\t\tinput: PluginOfficialImageGenerationSettingsUpdate,\n\t\t): Promise<PluginOfficialImageGenerationSettings>;\n\t};\n\tdownloads: {\n\t\tlist(): Promise<PluginOfficialDownloadItem[]>;\n\t\tcancel(id: string): Promise<void>;\n\t};\n\tupdater: {\n\t\tgetState(): Promise<PluginOfficialUpdaterState>;\n\t\tgetCurrentVersion(): Promise<string>;\n\t\tcheck(): Promise<PluginOfficialUpdaterState>;\n\t\tdownload(): Promise<PluginOfficialUpdaterState>;\n\t\tinstall(): Promise<void>;\n\t\tdismiss(): Promise<void>;\n\t\tcancel(): Promise<void>;\n\t};\n\twebhook: {\n\t\tlist(): Promise<PluginOfficialWebhookEndpoint[]>;\n\t\tlistProviders(): Promise<PluginOfficialWebhookProvider[]>;\n\t\tcreate(input: PluginOfficialWebhookCreateInput): Promise<PluginOfficialWebhookEndpoint>;\n\t\tupdate(id: string, input: PluginOfficialWebhookUpdateInput): Promise<PluginOfficialWebhookEndpoint>;\n\t\tsetEnabled(id: string, enabled: boolean): Promise<PluginOfficialWebhookEndpoint>;\n\t\tdelete(id: string): Promise<void>;\n\t\ttest(id: string): Promise<PluginOfficialWebhookSendResult>;\n\t\tsend(id: string, message: PluginOfficialWebhookMessage): Promise<PluginOfficialWebhookSendResult>;\n\t};\n\tskills: {\n\t\tlist(cwd?: string): Promise<PluginOfficialSkillInfo[]>;\n\t\tgetManifest(): Promise<Record<string, PluginOfficialInstalledSkill>>;\n\t\tsetEnabled(name: string, enabled: boolean): Promise<{ name: string; enabled: boolean }>;\n\t\tuninstall(name: string, type?: \"skill\"): Promise<void>;\n\t\t/**\n\t\t * 从能力市场按 slug 安装 skill(产品文案:能力)。\n\t\t * 下载在主进程完成;密钥类凭证不经过此 API。\n\t\t */\n\t\tinstallFromMarket(\n\t\t\ttype: \"skill\",\n\t\t\tslug: string,\n\t\t): Promise<{ name: string; type: \"skill\"; version: string; updated: boolean }>;\n\t};\n\tshortcuts: {\n\t\tlistAvailableActions(): Array<{ id: string; defaultShortcut: string }>;\n\t\tget(): Promise<{ bindings: PluginOfficialShortcutBinding[] }>;\n\t\tsetBinding(id: string, shortcut: string): Promise<{ bindings: PluginOfficialShortcutBinding[] }>;\n\t\tresetBinding(id: string): Promise<{ bindings: PluginOfficialShortcutBinding[]; shortcut: string }>;\n\t\tresetAllBindings(): Promise<{ bindings: PluginOfficialShortcutBinding[] }>;\n\t};\n\tim: {\n\t\tgetStatus(): Promise<PluginOfficialImStatus>;\n\t\tgetLogs(limit?: number): Promise<PluginOfficialImLog[]>;\n\t\tsetEnabled(enabled: boolean): Promise<{ status: unknown }>;\n\t\trestart(): Promise<{ status: unknown }>;\n\t\tsetAgentModel(\n\t\t\tmodelKey: string | null,\n\t\t\treasoningLevel?: string,\n\t\t): Promise<{ status: unknown }>;\n\t\tassertModelKeyExists(modelKey: string): Promise<void>;\n\t\t/**\n\t\t * 写入飞书凭证。Agent 应省略 appSecret 等密钥,由审批弹窗让用户手填。\n\t\t * 空字符串密钥字段表示保持现有值不改。\n\t\t */\n\t\tsetFeishuConfig(input: {\n\t\t\tenabled?: boolean;\n\t\t\tappId?: string;\n\t\t\tappSecret?: string;\n\t\t\tverificationToken?: string;\n\t\t\tencryptKey?: string;\n\t\t\tbaseUrl?: string;\n\t\t}): Promise<{ ok: boolean; error?: string }>;\n\t};\n\tmcp: {\n\t\tlist(target?: PluginOfficialMcpTarget): Promise<PluginOfficialMcpServerSummary[]>;\n\t\tget(name: string, target?: PluginOfficialMcpTarget): Promise<PluginOfficialMcpServerDetail>;\n\t\tlistNames(target?: PluginOfficialMcpTarget): Promise<string[]>;\n\t\tupsert(\n\t\t\tname: string,\n\t\t\tdata: PluginOfficialMcpUpsertData,\n\t\t\ttarget?: PluginOfficialMcpTarget,\n\t\t): Promise<PluginOfficialMcpServerDetail>;\n\t\tsetEnabled(name: string, enabled: boolean, target?: PluginOfficialMcpTarget): Promise<void>;\n\t\tremove(name: string, target?: PluginOfficialMcpTarget): Promise<void>;\n\t};\n\tmodels: {\n\t\t/**\n\t\t * 用户当前可选的全部模型:本地配置的 provider **加上**登录后服务端下发的远程目录\n\t\t * (Vetta Go 等,`remote: true`)。同一个 `provider/modelId` 以本地为准。\n\t\t * 与宿主输入栏模型选择器同一口径。\n\t\t */\n\t\tlist(): Promise<{ defaultModel: string | null; providers: PluginOfficialProviderSummary[] }>;\n\t\tget(provider?: string): Promise<unknown>;\n\t\tprobe(provider: string, model: string): Promise<{ ok: boolean; message?: string; error?: string }>;\n\t\tlistProviderIds(): Promise<string[]>;\n\t\tassertModelKeyExists(modelKey: string, operation?: string): Promise<void>;\n\t\tsetDefault(modelKey: string): Promise<{ defaultModel: string }>;\n\t\tupsertProvider(provider: string, data: PluginOfficialProviderUpsertData): Promise<PluginOfficialProviderDetail>;\n\t\t/** Removes the provider when present. Repeated removal is an idempotent no-op. */\n\t\tremoveProvider(provider: string): Promise<void>;\n\t};\n\tprojects: {\n\t\tlist(): Promise<{\n\t\t\tworkspacePath: string;\n\t\t\tprojects: PluginOfficialProjectEntry[];\n\t\t\tarchivedProjects: PluginOfficialProjectEntry[];\n\t\t}>;\n\t\tlistSessions(cwd: string): Promise<unknown[]>;\n\t\tlistRuntimeProjects(): Promise<unknown[]>;\n\t\tcreate(name: string, path?: string): Promise<PluginOfficialProjectEntry>;\n\t\topen(path: string, name?: string): Promise<PluginOfficialProjectEntry>;\n\t\trename(path: string, name: string): Promise<PluginOfficialProjectEntry>;\n\t\tarchive(path: string): Promise<void>;\n\t\tunarchive(path: string): Promise<void>;\n\t\tremove(path: string): Promise<void>;\n\t};\n\tplugins: {\n\t\tlist(): Promise<PluginOfficialPluginSummary[]>;\n\t\tget(id: string): Promise<PluginOfficialPluginSummary>;\n\t\tsetEnabled(id: string, enabled: boolean): Promise<PluginOfficialPluginSummary>;\n\t\tinstallFromUrl(\n\t\t\turl: string,\n\t\t\toptions?: { initiator?: \"plugin-cli\" },\n\t\t): Promise<PluginOfficialPluginSummary>;\n\t\tinstallFromPath(\n\t\t\tpath: string,\n\t\t\toptions?: {\n\t\t\t\tinitiator?: \"plugin-cli\" | \"plugin-workbench\";\n\t\t\t\tgrantedPermissions?: string[];\n\t\t\t\tenable?: boolean;\n\t\t\t\tsource?: \"archive\" | \"npm\";\n\t\t\t\texpectedSha256?: string;\n\t\t\t\texpectedId?: string;\n\t\t\t\texpectedVersion?: string;\n\t\t\t\tnpm?: {\n\t\t\t\t\tpackageName: string;\n\t\t\t\t\trequestedSpec: string;\n\t\t\t\t\tresolvedVersion: string;\n\t\t\t\t\tintegrity?: string;\n\t\t\t\t};\n\t\t\t},\n\t\t): Promise<PluginOfficialPluginSummary>;\n\t\tuninstall(id: string): Promise<void>;\n\t\treload(id: string): Promise<PluginOfficialPluginSummary>;\n\t\tgrantPermissions(id: string, permissions: PluginPermission[]): Promise<PluginOfficialPluginSummary>;\n\t\tstartDevWatch(id: string, projectDir: string): Promise<PluginOfficialPluginSummary>;\n\t\tstopDevWatch(id: string): Promise<void>;\n\t\tonChanged(handler: (event?: PluginOfficialPluginChangedEvent) => void): () => void;\n\t};\n\tdialog: {\n\t\tsaveCopy(sourcePath: string, options?: PluginOfficialSaveCopyOptions): Promise<string | null>;\n\t\t/**\n\t\t * 打开原生文件选择框,并把选中文件的**内容**一起返回。\n\t\t *\n\t\t * 插件的 `ctx.fs` 只能读已授权的项目根,因此「选个文件再自己去读」这条路走不通;\n\t\t * 这个接口不放宽任何目录授权,插件能看到的只有用户这次亲手选中的文件。\n\t\t * 用户取消时返回空数组。\n\t\t */\n\t\topenFiles(options?: PluginOfficialOpenFilesOptions): Promise<PluginOfficialOpenedFile[]>;\n\t};\n\tshell: {\n\t\t/**\n\t\t * 在系统文件管理器里定位并选中这个路径。\n\t\t *\n\t\t * 与 `ui.openExternal` 分工:那个只放行 http/https,用来把链接交给浏览器;\n\t\t * 这个只做「显示这个本地路径」,不能用来拉起任意协议。\n\t\t */\n\t\tshowItemInFolder(path: string): Promise<void>;\n\t};\n\tknowledge: {\n\t\tlist(): Promise<PluginOfficialKnowledgeBase[]>;\n\t\tfileStatuses(): Promise<Record<string, unknown>>;\n\t\tisProcessing(): Promise<boolean>;\n\t\tgetProcessing(): Promise<PluginOfficialKnowledgeProcessingSettings>;\n\t\tcreate(name: string): Promise<void>;\n\t\trename(name: string, newName: string): Promise<void>;\n\t\tdelete(name: string): Promise<void>;\n\t\taddFiles(kbId: string, paths: string[], move?: boolean): Promise<void>;\n\t\tdeleteEntry(kbId: string, relPath: string): Promise<void>;\n\t\tscanNow(): Promise<{ skipped: boolean; reason?: string }>;\n\t\tretryFailed(): Promise<{ skipped: boolean; reason?: string }>;\n\t\tsetProcessing(\n\t\t\tdata: Partial<{\n\t\t\t\tenabled: boolean;\n\t\t\t\tpollIntervalMinutes: 3 | 5 | 10 | 30;\n\t\t\t\tprocessingModelKey: string | null;\n\t\t\t\tprocessingModelReasoningLevel: string | null;\n\t\t\t\tagentConcurrency: number;\n\t\t\t\tocrConcurrency: number;\n\t\t\t}>,\n\t\t): Promise<PluginOfficialKnowledgeProcessingSettings>;\n\t};\n\tbatchTasks: {\n\t\tlistProjects(): Promise<unknown[]>;\n\t\tgetProject(projectId: string): Promise<unknown>;\n\t\tlistProjectIds(): Promise<string[]>;\n\t\tcreateProject(data: PluginOfficialBatchProjectCreateData): Promise<unknown>;\n\t\tupdateProject(projectId: string, data: PluginOfficialBatchProjectUpdateData): Promise<unknown>;\n\t\tdeleteProject(projectId: string): Promise<unknown>;\n\t\trunTask(projectId: string, taskId: string): Promise<unknown>;\n\t\tretryTask(projectId: string, taskId: string): Promise<unknown>;\n\t\tstopTask(projectId: string, taskId: string): Promise<unknown>;\n\t\tdeleteTask(projectId: string, taskId: string): Promise<unknown>;\n\t\tresumeTask(projectId: string, taskId: string): Promise<unknown>;\n\t\tresumeTaskWithText(projectId: string, taskId: string, text: string): Promise<unknown>;\n\t\tdeleteTaskSession(projectId: string, taskId: string): Promise<unknown>;\n\t\tbatchDelete(projectId: string): Promise<unknown>;\n\t\tbatchStart(projectId: string): Promise<unknown>;\n\t\tbatchStop(projectId: string): Promise<unknown>;\n\t\tbatchReset(projectId: string): Promise<unknown>;\n\t\tbatchResetFailed(projectId: string, taskIds: string[]): Promise<unknown>;\n\t};\n\tscheduler: {\n\t\tlistTasks(): Promise<unknown[]>;\n\t\tgetTask(taskId: string): Promise<unknown>;\n\t\tlistTaskIds(): Promise<string[]>;\n\t\tgetHistory(taskId: string): Promise<unknown[]>;\n\t\tcreateTask(data: PluginOfficialSchedulerTaskCreateData): Promise<unknown>;\n\t\tupdateTask(taskId: string, data: PluginOfficialSchedulerTaskUpdateData): Promise<unknown>;\n\t\tdeleteTask(taskId: string): Promise<unknown>;\n\t\tsetEnabled(taskId: string, enabled: boolean): Promise<unknown>;\n\t\trunNow(taskId: string): Promise<unknown>;\n\t\tabort(taskId: string): Promise<unknown>;\n\t};\n\tappearance: {\n\t\thelp(): Promise<unknown>;\n\t\tget(): Promise<unknown>;\n\t\tset(input: {\n\t\t\tmode?: \"light\" | \"dark\" | \"auto\";\n\t\t\tthemeId?: string;\n\t\t}): Promise<unknown>;\n\t\tsetLanguage(language: \"zh\" | \"en\"): Promise<unknown>;\n\t\tlistThemeIds(): string[];\n\t};\n\t/**\n\t * 后台会话编排。会话本体跑在主进程,创建后即使宿主停留在别的页面也会继续执行,\n\t * 因此系统插件可以据此做「多任务并发派单」类工作台(如看板)。\n\t */\n\tsessions: {\n\t\t/**\n\t\t * 在 `cwd` 下新建一个会话;不发送任何 prompt。\n\t\t *\n\t\t * 传 `modelKey`(`provider/modelId`)时写入该会话的模型设置,后续无论是插件\n\t\t * 继续 `prompt`、还是用户在对话页手动接着聊,都用这个模型;不传则跟随宿主全局默认。\n\t\t */\n\t\tcreate(input: { cwd: string; title?: string; modelKey?: string }): Promise<PluginOfficialSessionHandle>;\n\t\t/**\n\t\t * 向会话发起一轮对话。streaming 中会进入该会话的输入队列(ADR-0060)。\n\t\t *\n\t\t * `options.modelKey` 只钉住**这一轮**用哪个模型(不改会话设置);要让整个会话\n\t\t * 都用某个模型,在 `create` 时传 `modelKey`。\n\t\t */\n\t\tprompt(\n\t\t\tsessionId: string,\n\t\t\ttext: string,\n\t\t\toptions?: { modelKey?: string },\n\t\t): Promise<{ status: \"sent\" | \"queued\" | \"failed\"; error?: { message: string } }>;\n\t\t/** 中止会话当前回合。 */\n\t\tabort(sessionId: string): Promise<void>;\n\t\t/** 重命名会话(写入会话文件标题),用于把看板卡片标题同步到会话列表。 */\n\t\trename(sessionPath: string, name: string): Promise<void>;\n\t\t/** 列出某目录下的历史会话。 */\n\t\tlist(cwd: string): Promise<PluginOfficialSessionSummary[]>;\n\t\t/** 当前处于 agent loop 中的会话文件路径快照。 */\n\t\tlistRunning(): Promise<string[]>;\n\t\t/**\n\t\t * 当前有会话在跑的项目 cwd(去重)。\n\t\t *\n\t\t * 需要「这个项目忙不忙」时用它,不要拿 `listRunning()` 的路径去比对 cwd:会话文件\n\t\t * 默认落在按 cwd 编码的分片目录里,那个编码不可逆且会让不同项目撞进同一分片。\n\t\t */\n\t\tlistRunningCwds(): Promise<string[]>;\n\t\t/** 订阅运行态翻转;返回取消订阅函数。 */\n\t\tonRunningChanged(handler: (event: PluginOfficialSessionRunningEvent) => void): () => void;\n\t\t/** 把宿主导航到该会话的对话页。 */\n\t\topen(input: { cwd: string; sessionPath: string }): Promise<void>;\n\t};\n\tnavigation: {\n\t\thelp(): unknown;\n\t\tresolveOpen(input: PluginOfficialNavigationOpenInput): {\n\t\t\thashPath: string;\n\t\t\tresolved: unknown;\n\t\t};\n\t\topen(input: PluginOfficialNavigationOpenInput): Promise<unknown>;\n\t};\n}\n"]}
@@ -1,3 +1,3 @@
1
- export declare const PLUGIN_PERMISSIONS: readonly ["ui.slot.global", "ui.slot.ability-detail", "ui.slot.file-preview", "ui.slot.activity-tab", "ui.slot.bottom-panel", "terminal.run", "ui.slot.input-action", "ui.slot.message", "ui.slot.tool-call", "ui.slot.turn-card", "ui.slot.workspace-view", "ui.slot.new-session-context", "ui.slot.header-action", "ui.shortcuts.register", "conversation.draft.read", "ui.file-explorer.decorations", "ui.file-explorer.context-menu", "ui.file-explorer.toolbar", "workspace.read", "agent.session.read", "agent.session.write", "agent.command.run", "agent.command.spawn", "capture.offscreen", "browser.read", "browser.open", "browser.interact", "browser.profile.persist", "browser.attach", "browser.runtime.manage", "agent.systemPrompt.read", "agent.systemPrompt.write", "agent.systemPrompt.fullControl", "agent.skills.control", "agent.mcp.control", "agent.tools.control", "agent.tools.register", "agent.toolHandler.execute", "agent.hooks.register", "agent.hookHandler.execute", "agent.state.read", "agent.state.write", "agent.continuation.register", "agent.runtime.configure", "app.actions.register", "app.actionHandler.execute", "ai.models.list", "ai.complete", "models.manage", "fs.read", "fs.write", "network.fetch", "storage.read", "storage.write", "media.generate", "media.provider.register", "ai.ocr.recognize", "ai.ocr.provider.register", "settings.read", "settings.write", "secrets.read", "secrets.write", "shell.openExternal"];
1
+ export declare const PLUGIN_PERMISSIONS: readonly ["ui.slot.global", "ui.slot.ability-detail", "ui.slot.file-preview", "ui.slot.activity-tab", "ui.slot.bottom-panel", "terminal.run", "ui.slot.input-action", "ui.slot.message", "ui.slot.tool-call", "ui.slot.turn-card", "ui.slot.workspace-view", "ui.slot.new-session-context", "ui.slot.header-action", "ui.shortcuts.register", "conversation.draft.read", "ui.file-explorer.decorations", "ui.file-explorer.context-menu", "ui.file-explorer.toolbar", "workspace.read", "agent.session.read", "agent.session.metrics", "agent.session.write", "agent.command.run", "agent.command.spawn", "capture.offscreen", "browser.read", "browser.open", "browser.interact", "browser.profile.persist", "browser.attach", "browser.runtime.manage", "agent.systemPrompt.read", "agent.systemPrompt.write", "agent.systemPrompt.fullControl", "agent.skills.control", "agent.mcp.control", "agent.tools.control", "agent.tools.register", "agent.toolHandler.execute", "agent.hooks.register", "agent.hookHandler.execute", "agent.state.read", "agent.state.write", "agent.continuation.register", "agent.runtime.configure", "app.actions.register", "app.actionHandler.execute", "ai.models.list", "ai.complete", "models.manage", "fs.read", "fs.write", "network.fetch", "storage.read", "storage.write", "media.generate", "media.provider.register", "ai.ocr.recognize", "ai.ocr.provider.register", "settings.read", "settings.write", "secrets.read", "secrets.write", "shell.openExternal"];
2
2
  export type PluginPermission = (typeof PLUGIN_PERMISSIONS)[number];
3
3
  //# sourceMappingURL=permissions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,m5CAgErB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC","sourcesContent":["export const PLUGIN_PERMISSIONS = [\n\t\"ui.slot.global\",\n\t\"ui.slot.ability-detail\",\n\t\"ui.slot.file-preview\",\n\t\"ui.slot.activity-tab\",\n\t\"ui.slot.bottom-panel\",\n\t\"terminal.run\",\n\t\"ui.slot.input-action\",\n\t\"ui.slot.message\",\n\t\"ui.slot.tool-call\",\n\t\"ui.slot.turn-card\",\n\t\"ui.slot.workspace-view\",\n\t\"ui.slot.new-session-context\",\n\t\"ui.slot.header-action\",\n\t\"ui.shortcuts.register\",\n\t\"conversation.draft.read\",\n\t\"ui.file-explorer.decorations\",\n\t\"ui.file-explorer.context-menu\",\n\t\"ui.file-explorer.toolbar\",\n\t\"workspace.read\",\n\t\"agent.session.read\",\n\t\"agent.session.write\",\n\t\"agent.command.run\",\n\t\"agent.command.spawn\",\n\t\"capture.offscreen\",\n\t\"browser.read\",\n\t\"browser.open\",\n\t\"browser.interact\",\n\t\"browser.profile.persist\",\n\t\"browser.attach\",\n\t\"browser.runtime.manage\",\n\t\"agent.systemPrompt.read\",\n\t\"agent.systemPrompt.write\",\n\t\"agent.systemPrompt.fullControl\",\n\t\"agent.skills.control\",\n\t\"agent.mcp.control\",\n\t\"agent.tools.control\",\n\t\"agent.tools.register\",\n\t\"agent.toolHandler.execute\",\n\t\"agent.hooks.register\",\n\t\"agent.hookHandler.execute\",\n\t\"agent.state.read\",\n\t\"agent.state.write\",\n\t\"agent.continuation.register\",\n\t\"agent.runtime.configure\",\n\t\"app.actions.register\",\n\t\"app.actionHandler.execute\",\n\t\"ai.models.list\",\n\t\"ai.complete\",\n\t\"models.manage\",\n\t\"fs.read\",\n\t\"fs.write\",\n\t\"network.fetch\",\n\t\"storage.read\",\n\t\"storage.write\",\n\t\"media.generate\",\n\t\"media.provider.register\",\n\t\"ai.ocr.recognize\",\n\t\"ai.ocr.provider.register\",\n\t\"settings.read\",\n\t\"settings.write\",\n\t\"secrets.read\",\n\t\"secrets.write\",\n\t\"shell.openExternal\",\n] as const;\n\nexport type PluginPermission = (typeof PLUGIN_PERMISSIONS)[number];\n"]}
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,46CAiErB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC","sourcesContent":["export const PLUGIN_PERMISSIONS = [\n\t\"ui.slot.global\",\n\t\"ui.slot.ability-detail\",\n\t\"ui.slot.file-preview\",\n\t\"ui.slot.activity-tab\",\n\t\"ui.slot.bottom-panel\",\n\t\"terminal.run\",\n\t\"ui.slot.input-action\",\n\t\"ui.slot.message\",\n\t\"ui.slot.tool-call\",\n\t\"ui.slot.turn-card\",\n\t\"ui.slot.workspace-view\",\n\t\"ui.slot.new-session-context\",\n\t\"ui.slot.header-action\",\n\t\"ui.shortcuts.register\",\n\t\"conversation.draft.read\",\n\t\"ui.file-explorer.decorations\",\n\t\"ui.file-explorer.context-menu\",\n\t\"ui.file-explorer.toolbar\",\n\t\"workspace.read\",\n\t\"agent.session.read\",\n\t\"agent.session.metrics\",\n\t\"agent.session.write\",\n\t\"agent.command.run\",\n\t\"agent.command.spawn\",\n\t\"capture.offscreen\",\n\t\"browser.read\",\n\t\"browser.open\",\n\t\"browser.interact\",\n\t\"browser.profile.persist\",\n\t\"browser.attach\",\n\t\"browser.runtime.manage\",\n\t\"agent.systemPrompt.read\",\n\t\"agent.systemPrompt.write\",\n\t\"agent.systemPrompt.fullControl\",\n\t\"agent.skills.control\",\n\t\"agent.mcp.control\",\n\t\"agent.tools.control\",\n\t\"agent.tools.register\",\n\t\"agent.toolHandler.execute\",\n\t\"agent.hooks.register\",\n\t\"agent.hookHandler.execute\",\n\t\"agent.state.read\",\n\t\"agent.state.write\",\n\t\"agent.continuation.register\",\n\t\"agent.runtime.configure\",\n\t\"app.actions.register\",\n\t\"app.actionHandler.execute\",\n\t\"ai.models.list\",\n\t\"ai.complete\",\n\t\"models.manage\",\n\t\"fs.read\",\n\t\"fs.write\",\n\t\"network.fetch\",\n\t\"storage.read\",\n\t\"storage.write\",\n\t\"media.generate\",\n\t\"media.provider.register\",\n\t\"ai.ocr.recognize\",\n\t\"ai.ocr.provider.register\",\n\t\"settings.read\",\n\t\"settings.write\",\n\t\"secrets.read\",\n\t\"secrets.write\",\n\t\"shell.openExternal\",\n] as const;\n\nexport type PluginPermission = (typeof PLUGIN_PERMISSIONS)[number];\n"]}
@@ -19,6 +19,7 @@ export const PLUGIN_PERMISSIONS = [
19
19
  "ui.file-explorer.toolbar",
20
20
  "workspace.read",
21
21
  "agent.session.read",
22
+ "agent.session.metrics",
22
23
  "agent.session.write",
23
24
  "agent.command.run",
24
25
  "agent.command.spawn",
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.js","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IACjC,gBAAgB;IAChB,wBAAwB;IACxB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,cAAc;IACd,sBAAsB;IACtB,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,wBAAwB;IACxB,6BAA6B;IAC7B,uBAAuB;IACvB,uBAAuB;IACvB,yBAAyB;IACzB,8BAA8B;IAC9B,+BAA+B;IAC/B,0BAA0B;IAC1B,gBAAgB;IAChB,oBAAoB;IACpB,qBAAqB;IACrB,mBAAmB;IACnB,qBAAqB;IACrB,mBAAmB;IACnB,cAAc;IACd,cAAc;IACd,kBAAkB;IAClB,yBAAyB;IACzB,gBAAgB;IAChB,wBAAwB;IACxB,yBAAyB;IACzB,0BAA0B;IAC1B,gCAAgC;IAChC,sBAAsB;IACtB,mBAAmB;IACnB,qBAAqB;IACrB,sBAAsB;IACtB,2BAA2B;IAC3B,sBAAsB;IACtB,2BAA2B;IAC3B,kBAAkB;IAClB,mBAAmB;IACnB,6BAA6B;IAC7B,yBAAyB;IACzB,sBAAsB;IACtB,2BAA2B;IAC3B,gBAAgB;IAChB,aAAa;IACb,eAAe;IACf,SAAS;IACT,UAAU;IACV,eAAe;IACf,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,yBAAyB;IACzB,kBAAkB;IAClB,0BAA0B;IAC1B,eAAe;IACf,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,oBAAoB;CACX,CAAC","sourcesContent":["export const PLUGIN_PERMISSIONS = [\n\t\"ui.slot.global\",\n\t\"ui.slot.ability-detail\",\n\t\"ui.slot.file-preview\",\n\t\"ui.slot.activity-tab\",\n\t\"ui.slot.bottom-panel\",\n\t\"terminal.run\",\n\t\"ui.slot.input-action\",\n\t\"ui.slot.message\",\n\t\"ui.slot.tool-call\",\n\t\"ui.slot.turn-card\",\n\t\"ui.slot.workspace-view\",\n\t\"ui.slot.new-session-context\",\n\t\"ui.slot.header-action\",\n\t\"ui.shortcuts.register\",\n\t\"conversation.draft.read\",\n\t\"ui.file-explorer.decorations\",\n\t\"ui.file-explorer.context-menu\",\n\t\"ui.file-explorer.toolbar\",\n\t\"workspace.read\",\n\t\"agent.session.read\",\n\t\"agent.session.write\",\n\t\"agent.command.run\",\n\t\"agent.command.spawn\",\n\t\"capture.offscreen\",\n\t\"browser.read\",\n\t\"browser.open\",\n\t\"browser.interact\",\n\t\"browser.profile.persist\",\n\t\"browser.attach\",\n\t\"browser.runtime.manage\",\n\t\"agent.systemPrompt.read\",\n\t\"agent.systemPrompt.write\",\n\t\"agent.systemPrompt.fullControl\",\n\t\"agent.skills.control\",\n\t\"agent.mcp.control\",\n\t\"agent.tools.control\",\n\t\"agent.tools.register\",\n\t\"agent.toolHandler.execute\",\n\t\"agent.hooks.register\",\n\t\"agent.hookHandler.execute\",\n\t\"agent.state.read\",\n\t\"agent.state.write\",\n\t\"agent.continuation.register\",\n\t\"agent.runtime.configure\",\n\t\"app.actions.register\",\n\t\"app.actionHandler.execute\",\n\t\"ai.models.list\",\n\t\"ai.complete\",\n\t\"models.manage\",\n\t\"fs.read\",\n\t\"fs.write\",\n\t\"network.fetch\",\n\t\"storage.read\",\n\t\"storage.write\",\n\t\"media.generate\",\n\t\"media.provider.register\",\n\t\"ai.ocr.recognize\",\n\t\"ai.ocr.provider.register\",\n\t\"settings.read\",\n\t\"settings.write\",\n\t\"secrets.read\",\n\t\"secrets.write\",\n\t\"shell.openExternal\",\n] as const;\n\nexport type PluginPermission = (typeof PLUGIN_PERMISSIONS)[number];\n"]}
1
+ {"version":3,"file":"permissions.js","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IACjC,gBAAgB;IAChB,wBAAwB;IACxB,sBAAsB;IACtB,sBAAsB;IACtB,sBAAsB;IACtB,cAAc;IACd,sBAAsB;IACtB,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,wBAAwB;IACxB,6BAA6B;IAC7B,uBAAuB;IACvB,uBAAuB;IACvB,yBAAyB;IACzB,8BAA8B;IAC9B,+BAA+B;IAC/B,0BAA0B;IAC1B,gBAAgB;IAChB,oBAAoB;IACpB,uBAAuB;IACvB,qBAAqB;IACrB,mBAAmB;IACnB,qBAAqB;IACrB,mBAAmB;IACnB,cAAc;IACd,cAAc;IACd,kBAAkB;IAClB,yBAAyB;IACzB,gBAAgB;IAChB,wBAAwB;IACxB,yBAAyB;IACzB,0BAA0B;IAC1B,gCAAgC;IAChC,sBAAsB;IACtB,mBAAmB;IACnB,qBAAqB;IACrB,sBAAsB;IACtB,2BAA2B;IAC3B,sBAAsB;IACtB,2BAA2B;IAC3B,kBAAkB;IAClB,mBAAmB;IACnB,6BAA6B;IAC7B,yBAAyB;IACzB,sBAAsB;IACtB,2BAA2B;IAC3B,gBAAgB;IAChB,aAAa;IACb,eAAe;IACf,SAAS;IACT,UAAU;IACV,eAAe;IACf,cAAc;IACd,eAAe;IACf,gBAAgB;IAChB,yBAAyB;IACzB,kBAAkB;IAClB,0BAA0B;IAC1B,eAAe;IACf,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,oBAAoB;CACX,CAAC","sourcesContent":["export const PLUGIN_PERMISSIONS = [\n\t\"ui.slot.global\",\n\t\"ui.slot.ability-detail\",\n\t\"ui.slot.file-preview\",\n\t\"ui.slot.activity-tab\",\n\t\"ui.slot.bottom-panel\",\n\t\"terminal.run\",\n\t\"ui.slot.input-action\",\n\t\"ui.slot.message\",\n\t\"ui.slot.tool-call\",\n\t\"ui.slot.turn-card\",\n\t\"ui.slot.workspace-view\",\n\t\"ui.slot.new-session-context\",\n\t\"ui.slot.header-action\",\n\t\"ui.shortcuts.register\",\n\t\"conversation.draft.read\",\n\t\"ui.file-explorer.decorations\",\n\t\"ui.file-explorer.context-menu\",\n\t\"ui.file-explorer.toolbar\",\n\t\"workspace.read\",\n\t\"agent.session.read\",\n\t\"agent.session.metrics\",\n\t\"agent.session.write\",\n\t\"agent.command.run\",\n\t\"agent.command.spawn\",\n\t\"capture.offscreen\",\n\t\"browser.read\",\n\t\"browser.open\",\n\t\"browser.interact\",\n\t\"browser.profile.persist\",\n\t\"browser.attach\",\n\t\"browser.runtime.manage\",\n\t\"agent.systemPrompt.read\",\n\t\"agent.systemPrompt.write\",\n\t\"agent.systemPrompt.fullControl\",\n\t\"agent.skills.control\",\n\t\"agent.mcp.control\",\n\t\"agent.tools.control\",\n\t\"agent.tools.register\",\n\t\"agent.toolHandler.execute\",\n\t\"agent.hooks.register\",\n\t\"agent.hookHandler.execute\",\n\t\"agent.state.read\",\n\t\"agent.state.write\",\n\t\"agent.continuation.register\",\n\t\"agent.runtime.configure\",\n\t\"app.actions.register\",\n\t\"app.actionHandler.execute\",\n\t\"ai.models.list\",\n\t\"ai.complete\",\n\t\"models.manage\",\n\t\"fs.read\",\n\t\"fs.write\",\n\t\"network.fetch\",\n\t\"storage.read\",\n\t\"storage.write\",\n\t\"media.generate\",\n\t\"media.provider.register\",\n\t\"ai.ocr.recognize\",\n\t\"ai.ocr.provider.register\",\n\t\"settings.read\",\n\t\"settings.write\",\n\t\"secrets.read\",\n\t\"secrets.write\",\n\t\"shell.openExternal\",\n] as const;\n\nexport type PluginPermission = (typeof PLUGIN_PERMISSIONS)[number];\n"]}
package/dist/ui.d.ts CHANGED
@@ -368,6 +368,12 @@ export interface PluginOpenActivityTabOptions extends PluginActivityTabTargetOpt
368
368
  * widest the window allows — `"max"` keeps following window resizes until the
369
369
  * user drags the divider. The host clamps to its min/max bounds. Omit to keep
370
370
  * the user's current width.
371
+ *
372
+ * Applied when the tab is attached for the first time, or when this call opens
373
+ * a closed panel — the panel then slides in at this width in one motion.
374
+ * Ignored when the panel is already open with the tab attached (the user's
375
+ * width stands), and for calls made while `activate` is still running, since
376
+ * those replay on every reload.
371
377
  */
372
378
  width?: number | "max";
373
379
  }
@@ -948,9 +954,10 @@ export interface PluginUiApi {
948
954
  * `"max"` 是一种持续状态而非一次性求值:窗口尺寸变化时面板跟着变宽变窄,直到
949
955
  * 用户拖动分隔条或有人写入具体像素为止。传数字则是一次性的固定宽度。
950
956
  *
951
- * 与 `openActivityTab(id, { width })` 的区别:那里的宽度只在标签卡首次 attach
952
- * 时生效(避免 activate 重放覆盖用户手拖的宽度);这个是命令式的,每次调用都
953
- * 生效,供插件在自己的标签卡被激活、进入某种视图时按需调整。用户随后仍可拖动。
957
+ * 与 `openActivityTab(id, { width })` 的区别:那里的宽度只在「标签卡首次 attach」
958
+ * 或「把关着的面板翻开」时生效,且 activate 里的调用除外(避免重放覆盖用户手拖的
959
+ * 宽度);这个是命令式的,每次调用都生效,供插件在自己的标签卡被激活、进入某种
960
+ * 视图时按需调整。用户随后仍可拖动。
954
961
  */
955
962
  setActivityPanelWidth(width: number | "max"): void;
956
963
  /**
package/dist/ui.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AAEtE,MAAM,WAAW,4BAA4B;IAC5C,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,WAAW,4BAA4B;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;CACjB;AAED,oFAAoF;AACpF,MAAM,WAAW,mCAAmC;IACnD,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,aAAa,CAAC,4BAA4B,CAAC,CAAC;CACvD;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACxC,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAE7E;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GACvB;IAAE,IAAI,EAAE,MAA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;;OAOG;IACH,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC3C;;;;;OAKG;IACH,eAAe,IAAI,kBAAkB,CAAC;IACtC;;;;;OAKG;IACH,qBAAqB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,GAAG,UAAU,CAAC;CACjF","sourcesContent":["import type { ComponentType, ReactNode } from \"react\";\nimport type { ConversationMessage } from \"./conversation.js\";\nimport type { Disposable } from \"./disposable.js\";\nimport type { PluginImageRef } from \"./images.js\";\nimport type { PluginPromptAttachment } from \"./prompt-attachment.js\";\nimport type { ConversationScenario } from \"./scenario.js\";\nimport type { PluginShortcutScopeContribution } from \"./shortcuts.js\";\n\nexport interface PluginGlobalSlotContribution {\n\tid: string;\n\tcomponent: ComponentType;\n}\n\nexport interface PluginAbilityDetailSlotProps {\n\tabilityId: string;\n\tinstalled: boolean;\n\tenabled: boolean;\n}\n\n/** Inline setup/status surface rendered near the top of one ability detail page. */\nexport interface PluginAbilityDetailSlotContribution {\n\tid: string;\n\tabilityId: string;\n\tcomponent: ComponentType<PluginAbilityDetailSlotProps>;\n}\n\n/**\n * Props handed to a workspace-view component. A workspace view owns the whole\n * content area, so unlike panel slots it is addressed by its own route and can\n * be deep-linked; the host passes back its identity so one component can serve\n * several registered views.\n */\nexport interface PluginWorkspaceViewProps {\n\t/** The contribution id as registered (NOT namespaced). */\n\tviewId: string;\n\t/** The owning plugin id. */\n\tpluginId: string;\n}\n\n/**\n * Badge tone. The host maps it to its own theme colors — a plugin cannot pick a\n * raw color, so badges stay consistent with the built-in navigation entries.\n */\nexport type PluginNavBadgeTone = \"accent\" | \"danger\" | \"default\" | \"warning\";\n\n/**\n * A badge on the plugin's sidebar navigation entry.\n *\n * `beta` is the host's own preset — it renders exactly like the built-in\n * 知识库 Beta 标识, wording included (and localized by the host), so plugins do\n * not have to spell \"Beta\" themselves in every locale.\n *\n * `count` renders `99+` past 99 and disappears at 0 — an unread badge showing\n * \"0\" is worse than no badge.\n */\nexport type PluginNavBadge =\n\t| { kind: \"beta\" }\n\t| { kind: \"text\"; text: string; tone?: PluginNavBadgeTone }\n\t| { kind: \"count\"; count: number; tone?: PluginNavBadgeTone }\n\t| { kind: \"dot\"; tone?: PluginNavBadgeTone };\n\n/**\n * A **workspace view**(工作区视图): a full-page surface a plugin contributes to\n * the host's primary navigation. It is the plugin counterpart of a built-in page\n * such as 自动化 / 知识库 — the host gives it its own route\n * (`/workspace/<pluginId>/<viewId>`) and a sidebar entry, and the plugin owns the\n * entire content area while it is open.\n *\n * Use it for standalone workbenches that are NOT bound to one conversation\n * (dashboards, boards, consoles). Conversation-scoped UI belongs in an\n * {@link PluginActivityTabContribution activity tab}; floating UI belongs in a\n * {@link PluginGlobalSlotContribution global slot}.\n */\nexport interface PluginWorkspaceViewContribution {\n\t/** Unique within the plugin; the host namespaces it as `${pluginId}:${id}`. */\n\tid: string;\n\t/** Sidebar entry label. Supports `%catalogKey%` i18n lookup. */\n\tlabel: string;\n\t/**\n\t * Sidebar entry icon as an **iconify class string** (e.g.\n\t * `\"icon-[solar--widget-5-linear]\"`) — NOT a React node, because the host\n\t * renders it inside its own nav button and persists nav layout by key.\n\t *\n\t * Omit it to inherit the plugin's own `plugin.json` icon: a packaged image\n\t * (svg / png / webp …) is masked with the theme's foreground color, so a plugin\n\t * that ships artwork does not have to find a lookalike in an icon set. Set\n\t * {@link PluginWorkspaceViewContribution.iconTint} to `false` to keep its colors.\n\t */\n\ticon?: string;\n\t/**\n\t * Whether an image icon is tinted with the theme's foreground color. Defaults to\n\t * `true`, which keeps the entry consistent with the built-in navigation and legible\n\t * in every theme.\n\t *\n\t * Pass `false` for a full-color logo. Weigh it first: the entry renders at 16px\n\t * beside monochrome built-ins, and a fixed-color image cannot follow the active\n\t * theme — a dark logo can disappear on a dark sidebar. Has no effect on Iconify\n\t * class icons, which are always tinted.\n\t */\n\ticonTint?: boolean;\n\t/** Optional one-line description; shown as the nav entry tooltip. */\n\tdescription?: string;\n\t/**\n\t * Initial badge on the sidebar entry. `{ kind: \"text\" }` supports the same\n\t * `%catalogKey%` i18n lookup as {@link label}. Update it at runtime with\n\t * {@link PluginUiApi.setWorkspaceViewBadge}.\n\t */\n\tbadge?: PluginNavBadge;\n\t/** Zero-props aside from {@link PluginWorkspaceViewProps}. */\n\tcomponent: ComponentType<PluginWorkspaceViewProps>;\n\t/** Sort hint among this plugin's own views (ascending). Defaults to 0. */\n\tnavOrder?: number;\n\t/**\n\t * Whether this view takes a sidebar entry. Defaults to `true`.\n\t *\n\t * Pass `false` for a surface users open occasionally — a setup page, a\n\t * diagnostics console. It then lives only under Settings → More options,\n\t * where the host lists every off-sidebar view and opens it inside the\n\t * settings shell, so switching between such pages stays one click.\n\t *\n\t * The sidebar is a scarce, user-curated space: a plugin that always claims a\n\t * slot pushes the entries someone actually uses into the overflow menu.\n\t */\n\tsidebar?: boolean;\n}\n\n/**\n * What a workspace view puts into the **host page header** — the window's top\n * bar that also carries the drag region, the macOS traffic-light gutter and the\n * sidebar trigger.\n *\n * Without this the header still renders, showing the app name above the\n * plugin's own toolbar — two stacked bars. Set `hideTitle` and move the view's\n * toolbar in here and the surface gets a single, host-consistent header.\n *\n * `left` / `right` are ReactNodes rendered by the host inside that bar (left:\n * right after the sidebar trigger; right: before the window controls). They are\n * rendered in the plugin's i18n + CSS scope, so `useTranslation()` and the\n * plugin's own classes work as usual. Pass fresh nodes whenever the view's\n * state changes — this is a live setter, not a one-time registration.\n */\nexport interface PluginWorkspaceViewHeader {\n\t/** Replaces the host title text. Supports `%catalogKey%` i18n lookup. */\n\ttitle?: string;\n\t/** Drop the host title entirely (use when {@link left} carries its own). */\n\thideTitle?: boolean;\n\t/** Rendered in the header's left cluster, after the sidebar trigger. */\n\tleft?: ReactNode;\n\t/** Rendered in the header's action cluster, before the window controls. */\n\tright?: ReactNode;\n\t/**\n\t * Float the host header OVER the view instead of stacking above it. The view\n\t * then owns the full content height, and its top `~44px` sit under the\n\t * transparent header strip (window drag region / traffic lights / sidebar\n\t * trigger all keep working on top). Use for immersive full-page surfaces\n\t * whose own hero starts at the very top; leave unset for toolbar-style\n\t * headers that need their own opaque row.\n\t */\n\timmersive?: boolean;\n}\n\nexport interface PluginAudioMetadata {\n\t/** Embedded title; preview renderers should fall back to file.name. */\n\ttitle?: string;\n\tartist?: string;\n\t/** Embedded cover art as a Data URL when available. */\n\tcoverDataUrl?: string;\n}\n\nexport interface PluginPreviewUrlOptions {\n\t/** Optional media hint for ambiguous containers such as webm. */\n\tmediaKind?: \"audio\" | \"video\";\n}\n\n/**\n * The file handed to a file-preview plugin component. The host does NOT\n * pre-read or guess encoding — the plugin decides whether to read text or\n * bytes. `path` is also exposed for plugins that prefer native fetch.\n */\nexport interface PluginPreviewFile {\n\tpath: string | null;\n\tname: string;\n\textension: string;\n\tmime: string;\n\tsize: number;\n\t/** Read the file as a UTF-8 string. */\n\treadText(): Promise<string>;\n\t/** Read the raw file bytes. */\n\treadBytes(): Promise<ArrayBuffer>;\n\t/** A fetchable streaming URL for the file (Range-capable). */\n\tgetUrl(options?: PluginPreviewUrlOptions): string;\n\t/**\n\t * Subscribe to on-disk changes of this file. The listener fires (debounced\n\t * by the host) whenever the file's contents change, letting previews update\n\t * live. Returns a Disposable; call dispose() to stop watching. A no-op for\n\t * files without a real path (url-only sources).\n\t */\n\twatch(listener: () => void): Disposable;\n\t/**\n\t * Host-provided audio metadata for local media files. Returns null when the\n\t * host cannot provide metadata, e.g. url-only sources or unsupported files.\n\t */\n\tgetAudioMetadata?(): Promise<PluginAudioMetadata | null>;\n}\n\nexport interface PluginFilePreviewProps {\n\tfile: PluginPreviewFile;\n}\n\n/**\n * A file handed to {@link PluginUiApi.previewFile} — the *opening* side of the\n * global previewer, the mirror image of {@link PluginPreviewFile} (which is the\n * *rendering* side). Bytes never cross over: the host reads the source itself.\n *\n * Exactly one of `path` (local absolute path) or `url` (host media / http URL)\n * must be given. `path` is the shape the host's own file tree uses, so the\n * previewer also offers \"在 Finder 中显示\" for it.\n */\nexport interface PluginPreviewFileRef {\n\t/** Local absolute path. Requires the `fs.read` permission. */\n\tpath?: string;\n\t/** Fetchable URL (host media URL or http/https). Requires `ui.slot.message`. */\n\turl?: string;\n\t/**\n\t * Display name **including the extension** — the previewer dispatches to a\n\t * renderer by this extension, not by `mimeType`. Optional for `path`\n\t * sources (the host falls back to the path's basename).\n\t */\n\tname?: string;\n\tmimeType?: string;\n\t/** Byte size, shown in the previewer's download detail when known. */\n\tsize?: number;\n}\n\nexport interface PluginFilePreviewContribution {\n\t/** Lower-case extensions without the dot, e.g. [\"svg\"]. */\n\textensions: string[];\n\tcomponent: ComponentType<PluginFilePreviewProps>;\n}\n\n/** Host residency policy for an activity-panel tab. */\nexport type PluginActivityTabRetention = \"active-only\" | \"warm\" | \"pinned\";\n\n/**\n * 活动面板标签卡此刻所在的工作空间。`cwd` 与面板自己的作用域一致(项目详情页是项目根,\n * 会话页是会话 cwd),插件据此判断这个工作空间该不该出现自己的标签卡。\n */\nexport interface PluginActivityTabScope {\n\treadonly cwd: string | null;\n}\n\n/**\n * 一帧的标签卡状态,由 {@link PluginActivityTabContribution.useMeta} 按当前工作空间返回。\n * 只影响「在不在栏上」这类摆放语义;名字与图标仍以注册时声明为默认值。\n */\nexport interface PluginActivityTabMeta {\n\t/** 覆盖注册时的 label(已本地化);省略时用注册值。 */\n\treadonly label?: string;\n\t/** 覆盖注册时的 icon;省略时用注册值(含 `plugin.json#icon` 回落)。 */\n\treadonly icon?: ReactNode;\n\t/** 标签卡角标;0 / 省略表示不显示。 */\n\treadonly badge?: number;\n\t/**\n\t * 固定上栏:只要本帧返回的 meta 非空且 `pinned` 为 true,标签卡就一直在标签栏里,\n\t * 用户无法用减号移除,也不受「+」可添加池与历史隐藏记录左右。适合「工作空间里有\n\t * 这个东西就必须看得到」的面板(如项目根存在 `.git` 的 Git 面板)。\n\t *\n\t * 省略 = 按用户的上栏记录 / `initiallyVisible` 决定,用户仍可移除。\n\t */\n\treadonly pinned?: boolean;\n}\n\n/** {@link PluginActivityTabContribution.useMeta} 的返回:null = 本帧不进入候选。 */\nexport type PluginActivityTabMetaResult = PluginActivityTabMeta | null;\n\nexport interface PluginActivityTabContribution {\n\t/**\n\t * 标签栏上的默认相对位置,越小越靠前;缺省 100(排在全部内置标签卡之后)。\n\t *\n\t * 内置的取值可作标尺:文件 0、批量 10、浏览器 15、计划 18、待办 20、后台任务 30。\n\t * 下限被宿主钳到 10,「文件」永远是第一枚;用户拖拽出来的顺序优先于这个值。\n\t */\n\torder?: number;\n\tid: string;\n\tlabel: string;\n\t/**\n\t * Tab icon as a React node (not an iconify class string).\n\t * Omit to inherit the host-resolved brand icon from `plugin.json#icon`\n\t * (`ctx.plugin.iconUrl`). Prefer omitting for package brand icons so the\n\t * plugin never loads assets via absolute `/…` paths or host protocols.\n\t */\n\ticon?: ReactNode;\n\tcomponent: ComponentType;\n\t/**\n\t * 允许该标签卡出现的对话场景 slug 列表(镜像工具的 scope_use)。**fail-closed**:\n\t * 未声明/空数组 = 任何会话都不显示;声明后仅在列出的场景里出现(如\n\t * `[\"project\", \"conversation\"]`)。会话页插槽据此随对话类型显隐。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n\t/**\n\t * 注册后是否默认在标签栏里(缺省 `true`)。声明 `false` 表示「出现条件由我\n\t * 自己决定」——注册只是入池,之后由 {@link PluginUiApi.setActivityTabVisible}\n\t * 或 {@link PluginUiApi.openActivityTab} 决定何时上栏(如 git 只在仓库目录、\n\t * 工作台跟随输入栏 toggle)。无论哪种,用户仍可用减号手动隐藏。\n\t */\n\tinitiallyVisible?: boolean;\n\t/**\n\t * Component residency while the tab is inactive. Defaults to `\"warm\"`:\n\t * visited tabs stay mounted in the host's bounded LRU cache. Use\n\t * `\"active-only\"` for cheap, stateless content and `\"pinned\"` for runtimes\n\t * that must never be evicted while available.\n\t */\n\tretention?: PluginActivityTabRetention;\n\t/**\n\t * @deprecated Use {@link PluginActivityTabContribution.retention}. `true`\n\t * maps to `\"pinned\"`; `false` maps to `\"active-only\"`.\n\t */\n\tkeepAliveWhenAvailable?: boolean;\n\t/**\n\t * 按当前工作面决定这一帧的 meta:返回 `null` 表示本帧不进入候选(既不上栏,也不在\n\t * 「+」里),返回 `{ pinned: true }` 表示固定上栏且不可移除。\n\t *\n\t * 这是一个 **React hook**:宿主每次解析标签栏时按「已注册定义」各调用一次,所以可以在\n\t * 里面用任意 hook(自己的缓存 store、`useTranslation`……)。约束:\n\t * - 渲染期必须是纯计算,探测一类的异步工作放进 `useEffect`,结果写回自己的 store;\n\t * - 抛错只会让这一项消失(与 `null` 同效),不影响其它标签卡;\n\t * - 省略时行为与本字段出现前一致:静态 label / icon / badge,按用户上栏记录显隐。\n\t */\n\tuseMeta?: (scope: PluginActivityTabScope) => PluginActivityTabMetaResult;\n}\n\n/**\n * 会话底部面板的组件贡献。\n *\n * 与 {@link PluginActivityTabContribution} 的分工:活动面板在右侧、一个贡献只有一个\n * 实例、适合「看某个东西的当前状态」;底部面板横跨会话页下沿、可分屏、**同一个贡献\n * 可以开多个实例**,适合终端、日志跟随这类长驻的工作面。\n *\n * meta 走命令式的 {@link PluginBottomPanelContextValue.setMeta} 而不是「每帧返回 meta\n * 的 hook」:多实例场景下 hook 拿不到实例身份,两套 meta 事实源会在改名后打架。\n */\nexport interface PluginBottomPanelContribution {\n\t/** Unique within the plugin; the host namespaces it as `plugin:<pluginId>:<id>`. */\n\tid: string;\n\t/** 「+」菜单里的名字,也是新实例的初始名。Supports `%catalogKey%` i18n lookup. */\n\tlabel: string;\n\t/**\n\t * Tab icon as a React node or an iconify class string.\n\t * Omit to inherit the host-resolved brand icon from `plugin.json#icon`.\n\t */\n\ticon?: ReactNode;\n\t/** Zero-props;实例上下文经 {@link useBottomPanel} 取。 */\n\tcomponent: ComponentType;\n\t/**\n\t * 允许出现的对话场景 slug 列表。**fail-closed**:未声明/空数组 = 任何会话都不出现。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n\t/** 「+」菜单里的相对位置,越小越靠前;缺省 100(排在内置之后)。 */\n\torder?: number;\n\t/**\n\t * 同一会话里最多能开几个实例;缺省不限。单例面板给 1,终端一类不设。\n\t */\n\tmaxInstances?: number;\n}\n\n/** Explicit conversation scope for an activity-tab command. */\nexport interface PluginActivityTabTargetOptions {\n\t/**\n\t * Absolute cwd whose activity-tab state should be changed. Omit to target\n\t * the conversation currently displayed by the host. Tool handlers and\n\t * background work should pass the triggering session's cwd so a foreground\n\t * navigation change cannot redirect the command to another conversation.\n\t */\n\tcwd?: string;\n}\n\n/** Options for {@link PluginUiApi.openActivityTab}. */\nexport interface PluginOpenActivityTabOptions extends PluginActivityTabTargetOptions {\n\t/**\n\t * Desired panel width as it opens: a pixel number, or `\"max\"` to track the\n\t * widest the window allows — `\"max\"` keeps following window resizes until the\n\t * user drags the divider. The host clamps to its min/max bounds. Omit to keep\n\t * the user's current width.\n\t */\n\twidth?: number | \"max\";\n}\n\nexport interface PluginCaptureRegion {\n\tx: number;\n\ty: number;\n\twidth: number;\n\theight: number;\n}\n\n/**\n * Decoration a plugin contributes to the next outgoing prompt while its input\n * action is active. `metadata` is shallow-merged into the prompt request and\n * `instructions` are appended as hidden, model-visible guidance.\n */\nexport interface PluginPromptDecoration {\n\tmetadata?: Record<string, unknown>;\n\t/** Hidden plugin-owned instructions appended to the next agent turn. */\n\tinstructions?: string[];\n}\n\n/**\n * An action button shown in a row beneath the AI input bar. Rendered as a\n * toggle: clicking activates, clicking again deactivates. While active, the\n * host calls `decoratePrompt()` before each send and merges the returned\n * metadata into the outgoing prompt request. The plugin owns any side state\n * (it is the same Module Federation instance as its other slots).\n */\nexport interface PluginInputActionContribution {\n\tid: string;\n\tlabel: string;\n\t/** Button icon as a React node. Omit to inherit the plugin's `plugin.json#icon`. */\n\ticon?: ReactNode;\n\t/** Whether the action begins in the active state. Defaults to false. */\n\tdefaultActive?: boolean;\n\t/**\n\t * 该输入动作所依赖的 agent 工具名。设置后,仅当该工具在当前会话处于激活(按工具的\n\t * scope_use 解析)时才显示这个 badge——避免在工具被场景屏蔽(如批量任务)时仍显示一个\n\t * 点了也无效的开关。不设则始终显示。例如「图像生成」设为 \"generate_image\"。\n\t */\n\trequiresActiveTool?: string;\n\t/**\n\t * 允许该 toggle 出现的对话场景 slug 列表(镜像工具的 scope_use)。**fail-closed**:\n\t * 未声明/空数组 = 任何会话都不显示;声明后仅在列出的场景里出现。与 `requiresActiveTool`\n\t * 取「与」:两者都满足才显示。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n\t/**\n\t * When true, this plugin's agent contributions (tools / skills / MCP /\n\t * systemPrompt) and Activity Tabs are hard-isolated: inactive until this\n\t * toggle is on (ADR-0041, knowledgeMode-style). Default false.\n\t */\n\thardIsolation?: boolean;\n\t/**\n\t * Fired when the user toggles the action; `active` is the new state. Return\n\t * `false` when `active` is true to VETO the activation (e.g. the plugin needs\n\t * configuration first) — the toggle stays off. Deactivation can't be vetoed.\n\t */\n\tonToggle?(active: boolean): boolean | void;\n\t/**\n\t * Called by the host before sending while the action is active. The\n\t * returned metadata is merged into the outgoing prompt request.\n\t */\n\tdecoratePrompt?(): PluginPromptDecoration | void;\n}\n\n/**\n * A declarative, serializable descriptor for one card rendered beneath a\n * message. `type` selects a registered card renderer; `key` drives cross-turn\n * dedup (same key across turns = one logical card, shown only under its latest\n * anchor); `payload` carries STABLE REFERENCES (e.g. image ids), not a content\n * snapshot — the renderer resolves live state from it. `title`/`icon` label the\n * card's tab (override the renderer's registration defaults). Rides a tool\n * result's out-of-band `details.cards`; crosses the agent→host boundary, so\n * `icon` is an icon-symbol string, not a node.\n */\nexport interface CardDescriptor {\n\ttype: string;\n\tkey?: string;\n\tpayload?: unknown;\n\ttitle?: string;\n\ticon?: string;\n}\n\n/** A pending (in-flight) tool call handed to a renderer's `pendingFor`. */\nexport interface PluginPendingToolCall {\n\ttoolName: string;\n\targs: Record<string, unknown>;\n}\n\n/**\n * Props for a card renderer. `descriptor` is the card's data; `pending` is true\n * while it was synthesized from an in-flight tool (render a skeleton); `message`\n * is the anchoring conversation message.\n */\nexport interface PluginCardProps {\n\tdescriptor: CardDescriptor;\n\tpending: boolean;\n\tmessage: ConversationMessage;\n}\n\n/**\n * A card renderer registered by a plugin, keyed by `type`. A descriptor whose\n * `type` matches is rendered by `component`. `title`/`icon` are the default tab\n * label/icon (a descriptor may override either). `pendingFor`, given an\n * in-flight tool call, returns a provisional descriptor so a skeleton card\n * appears (and claims a tab) before the tool's result lands — or null when this\n * renderer doesn't handle that tool. The `type` must be globally unique across\n * plugins (convention: prefix with the plugin id, e.g. \"image-gen:preview\").\n */\nexport interface PluginCardRendererContribution {\n\ttype: string;\n\tcomponent: ComponentType<PluginCardProps>;\n\ttitle?: string;\n\t/** Default tab icon as a React node. Omit to inherit the plugin's `plugin.json#icon`. */\n\ticon?: ReactNode;\n\tpendingFor?: (toolCall: PluginPendingToolCall) => CardDescriptor | null;\n}\n\n/** A tool call handed to a tool-call slot renderer. */\nexport interface PluginToolCallSlotToolCall {\n\ttoolCallId: string;\n\ttoolName: string;\n\targs: Record<string, unknown>;\n\tstatus: \"pending\" | \"success\" | \"error\" | \"cancelled\";\n\tresult?: string;\n\tisError?: boolean;\n}\n\nexport interface PluginToolCallSlotProps {\n\ttoolCall: PluginToolCallSlotToolCall;\n}\n\n/**\n * A component that **replaces the host's default inline transcript rendering**\n * for a specific tool (matched by `toolName`; first registered renderer wins).\n * This is how a plugin renders rich UI for its OWN agent tool's output — plugin\n * tools cannot emit `details.cards`, so the message card system (registerCardRenderer)\n * does not serve them; the tool-call slot does.\n */\nexport interface PluginToolCallSlotContribution {\n\tid: string;\n\ttoolName: string;\n\tcomponent: ComponentType<PluginToolCallSlotProps>;\n}\n\n/**\n * A card rendered at the bottom of the message list for the LATEST turn — NOT\n * bound to a tool call. The host mounts `component` in the footer slot and\n * re-mounts it each session/turn; the plugin owns visibility entirely (it reads\n * live state via SDK hooks — `useActiveConversation`, `useConversationMessages`,\n * `ctx.conversation.on(\"turn-end\")` — and returns `null` to render nothing,\n * e.g. git renders only inside a repo that has changes). `scope_use` gates which\n * conversation scenarios it may appear in (**fail-closed**, mirrors the other\n * slots). `id` must be unique within the plugin.\n */\nexport interface PluginTurnCardContribution {\n\tid: string;\n\tcomponent: ComponentType;\n\t/**\n\t * 允许该 turn 卡出现的对话场景 slug 列表(镜像其它插槽的 scope_use)。**fail-closed**:\n\t * 未声明/空数组 = 任何会话都不显示;声明后仅在列出的场景里出现(如 `[\"project\"]`)。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n}\n\n/**\n * Options for {@link PluginUiApi.notify}. Surfaces a host toast so users can\n * see plugin failures without opening DevTools.\n */\nexport interface PluginNotifyOptions {\n\t/** Toast body. Required even when `error` is set (user-facing summary). */\n\tmessage: string;\n\t/** Defaults to plugin display name when omitted. */\n\ttitle?: string;\n\t/** Defaults to `\"info\"`; when `error` is set and variant omitted, host uses `\"error\"`. */\n\tvariant?: \"info\" | \"success\" | \"warning\" | \"error\";\n\t/**\n\t * Optional failure cause. Host formats message + stack and adds a\n\t * \"复制堆栈\" action so the user can paste it into bug reports / chat.\n\t */\n\terror?: unknown;\n\t/**\n\t * Auto-dismiss delay in ms. `0` keeps the toast until dismissed.\n\t * Defaults: sticky (`0`) when `error` is present, otherwise host default (~4s).\n\t */\n\tdurationMs?: number;\n}\n\n/**\n * 新会话上下文区的激活条件。**只能写本插件自己的东西**——填别人的 id 一律不生效。\n *\n * 这条限制是故意的:否则插件 A 可以声明「只要用户选了 B 的智能体我就上屏」,把别人的\n * 使用场景劫持过来。\n *\n * 各字段取并集:任意一条命中即激活。至少要声明一条——全空等于「任何新会话都上屏」,宿主拒掉。\n */\nexport interface PluginNewSessionContextActivation {\n\t/** 本插件在 manifest 里声明的智能体 id(不带 `plugin:` 前缀)。 */\n\tagents?: readonly string[];\n\t/** 本插件在 manifest 里声明的团队 id。省略则任意「含本插件成员的团队」都算命中。 */\n\tteams?: readonly string[];\n\t/** 本插件提供的 skill 名;用户在输入框里提到时命中。 */\n\tskills?: readonly string[];\n\t/** 本插件提供的 MCP server 名。 */\n\tmcpServers?: readonly string[];\n}\n\n/** 用户在新会话页当前选中的对话目标。 */\nexport interface PluginNewSessionTarget {\n\treadonly kind: \"agent\" | \"team\";\n\t/** Agent 档案 id 或团队 id。 */\n\treadonly id: string;\n\t/** 目标若由本插件贡献,这里给出 manifest 里的那个 id。 */\n\treadonly contributedId?: string;\n}\n\n/**\n * 渲染上下文。这是一个**会继续生长的对象**:后续新增字段不会破坏既有插件,所以按需\n * 解构、不要假定它只有这些键。\n */\nexport interface PluginNewSessionContext {\n\treadonly target: PluginNewSessionTarget | null;\n\t/** 输入框里提到的、属于本插件的能力。 */\n\treadonly mentionedAbilities: {\n\t\treadonly skills: readonly string[];\n\t\treadonly mcpServers: readonly string[];\n\t};\n\t/**\n\t * 输入框中尚未发送的文本。需要 `conversation.draft.read` 权限,未授予时恒为空串。\n\t *\n\t * 只在本贡献处于激活状态时提供——插件拿不到「用户随便打点什么」的全程流水。\n\t */\n\treadonly draft: string;\n\t/** 当前工作区目录;未选择项目时为 null。 */\n\treadonly cwd: string | null;\n\t/** 回写输入栏。刻意不提供「直接发送」:越过发送前这道关不属于本区职责。 */\n\treadonly composer: {\n\t\t/** 把资源挂成附件,随下一次发送带走。 */\n\t\tattach(attachment: PluginPromptAttachment): void;\n\t\t/**\n\t\t * 往草稿里插一段文本。始终是插入而非替换,免得抹掉用户已经打的内容。\n\t\t *\n\t\t * `position` 缺省为 `\"end\"`(光标处)。`\"start\"` 插到最前面,适合「先定题、细节\n\t\t * 由用户补」这类写法——用户点完多半光标并不在开头,位置只能由调用方定死。\n\t\t */\n\t\tinsertText(text: string, options?: { position?: \"start\" | \"end\" }): void;\n\t};\n}\n\n/**\n * 新会话页输入框下方的一块内容(`ui.slot.new-session-context`)。\n *\n * 与 input-action 的分工:那是发送前的开关,这是发送前的**上下文**——把用户接下来多半\n * 要用到的素材摆出来。激活与否由宿主按 {@link PluginNewSessionContextActivation} 裁决,\n * 插件只负责在被激活后渲染,因此拿不到用户逐键输入的全程内容。\n *\n * 同时有多个贡献上屏时,宿主会在该区域顶部出 tabbar;只有一个时直接渲染内容。\n */\nexport interface PluginNewSessionContextContribution {\n\tid: string;\n\t/** tabbar 上的标题;只有一个贡献上屏时不展示。 */\n\tlabel: string;\n\t/** tab 图标;省略时用插件自己的图标。 */\n\ticon?: ReactNode;\n\tactivateWhen: PluginNewSessionContextActivation;\n\t/**\n\t * 横向占位。`\"input\"`(默认)与输入框同宽,适合补充说明一类的窄内容;`\"wide\"` 铺满\n\t * 页面可用宽度,留给画廊、素材墙这类「内容本身就是主角」的东西——把它们压在输入框\n\t * 宽度里,每一项都会小到看不清。\n\t */\n\twidth?: \"input\" | \"wide\";\n\trender(context: PluginNewSessionContext): ReactNode;\n}\n\n/**\n * 顶栏动作的下拉菜单项。点击一项执行 `onSelect` 并关闭菜单(`checkbox` / `radio` 例外,见\n * {@link PluginHeaderActionMenuItemKind})。\n */\n/**\n * 菜单项的类型。省略即普通命令项;其余类型让「列表就是状态」的场景(分支列表、开关、\n * 加载中、空态)不必退化成纯文字:\n * - `checkbox` / `radio`:`checked` 决定勾选标记,点它触发 `onSelect` 后菜单不自动关(适合切换开关);\n * - `label`:分组标题,不可点;\n * - `loading` / `empty`:占位行,自动禁用、不可点;\n * - `submenu`:`children` 是下一级菜单项(只支持一层)。\n */\nexport type PluginHeaderActionMenuItemKind =\n\t| \"item\"\n\t| \"checkbox\"\n\t| \"radio\"\n\t| \"label\"\n\t| \"loading\"\n\t| \"empty\"\n\t| \"submenu\";\n\nexport interface PluginHeaderActionMenuItem {\n\t/** 项在菜单内唯一的 id。 */\n\tid: string;\n\t/** 默认 `item`。 */\n\tkind?: PluginHeaderActionMenuItemKind;\n\tlabel: string;\n\t/** 菜单项前的图标,16px 方框内显示。`checkbox` / `radio` 已选中时换成勾选标记。 */\n\ticon?: ReactNode;\n\t/** `submenu` 且给了 `children` 时可省略。 */\n\tonSelect?: () => void;\n\t/** `submenu` 的下一级菜单项。 */\n\tchildren?: readonly PluginHeaderActionMenuItem[];\n\t/** `checkbox` / `radio` 是否已选中。 */\n\tchecked?: boolean;\n\tdisabled?: boolean;\n\t/** 禁用原因:禁用时排在 `title` 之前显示,用户才知道为什么点不了。 */\n\tdisabledReason?: string;\n\t/** 危险操作(红色)。 */\n\tdestructive?: boolean;\n\t/** 在这一项之前画一条分隔线。 */\n\tseparatorBefore?: boolean;\n}\n\n/** 顶栏动作气泡里的内容组件拿到的 props。 */\nexport interface PluginHeaderActionPopoverProps {\n\t/** 关闭气泡(例如内容里点了「完成」)。 */\n\tclose: () => void;\n}\n\n/** 角标与图标的语义色,跟随宿主主题;`neutral` 为默认。 */\nexport type PluginHeaderActionTone = \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\";\n\n/** 气泡尺寸:`sm` 约 16rem,`md`(默认)约 24rem,`lg` 约 32rem。 */\nexport type PluginHeaderActionPopoverSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * 气泡的容器形态。默认 `popover`(贴着按钮的小浮层);内容是有输入框、列表等需要专注的界面时\n * 用 `dialog`(宿主居中对话框,带标题栏与关闭按钮,宽度由 `size` 决定)。\n */\nexport type PluginHeaderActionPopoverHost = \"popover\" | \"dialog\";\n\n/** 气泡声明:直接给组件,或给组件加容器参数。 */\nexport type PluginHeaderActionPopover =\n\t| ComponentType<PluginHeaderActionPopoverProps>\n\t| {\n\t\t\tcomponent: ComponentType<PluginHeaderActionPopoverProps>;\n\t\t\tsize?: PluginHeaderActionPopoverSize;\n\t\t\thost?: PluginHeaderActionPopoverHost;\n\t\t\ttitle?: string;\n\t };\n\n/** 顶栏动作此刻能拿到的上下文:它在哪个页面、当前工作目录是什么。 */\nexport interface PluginHeaderActionContext {\n\t/**\n\t * 当前页面。`conversation` = 会话页;`new-session` = 新会话页(还没有消息,\n\t * 顶栏只有置顶与活动面板开关)。\n\t */\n\tsurface: PluginHeaderActionSurface;\n\t/** 当前工作目录;没有项目(例如空白新会话)时为 `null`。 */\n\tcwd: string | null;\n}\n\n/** 顶栏动作可以出现的页面。 */\nexport type PluginHeaderActionSurface = \"conversation\" | \"new-session\";\n\n/**\n * 顶栏动作此刻的**声明**,由 {@link PluginHeaderActionContribution.useAction} 返回。\n *\n * 宿主用它统一渲染成与内置按钮完全一致的一格;插件能决定的只有下面这些字段,没有 `className`、\n * `style`,也无法替换按钮本身。默认**只有图标**,名称靠悬浮提示(`title`)显示;需要把状态\n * 写在脸上时用 `label`(宽屏才显示,窄了自动退回图标)。\n * `click` / `menuItems` / `popover` **三选一**:\n * 同时给多个时按 `menuItems` > `popover` > `onClick` 取第一个;一个都没有则该动作不显示。\n *\n * 宿主会校验并截断:`title` 最长 40 字、`label` 最长 24 字(超出截断),`menuItems` 最多\n * 20 项,`badge` 只接受数字(≥ 1,超过 99 显示 `99+`)或 `true`(红点)。\n */\nexport interface PluginHeaderActionState {\n\t/** 必填。悬浮提示、无障碍名称(按钮上不显示文字时,用户全靠它认出这个动作)。 */\n\ttitle: string;\n\t/**\n\t * 必填。图标节点,宿主放进 16px 的固定方框里并忽略指针事件,建议直接用\n\t * iconify 的 `<span className=\"icon-[solar--…]\" />`。\n\t */\n\ticon: ReactNode;\n\t/**\n\t * 图标右侧的文字,用于「状态本身就是文字」的动作(分支名、当前模型、同步落后数)。\n\t * 最长 24 字;顶栏有位置时显示,被收纳、页头挤窄、顶栏超过 4 格时自动退回纯图标。\n\t */\n\tlabel?: string;\n\t/** 角标:数字显示计数,`true` 显示红点。被收纳时宿主会把它汇总到收纳入口上。 */\n\tbadge?: number | boolean;\n\t/** 角标与图标的语义色,默认 `neutral`(灰色数字 / 本色图标)。 */\n\ttone?: PluginHeaderActionTone;\n\t/** 选中态(例如面板已打开)。 */\n\tactive?: boolean;\n\tdisabled?: boolean;\n\t/** 禁用原因:禁用时替代 `title` 显示,用户才知道为什么点不了。 */\n\tdisabledReason?: string;\n\t/**\n\t * 处于选中态时,即使被收纳也要在活动面板开关左侧露出来(例如「正在录制」这类必须可见的状态)。\n\t * 只在顶栏有活动面板开关的页面上生效。\n\t */\n\tpromoteWhenActive?: boolean;\n\t/** 点击直接执行。 */\n\tonClick?: () => void;\n\t/** 点击向下弹出下拉菜单。 */\n\tmenuItems?: readonly PluginHeaderActionMenuItem[];\n\t/**\n\t * 点击弹出气泡,内容是你自己的组件。气泡的背景、圆角、投影由宿主固定,宽高随内容自适应;\n\t * 被收纳时它会在收纳托盘里**内联展开**(宽约 260px),内容请能在这个宽度下正常显示。\n\t */\n\tpopover?: PluginHeaderActionPopover;\n}\n\n/**\n * 会话页与新会话页顶栏右侧按钮组里的一格(`ui.slot.header-action`)。\n *\n * 顶栏右侧是**宿主统一管理的一个按钮组**:内置按钮(导出 / 置顶 / 终端 / 底部面板)与所有插件\n * 贡献排在同一组里,外观由宿主决定,插件不能自定义样式。显示规则:\n * - 顶栏最多显示 7 格(不含最右侧固定的「活动面板」开关),内置与插件共用这 7 个名额;\n * - 超出的、以及用户主动收起的动作进入「收纳」托盘(悬浮在按钮组上时,组下方出现的小白条);\n * - 用户可以在托盘里拖动调整顺序、决定哪些在顶栏哪些收纳,这份布局按动作 id 记在本机;\n * - 新装插件的动作:顶栏还有空位就排进去,否则进收纳,不会挤走用户已有的布局;\n * - `pin: \"prefer\"` 只是「用户没调整过时优先上栏」的建议,仍然用户可以改、也不突破 7 格上限。\n * 所以插件**不能**假定自己一定在顶栏上,也不能依赖相邻的是谁。\n *\n * 出现页面由 `surfaces` 决定,默认只有会话页。\n */\nexport interface PluginHeaderActionContribution {\n\t/** 贡献 id,在本插件内唯一,最长 64 字符。用户的布局按 `${插件 id}:${id}` 记忆,请不要随意改名。 */\n\tid: string;\n\t/**\n\t * 默认排序权重,小的靠左。**只影响用户还没自己调整过时的初始位置**,省略按注册顺序排在最后;\n\t * 同值按插件 id、贡献 id 稳定排序。\n\t */\n\torder?: number;\n\t/** 出现在哪些页面,默认 `[\"conversation\"]`。 */\n\tsurfaces?: readonly PluginHeaderActionSurface[];\n\t/**\n\t * 初始布局建议。`\"prefer\"` 表示用户没调整过布局时优先占用顶栏的一个名额\n\t * (仍受 7 格上限与用户后来的调整约束);默认 `\"normal\"`,即先待在收纳托盘里。\n\t */\n\tpin?: \"normal\" | \"prefer\";\n\t/**\n\t * 返回动作此刻的声明,返回 `null` 表示当前不适用(例如没有项目目录),宿主不显示也不占位。\n\t *\n\t * 这是一个 **React hook**:宿主在对应页面顶栏挂载期间一直调用它,所以可以在里面用任意 hook\n\t * (`useActiveConversation()`、`useTranslation()`、你自己的 store……),数据变化时自然重新声明。\n\t * 入参给出当前页面与工作目录,可以据此决定是否出现、显示什么。\n\t * 约束:\n\t * - 渲染期必须是纯计算,不要在里面发请求、起定时器;这类副作用放进 `useEffect`;\n\t * - 抛错只会让这一项消失(错误边界隔离),不会影响其它动作;\n\t * - 每次渲染都可以返回新对象,宿主不依赖引用相等。\n\t */\n\tuseAction: (context: PluginHeaderActionContext) => PluginHeaderActionState | null;\n}\n\n/**\n * 宿主左侧侧边栏此刻的形态。给插件自适应布局用——尤其是沉浸式工作区视图:\n * 侧边栏收起时宿主页头会长出「展开侧边栏」按钮并占住左上角,视图自己画在那一带的\n * 东西需要让位。\n */\nexport interface PluginSidebarState {\n\t/** 用户手动收起了侧边栏。窄屏下这一位仍然只反映用户意愿,不受窗口宽度影响。 */\n\tcollapsed: boolean;\n\t/** 窗口窄到侧边栏改走悬浮覆盖,不再占据左侧一栏。 */\n\tnarrow: boolean;\n\t/** 侧边栏此刻是否实际占着左边那一栏。等价于 `!collapsed && !narrow`,多数自适应只需要这一位。 */\n\tvisible: boolean;\n}\n\nexport interface PluginUiApi {\n\tregisterGlobalSlot(contribution: PluginGlobalSlotContribution): Disposable;\n\tregisterAbilityDetailSlot(contribution: PluginAbilityDetailSlotContribution): Disposable;\n\t/** Render an opaque setup URL as a host-themed PNG data URL. */\n\tcreateQrCode(text: string): Promise<string>;\n\t/**\n\t * Register a **workspace view**(工作区视图)— a full-page surface with its own\n\t * route and sidebar entry, on par with the host's built-in pages. Needs the\n\t * `ui.slot.workspace-view` permission (missing permission = **warn+noop**).\n\t *\n\t * The entry lands in the sidebar's「更多」收纳 by default; the user can pin it\n\t * to the top region or reorder it, and that layout is remembered.\n\t */\n\tregisterWorkspaceView(contribution: PluginWorkspaceViewContribution): Disposable;\n\t/**\n\t * Register a **new-session context block** — content shown beneath the input\n\t * on the new-session page, surfaced only when the user's current selection or\n\t * draft matches {@link PluginNewSessionContextActivation}. Needs the\n\t * `ui.slot.new-session-context` permission (missing permission = **warn+noop**).\n\t */\n\tregisterNewSessionContext(contribution: PluginNewSessionContextContribution): Disposable;\n\t/**\n\t * Register a **header action** — one declarative slot in the conversation\n\t * page header's host-managed button group (icon / badge plus a click,\n\t * menu or popover; no custom styling — see\n\t * {@link PluginHeaderActionContribution}). The user decides, via the group's\n\t * overflow tray, which actions sit in the header (max 7 shared with the host's\n\t * own buttons) and in what order. Needs the `ui.slot.header-action`\n\t * permission (missing permission = **warn+noop**) and Plugin API `^2.9.0`.\n\t */\n\tregisterHeaderAction(contribution: PluginHeaderActionContribution): Disposable;\n\t/**\n\t * Navigate to one of this plugin's own workspace views. `viewId` is the\n\t * contribution id passed to {@link PluginUiApi.registerWorkspaceView}. No-op\n\t * when the view is not registered (e.g. permission missing).\n\t */\n\topenWorkspaceView(viewId: string): void;\n\t/**\n\t * Update (or clear, with `null`) the badge on one of this plugin's workspace\n\t * view entries. Re-registering the view is NOT a way to do this — it would\n\t * remount the whole surface — so live badges (unread counts, status dots)\n\t * must come through here.\n\t *\n\t * No-op when the view is not registered (e.g. permission missing).\n\t */\n\tsetWorkspaceViewBadge(viewId: string, badge: PluginNavBadge | null): void;\n\t/**\n\t * Fill (or clear, with `null`) the host page header while one of this\n\t * plugin's workspace views is open. Call it from the view component (an\n\t * effect that re-runs on state change) and clear it on unmount — the host\n\t * keeps the entry keyed by view, and only applies it on that view's route.\n\t *\n\t * The header itself is never removed: it owns the window drag region and the\n\t * macOS traffic-light gutter. This is how a view takes it over instead.\n\t *\n\t * No-op when the view is not registered (e.g. permission missing).\n\t */\n\tsetWorkspaceViewHeader(viewId: string, header: PluginWorkspaceViewHeader | null): void;\n\t/**\n\t * Register a preview component keyed by file extension. The host dispatches\n\t * registered extensions before its built-in fallback renderers; first\n\t * registrant wins on conflict.\n\t */\n\tregisterFilePreview(contribution: PluginFilePreviewContribution): Disposable;\n\t/**\n\t * Register an activity-panel tab into the addable pool. The user attaches\n\t * it manually via the panel's \"+\" picker; attach records are keyed by the\n\t * workspace cwd. A contribution that declares `useMeta` decides its own\n\t * availability per workspace (see {@link PluginActivityTabContribution.useMeta}).\n\t */\n\tregisterActivityTab(contribution: PluginActivityTabContribution): Disposable;\n\t/**\n\t * Register a component into the session's bottom panel addable pool. The user\n\t * opens instances from the panel's \"+\" menu; one contribution can have several\n\t * instances in the same session, and each instance renames itself through\n\t * {@link useBottomPanel}.\n\t */\n\tregisterBottomPanel(contribution: PluginBottomPanelContribution): Disposable;\n\t/**\n\t * Register a toggle action shown beneath the AI input bar. While active,\n\t * its `decoratePrompt()` annotates the next outgoing prompt.\n\t */\n\tregisterInputAction(contribution: PluginInputActionContribution): Disposable;\n\t/**\n\t * Register a card renderer keyed by `type`. Cards rendered beneath a message\n\t * come from tool results' out-of-band `details.cards` (or `pendingFor` for\n\t * in-flight tools); the host resolves each card's `type` to a registered\n\t * renderer. Multiple cards under one message are shown as a tab-switcher\n\t * (\"收纳\") or a flat list.\n\t */\n\tregisterCardRenderer(contribution: PluginCardRendererContribution): Disposable;\n\t/**\n\t * Register a renderer that replaces the host's default inline transcript UI\n\t * for a tool call (matched by `toolName`). The complement to card renderers:\n\t * use it to render UI for a plugin's own agent tool output.\n\t */\n\tregisterToolCallSlot(contribution: PluginToolCallSlotContribution): Disposable;\n\t/**\n\t * Register a card rendered at the bottom of the message list for the latest\n\t * turn — NOT bound to a tool call. The host mounts the component in the\n\t * footer slot; the plugin owns visibility (return `null` to render nothing,\n\t * e.g. git renders only in a repo with changes). Gated by `scope_use`\n\t * (fail-closed). Needs the `ui.slot.turn-card` permission.\n\t */\n\tregisterTurnCard(contribution: PluginTurnCardContribution): Disposable;\n\t/**\n\t * Register a keyboard shortcut scope on the host's shared ShortcutScopeStack\n\t * (same path as host UI: modal > overlay > surface > app). Needs\n\t * `ui.shortcuts.register`. Plugins cannot use kind `\"app\"` (reserved for\n\t * host-configurable global actions). Prefer {@link usePluginShortcutScope}\n\t * from React components with a module-captured `registerShortcutScope`.\n\t */\n\tregisterShortcutScope(contribution: PluginShortcutScopeContribution): Disposable;\n\t/**\n\t * Programmatically attach (if needed) and activate one of this plugin's\n\t * own activity tabs in a conversation's activity panel. `tabId`\n\t * is the contribution id passed to registerActivityTab. Any payload (e.g.\n\t * which image to edit) is passed via the plugin's own in-memory state.\n\t *\n\t * Pass `options.width` to size the panel as it opens — a pixel number, or\n\t * `\"max\"` to expand it to the widest the current window allows (the host\n\t * still clamps to its min/max and auto-hides the sidebar when needed). Omit\n\t * to leave the user's current width untouched.\n\t *\n\t * Omit `options.cwd` for the conversation currently displayed by the host.\n\t * Tool handlers and background work should pass their session cwd explicitly.\n\t */\n\topenActivityTab(tabId: string, options?: PluginOpenActivityTabOptions): void;\n\t/**\n\t * 把本插件的某个活动面板标签卡在目标会话里上栏 / 下栏,**不激活也不展开\n\t * 面板**——`openActivityTab` 是「用户此刻要看它」,这个是「它现在该不该在\n\t * 栏里」。配合 `initiallyVisible: false` 使用,插件即可完全掌握自己标签卡的\n\t * 出现条件(如 git 只在仓库目录里上栏、工作台跟随输入栏 toggle)。\n\t *\n\t * 上栏记录按会话 cwd 持久化(ADR-0026),所以只需在条件变化时调用一次;\n\t * 用户随后用减号手动隐藏的结果不会被重复调用覆盖。缺省作用于宿主当前显示的\n\t * 会话;工具 handler 与后台任务应通过 `options.cwd` 传入自己的会话 cwd。既没有\n\t * 显式 cwd、也没有活动会话时为 no-op(无处记录)。\n\t */\n\tsetActivityTabVisible(tabId: string, visible: boolean, options?: PluginActivityTabTargetOptions): void;\n\t/**\n\t * 直接设置活动面板宽度:像素值,或 `\"max\"` 表示「跟随窗口拉满」(宿主仍会夹到\n\t * 自己的 min/max 内,必要时自动收起侧边栏)。\n\t *\n\t * `\"max\"` 是一种持续状态而非一次性求值:窗口尺寸变化时面板跟着变宽变窄,直到\n\t * 用户拖动分隔条或有人写入具体像素为止。传数字则是一次性的固定宽度。\n\t *\n\t * 与 `openActivityTab(id, { width })` 的区别:那里的宽度只在标签卡首次 attach\n\t * 时生效(避免 activate 重放覆盖用户手拖的宽度);这个是命令式的,每次调用都\n\t * 生效,供插件在自己的标签卡被激活、进入某种视图时按需调整。用户随后仍可拖动。\n\t */\n\tsetActivityPanelWidth(width: number | \"max\"): void;\n\t/**\n\t * Bind or clear plugin-owned context for outgoing prompts. The host renders\n\t * its label/icon and carries a structured `context` as a versioned snapshot.\n\t * Attachments default to one-shot; `lifecycle: \"sticky\"` remains until the\n\t * plugin or user clears the capsule.\n\t */\n\tsetPromptAttachment(attachment: PluginPromptAttachment | null): void;\n\t/**\n\t * Open the host's global full-screen image previewer for the given image.\n\t * Only the image reference (id/url) crosses over — bytes stay out-of-band.\n\t *\n\t * Pass `group` (e.g. all images of the message) to open as an image group:\n\t * the previewer shows a thumbnail strip + arrows and starts at `ref`.\n\t */\n\tpreviewImage(ref: PluginImageRef, group?: PluginImageRef[]): void;\n\t/**\n\t * Open the host's global file previewer for any file — the general form of\n\t * {@link PluginUiApi.previewImage}, which only takes image URLs. Accepts a\n\t * local absolute `path` (the shape the host's own file tree uses) as well as\n\t * a `url`; the previewer dispatches by the file's extension, so a file type\n\t * some plugin registered via `registerFilePreview` lands in that renderer.\n\t *\n\t * Pass `group` (e.g. all outputs of one run) to open as a group: images get\n\t * the thumbnail strip + arrows, and the previewer starts at `file`.\n\t *\n\t * Permissions: `fs.read` as soon as any entry carries a `path` (it hands a\n\t * local file to the host to read); `ui.slot.message` for url-only calls,\n\t * same gate as `previewImage`.\n\t */\n\tpreviewFile(file: PluginPreviewFileRef, group?: PluginPreviewFileRef[]): void;\n\t/**\n\t * Capture a rectangle in the current Vetta window and open the host save\n\t * dialog. Coordinates use renderer DIP values such as getBoundingClientRect().\n\t * Requires `ui.slot.activity-tab`.\n\t */\n\tcaptureRegion(rect: PluginCaptureRegion, defaultFileName: string): Promise<string | null>;\n\t/**\n\t * Copy an image to the system clipboard. Takes a `data:image/...;base64,`\n\t * URL and goes through the native clipboard, so it does not depend on the\n\t * renderer's `ClipboardItem` support. No permission required — the plugin\n\t * can only write what it already rendered.\n\t */\n\tcopyImage(dataUrl: string): Promise<void>;\n\t/**\n\t * Hand a URL to the OS default browser (Electron `shell.openExternal`) —\n\t * NOT the in-app browser panel. Only `http:`/`https:` are accepted; the host\n\t * rejects every other protocol, so this cannot be used to launch arbitrary\n\t * schemes. Needs `shell.openExternal`.\n\t */\n\topenExternal(url: string): Promise<void>;\n\t/**\n\t * Show a global toast in the host UI (bottom-right). No permission required.\n\t * Prefer this over swallowing errors into opaque UI copy: pass `error` so\n\t * the host attaches a one-click \"copy stack\" action for the user.\n\t *\n\t * Capture `ctx.ui.notify` in `activate` if React components need it\n\t * (components do not receive `ctx`).\n\t */\n\tnotify(options: PluginNotifyOptions): void;\n\t/**\n\t * 读当前侧边栏形态。无需权限——这是纯布局信息,不含任何用户数据。\n\t *\n\t * React 组件请改用 `useSidebarState()`:它会在状态变化时重渲染,不必自己订阅。\n\t * 这一对只为拿不到 hook 的地方准备(`activate()` 内、工具处理器、命令式绘制的画布)。\n\t */\n\tgetSidebarState(): PluginSidebarState;\n\t/**\n\t * 订阅侧边栏形态变化——用户收起/展开侧边栏、或窗口跨过窄屏阈值时触发。\n\t * 返回 Disposable 取消订阅;请在插件失活时释放。\n\t *\n\t * 回调按值去重:拖窗口不会把它打成回调风暴,只有三元组真的变了才通知。\n\t */\n\tonSidebarStateChanged(listener: (state: PluginSidebarState) => void): Disposable;\n}\n"]}
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["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AAC;IACtC;;;;;OAKG;IACH,qBAAqB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,GAAG,UAAU,CAAC;CACjF","sourcesContent":["import type { ComponentType, ReactNode } from \"react\";\nimport type { ConversationMessage } from \"./conversation.js\";\nimport type { Disposable } from \"./disposable.js\";\nimport type { PluginImageRef } from \"./images.js\";\nimport type { PluginPromptAttachment } from \"./prompt-attachment.js\";\nimport type { ConversationScenario } from \"./scenario.js\";\nimport type { PluginShortcutScopeContribution } from \"./shortcuts.js\";\n\nexport interface PluginGlobalSlotContribution {\n\tid: string;\n\tcomponent: ComponentType;\n}\n\nexport interface PluginAbilityDetailSlotProps {\n\tabilityId: string;\n\tinstalled: boolean;\n\tenabled: boolean;\n}\n\n/** Inline setup/status surface rendered near the top of one ability detail page. */\nexport interface PluginAbilityDetailSlotContribution {\n\tid: string;\n\tabilityId: string;\n\tcomponent: ComponentType<PluginAbilityDetailSlotProps>;\n}\n\n/**\n * Props handed to a workspace-view component. A workspace view owns the whole\n * content area, so unlike panel slots it is addressed by its own route and can\n * be deep-linked; the host passes back its identity so one component can serve\n * several registered views.\n */\nexport interface PluginWorkspaceViewProps {\n\t/** The contribution id as registered (NOT namespaced). */\n\tviewId: string;\n\t/** The owning plugin id. */\n\tpluginId: string;\n}\n\n/**\n * Badge tone. The host maps it to its own theme colors — a plugin cannot pick a\n * raw color, so badges stay consistent with the built-in navigation entries.\n */\nexport type PluginNavBadgeTone = \"accent\" | \"danger\" | \"default\" | \"warning\";\n\n/**\n * A badge on the plugin's sidebar navigation entry.\n *\n * `beta` is the host's own preset — it renders exactly like the built-in\n * 知识库 Beta 标识, wording included (and localized by the host), so plugins do\n * not have to spell \"Beta\" themselves in every locale.\n *\n * `count` renders `99+` past 99 and disappears at 0 — an unread badge showing\n * \"0\" is worse than no badge.\n */\nexport type PluginNavBadge =\n\t| { kind: \"beta\" }\n\t| { kind: \"text\"; text: string; tone?: PluginNavBadgeTone }\n\t| { kind: \"count\"; count: number; tone?: PluginNavBadgeTone }\n\t| { kind: \"dot\"; tone?: PluginNavBadgeTone };\n\n/**\n * A **workspace view**(工作区视图): a full-page surface a plugin contributes to\n * the host's primary navigation. It is the plugin counterpart of a built-in page\n * such as 自动化 / 知识库 — the host gives it its own route\n * (`/workspace/<pluginId>/<viewId>`) and a sidebar entry, and the plugin owns the\n * entire content area while it is open.\n *\n * Use it for standalone workbenches that are NOT bound to one conversation\n * (dashboards, boards, consoles). Conversation-scoped UI belongs in an\n * {@link PluginActivityTabContribution activity tab}; floating UI belongs in a\n * {@link PluginGlobalSlotContribution global slot}.\n */\nexport interface PluginWorkspaceViewContribution {\n\t/** Unique within the plugin; the host namespaces it as `${pluginId}:${id}`. */\n\tid: string;\n\t/** Sidebar entry label. Supports `%catalogKey%` i18n lookup. */\n\tlabel: string;\n\t/**\n\t * Sidebar entry icon as an **iconify class string** (e.g.\n\t * `\"icon-[solar--widget-5-linear]\"`) — NOT a React node, because the host\n\t * renders it inside its own nav button and persists nav layout by key.\n\t *\n\t * Omit it to inherit the plugin's own `plugin.json` icon: a packaged image\n\t * (svg / png / webp …) is masked with the theme's foreground color, so a plugin\n\t * that ships artwork does not have to find a lookalike in an icon set. Set\n\t * {@link PluginWorkspaceViewContribution.iconTint} to `false` to keep its colors.\n\t */\n\ticon?: string;\n\t/**\n\t * Whether an image icon is tinted with the theme's foreground color. Defaults to\n\t * `true`, which keeps the entry consistent with the built-in navigation and legible\n\t * in every theme.\n\t *\n\t * Pass `false` for a full-color logo. Weigh it first: the entry renders at 16px\n\t * beside monochrome built-ins, and a fixed-color image cannot follow the active\n\t * theme — a dark logo can disappear on a dark sidebar. Has no effect on Iconify\n\t * class icons, which are always tinted.\n\t */\n\ticonTint?: boolean;\n\t/** Optional one-line description; shown as the nav entry tooltip. */\n\tdescription?: string;\n\t/**\n\t * Initial badge on the sidebar entry. `{ kind: \"text\" }` supports the same\n\t * `%catalogKey%` i18n lookup as {@link label}. Update it at runtime with\n\t * {@link PluginUiApi.setWorkspaceViewBadge}.\n\t */\n\tbadge?: PluginNavBadge;\n\t/** Zero-props aside from {@link PluginWorkspaceViewProps}. */\n\tcomponent: ComponentType<PluginWorkspaceViewProps>;\n\t/** Sort hint among this plugin's own views (ascending). Defaults to 0. */\n\tnavOrder?: number;\n\t/**\n\t * Whether this view takes a sidebar entry. Defaults to `true`.\n\t *\n\t * Pass `false` for a surface users open occasionally — a setup page, a\n\t * diagnostics console. It then lives only under Settings → More options,\n\t * where the host lists every off-sidebar view and opens it inside the\n\t * settings shell, so switching between such pages stays one click.\n\t *\n\t * The sidebar is a scarce, user-curated space: a plugin that always claims a\n\t * slot pushes the entries someone actually uses into the overflow menu.\n\t */\n\tsidebar?: boolean;\n}\n\n/**\n * What a workspace view puts into the **host page header** — the window's top\n * bar that also carries the drag region, the macOS traffic-light gutter and the\n * sidebar trigger.\n *\n * Without this the header still renders, showing the app name above the\n * plugin's own toolbar — two stacked bars. Set `hideTitle` and move the view's\n * toolbar in here and the surface gets a single, host-consistent header.\n *\n * `left` / `right` are ReactNodes rendered by the host inside that bar (left:\n * right after the sidebar trigger; right: before the window controls). They are\n * rendered in the plugin's i18n + CSS scope, so `useTranslation()` and the\n * plugin's own classes work as usual. Pass fresh nodes whenever the view's\n * state changes — this is a live setter, not a one-time registration.\n */\nexport interface PluginWorkspaceViewHeader {\n\t/** Replaces the host title text. Supports `%catalogKey%` i18n lookup. */\n\ttitle?: string;\n\t/** Drop the host title entirely (use when {@link left} carries its own). */\n\thideTitle?: boolean;\n\t/** Rendered in the header's left cluster, after the sidebar trigger. */\n\tleft?: ReactNode;\n\t/** Rendered in the header's action cluster, before the window controls. */\n\tright?: ReactNode;\n\t/**\n\t * Float the host header OVER the view instead of stacking above it. The view\n\t * then owns the full content height, and its top `~44px` sit under the\n\t * transparent header strip (window drag region / traffic lights / sidebar\n\t * trigger all keep working on top). Use for immersive full-page surfaces\n\t * whose own hero starts at the very top; leave unset for toolbar-style\n\t * headers that need their own opaque row.\n\t */\n\timmersive?: boolean;\n}\n\nexport interface PluginAudioMetadata {\n\t/** Embedded title; preview renderers should fall back to file.name. */\n\ttitle?: string;\n\tartist?: string;\n\t/** Embedded cover art as a Data URL when available. */\n\tcoverDataUrl?: string;\n}\n\nexport interface PluginPreviewUrlOptions {\n\t/** Optional media hint for ambiguous containers such as webm. */\n\tmediaKind?: \"audio\" | \"video\";\n}\n\n/**\n * The file handed to a file-preview plugin component. The host does NOT\n * pre-read or guess encoding — the plugin decides whether to read text or\n * bytes. `path` is also exposed for plugins that prefer native fetch.\n */\nexport interface PluginPreviewFile {\n\tpath: string | null;\n\tname: string;\n\textension: string;\n\tmime: string;\n\tsize: number;\n\t/** Read the file as a UTF-8 string. */\n\treadText(): Promise<string>;\n\t/** Read the raw file bytes. */\n\treadBytes(): Promise<ArrayBuffer>;\n\t/** A fetchable streaming URL for the file (Range-capable). */\n\tgetUrl(options?: PluginPreviewUrlOptions): string;\n\t/**\n\t * Subscribe to on-disk changes of this file. The listener fires (debounced\n\t * by the host) whenever the file's contents change, letting previews update\n\t * live. Returns a Disposable; call dispose() to stop watching. A no-op for\n\t * files without a real path (url-only sources).\n\t */\n\twatch(listener: () => void): Disposable;\n\t/**\n\t * Host-provided audio metadata for local media files. Returns null when the\n\t * host cannot provide metadata, e.g. url-only sources or unsupported files.\n\t */\n\tgetAudioMetadata?(): Promise<PluginAudioMetadata | null>;\n}\n\nexport interface PluginFilePreviewProps {\n\tfile: PluginPreviewFile;\n}\n\n/**\n * A file handed to {@link PluginUiApi.previewFile} — the *opening* side of the\n * global previewer, the mirror image of {@link PluginPreviewFile} (which is the\n * *rendering* side). Bytes never cross over: the host reads the source itself.\n *\n * Exactly one of `path` (local absolute path) or `url` (host media / http URL)\n * must be given. `path` is the shape the host's own file tree uses, so the\n * previewer also offers \"在 Finder 中显示\" for it.\n */\nexport interface PluginPreviewFileRef {\n\t/** Local absolute path. Requires the `fs.read` permission. */\n\tpath?: string;\n\t/** Fetchable URL (host media URL or http/https). Requires `ui.slot.message`. */\n\turl?: string;\n\t/**\n\t * Display name **including the extension** — the previewer dispatches to a\n\t * renderer by this extension, not by `mimeType`. Optional for `path`\n\t * sources (the host falls back to the path's basename).\n\t */\n\tname?: string;\n\tmimeType?: string;\n\t/** Byte size, shown in the previewer's download detail when known. */\n\tsize?: number;\n}\n\nexport interface PluginFilePreviewContribution {\n\t/** Lower-case extensions without the dot, e.g. [\"svg\"]. */\n\textensions: string[];\n\tcomponent: ComponentType<PluginFilePreviewProps>;\n}\n\n/** Host residency policy for an activity-panel tab. */\nexport type PluginActivityTabRetention = \"active-only\" | \"warm\" | \"pinned\";\n\n/**\n * 活动面板标签卡此刻所在的工作空间。`cwd` 与面板自己的作用域一致(项目详情页是项目根,\n * 会话页是会话 cwd),插件据此判断这个工作空间该不该出现自己的标签卡。\n */\nexport interface PluginActivityTabScope {\n\treadonly cwd: string | null;\n}\n\n/**\n * 一帧的标签卡状态,由 {@link PluginActivityTabContribution.useMeta} 按当前工作空间返回。\n * 只影响「在不在栏上」这类摆放语义;名字与图标仍以注册时声明为默认值。\n */\nexport interface PluginActivityTabMeta {\n\t/** 覆盖注册时的 label(已本地化);省略时用注册值。 */\n\treadonly label?: string;\n\t/** 覆盖注册时的 icon;省略时用注册值(含 `plugin.json#icon` 回落)。 */\n\treadonly icon?: ReactNode;\n\t/** 标签卡角标;0 / 省略表示不显示。 */\n\treadonly badge?: number;\n\t/**\n\t * 固定上栏:只要本帧返回的 meta 非空且 `pinned` 为 true,标签卡就一直在标签栏里,\n\t * 用户无法用减号移除,也不受「+」可添加池与历史隐藏记录左右。适合「工作空间里有\n\t * 这个东西就必须看得到」的面板(如项目根存在 `.git` 的 Git 面板)。\n\t *\n\t * 省略 = 按用户的上栏记录 / `initiallyVisible` 决定,用户仍可移除。\n\t */\n\treadonly pinned?: boolean;\n}\n\n/** {@link PluginActivityTabContribution.useMeta} 的返回:null = 本帧不进入候选。 */\nexport type PluginActivityTabMetaResult = PluginActivityTabMeta | null;\n\nexport interface PluginActivityTabContribution {\n\t/**\n\t * 标签栏上的默认相对位置,越小越靠前;缺省 100(排在全部内置标签卡之后)。\n\t *\n\t * 内置的取值可作标尺:文件 0、批量 10、浏览器 15、计划 18、待办 20、后台任务 30。\n\t * 下限被宿主钳到 10,「文件」永远是第一枚;用户拖拽出来的顺序优先于这个值。\n\t */\n\torder?: number;\n\tid: string;\n\tlabel: string;\n\t/**\n\t * Tab icon as a React node (not an iconify class string).\n\t * Omit to inherit the host-resolved brand icon from `plugin.json#icon`\n\t * (`ctx.plugin.iconUrl`). Prefer omitting for package brand icons so the\n\t * plugin never loads assets via absolute `/…` paths or host protocols.\n\t */\n\ticon?: ReactNode;\n\tcomponent: ComponentType;\n\t/**\n\t * 允许该标签卡出现的对话场景 slug 列表(镜像工具的 scope_use)。**fail-closed**:\n\t * 未声明/空数组 = 任何会话都不显示;声明后仅在列出的场景里出现(如\n\t * `[\"project\", \"conversation\"]`)。会话页插槽据此随对话类型显隐。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n\t/**\n\t * 注册后是否默认在标签栏里(缺省 `true`)。声明 `false` 表示「出现条件由我\n\t * 自己决定」——注册只是入池,之后由 {@link PluginUiApi.setActivityTabVisible}\n\t * 或 {@link PluginUiApi.openActivityTab} 决定何时上栏(如 git 只在仓库目录、\n\t * 工作台跟随输入栏 toggle)。无论哪种,用户仍可用减号手动隐藏。\n\t */\n\tinitiallyVisible?: boolean;\n\t/**\n\t * Component residency while the tab is inactive. Defaults to `\"warm\"`:\n\t * visited tabs stay mounted in the host's bounded LRU cache. Use\n\t * `\"active-only\"` for cheap, stateless content and `\"pinned\"` for runtimes\n\t * that must never be evicted while available.\n\t */\n\tretention?: PluginActivityTabRetention;\n\t/**\n\t * @deprecated Use {@link PluginActivityTabContribution.retention}. `true`\n\t * maps to `\"pinned\"`; `false` maps to `\"active-only\"`.\n\t */\n\tkeepAliveWhenAvailable?: boolean;\n\t/**\n\t * 按当前工作面决定这一帧的 meta:返回 `null` 表示本帧不进入候选(既不上栏,也不在\n\t * 「+」里),返回 `{ pinned: true }` 表示固定上栏且不可移除。\n\t *\n\t * 这是一个 **React hook**:宿主每次解析标签栏时按「已注册定义」各调用一次,所以可以在\n\t * 里面用任意 hook(自己的缓存 store、`useTranslation`……)。约束:\n\t * - 渲染期必须是纯计算,探测一类的异步工作放进 `useEffect`,结果写回自己的 store;\n\t * - 抛错只会让这一项消失(与 `null` 同效),不影响其它标签卡;\n\t * - 省略时行为与本字段出现前一致:静态 label / icon / badge,按用户上栏记录显隐。\n\t */\n\tuseMeta?: (scope: PluginActivityTabScope) => PluginActivityTabMetaResult;\n}\n\n/**\n * 会话底部面板的组件贡献。\n *\n * 与 {@link PluginActivityTabContribution} 的分工:活动面板在右侧、一个贡献只有一个\n * 实例、适合「看某个东西的当前状态」;底部面板横跨会话页下沿、可分屏、**同一个贡献\n * 可以开多个实例**,适合终端、日志跟随这类长驻的工作面。\n *\n * meta 走命令式的 {@link PluginBottomPanelContextValue.setMeta} 而不是「每帧返回 meta\n * 的 hook」:多实例场景下 hook 拿不到实例身份,两套 meta 事实源会在改名后打架。\n */\nexport interface PluginBottomPanelContribution {\n\t/** Unique within the plugin; the host namespaces it as `plugin:<pluginId>:<id>`. */\n\tid: string;\n\t/** 「+」菜单里的名字,也是新实例的初始名。Supports `%catalogKey%` i18n lookup. */\n\tlabel: string;\n\t/**\n\t * Tab icon as a React node or an iconify class string.\n\t * Omit to inherit the host-resolved brand icon from `plugin.json#icon`.\n\t */\n\ticon?: ReactNode;\n\t/** Zero-props;实例上下文经 {@link useBottomPanel} 取。 */\n\tcomponent: ComponentType;\n\t/**\n\t * 允许出现的对话场景 slug 列表。**fail-closed**:未声明/空数组 = 任何会话都不出现。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n\t/** 「+」菜单里的相对位置,越小越靠前;缺省 100(排在内置之后)。 */\n\torder?: number;\n\t/**\n\t * 同一会话里最多能开几个实例;缺省不限。单例面板给 1,终端一类不设。\n\t */\n\tmaxInstances?: number;\n}\n\n/** Explicit conversation scope for an activity-tab command. */\nexport interface PluginActivityTabTargetOptions {\n\t/**\n\t * Absolute cwd whose activity-tab state should be changed. Omit to target\n\t * the conversation currently displayed by the host. Tool handlers and\n\t * background work should pass the triggering session's cwd so a foreground\n\t * navigation change cannot redirect the command to another conversation.\n\t */\n\tcwd?: string;\n}\n\n/** Options for {@link PluginUiApi.openActivityTab}. */\nexport interface PluginOpenActivityTabOptions extends PluginActivityTabTargetOptions {\n\t/**\n\t * Desired panel width as it opens: a pixel number, or `\"max\"` to track the\n\t * widest the window allows — `\"max\"` keeps following window resizes until the\n\t * user drags the divider. The host clamps to its min/max bounds. Omit to keep\n\t * the user's current width.\n\t *\n\t * Applied when the tab is attached for the first time, or when this call opens\n\t * a closed panel — the panel then slides in at this width in one motion.\n\t * Ignored when the panel is already open with the tab attached (the user's\n\t * width stands), and for calls made while `activate` is still running, since\n\t * those replay on every reload.\n\t */\n\twidth?: number | \"max\";\n}\n\nexport interface PluginCaptureRegion {\n\tx: number;\n\ty: number;\n\twidth: number;\n\theight: number;\n}\n\n/**\n * Decoration a plugin contributes to the next outgoing prompt while its input\n * action is active. `metadata` is shallow-merged into the prompt request and\n * `instructions` are appended as hidden, model-visible guidance.\n */\nexport interface PluginPromptDecoration {\n\tmetadata?: Record<string, unknown>;\n\t/** Hidden plugin-owned instructions appended to the next agent turn. */\n\tinstructions?: string[];\n}\n\n/**\n * An action button shown in a row beneath the AI input bar. Rendered as a\n * toggle: clicking activates, clicking again deactivates. While active, the\n * host calls `decoratePrompt()` before each send and merges the returned\n * metadata into the outgoing prompt request. The plugin owns any side state\n * (it is the same Module Federation instance as its other slots).\n */\nexport interface PluginInputActionContribution {\n\tid: string;\n\tlabel: string;\n\t/** Button icon as a React node. Omit to inherit the plugin's `plugin.json#icon`. */\n\ticon?: ReactNode;\n\t/** Whether the action begins in the active state. Defaults to false. */\n\tdefaultActive?: boolean;\n\t/**\n\t * 该输入动作所依赖的 agent 工具名。设置后,仅当该工具在当前会话处于激活(按工具的\n\t * scope_use 解析)时才显示这个 badge——避免在工具被场景屏蔽(如批量任务)时仍显示一个\n\t * 点了也无效的开关。不设则始终显示。例如「图像生成」设为 \"generate_image\"。\n\t */\n\trequiresActiveTool?: string;\n\t/**\n\t * 允许该 toggle 出现的对话场景 slug 列表(镜像工具的 scope_use)。**fail-closed**:\n\t * 未声明/空数组 = 任何会话都不显示;声明后仅在列出的场景里出现。与 `requiresActiveTool`\n\t * 取「与」:两者都满足才显示。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n\t/**\n\t * When true, this plugin's agent contributions (tools / skills / MCP /\n\t * systemPrompt) and Activity Tabs are hard-isolated: inactive until this\n\t * toggle is on (ADR-0041, knowledgeMode-style). Default false.\n\t */\n\thardIsolation?: boolean;\n\t/**\n\t * Fired when the user toggles the action; `active` is the new state. Return\n\t * `false` when `active` is true to VETO the activation (e.g. the plugin needs\n\t * configuration first) — the toggle stays off. Deactivation can't be vetoed.\n\t */\n\tonToggle?(active: boolean): boolean | void;\n\t/**\n\t * Called by the host before sending while the action is active. The\n\t * returned metadata is merged into the outgoing prompt request.\n\t */\n\tdecoratePrompt?(): PluginPromptDecoration | void;\n}\n\n/**\n * A declarative, serializable descriptor for one card rendered beneath a\n * message. `type` selects a registered card renderer; `key` drives cross-turn\n * dedup (same key across turns = one logical card, shown only under its latest\n * anchor); `payload` carries STABLE REFERENCES (e.g. image ids), not a content\n * snapshot — the renderer resolves live state from it. `title`/`icon` label the\n * card's tab (override the renderer's registration defaults). Rides a tool\n * result's out-of-band `details.cards`; crosses the agent→host boundary, so\n * `icon` is an icon-symbol string, not a node.\n */\nexport interface CardDescriptor {\n\ttype: string;\n\tkey?: string;\n\tpayload?: unknown;\n\ttitle?: string;\n\ticon?: string;\n}\n\n/** A pending (in-flight) tool call handed to a renderer's `pendingFor`. */\nexport interface PluginPendingToolCall {\n\ttoolName: string;\n\targs: Record<string, unknown>;\n}\n\n/**\n * Props for a card renderer. `descriptor` is the card's data; `pending` is true\n * while it was synthesized from an in-flight tool (render a skeleton); `message`\n * is the anchoring conversation message.\n */\nexport interface PluginCardProps {\n\tdescriptor: CardDescriptor;\n\tpending: boolean;\n\tmessage: ConversationMessage;\n}\n\n/**\n * A card renderer registered by a plugin, keyed by `type`. A descriptor whose\n * `type` matches is rendered by `component`. `title`/`icon` are the default tab\n * label/icon (a descriptor may override either). `pendingFor`, given an\n * in-flight tool call, returns a provisional descriptor so a skeleton card\n * appears (and claims a tab) before the tool's result lands — or null when this\n * renderer doesn't handle that tool. The `type` must be globally unique across\n * plugins (convention: prefix with the plugin id, e.g. \"image-gen:preview\").\n */\nexport interface PluginCardRendererContribution {\n\ttype: string;\n\tcomponent: ComponentType<PluginCardProps>;\n\ttitle?: string;\n\t/** Default tab icon as a React node. Omit to inherit the plugin's `plugin.json#icon`. */\n\ticon?: ReactNode;\n\tpendingFor?: (toolCall: PluginPendingToolCall) => CardDescriptor | null;\n}\n\n/** A tool call handed to a tool-call slot renderer. */\nexport interface PluginToolCallSlotToolCall {\n\ttoolCallId: string;\n\ttoolName: string;\n\targs: Record<string, unknown>;\n\tstatus: \"pending\" | \"success\" | \"error\" | \"cancelled\";\n\tresult?: string;\n\tisError?: boolean;\n}\n\nexport interface PluginToolCallSlotProps {\n\ttoolCall: PluginToolCallSlotToolCall;\n}\n\n/**\n * A component that **replaces the host's default inline transcript rendering**\n * for a specific tool (matched by `toolName`; first registered renderer wins).\n * This is how a plugin renders rich UI for its OWN agent tool's output — plugin\n * tools cannot emit `details.cards`, so the message card system (registerCardRenderer)\n * does not serve them; the tool-call slot does.\n */\nexport interface PluginToolCallSlotContribution {\n\tid: string;\n\ttoolName: string;\n\tcomponent: ComponentType<PluginToolCallSlotProps>;\n}\n\n/**\n * A card rendered at the bottom of the message list for the LATEST turn — NOT\n * bound to a tool call. The host mounts `component` in the footer slot and\n * re-mounts it each session/turn; the plugin owns visibility entirely (it reads\n * live state via SDK hooks — `useActiveConversation`, `useConversationMessages`,\n * `ctx.conversation.on(\"turn-end\")` — and returns `null` to render nothing,\n * e.g. git renders only inside a repo that has changes). `scope_use` gates which\n * conversation scenarios it may appear in (**fail-closed**, mirrors the other\n * slots). `id` must be unique within the plugin.\n */\nexport interface PluginTurnCardContribution {\n\tid: string;\n\tcomponent: ComponentType;\n\t/**\n\t * 允许该 turn 卡出现的对话场景 slug 列表(镜像其它插槽的 scope_use)。**fail-closed**:\n\t * 未声明/空数组 = 任何会话都不显示;声明后仅在列出的场景里出现(如 `[\"project\"]`)。\n\t */\n\tscope_use?: readonly ConversationScenario[];\n}\n\n/**\n * Options for {@link PluginUiApi.notify}. Surfaces a host toast so users can\n * see plugin failures without opening DevTools.\n */\nexport interface PluginNotifyOptions {\n\t/** Toast body. Required even when `error` is set (user-facing summary). */\n\tmessage: string;\n\t/** Defaults to plugin display name when omitted. */\n\ttitle?: string;\n\t/** Defaults to `\"info\"`; when `error` is set and variant omitted, host uses `\"error\"`. */\n\tvariant?: \"info\" | \"success\" | \"warning\" | \"error\";\n\t/**\n\t * Optional failure cause. Host formats message + stack and adds a\n\t * \"复制堆栈\" action so the user can paste it into bug reports / chat.\n\t */\n\terror?: unknown;\n\t/**\n\t * Auto-dismiss delay in ms. `0` keeps the toast until dismissed.\n\t * Defaults: sticky (`0`) when `error` is present, otherwise host default (~4s).\n\t */\n\tdurationMs?: number;\n}\n\n/**\n * 新会话上下文区的激活条件。**只能写本插件自己的东西**——填别人的 id 一律不生效。\n *\n * 这条限制是故意的:否则插件 A 可以声明「只要用户选了 B 的智能体我就上屏」,把别人的\n * 使用场景劫持过来。\n *\n * 各字段取并集:任意一条命中即激活。至少要声明一条——全空等于「任何新会话都上屏」,宿主拒掉。\n */\nexport interface PluginNewSessionContextActivation {\n\t/** 本插件在 manifest 里声明的智能体 id(不带 `plugin:` 前缀)。 */\n\tagents?: readonly string[];\n\t/** 本插件在 manifest 里声明的团队 id。省略则任意「含本插件成员的团队」都算命中。 */\n\tteams?: readonly string[];\n\t/** 本插件提供的 skill 名;用户在输入框里提到时命中。 */\n\tskills?: readonly string[];\n\t/** 本插件提供的 MCP server 名。 */\n\tmcpServers?: readonly string[];\n}\n\n/** 用户在新会话页当前选中的对话目标。 */\nexport interface PluginNewSessionTarget {\n\treadonly kind: \"agent\" | \"team\";\n\t/** Agent 档案 id 或团队 id。 */\n\treadonly id: string;\n\t/** 目标若由本插件贡献,这里给出 manifest 里的那个 id。 */\n\treadonly contributedId?: string;\n}\n\n/**\n * 渲染上下文。这是一个**会继续生长的对象**:后续新增字段不会破坏既有插件,所以按需\n * 解构、不要假定它只有这些键。\n */\nexport interface PluginNewSessionContext {\n\treadonly target: PluginNewSessionTarget | null;\n\t/** 输入框里提到的、属于本插件的能力。 */\n\treadonly mentionedAbilities: {\n\t\treadonly skills: readonly string[];\n\t\treadonly mcpServers: readonly string[];\n\t};\n\t/**\n\t * 输入框中尚未发送的文本。需要 `conversation.draft.read` 权限,未授予时恒为空串。\n\t *\n\t * 只在本贡献处于激活状态时提供——插件拿不到「用户随便打点什么」的全程流水。\n\t */\n\treadonly draft: string;\n\t/** 当前工作区目录;未选择项目时为 null。 */\n\treadonly cwd: string | null;\n\t/** 回写输入栏。刻意不提供「直接发送」:越过发送前这道关不属于本区职责。 */\n\treadonly composer: {\n\t\t/** 把资源挂成附件,随下一次发送带走。 */\n\t\tattach(attachment: PluginPromptAttachment): void;\n\t\t/**\n\t\t * 往草稿里插一段文本。始终是插入而非替换,免得抹掉用户已经打的内容。\n\t\t *\n\t\t * `position` 缺省为 `\"end\"`(光标处)。`\"start\"` 插到最前面,适合「先定题、细节\n\t\t * 由用户补」这类写法——用户点完多半光标并不在开头,位置只能由调用方定死。\n\t\t */\n\t\tinsertText(text: string, options?: { position?: \"start\" | \"end\" }): void;\n\t};\n}\n\n/**\n * 新会话页输入框下方的一块内容(`ui.slot.new-session-context`)。\n *\n * 与 input-action 的分工:那是发送前的开关,这是发送前的**上下文**——把用户接下来多半\n * 要用到的素材摆出来。激活与否由宿主按 {@link PluginNewSessionContextActivation} 裁决,\n * 插件只负责在被激活后渲染,因此拿不到用户逐键输入的全程内容。\n *\n * 同时有多个贡献上屏时,宿主会在该区域顶部出 tabbar;只有一个时直接渲染内容。\n */\nexport interface PluginNewSessionContextContribution {\n\tid: string;\n\t/** tabbar 上的标题;只有一个贡献上屏时不展示。 */\n\tlabel: string;\n\t/** tab 图标;省略时用插件自己的图标。 */\n\ticon?: ReactNode;\n\tactivateWhen: PluginNewSessionContextActivation;\n\t/**\n\t * 横向占位。`\"input\"`(默认)与输入框同宽,适合补充说明一类的窄内容;`\"wide\"` 铺满\n\t * 页面可用宽度,留给画廊、素材墙这类「内容本身就是主角」的东西——把它们压在输入框\n\t * 宽度里,每一项都会小到看不清。\n\t */\n\twidth?: \"input\" | \"wide\";\n\trender(context: PluginNewSessionContext): ReactNode;\n}\n\n/**\n * 顶栏动作的下拉菜单项。点击一项执行 `onSelect` 并关闭菜单(`checkbox` / `radio` 例外,见\n * {@link PluginHeaderActionMenuItemKind})。\n */\n/**\n * 菜单项的类型。省略即普通命令项;其余类型让「列表就是状态」的场景(分支列表、开关、\n * 加载中、空态)不必退化成纯文字:\n * - `checkbox` / `radio`:`checked` 决定勾选标记,点它触发 `onSelect` 后菜单不自动关(适合切换开关);\n * - `label`:分组标题,不可点;\n * - `loading` / `empty`:占位行,自动禁用、不可点;\n * - `submenu`:`children` 是下一级菜单项(只支持一层)。\n */\nexport type PluginHeaderActionMenuItemKind =\n\t| \"item\"\n\t| \"checkbox\"\n\t| \"radio\"\n\t| \"label\"\n\t| \"loading\"\n\t| \"empty\"\n\t| \"submenu\";\n\nexport interface PluginHeaderActionMenuItem {\n\t/** 项在菜单内唯一的 id。 */\n\tid: string;\n\t/** 默认 `item`。 */\n\tkind?: PluginHeaderActionMenuItemKind;\n\tlabel: string;\n\t/** 菜单项前的图标,16px 方框内显示。`checkbox` / `radio` 已选中时换成勾选标记。 */\n\ticon?: ReactNode;\n\t/** `submenu` 且给了 `children` 时可省略。 */\n\tonSelect?: () => void;\n\t/** `submenu` 的下一级菜单项。 */\n\tchildren?: readonly PluginHeaderActionMenuItem[];\n\t/** `checkbox` / `radio` 是否已选中。 */\n\tchecked?: boolean;\n\tdisabled?: boolean;\n\t/** 禁用原因:禁用时排在 `title` 之前显示,用户才知道为什么点不了。 */\n\tdisabledReason?: string;\n\t/** 危险操作(红色)。 */\n\tdestructive?: boolean;\n\t/** 在这一项之前画一条分隔线。 */\n\tseparatorBefore?: boolean;\n}\n\n/** 顶栏动作气泡里的内容组件拿到的 props。 */\nexport interface PluginHeaderActionPopoverProps {\n\t/** 关闭气泡(例如内容里点了「完成」)。 */\n\tclose: () => void;\n}\n\n/** 角标与图标的语义色,跟随宿主主题;`neutral` 为默认。 */\nexport type PluginHeaderActionTone = \"neutral\" | \"info\" | \"success\" | \"warning\" | \"danger\";\n\n/** 气泡尺寸:`sm` 约 16rem,`md`(默认)约 24rem,`lg` 约 32rem。 */\nexport type PluginHeaderActionPopoverSize = \"sm\" | \"md\" | \"lg\";\n\n/**\n * 气泡的容器形态。默认 `popover`(贴着按钮的小浮层);内容是有输入框、列表等需要专注的界面时\n * 用 `dialog`(宿主居中对话框,带标题栏与关闭按钮,宽度由 `size` 决定)。\n */\nexport type PluginHeaderActionPopoverHost = \"popover\" | \"dialog\";\n\n/** 气泡声明:直接给组件,或给组件加容器参数。 */\nexport type PluginHeaderActionPopover =\n\t| ComponentType<PluginHeaderActionPopoverProps>\n\t| {\n\t\t\tcomponent: ComponentType<PluginHeaderActionPopoverProps>;\n\t\t\tsize?: PluginHeaderActionPopoverSize;\n\t\t\thost?: PluginHeaderActionPopoverHost;\n\t\t\ttitle?: string;\n\t };\n\n/** 顶栏动作此刻能拿到的上下文:它在哪个页面、当前工作目录是什么。 */\nexport interface PluginHeaderActionContext {\n\t/**\n\t * 当前页面。`conversation` = 会话页;`new-session` = 新会话页(还没有消息,\n\t * 顶栏只有置顶与活动面板开关)。\n\t */\n\tsurface: PluginHeaderActionSurface;\n\t/** 当前工作目录;没有项目(例如空白新会话)时为 `null`。 */\n\tcwd: string | null;\n}\n\n/** 顶栏动作可以出现的页面。 */\nexport type PluginHeaderActionSurface = \"conversation\" | \"new-session\";\n\n/**\n * 顶栏动作此刻的**声明**,由 {@link PluginHeaderActionContribution.useAction} 返回。\n *\n * 宿主用它统一渲染成与内置按钮完全一致的一格;插件能决定的只有下面这些字段,没有 `className`、\n * `style`,也无法替换按钮本身。默认**只有图标**,名称靠悬浮提示(`title`)显示;需要把状态\n * 写在脸上时用 `label`(宽屏才显示,窄了自动退回图标)。\n * `click` / `menuItems` / `popover` **三选一**:\n * 同时给多个时按 `menuItems` > `popover` > `onClick` 取第一个;一个都没有则该动作不显示。\n *\n * 宿主会校验并截断:`title` 最长 40 字、`label` 最长 24 字(超出截断),`menuItems` 最多\n * 20 项,`badge` 只接受数字(≥ 1,超过 99 显示 `99+`)或 `true`(红点)。\n */\nexport interface PluginHeaderActionState {\n\t/** 必填。悬浮提示、无障碍名称(按钮上不显示文字时,用户全靠它认出这个动作)。 */\n\ttitle: string;\n\t/**\n\t * 必填。图标节点,宿主放进 16px 的固定方框里并忽略指针事件,建议直接用\n\t * iconify 的 `<span className=\"icon-[solar--…]\" />`。\n\t */\n\ticon: ReactNode;\n\t/**\n\t * 图标右侧的文字,用于「状态本身就是文字」的动作(分支名、当前模型、同步落后数)。\n\t * 最长 24 字;顶栏有位置时显示,被收纳、页头挤窄、顶栏超过 4 格时自动退回纯图标。\n\t */\n\tlabel?: string;\n\t/** 角标:数字显示计数,`true` 显示红点。被收纳时宿主会把它汇总到收纳入口上。 */\n\tbadge?: number | boolean;\n\t/** 角标与图标的语义色,默认 `neutral`(灰色数字 / 本色图标)。 */\n\ttone?: PluginHeaderActionTone;\n\t/** 选中态(例如面板已打开)。 */\n\tactive?: boolean;\n\tdisabled?: boolean;\n\t/** 禁用原因:禁用时替代 `title` 显示,用户才知道为什么点不了。 */\n\tdisabledReason?: string;\n\t/**\n\t * 处于选中态时,即使被收纳也要在活动面板开关左侧露出来(例如「正在录制」这类必须可见的状态)。\n\t * 只在顶栏有活动面板开关的页面上生效。\n\t */\n\tpromoteWhenActive?: boolean;\n\t/** 点击直接执行。 */\n\tonClick?: () => void;\n\t/** 点击向下弹出下拉菜单。 */\n\tmenuItems?: readonly PluginHeaderActionMenuItem[];\n\t/**\n\t * 点击弹出气泡,内容是你自己的组件。气泡的背景、圆角、投影由宿主固定,宽高随内容自适应;\n\t * 被收纳时它会在收纳托盘里**内联展开**(宽约 260px),内容请能在这个宽度下正常显示。\n\t */\n\tpopover?: PluginHeaderActionPopover;\n}\n\n/**\n * 会话页与新会话页顶栏右侧按钮组里的一格(`ui.slot.header-action`)。\n *\n * 顶栏右侧是**宿主统一管理的一个按钮组**:内置按钮(导出 / 置顶 / 终端 / 底部面板)与所有插件\n * 贡献排在同一组里,外观由宿主决定,插件不能自定义样式。显示规则:\n * - 顶栏最多显示 7 格(不含最右侧固定的「活动面板」开关),内置与插件共用这 7 个名额;\n * - 超出的、以及用户主动收起的动作进入「收纳」托盘(悬浮在按钮组上时,组下方出现的小白条);\n * - 用户可以在托盘里拖动调整顺序、决定哪些在顶栏哪些收纳,这份布局按动作 id 记在本机;\n * - 新装插件的动作:顶栏还有空位就排进去,否则进收纳,不会挤走用户已有的布局;\n * - `pin: \"prefer\"` 只是「用户没调整过时优先上栏」的建议,仍然用户可以改、也不突破 7 格上限。\n * 所以插件**不能**假定自己一定在顶栏上,也不能依赖相邻的是谁。\n *\n * 出现页面由 `surfaces` 决定,默认只有会话页。\n */\nexport interface PluginHeaderActionContribution {\n\t/** 贡献 id,在本插件内唯一,最长 64 字符。用户的布局按 `${插件 id}:${id}` 记忆,请不要随意改名。 */\n\tid: string;\n\t/**\n\t * 默认排序权重,小的靠左。**只影响用户还没自己调整过时的初始位置**,省略按注册顺序排在最后;\n\t * 同值按插件 id、贡献 id 稳定排序。\n\t */\n\torder?: number;\n\t/** 出现在哪些页面,默认 `[\"conversation\"]`。 */\n\tsurfaces?: readonly PluginHeaderActionSurface[];\n\t/**\n\t * 初始布局建议。`\"prefer\"` 表示用户没调整过布局时优先占用顶栏的一个名额\n\t * (仍受 7 格上限与用户后来的调整约束);默认 `\"normal\"`,即先待在收纳托盘里。\n\t */\n\tpin?: \"normal\" | \"prefer\";\n\t/**\n\t * 返回动作此刻的声明,返回 `null` 表示当前不适用(例如没有项目目录),宿主不显示也不占位。\n\t *\n\t * 这是一个 **React hook**:宿主在对应页面顶栏挂载期间一直调用它,所以可以在里面用任意 hook\n\t * (`useActiveConversation()`、`useTranslation()`、你自己的 store……),数据变化时自然重新声明。\n\t * 入参给出当前页面与工作目录,可以据此决定是否出现、显示什么。\n\t * 约束:\n\t * - 渲染期必须是纯计算,不要在里面发请求、起定时器;这类副作用放进 `useEffect`;\n\t * - 抛错只会让这一项消失(错误边界隔离),不会影响其它动作;\n\t * - 每次渲染都可以返回新对象,宿主不依赖引用相等。\n\t */\n\tuseAction: (context: PluginHeaderActionContext) => PluginHeaderActionState | null;\n}\n\n/**\n * 宿主左侧侧边栏此刻的形态。给插件自适应布局用——尤其是沉浸式工作区视图:\n * 侧边栏收起时宿主页头会长出「展开侧边栏」按钮并占住左上角,视图自己画在那一带的\n * 东西需要让位。\n */\nexport interface PluginSidebarState {\n\t/** 用户手动收起了侧边栏。窄屏下这一位仍然只反映用户意愿,不受窗口宽度影响。 */\n\tcollapsed: boolean;\n\t/** 窗口窄到侧边栏改走悬浮覆盖,不再占据左侧一栏。 */\n\tnarrow: boolean;\n\t/** 侧边栏此刻是否实际占着左边那一栏。等价于 `!collapsed && !narrow`,多数自适应只需要这一位。 */\n\tvisible: boolean;\n}\n\nexport interface PluginUiApi {\n\tregisterGlobalSlot(contribution: PluginGlobalSlotContribution): Disposable;\n\tregisterAbilityDetailSlot(contribution: PluginAbilityDetailSlotContribution): Disposable;\n\t/** Render an opaque setup URL as a host-themed PNG data URL. */\n\tcreateQrCode(text: string): Promise<string>;\n\t/**\n\t * Register a **workspace view**(工作区视图)— a full-page surface with its own\n\t * route and sidebar entry, on par with the host's built-in pages. Needs the\n\t * `ui.slot.workspace-view` permission (missing permission = **warn+noop**).\n\t *\n\t * The entry lands in the sidebar's「更多」收纳 by default; the user can pin it\n\t * to the top region or reorder it, and that layout is remembered.\n\t */\n\tregisterWorkspaceView(contribution: PluginWorkspaceViewContribution): Disposable;\n\t/**\n\t * Register a **new-session context block** — content shown beneath the input\n\t * on the new-session page, surfaced only when the user's current selection or\n\t * draft matches {@link PluginNewSessionContextActivation}. Needs the\n\t * `ui.slot.new-session-context` permission (missing permission = **warn+noop**).\n\t */\n\tregisterNewSessionContext(contribution: PluginNewSessionContextContribution): Disposable;\n\t/**\n\t * Register a **header action** — one declarative slot in the conversation\n\t * page header's host-managed button group (icon / badge plus a click,\n\t * menu or popover; no custom styling — see\n\t * {@link PluginHeaderActionContribution}). The user decides, via the group's\n\t * overflow tray, which actions sit in the header (max 7 shared with the host's\n\t * own buttons) and in what order. Needs the `ui.slot.header-action`\n\t * permission (missing permission = **warn+noop**) and Plugin API `^2.9.0`.\n\t */\n\tregisterHeaderAction(contribution: PluginHeaderActionContribution): Disposable;\n\t/**\n\t * Navigate to one of this plugin's own workspace views. `viewId` is the\n\t * contribution id passed to {@link PluginUiApi.registerWorkspaceView}. No-op\n\t * when the view is not registered (e.g. permission missing).\n\t */\n\topenWorkspaceView(viewId: string): void;\n\t/**\n\t * Update (or clear, with `null`) the badge on one of this plugin's workspace\n\t * view entries. Re-registering the view is NOT a way to do this — it would\n\t * remount the whole surface — so live badges (unread counts, status dots)\n\t * must come through here.\n\t *\n\t * No-op when the view is not registered (e.g. permission missing).\n\t */\n\tsetWorkspaceViewBadge(viewId: string, badge: PluginNavBadge | null): void;\n\t/**\n\t * Fill (or clear, with `null`) the host page header while one of this\n\t * plugin's workspace views is open. Call it from the view component (an\n\t * effect that re-runs on state change) and clear it on unmount — the host\n\t * keeps the entry keyed by view, and only applies it on that view's route.\n\t *\n\t * The header itself is never removed: it owns the window drag region and the\n\t * macOS traffic-light gutter. This is how a view takes it over instead.\n\t *\n\t * No-op when the view is not registered (e.g. permission missing).\n\t */\n\tsetWorkspaceViewHeader(viewId: string, header: PluginWorkspaceViewHeader | null): void;\n\t/**\n\t * Register a preview component keyed by file extension. The host dispatches\n\t * registered extensions before its built-in fallback renderers; first\n\t * registrant wins on conflict.\n\t */\n\tregisterFilePreview(contribution: PluginFilePreviewContribution): Disposable;\n\t/**\n\t * Register an activity-panel tab into the addable pool. The user attaches\n\t * it manually via the panel's \"+\" picker; attach records are keyed by the\n\t * workspace cwd. A contribution that declares `useMeta` decides its own\n\t * availability per workspace (see {@link PluginActivityTabContribution.useMeta}).\n\t */\n\tregisterActivityTab(contribution: PluginActivityTabContribution): Disposable;\n\t/**\n\t * Register a component into the session's bottom panel addable pool. The user\n\t * opens instances from the panel's \"+\" menu; one contribution can have several\n\t * instances in the same session, and each instance renames itself through\n\t * {@link useBottomPanel}.\n\t */\n\tregisterBottomPanel(contribution: PluginBottomPanelContribution): Disposable;\n\t/**\n\t * Register a toggle action shown beneath the AI input bar. While active,\n\t * its `decoratePrompt()` annotates the next outgoing prompt.\n\t */\n\tregisterInputAction(contribution: PluginInputActionContribution): Disposable;\n\t/**\n\t * Register a card renderer keyed by `type`. Cards rendered beneath a message\n\t * come from tool results' out-of-band `details.cards` (or `pendingFor` for\n\t * in-flight tools); the host resolves each card's `type` to a registered\n\t * renderer. Multiple cards under one message are shown as a tab-switcher\n\t * (\"收纳\") or a flat list.\n\t */\n\tregisterCardRenderer(contribution: PluginCardRendererContribution): Disposable;\n\t/**\n\t * Register a renderer that replaces the host's default inline transcript UI\n\t * for a tool call (matched by `toolName`). The complement to card renderers:\n\t * use it to render UI for a plugin's own agent tool output.\n\t */\n\tregisterToolCallSlot(contribution: PluginToolCallSlotContribution): Disposable;\n\t/**\n\t * Register a card rendered at the bottom of the message list for the latest\n\t * turn — NOT bound to a tool call. The host mounts the component in the\n\t * footer slot; the plugin owns visibility (return `null` to render nothing,\n\t * e.g. git renders only in a repo with changes). Gated by `scope_use`\n\t * (fail-closed). Needs the `ui.slot.turn-card` permission.\n\t */\n\tregisterTurnCard(contribution: PluginTurnCardContribution): Disposable;\n\t/**\n\t * Register a keyboard shortcut scope on the host's shared ShortcutScopeStack\n\t * (same path as host UI: modal > overlay > surface > app). Needs\n\t * `ui.shortcuts.register`. Plugins cannot use kind `\"app\"` (reserved for\n\t * host-configurable global actions). Prefer {@link usePluginShortcutScope}\n\t * from React components with a module-captured `registerShortcutScope`.\n\t */\n\tregisterShortcutScope(contribution: PluginShortcutScopeContribution): Disposable;\n\t/**\n\t * Programmatically attach (if needed) and activate one of this plugin's\n\t * own activity tabs in a conversation's activity panel. `tabId`\n\t * is the contribution id passed to registerActivityTab. Any payload (e.g.\n\t * which image to edit) is passed via the plugin's own in-memory state.\n\t *\n\t * Pass `options.width` to size the panel as it opens — a pixel number, or\n\t * `\"max\"` to expand it to the widest the current window allows (the host\n\t * still clamps to its min/max and auto-hides the sidebar when needed). Omit\n\t * to leave the user's current width untouched.\n\t *\n\t * Omit `options.cwd` for the conversation currently displayed by the host.\n\t * Tool handlers and background work should pass their session cwd explicitly.\n\t */\n\topenActivityTab(tabId: string, options?: PluginOpenActivityTabOptions): void;\n\t/**\n\t * 把本插件的某个活动面板标签卡在目标会话里上栏 / 下栏,**不激活也不展开\n\t * 面板**——`openActivityTab` 是「用户此刻要看它」,这个是「它现在该不该在\n\t * 栏里」。配合 `initiallyVisible: false` 使用,插件即可完全掌握自己标签卡的\n\t * 出现条件(如 git 只在仓库目录里上栏、工作台跟随输入栏 toggle)。\n\t *\n\t * 上栏记录按会话 cwd 持久化(ADR-0026),所以只需在条件变化时调用一次;\n\t * 用户随后用减号手动隐藏的结果不会被重复调用覆盖。缺省作用于宿主当前显示的\n\t * 会话;工具 handler 与后台任务应通过 `options.cwd` 传入自己的会话 cwd。既没有\n\t * 显式 cwd、也没有活动会话时为 no-op(无处记录)。\n\t */\n\tsetActivityTabVisible(tabId: string, visible: boolean, options?: PluginActivityTabTargetOptions): void;\n\t/**\n\t * 直接设置活动面板宽度:像素值,或 `\"max\"` 表示「跟随窗口拉满」(宿主仍会夹到\n\t * 自己的 min/max 内,必要时自动收起侧边栏)。\n\t *\n\t * `\"max\"` 是一种持续状态而非一次性求值:窗口尺寸变化时面板跟着变宽变窄,直到\n\t * 用户拖动分隔条或有人写入具体像素为止。传数字则是一次性的固定宽度。\n\t *\n\t * 与 `openActivityTab(id, { width })` 的区别:那里的宽度只在「标签卡首次 attach」\n\t * 或「把关着的面板翻开」时生效,且 activate 里的调用除外(避免重放覆盖用户手拖的\n\t * 宽度);这个是命令式的,每次调用都生效,供插件在自己的标签卡被激活、进入某种\n\t * 视图时按需调整。用户随后仍可拖动。\n\t */\n\tsetActivityPanelWidth(width: number | \"max\"): void;\n\t/**\n\t * Bind or clear plugin-owned context for outgoing prompts. The host renders\n\t * its label/icon and carries a structured `context` as a versioned snapshot.\n\t * Attachments default to one-shot; `lifecycle: \"sticky\"` remains until the\n\t * plugin or user clears the capsule.\n\t */\n\tsetPromptAttachment(attachment: PluginPromptAttachment | null): void;\n\t/**\n\t * Open the host's global full-screen image previewer for the given image.\n\t * Only the image reference (id/url) crosses over — bytes stay out-of-band.\n\t *\n\t * Pass `group` (e.g. all images of the message) to open as an image group:\n\t * the previewer shows a thumbnail strip + arrows and starts at `ref`.\n\t */\n\tpreviewImage(ref: PluginImageRef, group?: PluginImageRef[]): void;\n\t/**\n\t * Open the host's global file previewer for any file — the general form of\n\t * {@link PluginUiApi.previewImage}, which only takes image URLs. Accepts a\n\t * local absolute `path` (the shape the host's own file tree uses) as well as\n\t * a `url`; the previewer dispatches by the file's extension, so a file type\n\t * some plugin registered via `registerFilePreview` lands in that renderer.\n\t *\n\t * Pass `group` (e.g. all outputs of one run) to open as a group: images get\n\t * the thumbnail strip + arrows, and the previewer starts at `file`.\n\t *\n\t * Permissions: `fs.read` as soon as any entry carries a `path` (it hands a\n\t * local file to the host to read); `ui.slot.message` for url-only calls,\n\t * same gate as `previewImage`.\n\t */\n\tpreviewFile(file: PluginPreviewFileRef, group?: PluginPreviewFileRef[]): void;\n\t/**\n\t * Capture a rectangle in the current Vetta window and open the host save\n\t * dialog. Coordinates use renderer DIP values such as getBoundingClientRect().\n\t * Requires `ui.slot.activity-tab`.\n\t */\n\tcaptureRegion(rect: PluginCaptureRegion, defaultFileName: string): Promise<string | null>;\n\t/**\n\t * Copy an image to the system clipboard. Takes a `data:image/...;base64,`\n\t * URL and goes through the native clipboard, so it does not depend on the\n\t * renderer's `ClipboardItem` support. No permission required — the plugin\n\t * can only write what it already rendered.\n\t */\n\tcopyImage(dataUrl: string): Promise<void>;\n\t/**\n\t * Hand a URL to the OS default browser (Electron `shell.openExternal`) —\n\t * NOT the in-app browser panel. Only `http:`/`https:` are accepted; the host\n\t * rejects every other protocol, so this cannot be used to launch arbitrary\n\t * schemes. Needs `shell.openExternal`.\n\t */\n\topenExternal(url: string): Promise<void>;\n\t/**\n\t * Show a global toast in the host UI (bottom-right). No permission required.\n\t * Prefer this over swallowing errors into opaque UI copy: pass `error` so\n\t * the host attaches a one-click \"copy stack\" action for the user.\n\t *\n\t * Capture `ctx.ui.notify` in `activate` if React components need it\n\t * (components do not receive `ctx`).\n\t */\n\tnotify(options: PluginNotifyOptions): void;\n\t/**\n\t * 读当前侧边栏形态。无需权限——这是纯布局信息,不含任何用户数据。\n\t *\n\t * React 组件请改用 `useSidebarState()`:它会在状态变化时重渲染,不必自己订阅。\n\t * 这一对只为拿不到 hook 的地方准备(`activate()` 内、工具处理器、命令式绘制的画布)。\n\t */\n\tgetSidebarState(): PluginSidebarState;\n\t/**\n\t * 订阅侧边栏形态变化——用户收起/展开侧边栏、或窗口跨过窄屏阈值时触发。\n\t * 返回 Disposable 取消订阅;请在插件失活时释放。\n\t *\n\t * 回调按值去重:拖窗口不会把它打成回调风暴,只有三元组真的变了才通知。\n\t */\n\tonSidebarStateChanged(listener: (state: PluginSidebarState) => void): Disposable;\n}\n"]}