@vetta-org/plugin-sdk 0.0.2 → 0.0.4
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.
- package/dist/activity-tab.d.ts +18 -0
- package/dist/activity-tab.d.ts.map +1 -0
- package/dist/activity-tab.js +12 -0
- package/dist/activity-tab.js.map +1 -0
- package/dist/agent.d.ts +206 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +2 -0
- package/dist/agent.js.map +1 -0
- package/dist/app-actions.d.ts +63 -0
- package/dist/app-actions.d.ts.map +1 -0
- package/dist/app-actions.js +12 -0
- package/dist/app-actions.js.map +1 -0
- package/dist/command.d.ts +25 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +2 -0
- package/dist/command.js.map +1 -0
- package/dist/context.d.ts +45 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +4 -0
- package/dist/context.js.map +1 -0
- package/dist/conversation.d.ts +50 -0
- package/dist/conversation.d.ts.map +1 -0
- package/dist/conversation.js +2 -0
- package/dist/conversation.js.map +1 -0
- package/dist/disposable.d.ts +4 -0
- package/dist/disposable.d.ts.map +1 -0
- package/dist/disposable.js +2 -0
- package/dist/disposable.js.map +1 -0
- package/dist/fs.d.ts +34 -0
- package/dist/fs.d.ts.map +1 -0
- package/dist/fs.js +2 -0
- package/dist/fs.js.map +1 -0
- package/dist/hooks.d.ts +39 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +41 -0
- package/dist/hooks.js.map +1 -0
- package/dist/host-bridge.d.ts +14 -0
- package/dist/host-bridge.d.ts.map +1 -0
- package/dist/host-bridge.js +12 -0
- package/dist/host-bridge.js.map +1 -0
- package/dist/i18n.d.ts +35 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +29 -0
- package/dist/i18n.js.map +1 -0
- package/dist/images.d.ts +58 -0
- package/dist/images.d.ts.map +1 -0
- package/dist/images.js +2 -0
- package/dist/images.js.map +1 -0
- package/dist/index.d.ts +29 -885
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -88
- package/dist/index.js.map +1 -1
- package/dist/manifest.d.ts +57 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +2 -0
- package/dist/manifest.js.map +1 -0
- package/dist/official.d.ts +520 -0
- package/dist/official.d.ts.map +1 -0
- package/dist/official.js +2 -0
- package/dist/official.js.map +1 -0
- package/dist/permissions.d.ts +2 -0
- package/dist/permissions.d.ts.map +1 -0
- package/dist/permissions.js +2 -0
- package/dist/permissions.js.map +1 -0
- package/dist/scenario.d.ts +9 -0
- package/dist/scenario.d.ts.map +1 -0
- package/dist/scenario.js +2 -0
- package/dist/scenario.js.map +1 -0
- package/dist/settings.d.ts +13 -0
- package/dist/settings.d.ts.map +1 -0
- package/dist/settings.js +2 -0
- package/dist/settings.js.map +1 -0
- package/dist/ui.d.ts +338 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +2 -0
- package/dist/ui.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 对话场景 slug——决定一个工具 / 会话页插槽在哪些类型的会话里激活或可见。
|
|
3
|
+
*
|
|
4
|
+
* 本类型在 plugin-sdk 内本地定义(SDK 零依赖,不引入宿主包),与宿主
|
|
5
|
+
* `@vetta/coding-agent` 的 `ConversationScenario` 保持一一对应;任一侧增删场景时两边须同步,
|
|
6
|
+
* 否则宿主回传的 scenario 与此 union 不一致会触发编译错误(即为期望的漂移护栏)。
|
|
7
|
+
*/
|
|
8
|
+
export type ConversationScenario = "im-claw" | "conversation" | "project" | "batch" | "automation" | "kb-processing" | "cli";
|
|
9
|
+
//# sourceMappingURL=scenario.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario.d.ts","sourceRoot":"","sources":["../src/scenario.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,GAC7B,SAAS,GACT,cAAc,GACd,SAAS,GACT,OAAO,GACP,YAAY,GACZ,eAAe,GACf,KAAK,CAAC","sourcesContent":["/**\n * 对话场景 slug——决定一个工具 / 会话页插槽在哪些类型的会话里激活或可见。\n *\n * 本类型在 plugin-sdk 内本地定义(SDK 零依赖,不引入宿主包),与宿主\n * `@vetta/coding-agent` 的 `ConversationScenario` 保持一一对应;任一侧增删场景时两边须同步,\n * 否则宿主回传的 scenario 与此 union 不一致会触发编译错误(即为期望的漂移护栏)。\n */\nexport type ConversationScenario =\n\t| \"im-claw\" // Claw IM 对话\n\t| \"conversation\" // 普通对话\n\t| \"project\" // 普通项目中对话\n\t| \"batch\" // 批量任务对话\n\t| \"automation\" // 自动化任务对话\n\t| \"kb-processing\" // 知识库加工对话\n\t| \"cli\"; // 裸 CLI / SDK 消费者\n"]}
|
package/dist/scenario.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scenario.js","sourceRoot":"","sources":["../src/scenario.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * 对话场景 slug——决定一个工具 / 会话页插槽在哪些类型的会话里激活或可见。\n *\n * 本类型在 plugin-sdk 内本地定义(SDK 零依赖,不引入宿主包),与宿主\n * `@vetta/coding-agent` 的 `ConversationScenario` 保持一一对应;任一侧增删场景时两边须同步,\n * 否则宿主回传的 scenario 与此 union 不一致会触发编译错误(即为期望的漂移护栏)。\n */\nexport type ConversationScenario =\n\t| \"im-claw\" // Claw IM 对话\n\t| \"conversation\" // 普通对话\n\t| \"project\" // 普通项目中对话\n\t| \"batch\" // 批量任务对话\n\t| \"automation\" // 自动化任务对话\n\t| \"kb-processing\" // 知识库加工对话\n\t| \"cli\"; // 裸 CLI / SDK 消费者\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Disposable } from "./disposable.js";
|
|
2
|
+
/**
|
|
3
|
+
* Read-side access to this plugin's settings (the values configured against
|
|
4
|
+
* the `contributes.settings` schema declared in plugin.json, namespaced by
|
|
5
|
+
* plugin id). Writes go through the host's settings UI, not the plugin.
|
|
6
|
+
*/
|
|
7
|
+
export interface PluginSettingsApi {
|
|
8
|
+
get<T = unknown>(key: string): T | undefined;
|
|
9
|
+
getAll(): Record<string, unknown>;
|
|
10
|
+
/** Fired when any of this plugin's setting values change. */
|
|
11
|
+
onChange(listener: (values: Record<string, unknown>) => void): Disposable;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IACjC,GAAG,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;IAC7C,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,GAAG,UAAU,CAAC;CAC1E","sourcesContent":["import type { Disposable } from \"./disposable.js\";\n\n/**\n * Read-side access to this plugin's settings (the values configured against\n * the `contributes.settings` schema declared in plugin.json, namespaced by\n * plugin id). Writes go through the host's settings UI, not the plugin.\n */\nexport interface PluginSettingsApi {\n\tget<T = unknown>(key: string): T | undefined;\n\tgetAll(): Record<string, unknown>;\n\t/** Fired when any of this plugin's setting values change. */\n\tonChange(listener: (values: Record<string, unknown>) => void): Disposable;\n}\n"]}
|
package/dist/settings.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"","sourcesContent":["import type { Disposable } from \"./disposable.js\";\n\n/**\n * Read-side access to this plugin's settings (the values configured against\n * the `contributes.settings` schema declared in plugin.json, namespaced by\n * plugin id). Writes go through the host's settings UI, not the plugin.\n */\nexport interface PluginSettingsApi {\n\tget<T = unknown>(key: string): T | undefined;\n\tgetAll(): Record<string, unknown>;\n\t/** Fired when any of this plugin's setting values change. */\n\tonChange(listener: (values: Record<string, unknown>) => void): Disposable;\n}\n"]}
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from "react";
|
|
2
|
+
import type { ConversationMessage } from "./conversation.js";
|
|
3
|
+
import type { Disposable } from "./disposable.js";
|
|
4
|
+
import type { PluginImageRef } from "./images.js";
|
|
5
|
+
import type { ConversationScenario } from "./scenario.js";
|
|
6
|
+
export interface PluginGlobalSlotContribution {
|
|
7
|
+
id: string;
|
|
8
|
+
component: ComponentType;
|
|
9
|
+
}
|
|
10
|
+
export interface PluginAudioMetadata {
|
|
11
|
+
/** Embedded title; preview renderers should fall back to file.name. */
|
|
12
|
+
title?: string;
|
|
13
|
+
artist?: string;
|
|
14
|
+
/** Embedded cover art as a Data URL when available. */
|
|
15
|
+
coverDataUrl?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PluginPreviewUrlOptions {
|
|
18
|
+
/** Optional media hint for ambiguous containers such as webm. */
|
|
19
|
+
mediaKind?: "audio" | "video";
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The file handed to a file-preview plugin component. The host does NOT
|
|
23
|
+
* pre-read or guess encoding — the plugin decides whether to read text or
|
|
24
|
+
* bytes. `path` is also exposed for plugins that prefer native fetch.
|
|
25
|
+
*/
|
|
26
|
+
export interface PluginPreviewFile {
|
|
27
|
+
path: string | null;
|
|
28
|
+
name: string;
|
|
29
|
+
extension: string;
|
|
30
|
+
mime: string;
|
|
31
|
+
size: number;
|
|
32
|
+
/** Read the file as a UTF-8 string. */
|
|
33
|
+
readText(): Promise<string>;
|
|
34
|
+
/** Read the raw file bytes. */
|
|
35
|
+
readBytes(): Promise<ArrayBuffer>;
|
|
36
|
+
/** A fetchable streaming URL for the file (Range-capable). */
|
|
37
|
+
getUrl(options?: PluginPreviewUrlOptions): string;
|
|
38
|
+
/**
|
|
39
|
+
* Subscribe to on-disk changes of this file. The listener fires (debounced
|
|
40
|
+
* by the host) whenever the file's contents change, letting previews update
|
|
41
|
+
* live. Returns a Disposable; call dispose() to stop watching. A no-op for
|
|
42
|
+
* files without a real path (url-only sources).
|
|
43
|
+
*/
|
|
44
|
+
watch(listener: () => void): Disposable;
|
|
45
|
+
/**
|
|
46
|
+
* Host-provided audio metadata for local media files. Returns null when the
|
|
47
|
+
* host cannot provide metadata, e.g. url-only sources or unsupported files.
|
|
48
|
+
*/
|
|
49
|
+
getAudioMetadata?(): Promise<PluginAudioMetadata | null>;
|
|
50
|
+
}
|
|
51
|
+
export interface PluginFilePreviewProps {
|
|
52
|
+
file: PluginPreviewFile;
|
|
53
|
+
}
|
|
54
|
+
export interface PluginFilePreviewContribution {
|
|
55
|
+
/** Lower-case extensions without the dot, e.g. ["svg"]. */
|
|
56
|
+
extensions: string[];
|
|
57
|
+
component: ComponentType<PluginFilePreviewProps>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* An activity-panel tab contributed by a plugin. Registering only adds the
|
|
61
|
+
* tab to the "addable pool" — it renders only after the user attaches it in
|
|
62
|
+
* the activity panel (scoped by session cwd).
|
|
63
|
+
*/
|
|
64
|
+
export interface PluginActivityTabContribution {
|
|
65
|
+
id: string;
|
|
66
|
+
label: string;
|
|
67
|
+
/** Tab icon as a React node (not an iconify class string). */
|
|
68
|
+
icon?: ReactNode;
|
|
69
|
+
component: ComponentType;
|
|
70
|
+
/**
|
|
71
|
+
* 允许该标签卡出现的对话场景 slug 列表(镜像工具的 scope_use)。**fail-closed**:
|
|
72
|
+
* 未声明/空数组 = 任何会话都不显示;声明后仅在列出的场景里出现(如
|
|
73
|
+
* `["project", "conversation"]`)。会话页插槽据此随对话类型显隐。
|
|
74
|
+
*/
|
|
75
|
+
scope_use?: readonly ConversationScenario[];
|
|
76
|
+
}
|
|
77
|
+
/** Options for {@link PluginUiApi.openActivityTab}. */
|
|
78
|
+
export interface PluginOpenActivityTabOptions {
|
|
79
|
+
/**
|
|
80
|
+
* Desired panel width as it opens: a pixel number, or `"max"` for the widest
|
|
81
|
+
* the current window allows. The host clamps to its min/max bounds. Omit to
|
|
82
|
+
* keep the user's current width.
|
|
83
|
+
*/
|
|
84
|
+
width?: number | "max";
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Decoration a plugin contributes to the next outgoing prompt while its input
|
|
88
|
+
* action is active. `metadata` is shallow-merged into the prompt request's
|
|
89
|
+
* `metadata` bag, which the agent turn can read (e.g. `{ imageMode: true }`).
|
|
90
|
+
*/
|
|
91
|
+
export interface PluginPromptDecoration {
|
|
92
|
+
metadata?: Record<string, unknown>;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* An action button shown in a row beneath the AI input bar. Rendered as a
|
|
96
|
+
* toggle: clicking activates, clicking again deactivates. While active, the
|
|
97
|
+
* host calls `decoratePrompt()` before each send and merges the returned
|
|
98
|
+
* metadata into the outgoing prompt request. The plugin owns any side state
|
|
99
|
+
* (it is the same Module Federation instance as its other slots).
|
|
100
|
+
*/
|
|
101
|
+
export interface PluginInputActionContribution {
|
|
102
|
+
id: string;
|
|
103
|
+
label: string;
|
|
104
|
+
/** Button icon as a React node (not an iconify class string). */
|
|
105
|
+
icon?: ReactNode;
|
|
106
|
+
/** Whether the action begins in the active state. Defaults to false. */
|
|
107
|
+
defaultActive?: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* 该输入动作所依赖的 agent 工具名。设置后,仅当该工具在当前会话处于激活(按工具的
|
|
110
|
+
* scope_use 解析)时才显示这个 badge——避免在工具被场景屏蔽(如批量任务)时仍显示一个
|
|
111
|
+
* 点了也无效的开关。不设则始终显示。例如「图像生成」设为 "generate_image"。
|
|
112
|
+
*/
|
|
113
|
+
requiresActiveTool?: string;
|
|
114
|
+
/**
|
|
115
|
+
* 允许该 toggle 出现的对话场景 slug 列表(镜像工具的 scope_use)。**fail-closed**:
|
|
116
|
+
* 未声明/空数组 = 任何会话都不显示;声明后仅在列出的场景里出现。与 `requiresActiveTool`
|
|
117
|
+
* 取「与」:两者都满足才显示。
|
|
118
|
+
*/
|
|
119
|
+
scope_use?: readonly ConversationScenario[];
|
|
120
|
+
/**
|
|
121
|
+
* When true, this plugin's agent contributions (tools / skills / MCP /
|
|
122
|
+
* systemPrompt) and Activity Tabs are hard-isolated: inactive until this
|
|
123
|
+
* toggle is on (ADR-0041, knowledgeMode-style). Default false.
|
|
124
|
+
*/
|
|
125
|
+
hardIsolation?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Fired when the user toggles the action; `active` is the new state. Return
|
|
128
|
+
* `false` when `active` is true to VETO the activation (e.g. the plugin needs
|
|
129
|
+
* configuration first) — the toggle stays off. Deactivation can't be vetoed.
|
|
130
|
+
*/
|
|
131
|
+
onToggle?(active: boolean): boolean | void;
|
|
132
|
+
/**
|
|
133
|
+
* Called by the host before sending while the action is active. The
|
|
134
|
+
* returned metadata is merged into the outgoing prompt request.
|
|
135
|
+
*/
|
|
136
|
+
decoratePrompt?(): PluginPromptDecoration | void;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* A declarative, serializable descriptor for one card rendered beneath a
|
|
140
|
+
* message. `type` selects a registered card renderer; `key` drives cross-turn
|
|
141
|
+
* dedup (same key across turns = one logical card, shown only under its latest
|
|
142
|
+
* anchor); `payload` carries STABLE REFERENCES (e.g. image ids), not a content
|
|
143
|
+
* snapshot — the renderer resolves live state from it. `title`/`icon` label the
|
|
144
|
+
* card's tab (override the renderer's registration defaults). Rides a tool
|
|
145
|
+
* result's out-of-band `details.cards`; crosses the agent→host boundary, so
|
|
146
|
+
* `icon` is an icon-symbol string, not a node.
|
|
147
|
+
*/
|
|
148
|
+
export interface CardDescriptor {
|
|
149
|
+
type: string;
|
|
150
|
+
key?: string;
|
|
151
|
+
payload?: unknown;
|
|
152
|
+
title?: string;
|
|
153
|
+
icon?: string;
|
|
154
|
+
}
|
|
155
|
+
/** A pending (in-flight) tool call handed to a renderer's `pendingFor`. */
|
|
156
|
+
export interface PluginPendingToolCall {
|
|
157
|
+
toolName: string;
|
|
158
|
+
args: Record<string, unknown>;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Props for a card renderer. `descriptor` is the card's data; `pending` is true
|
|
162
|
+
* while it was synthesized from an in-flight tool (render a skeleton); `message`
|
|
163
|
+
* is the anchoring conversation message.
|
|
164
|
+
*/
|
|
165
|
+
export interface PluginCardProps {
|
|
166
|
+
descriptor: CardDescriptor;
|
|
167
|
+
pending: boolean;
|
|
168
|
+
message: ConversationMessage;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* A card renderer registered by a plugin, keyed by `type`. A descriptor whose
|
|
172
|
+
* `type` matches is rendered by `component`. `title`/`icon` are the default tab
|
|
173
|
+
* label/icon (a descriptor may override `title`). `pendingFor`, given an
|
|
174
|
+
* in-flight tool call, returns a provisional descriptor so a skeleton card
|
|
175
|
+
* appears (and claims a tab) before the tool's result lands — or null when this
|
|
176
|
+
* renderer doesn't handle that tool. The `type` must be globally unique across
|
|
177
|
+
* plugins (convention: prefix with the plugin id, e.g. "image-gen:preview").
|
|
178
|
+
*/
|
|
179
|
+
export interface PluginCardRendererContribution {
|
|
180
|
+
type: string;
|
|
181
|
+
component: ComponentType<PluginCardProps>;
|
|
182
|
+
title?: string;
|
|
183
|
+
/** Default tab icon as a React node (not an iconify class string). */
|
|
184
|
+
icon?: ReactNode;
|
|
185
|
+
pendingFor?: (toolCall: PluginPendingToolCall) => CardDescriptor | null;
|
|
186
|
+
}
|
|
187
|
+
/** A tool call handed to a tool-call slot renderer. */
|
|
188
|
+
export interface PluginToolCallSlotToolCall {
|
|
189
|
+
toolCallId: string;
|
|
190
|
+
toolName: string;
|
|
191
|
+
args: Record<string, unknown>;
|
|
192
|
+
status: "pending" | "success" | "error";
|
|
193
|
+
result?: string;
|
|
194
|
+
isError?: boolean;
|
|
195
|
+
}
|
|
196
|
+
export interface PluginToolCallSlotProps {
|
|
197
|
+
toolCall: PluginToolCallSlotToolCall;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* A component that **replaces the host's default inline transcript rendering**
|
|
201
|
+
* for a specific tool (matched by `toolName`; first registered renderer wins).
|
|
202
|
+
* This is how a plugin renders rich UI for its OWN agent tool's output — plugin
|
|
203
|
+
* tools cannot emit `details.cards`, so the message card system (registerCardRenderer)
|
|
204
|
+
* does not serve them; the tool-call slot does.
|
|
205
|
+
*/
|
|
206
|
+
export interface PluginToolCallSlotContribution {
|
|
207
|
+
id: string;
|
|
208
|
+
toolName: string;
|
|
209
|
+
component: ComponentType<PluginToolCallSlotProps>;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* A card rendered at the bottom of the message list for the LATEST turn — NOT
|
|
213
|
+
* bound to a tool call. The host mounts `component` in the footer slot and
|
|
214
|
+
* re-mounts it each session/turn; the plugin owns visibility entirely (it reads
|
|
215
|
+
* live state via SDK hooks — `useActiveConversation`, `useConversationMessages`,
|
|
216
|
+
* `ctx.conversation.on("turn-end")` — and returns `null` to render nothing,
|
|
217
|
+
* e.g. git renders only inside a repo that has changes). `scope_use` gates which
|
|
218
|
+
* conversation scenarios it may appear in (**fail-closed**, mirrors the other
|
|
219
|
+
* slots). `id` must be unique within the plugin.
|
|
220
|
+
*/
|
|
221
|
+
export interface PluginTurnCardContribution {
|
|
222
|
+
id: string;
|
|
223
|
+
component: ComponentType;
|
|
224
|
+
/**
|
|
225
|
+
* 允许该 turn 卡出现的对话场景 slug 列表(镜像其它插槽的 scope_use)。**fail-closed**:
|
|
226
|
+
* 未声明/空数组 = 任何会话都不显示;声明后仅在列出的场景里出现(如 `["project"]`)。
|
|
227
|
+
*/
|
|
228
|
+
scope_use?: readonly ConversationScenario[];
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Options for {@link PluginUiApi.notify}. Surfaces a host toast so users can
|
|
232
|
+
* see plugin failures without opening DevTools.
|
|
233
|
+
*/
|
|
234
|
+
export interface PluginNotifyOptions {
|
|
235
|
+
/** Toast body. Required even when `error` is set (user-facing summary). */
|
|
236
|
+
message: string;
|
|
237
|
+
/** Defaults to plugin display name when omitted. */
|
|
238
|
+
title?: string;
|
|
239
|
+
/** Defaults to `"info"`; when `error` is set and variant omitted, host uses `"error"`. */
|
|
240
|
+
variant?: "info" | "success" | "warning" | "error";
|
|
241
|
+
/**
|
|
242
|
+
* Optional failure cause. Host formats message + stack and adds a
|
|
243
|
+
* "复制堆栈" action so the user can paste it into bug reports / chat.
|
|
244
|
+
*/
|
|
245
|
+
error?: unknown;
|
|
246
|
+
/**
|
|
247
|
+
* Auto-dismiss delay in ms. `0` keeps the toast until dismissed.
|
|
248
|
+
* Defaults: sticky (`0`) when `error` is present, otherwise host default (~4s).
|
|
249
|
+
*/
|
|
250
|
+
durationMs?: number;
|
|
251
|
+
}
|
|
252
|
+
export interface PluginUiApi {
|
|
253
|
+
registerGlobalSlot(contribution: PluginGlobalSlotContribution): Disposable;
|
|
254
|
+
/**
|
|
255
|
+
* Register a preview component keyed by file extension. The host dispatches
|
|
256
|
+
* registered extensions before its built-in fallback renderers; first
|
|
257
|
+
* registrant wins on conflict.
|
|
258
|
+
*/
|
|
259
|
+
registerFilePreview(contribution: PluginFilePreviewContribution): Disposable;
|
|
260
|
+
/**
|
|
261
|
+
* Register an activity-panel tab into the addable pool. The user attaches
|
|
262
|
+
* it manually via the panel's "+" picker; attach records are keyed by the
|
|
263
|
+
* session cwd.
|
|
264
|
+
*/
|
|
265
|
+
registerActivityTab(contribution: PluginActivityTabContribution): Disposable;
|
|
266
|
+
/**
|
|
267
|
+
* Register a toggle action shown beneath the AI input bar. While active,
|
|
268
|
+
* its `decoratePrompt()` annotates the next outgoing prompt.
|
|
269
|
+
*/
|
|
270
|
+
registerInputAction(contribution: PluginInputActionContribution): Disposable;
|
|
271
|
+
/**
|
|
272
|
+
* Register a card renderer keyed by `type`. Cards rendered beneath a message
|
|
273
|
+
* come from tool results' out-of-band `details.cards` (or `pendingFor` for
|
|
274
|
+
* in-flight tools); the host resolves each card's `type` to a registered
|
|
275
|
+
* renderer. Multiple cards under one message are shown as a tab-switcher
|
|
276
|
+
* ("收纳") or a flat list.
|
|
277
|
+
*/
|
|
278
|
+
registerCardRenderer(contribution: PluginCardRendererContribution): Disposable;
|
|
279
|
+
/**
|
|
280
|
+
* Register a renderer that replaces the host's default inline transcript UI
|
|
281
|
+
* for a tool call (matched by `toolName`). The complement to card renderers:
|
|
282
|
+
* use it to render UI for a plugin's own agent tool output.
|
|
283
|
+
*/
|
|
284
|
+
registerToolCallSlot(contribution: PluginToolCallSlotContribution): Disposable;
|
|
285
|
+
/**
|
|
286
|
+
* Register a card rendered at the bottom of the message list for the latest
|
|
287
|
+
* turn — NOT bound to a tool call. The host mounts the component in the
|
|
288
|
+
* footer slot; the plugin owns visibility (return `null` to render nothing,
|
|
289
|
+
* e.g. git renders only in a repo with changes). Gated by `scope_use`
|
|
290
|
+
* (fail-closed). Needs the `ui.slot.turn-card` permission.
|
|
291
|
+
*/
|
|
292
|
+
registerTurnCard(contribution: PluginTurnCardContribution): Disposable;
|
|
293
|
+
/**
|
|
294
|
+
* Programmatically attach (if needed) and activate one of this plugin's
|
|
295
|
+
* own activity tabs in the current conversation's activity panel. `tabId`
|
|
296
|
+
* is the contribution id passed to registerActivityTab. Any payload (e.g.
|
|
297
|
+
* which image to edit) is passed via the plugin's own in-memory state.
|
|
298
|
+
*
|
|
299
|
+
* Pass `options.width` to size the panel as it opens — a pixel number, or
|
|
300
|
+
* `"max"` to expand it to the widest the current window allows (the host
|
|
301
|
+
* still clamps to its min/max and auto-hides the sidebar when needed). Omit
|
|
302
|
+
* to leave the user's current width untouched.
|
|
303
|
+
*/
|
|
304
|
+
openActivityTab(tabId: string, options?: PluginOpenActivityTabOptions): void;
|
|
305
|
+
/**
|
|
306
|
+
* Bind (or clear, with `null`) an image as the "edit target" for the next
|
|
307
|
+
* outgoing prompt. The host renders it as a thumbnail capsule in the AI input
|
|
308
|
+
* bar's top capsule strip and, at send time, injects `metadata.editImageId`
|
|
309
|
+
* (the ref's id) so this turn edits that image. One-shot: cleared after the
|
|
310
|
+
* prompt is sent (or when the user closes the capsule). Only the image
|
|
311
|
+
* reference (id/url) crosses over — bytes stay out-of-band.
|
|
312
|
+
*/
|
|
313
|
+
setEditImageAttachment(ref: PluginImageRef | null): void;
|
|
314
|
+
/**
|
|
315
|
+
* Open the host's global full-screen image previewer for the given image.
|
|
316
|
+
* Only the image reference (id/url) crosses over — bytes stay out-of-band.
|
|
317
|
+
*
|
|
318
|
+
* Pass `group` (e.g. all images of the message) to open as an image group:
|
|
319
|
+
* the previewer shows a thumbnail strip + arrows and starts at `ref`.
|
|
320
|
+
*/
|
|
321
|
+
previewImage(ref: PluginImageRef, group?: PluginImageRef[]): void;
|
|
322
|
+
/**
|
|
323
|
+
* Open the app settings, scrolled to and highlighting THIS plugin's own
|
|
324
|
+
* settings section (e.g. so the user can fill in a required API key/model).
|
|
325
|
+
* The host owns the navigation; the plugin only asks to jump there.
|
|
326
|
+
*/
|
|
327
|
+
openPluginSettings(): void;
|
|
328
|
+
/**
|
|
329
|
+
* Show a global toast in the host UI (bottom-right). No permission required.
|
|
330
|
+
* Prefer this over swallowing errors into opaque UI copy: pass `error` so
|
|
331
|
+
* the host attaches a one-click "copy stack" action for the user.
|
|
332
|
+
*
|
|
333
|
+
* Capture `ctx.ui.notify` in `activate` if React components need it
|
|
334
|
+
* (components do not receive `ctx`).
|
|
335
|
+
*/
|
|
336
|
+
notify(options: PluginNotifyOptions): void;
|
|
337
|
+
}
|
|
338
|
+
//# sourceMappingURL=ui.d.ts.map
|
package/dist/ui.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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AAG,IAAI,CAAC;IAC7E;;;;;;;OAOG;IACH,sBAAsB,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;IACzD;;;;;;OAMG;IACH,YAAY,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IAClE;;;;OAIG;IACH,kBAAkB,IAAI,IAAI,CAAC;IAC3B;;;;;;;OAOG;IACH,MAAM,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAC3C","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 { ConversationScenario } from \"./scenario.js\";\n\nexport interface PluginGlobalSlotContribution {\n\tid: string;\n\tcomponent: ComponentType;\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\nexport interface PluginFilePreviewContribution {\n\t/** Lower-case extensions without the dot, e.g. [\"svg\"]. */\n\textensions: string[];\n\tcomponent: ComponentType<PluginFilePreviewProps>;\n}\n\n/**\n * An activity-panel tab contributed by a plugin. Registering only adds the\n * tab to the \"addable pool\" — it renders only after the user attaches it in\n * the activity panel (scoped by session cwd).\n */\nexport interface PluginActivityTabContribution {\n\tid: string;\n\tlabel: string;\n\t/** Tab icon as a React node (not an iconify class string). */\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}\n\n/** Options for {@link PluginUiApi.openActivityTab}. */\nexport interface PluginOpenActivityTabOptions {\n\t/**\n\t * Desired panel width as it opens: a pixel number, or `\"max\"` for the widest\n\t * the current window allows. The host clamps to its min/max bounds. Omit to\n\t * keep the user's current width.\n\t */\n\twidth?: number | \"max\";\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's\n * `metadata` bag, which the agent turn can read (e.g. `{ imageMode: true }`).\n */\nexport interface PluginPromptDecoration {\n\tmetadata?: Record<string, unknown>;\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 (not an iconify class string). */\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 `title`). `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 (not an iconify class string). */\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\";\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\nexport interface PluginUiApi {\n\tregisterGlobalSlot(contribution: PluginGlobalSlotContribution): Disposable;\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 * session cwd.\n\t */\n\tregisterActivityTab(contribution: PluginActivityTabContribution): 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 * Programmatically attach (if needed) and activate one of this plugin's\n\t * own activity tabs in the current 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\topenActivityTab(tabId: string, options?: PluginOpenActivityTabOptions): void;\n\t/**\n\t * Bind (or clear, with `null`) an image as the \"edit target\" for the next\n\t * outgoing prompt. The host renders it as a thumbnail capsule in the AI input\n\t * bar's top capsule strip and, at send time, injects `metadata.editImageId`\n\t * (the ref's id) so this turn edits that image. One-shot: cleared after the\n\t * prompt is sent (or when the user closes the capsule). Only the image\n\t * reference (id/url) crosses over — bytes stay out-of-band.\n\t */\n\tsetEditImageAttachment(ref: PluginImageRef | 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 app settings, scrolled to and highlighting THIS plugin's own\n\t * settings section (e.g. so the user can fill in a required API key/model).\n\t * The host owns the navigation; the plugin only asks to jump there.\n\t */\n\topenPluginSettings(): 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}\n"]}
|
package/dist/ui.js
ADDED
package/dist/ui.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"","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 { ConversationScenario } from \"./scenario.js\";\n\nexport interface PluginGlobalSlotContribution {\n\tid: string;\n\tcomponent: ComponentType;\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\nexport interface PluginFilePreviewContribution {\n\t/** Lower-case extensions without the dot, e.g. [\"svg\"]. */\n\textensions: string[];\n\tcomponent: ComponentType<PluginFilePreviewProps>;\n}\n\n/**\n * An activity-panel tab contributed by a plugin. Registering only adds the\n * tab to the \"addable pool\" — it renders only after the user attaches it in\n * the activity panel (scoped by session cwd).\n */\nexport interface PluginActivityTabContribution {\n\tid: string;\n\tlabel: string;\n\t/** Tab icon as a React node (not an iconify class string). */\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}\n\n/** Options for {@link PluginUiApi.openActivityTab}. */\nexport interface PluginOpenActivityTabOptions {\n\t/**\n\t * Desired panel width as it opens: a pixel number, or `\"max\"` for the widest\n\t * the current window allows. The host clamps to its min/max bounds. Omit to\n\t * keep the user's current width.\n\t */\n\twidth?: number | \"max\";\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's\n * `metadata` bag, which the agent turn can read (e.g. `{ imageMode: true }`).\n */\nexport interface PluginPromptDecoration {\n\tmetadata?: Record<string, unknown>;\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 (not an iconify class string). */\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 `title`). `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 (not an iconify class string). */\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\";\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\nexport interface PluginUiApi {\n\tregisterGlobalSlot(contribution: PluginGlobalSlotContribution): Disposable;\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 * session cwd.\n\t */\n\tregisterActivityTab(contribution: PluginActivityTabContribution): 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 * Programmatically attach (if needed) and activate one of this plugin's\n\t * own activity tabs in the current 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\topenActivityTab(tabId: string, options?: PluginOpenActivityTabOptions): void;\n\t/**\n\t * Bind (or clear, with `null`) an image as the \"edit target\" for the next\n\t * outgoing prompt. The host renders it as a thumbnail capsule in the AI input\n\t * bar's top capsule strip and, at send time, injects `metadata.editImageId`\n\t * (the ref's id) so this turn edits that image. One-shot: cleared after the\n\t * prompt is sent (or when the user closes the capsule). Only the image\n\t * reference (id/url) crosses over — bytes stay out-of-band.\n\t */\n\tsetEditImageAttachment(ref: PluginImageRef | 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 app settings, scrolled to and highlighting THIS plugin's own\n\t * settings section (e.g. so the user can fill in a required API key/model).\n\t * The host owns the navigation; the plugin only asks to jump there.\n\t */\n\topenPluginSettings(): 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}\n"]}
|