@vetta-org/plugin-sdk 0.3.18 → 0.3.19
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/capture.d.ts +13 -2
- package/dist/capture.d.ts.map +1 -1
- package/dist/capture.js.map +1 -1
- package/dist/conversation.d.ts +6 -0
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/ui.d.ts +55 -20
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js.map +1 -1
- package/docs/conversation-and-agent.md +3 -1
- package/docs/ui-slots.md +7 -3
- package/package.json +1 -1
package/dist/capture.d.ts
CHANGED
|
@@ -37,12 +37,23 @@ export interface PluginOffscreenCaptureOptions {
|
|
|
37
37
|
format?: "jpeg" | "png";
|
|
38
38
|
/** 仅 jpeg 生效,0–1。 */
|
|
39
39
|
quality?: number;
|
|
40
|
+
/**
|
|
41
|
+
* 期望的设备像素比,用于需要比屏幕更锐的交付图(如放大合成的渲染图)。
|
|
42
|
+
*
|
|
43
|
+
* 宿主把窗口放大、页面缩放同样倍数来实现:页面看到的 CSS 视口与不传时完全一致,
|
|
44
|
+
* 只有位图更密。只升不降(显示器本身已够就按显示器出),上限 4;放大后的窗口边长
|
|
45
|
+
* 超出宿主上限时自动降到放得下的倍率。实际倍率以结果的 `scaleFactor` 为准。
|
|
46
|
+
*
|
|
47
|
+
* 缩放按会话键隔离;不带 `sessionKey` 的一次性请求共用一个分区,倍率不同的并发
|
|
48
|
+
* 一次性请求可能互相影响,需要指定倍率时请带 `sessionKey`。旧宿主忽略此字段。
|
|
49
|
+
*/
|
|
50
|
+
pixelRatio?: number;
|
|
40
51
|
}
|
|
41
52
|
export interface PluginOffscreenCaptureResult {
|
|
42
53
|
dataUrl: string;
|
|
43
54
|
/**
|
|
44
|
-
* 实际生效的设备像素比:位图物理像素 = CSS 尺寸 ×
|
|
45
|
-
*
|
|
55
|
+
* 实际生效的设备像素比:位图物理像素 = CSS 尺寸 × 此值。不传 `pixelRatio` 时跟随
|
|
56
|
+
* 主显示器的缩放(Retina 为 2)。
|
|
46
57
|
*/
|
|
47
58
|
scaleFactor: number;
|
|
48
59
|
/**
|
package/dist/capture.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../src/capture.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,6BAA6B;IAC7C,gGAAsD;IACtD,GAAG,EAAE,MAAM,CAAC;IACZ,sCAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,sCAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qGAA+C;IAC/C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qFAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2FAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACxB,iCAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../src/capture.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,6BAA6B;IAC7C,gGAAsD;IACtD,GAAG,EAAE,MAAM,CAAC;IACZ,sCAAoB;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,sCAAoB;IACpB,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qGAA+C;IAC/C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qFAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2FAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACxB,iCAAqB;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,4BAA4B;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAChC,SAAS,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IACzF,sGAAkD;IAClD,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD","sourcesContent":["export interface PluginOffscreenCaptureOptions {\n\t/** 目标页面地址,仅允许 http(s)(如插件自己 spawn 的本地 dev server)。 */\n\turl: string;\n\t/** 视口宽度(CSS 像素)。 */\n\twidth: number;\n\t/** 视口高度(CSS 像素)。 */\n\theight: number;\n\t/**\n\t * 复用键。同 key 的请求串行执行并复用同一个离屏窗口:url 未变时跳过重新加载,\n\t * SPA 页面可用 `prepareScript` 做客户端路由切换,省掉整页加载。省略则本次\n\t * 请求独占一个窗口、用完即毁。窗口闲置一段时间后由宿主自动回收。\n\t */\n\tsessionKey?: string;\n\t/** 页面加载完成(或复用窗口)后注入执行的脚本,如 postMessage 切路由。 */\n\tprepareScript?: string;\n\t/**\n\t * 就绪表达式。宿主轮询它直到真值才截图,用于等待页面自己的「渲染完成」信号\n\t * (如 `window.__ready === true`)。省略则加载完成即视为就绪。\n\t */\n\treadyExpression?: string;\n\t/** 就绪后的静置时间(毫秒),等图片解码、过渡动画落定。 */\n\tsettleMs?: number;\n\t/**\n\t * 探针表达式。在**截图的同一时刻**(就绪 + 静置之后)对页面求值,结果经\n\t * `JSON.stringify` 回传到 `PluginOffscreenCaptureResult.probe`。\n\t *\n\t * 存在的理由:渲染是这条链上最贵的一步,而位图是它最难用的产物——「这段文字换了\n\t * 行没有」「这两条边对齐没有」在 DOM 里是确定的度量,在图里只能靠看。同一次渲染\n\t * 顺带把度量取回来,比让调用方再渲染一次或让模型看图去猜都更可靠。\n\t *\n\t * 求值失败(抛错、返回不可序列化的值)不影响截图:`probe` 为 `undefined`,\n\t * 位图照常返回。探针是搭车的附加信息,不是截图的前置条件。\n\t */\n\tprobeScript?: string;\n\t/** 整体超时(毫秒,含加载与就绪等待),宿主按自身上限收紧。 */\n\ttimeoutMs?: number;\n\tformat?: \"jpeg\" | \"png\";\n\t/** 仅 jpeg 生效,0–1。 */\n\tquality?: number;\n\t/**\n\t * 期望的设备像素比,用于需要比屏幕更锐的交付图(如放大合成的渲染图)。\n\t *\n\t * 宿主把窗口放大、页面缩放同样倍数来实现:页面看到的 CSS 视口与不传时完全一致,\n\t * 只有位图更密。只升不降(显示器本身已够就按显示器出),上限 4;放大后的窗口边长\n\t * 超出宿主上限时自动降到放得下的倍率。实际倍率以结果的 `scaleFactor` 为准。\n\t *\n\t * 缩放按会话键隔离;不带 `sessionKey` 的一次性请求共用一个分区,倍率不同的并发\n\t * 一次性请求可能互相影响,需要指定倍率时请带 `sessionKey`。旧宿主忽略此字段。\n\t */\n\tpixelRatio?: number;\n}\n\nexport interface PluginOffscreenCaptureResult {\n\tdataUrl: string;\n\t/**\n\t * 实际生效的设备像素比:位图物理像素 = CSS 尺寸 × 此值。不传 `pixelRatio` 时跟随\n\t * 主显示器的缩放(Retina 为 2)。\n\t */\n\tscaleFactor: number;\n\t/**\n\t * `probeScript` 的求值结果,经 JSON 往返。没传探针、求值抛错或结果不可序列化时\n\t * 为 `undefined`——调用方无法从这里区分三者,探针本就不该承担错误报告。\n\t */\n\tprobe?: unknown;\n}\n\n/**\n * 主进程离屏窗口截图。与 DOM 克隆类方案(html-to-image 等)不同,这里走真实的\n * Chromium 渲染管线,产出与页面在屏显示逐像素一致的位图,不存在克隆重排带来的\n * 断行/亚像素偏差。需要 `capture.offscreen` 权限。\n */\nexport interface PluginCaptureApi {\n\toffscreen(options: PluginOffscreenCaptureOptions): Promise<PluginOffscreenCaptureResult>;\n\t/** 释放 sessionKey 对应的离屏窗口;下次同 key 请求会重新加载页面。幂等。 */\n\treleaseOffscreen(sessionKey: string): Promise<void>;\n}\n"]}
|
package/dist/capture.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../src/capture.ts"],"names":[],"mappings":"","sourcesContent":["export interface PluginOffscreenCaptureOptions {\n\t/** 目标页面地址,仅允许 http(s)(如插件自己 spawn 的本地 dev server)。 */\n\turl: string;\n\t/** 视口宽度(CSS 像素)。 */\n\twidth: number;\n\t/** 视口高度(CSS 像素)。 */\n\theight: number;\n\t/**\n\t * 复用键。同 key 的请求串行执行并复用同一个离屏窗口:url 未变时跳过重新加载,\n\t * SPA 页面可用 `prepareScript` 做客户端路由切换,省掉整页加载。省略则本次\n\t * 请求独占一个窗口、用完即毁。窗口闲置一段时间后由宿主自动回收。\n\t */\n\tsessionKey?: string;\n\t/** 页面加载完成(或复用窗口)后注入执行的脚本,如 postMessage 切路由。 */\n\tprepareScript?: string;\n\t/**\n\t * 就绪表达式。宿主轮询它直到真值才截图,用于等待页面自己的「渲染完成」信号\n\t * (如 `window.__ready === true`)。省略则加载完成即视为就绪。\n\t */\n\treadyExpression?: string;\n\t/** 就绪后的静置时间(毫秒),等图片解码、过渡动画落定。 */\n\tsettleMs?: number;\n\t/**\n\t * 探针表达式。在**截图的同一时刻**(就绪 + 静置之后)对页面求值,结果经\n\t * `JSON.stringify` 回传到 `PluginOffscreenCaptureResult.probe`。\n\t *\n\t * 存在的理由:渲染是这条链上最贵的一步,而位图是它最难用的产物——「这段文字换了\n\t * 行没有」「这两条边对齐没有」在 DOM 里是确定的度量,在图里只能靠看。同一次渲染\n\t * 顺带把度量取回来,比让调用方再渲染一次或让模型看图去猜都更可靠。\n\t *\n\t * 求值失败(抛错、返回不可序列化的值)不影响截图:`probe` 为 `undefined`,\n\t * 位图照常返回。探针是搭车的附加信息,不是截图的前置条件。\n\t */\n\tprobeScript?: string;\n\t/** 整体超时(毫秒,含加载与就绪等待),宿主按自身上限收紧。 */\n\ttimeoutMs?: number;\n\tformat?: \"jpeg\" | \"png\";\n\t/** 仅 jpeg 生效,0–1。 */\n\tquality?: number;\n}\n\nexport interface PluginOffscreenCaptureResult {\n\tdataUrl: string;\n\t/**\n\t * 实际生效的设备像素比:位图物理像素 = CSS 尺寸 ×
|
|
1
|
+
{"version":3,"file":"capture.js","sourceRoot":"","sources":["../src/capture.ts"],"names":[],"mappings":"","sourcesContent":["export interface PluginOffscreenCaptureOptions {\n\t/** 目标页面地址,仅允许 http(s)(如插件自己 spawn 的本地 dev server)。 */\n\turl: string;\n\t/** 视口宽度(CSS 像素)。 */\n\twidth: number;\n\t/** 视口高度(CSS 像素)。 */\n\theight: number;\n\t/**\n\t * 复用键。同 key 的请求串行执行并复用同一个离屏窗口:url 未变时跳过重新加载,\n\t * SPA 页面可用 `prepareScript` 做客户端路由切换,省掉整页加载。省略则本次\n\t * 请求独占一个窗口、用完即毁。窗口闲置一段时间后由宿主自动回收。\n\t */\n\tsessionKey?: string;\n\t/** 页面加载完成(或复用窗口)后注入执行的脚本,如 postMessage 切路由。 */\n\tprepareScript?: string;\n\t/**\n\t * 就绪表达式。宿主轮询它直到真值才截图,用于等待页面自己的「渲染完成」信号\n\t * (如 `window.__ready === true`)。省略则加载完成即视为就绪。\n\t */\n\treadyExpression?: string;\n\t/** 就绪后的静置时间(毫秒),等图片解码、过渡动画落定。 */\n\tsettleMs?: number;\n\t/**\n\t * 探针表达式。在**截图的同一时刻**(就绪 + 静置之后)对页面求值,结果经\n\t * `JSON.stringify` 回传到 `PluginOffscreenCaptureResult.probe`。\n\t *\n\t * 存在的理由:渲染是这条链上最贵的一步,而位图是它最难用的产物——「这段文字换了\n\t * 行没有」「这两条边对齐没有」在 DOM 里是确定的度量,在图里只能靠看。同一次渲染\n\t * 顺带把度量取回来,比让调用方再渲染一次或让模型看图去猜都更可靠。\n\t *\n\t * 求值失败(抛错、返回不可序列化的值)不影响截图:`probe` 为 `undefined`,\n\t * 位图照常返回。探针是搭车的附加信息,不是截图的前置条件。\n\t */\n\tprobeScript?: string;\n\t/** 整体超时(毫秒,含加载与就绪等待),宿主按自身上限收紧。 */\n\ttimeoutMs?: number;\n\tformat?: \"jpeg\" | \"png\";\n\t/** 仅 jpeg 生效,0–1。 */\n\tquality?: number;\n\t/**\n\t * 期望的设备像素比,用于需要比屏幕更锐的交付图(如放大合成的渲染图)。\n\t *\n\t * 宿主把窗口放大、页面缩放同样倍数来实现:页面看到的 CSS 视口与不传时完全一致,\n\t * 只有位图更密。只升不降(显示器本身已够就按显示器出),上限 4;放大后的窗口边长\n\t * 超出宿主上限时自动降到放得下的倍率。实际倍率以结果的 `scaleFactor` 为准。\n\t *\n\t * 缩放按会话键隔离;不带 `sessionKey` 的一次性请求共用一个分区,倍率不同的并发\n\t * 一次性请求可能互相影响,需要指定倍率时请带 `sessionKey`。旧宿主忽略此字段。\n\t */\n\tpixelRatio?: number;\n}\n\nexport interface PluginOffscreenCaptureResult {\n\tdataUrl: string;\n\t/**\n\t * 实际生效的设备像素比:位图物理像素 = CSS 尺寸 × 此值。不传 `pixelRatio` 时跟随\n\t * 主显示器的缩放(Retina 为 2)。\n\t */\n\tscaleFactor: number;\n\t/**\n\t * `probeScript` 的求值结果,经 JSON 往返。没传探针、求值抛错或结果不可序列化时\n\t * 为 `undefined`——调用方无法从这里区分三者,探针本就不该承担错误报告。\n\t */\n\tprobe?: unknown;\n}\n\n/**\n * 主进程离屏窗口截图。与 DOM 克隆类方案(html-to-image 等)不同,这里走真实的\n * Chromium 渲染管线,产出与页面在屏显示逐像素一致的位图,不存在克隆重排带来的\n * 断行/亚像素偏差。需要 `capture.offscreen` 权限。\n */\nexport interface PluginCaptureApi {\n\toffscreen(options: PluginOffscreenCaptureOptions): Promise<PluginOffscreenCaptureResult>;\n\t/** 释放 sessionKey 对应的离屏窗口;下次同 key 请求会重新加载页面。幂等。 */\n\treleaseOffscreen(sessionKey: string): Promise<void>;\n}\n"]}
|
package/dist/conversation.d.ts
CHANGED
|
@@ -13,6 +13,12 @@ export interface ConversationMessage {
|
|
|
13
13
|
role: "user" | "assistant" | "compaction";
|
|
14
14
|
text: string;
|
|
15
15
|
timestamp?: number;
|
|
16
|
+
/**
|
|
17
|
+
* 这条助手消息里调用过的工具名(去重,按首次出现顺序)。没有调用工具时省略。
|
|
18
|
+
* 来自对话记录本身,打开历史会话同样有,插件可据此判断「这个会话做过某类事」。
|
|
19
|
+
* Plugin API `^2.14.0`;旧宿主不提供这个字段。
|
|
20
|
+
*/
|
|
21
|
+
toolNames?: string[];
|
|
16
22
|
}
|
|
17
23
|
export type ConversationEvent = {
|
|
18
24
|
type: "turn-start";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../src/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEzE,MAAM,WAAW,iBAAiB;IACjC,wEAAwE;IACxE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,OAAO,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GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACvF,sEAAsE;IACtE,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,oDAAoD;IACpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB;;;;;;OAMG;IACH,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,UAAU,CAAC;IAC7D;;;OAGG;IACH,oBAAoB,IAAI,yBAAyB,CAAC;IAClD;;;OAGG;IACH,mBAAmB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,yBAAyB,KAAK,IAAI,GAAG,UAAU,CAAC;CACzF","sourcesContent":["import type { Disposable } from \"./disposable.js\";\nimport type { GenerationMetricsSnapshot } from \"./generation-metrics.js\";\n\nexport interface ConversationState {\n\t/** Active session runtimeId, or null when no conversation is active. */\n\tid: string | null;\n\tcwd: string | null;\n\tsessionPath: string | null;\n\tmodel: string | null;\n\tisStreaming: boolean;\n}\n\nexport interface ConversationMessage {\n\tid: string;\n\trole: \"user\" | \"assistant\" | \"compaction\";\n\ttext: string;\n\ttimestamp?: number;\n\t/**\n\t * 这条助手消息里调用过的工具名(去重,按首次出现顺序)。没有调用工具时省略。\n\t * 来自对话记录本身,打开历史会话同样有,插件可据此判断「这个会话做过某类事」。\n\t * Plugin API `^2.14.0`;旧宿主不提供这个字段。\n\t */\n\ttoolNames?: string[];\n}\n\nexport type ConversationEvent =\n\t| { type: \"turn-start\" }\n\t| { type: \"turn-end\"; stopReason: string }\n\t| { type: \"message-added\"; message: ConversationMessage }\n\t| { type: \"message-updated\"; delta: string }\n\t/**\n\t * 模型还在生成这次调用,流式参数已解析出新的键。\n\t *\n\t * 用它做「agent 正在动某个目标」这类实时 UI:`edit` / `write` 真正耗时的是\n\t * 生成参数(一整份文件正文),执行只要几毫秒,等 `tool-call-start` 到手时活\n\t * 已经干完了。目标路径通常是参数里的第一个键,所以能提前几秒拿到。\n\t *\n\t * 天然是残缺的:后面的键还没到,正在生成的那个键也不含在内。要权威全量参数\n\t * 请用 `tool-call-start`。同一次调用会随键数增长发多次,不会逐 token 发。\n\t */\n\t| { type: \"tool-call-args\"; toolCallId: string; toolName: string; args: Record<string, unknown> }\n\t| { type: \"tool-call-start\"; toolCallId: string; toolName: string; args?: Record<string, unknown> }\n\t| { type: \"tool-call-end\"; toolCallId: string; toolName: string; isError: boolean }\n\t| { type: \"conversation-changed\"; conversation: ConversationState }\n\t| { type: \"queue-changed\"; queue: ConversationQueueState };\n\n/** 会话输入队列快照(ADR-0060):排队中的 prompt 与暂停状态。 */\nexport interface ConversationQueueState {\n\t/** abort/error 后队列暂停;恢复由用户在宿主 UI 操作。 */\n\tpaused: boolean;\n\titems: Array<{ id: string; displayText: string }>;\n}\n\n/**\n * sendPrompt 的回执(ADR-0060)。streaming 中发送不再静默排队:返回 `queued` 与\n * 队列条目 id,插件可结合 `queue-changed` 事件呈现「已排队/已发出/被移除」状态。\n */\nexport interface SendPromptResult {\n\tstatus: \"sent\" | \"queued\" | \"failed\";\n\terror?: { message: string };\n\tqueueItemId?: string;\n}\n\n/** createSession 的可选项。 */\nexport interface CreateSessionOptions {\n\t/**\n\t * false 时会话照常创建并设为活跃,但宿主停留在当前路由(后台任务用)。\n\t * 默认 true:与用户在新会话页手动发送的观感一致,发出去就进对话页。\n\t */\n\tnavigate?: boolean;\n}\n\nexport interface PluginConversationApi {\n\t/**\n\t * Send a prompt into the active conversation (renders as a user turn).\n\t * Streaming 中会进入会话队列并立即 resolve `{ status: \"queued\" }`;\n\t * 队列在本轮自然停止点接力消费,abort/error 后暂停待用户处置。\n\t *\n\t * 没有活跃会话时抛错。插件若想在这种情况下也把话说出去,先 {@link createSession}。\n\t */\n\tsendPrompt(text: string): Promise<SendPromptResult>;\n\t/**\n\t * Create a conversation in `cwd` and make it active, resolving once it is ready\n\t * to receive prompts — `await createSession(cwd)` 后可以直接 {@link sendPrompt}。\n\t *\n\t * 用于宿主此刻没有活跃会话的场景(例如用户停在新会话页,插件侧却已经产生了要\n\t * 交给 agent 的工作)。已有活跃会话时照样新建一个,不做复用判断——要不要新开由\n\t * 插件按自己的语义决定。\n\t *\n\t * 执行模式跟随宿主当前选择,插件不感知。\n\t */\n\tcreateSession(cwd: string, options?: CreateSessionOptions): Promise<ConversationState>;\n\t/** Fill the input bar without sending; the user can edit and send. */\n\tinsertText(text: string): void;\n\t/** Abort the active conversation's current turn. */\n\tabort(): Promise<void>;\n\t/**\n\t * Subscribe to real-time conversation events. The listener is replayed one\n\t * `conversation-changed` with the current state right after subscribing (in a\n\t * microtask), so logic keyed off the active conversation — e.g. deciding\n\t * whether an activity tab belongs in the tab bar for this cwd — runs without\n\t * waiting for the next session switch.\n\t */\n\ton(listener: (event: ConversationEvent) => void): Disposable;\n\t/**\n\t * 当前活动会话的生成指标快照(首字延迟、tok/s、token 用量),口径见 {@link GenerationMetricsSnapshot}。\n\t * 需要 `agent.session.metrics`(或 `agent.session.read`)。Plugin API `^2.12.0`;旧宿主上为 `undefined`。\n\t */\n\tgetGenerationMetrics(): GenerationMetricsSnapshot;\n\t/**\n\t * 订阅生成指标。生成中宿主限频推送(约每 250ms 一次),阶段切换、调用结束、切换会话时立即推送;\n\t * 订阅后在微任务里回放一次当前快照。权限与版本要求同 {@link getGenerationMetrics}。\n\t */\n\tonGenerationMetrics(listener: (snapshot: GenerationMetricsSnapshot) => void): Disposable;\n}\n"]}
|
package/dist/conversation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../src/conversation.ts"],"names":[],"mappings":"","sourcesContent":["import type { Disposable } from \"./disposable.js\";\nimport type { GenerationMetricsSnapshot } from \"./generation-metrics.js\";\n\nexport interface ConversationState {\n\t/** Active session runtimeId, or null when no conversation is active. */\n\tid: string | null;\n\tcwd: string | null;\n\tsessionPath: string | null;\n\tmodel: string | null;\n\tisStreaming: boolean;\n}\n\nexport interface ConversationMessage {\n\tid: string;\n\trole: \"user\" | \"assistant\" | \"compaction\";\n\ttext: string;\n\ttimestamp?: number;\n}\n\nexport type ConversationEvent =\n\t| { type: \"turn-start\" }\n\t| { type: \"turn-end\"; stopReason: string }\n\t| { type: \"message-added\"; message: ConversationMessage }\n\t| { type: \"message-updated\"; delta: string }\n\t/**\n\t * 模型还在生成这次调用,流式参数已解析出新的键。\n\t *\n\t * 用它做「agent 正在动某个目标」这类实时 UI:`edit` / `write` 真正耗时的是\n\t * 生成参数(一整份文件正文),执行只要几毫秒,等 `tool-call-start` 到手时活\n\t * 已经干完了。目标路径通常是参数里的第一个键,所以能提前几秒拿到。\n\t *\n\t * 天然是残缺的:后面的键还没到,正在生成的那个键也不含在内。要权威全量参数\n\t * 请用 `tool-call-start`。同一次调用会随键数增长发多次,不会逐 token 发。\n\t */\n\t| { type: \"tool-call-args\"; toolCallId: string; toolName: string; args: Record<string, unknown> }\n\t| { type: \"tool-call-start\"; toolCallId: string; toolName: string; args?: Record<string, unknown> }\n\t| { type: \"tool-call-end\"; toolCallId: string; toolName: string; isError: boolean }\n\t| { type: \"conversation-changed\"; conversation: ConversationState }\n\t| { type: \"queue-changed\"; queue: ConversationQueueState };\n\n/** 会话输入队列快照(ADR-0060):排队中的 prompt 与暂停状态。 */\nexport interface ConversationQueueState {\n\t/** abort/error 后队列暂停;恢复由用户在宿主 UI 操作。 */\n\tpaused: boolean;\n\titems: Array<{ id: string; displayText: string }>;\n}\n\n/**\n * sendPrompt 的回执(ADR-0060)。streaming 中发送不再静默排队:返回 `queued` 与\n * 队列条目 id,插件可结合 `queue-changed` 事件呈现「已排队/已发出/被移除」状态。\n */\nexport interface SendPromptResult {\n\tstatus: \"sent\" | \"queued\" | \"failed\";\n\terror?: { message: string };\n\tqueueItemId?: string;\n}\n\n/** createSession 的可选项。 */\nexport interface CreateSessionOptions {\n\t/**\n\t * false 时会话照常创建并设为活跃,但宿主停留在当前路由(后台任务用)。\n\t * 默认 true:与用户在新会话页手动发送的观感一致,发出去就进对话页。\n\t */\n\tnavigate?: boolean;\n}\n\nexport interface PluginConversationApi {\n\t/**\n\t * Send a prompt into the active conversation (renders as a user turn).\n\t * Streaming 中会进入会话队列并立即 resolve `{ status: \"queued\" }`;\n\t * 队列在本轮自然停止点接力消费,abort/error 后暂停待用户处置。\n\t *\n\t * 没有活跃会话时抛错。插件若想在这种情况下也把话说出去,先 {@link createSession}。\n\t */\n\tsendPrompt(text: string): Promise<SendPromptResult>;\n\t/**\n\t * Create a conversation in `cwd` and make it active, resolving once it is ready\n\t * to receive prompts — `await createSession(cwd)` 后可以直接 {@link sendPrompt}。\n\t *\n\t * 用于宿主此刻没有活跃会话的场景(例如用户停在新会话页,插件侧却已经产生了要\n\t * 交给 agent 的工作)。已有活跃会话时照样新建一个,不做复用判断——要不要新开由\n\t * 插件按自己的语义决定。\n\t *\n\t * 执行模式跟随宿主当前选择,插件不感知。\n\t */\n\tcreateSession(cwd: string, options?: CreateSessionOptions): Promise<ConversationState>;\n\t/** Fill the input bar without sending; the user can edit and send. */\n\tinsertText(text: string): void;\n\t/** Abort the active conversation's current turn. */\n\tabort(): Promise<void>;\n\t/**\n\t * Subscribe to real-time conversation events. The listener is replayed one\n\t * `conversation-changed` with the current state right after subscribing (in a\n\t * microtask), so logic keyed off the active conversation — e.g. deciding\n\t * whether an activity tab belongs in the tab bar for this cwd — runs without\n\t * waiting for the next session switch.\n\t */\n\ton(listener: (event: ConversationEvent) => void): Disposable;\n\t/**\n\t * 当前活动会话的生成指标快照(首字延迟、tok/s、token 用量),口径见 {@link GenerationMetricsSnapshot}。\n\t * 需要 `agent.session.metrics`(或 `agent.session.read`)。Plugin API `^2.12.0`;旧宿主上为 `undefined`。\n\t */\n\tgetGenerationMetrics(): GenerationMetricsSnapshot;\n\t/**\n\t * 订阅生成指标。生成中宿主限频推送(约每 250ms 一次),阶段切换、调用结束、切换会话时立即推送;\n\t * 订阅后在微任务里回放一次当前快照。权限与版本要求同 {@link getGenerationMetrics}。\n\t */\n\tonGenerationMetrics(listener: (snapshot: GenerationMetricsSnapshot) => void): Disposable;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../src/conversation.ts"],"names":[],"mappings":"","sourcesContent":["import type { Disposable } from \"./disposable.js\";\nimport type { GenerationMetricsSnapshot } from \"./generation-metrics.js\";\n\nexport interface ConversationState {\n\t/** Active session runtimeId, or null when no conversation is active. */\n\tid: string | null;\n\tcwd: string | null;\n\tsessionPath: string | null;\n\tmodel: string | null;\n\tisStreaming: boolean;\n}\n\nexport interface ConversationMessage {\n\tid: string;\n\trole: \"user\" | \"assistant\" | \"compaction\";\n\ttext: string;\n\ttimestamp?: number;\n\t/**\n\t * 这条助手消息里调用过的工具名(去重,按首次出现顺序)。没有调用工具时省略。\n\t * 来自对话记录本身,打开历史会话同样有,插件可据此判断「这个会话做过某类事」。\n\t * Plugin API `^2.14.0`;旧宿主不提供这个字段。\n\t */\n\ttoolNames?: string[];\n}\n\nexport type ConversationEvent =\n\t| { type: \"turn-start\" }\n\t| { type: \"turn-end\"; stopReason: string }\n\t| { type: \"message-added\"; message: ConversationMessage }\n\t| { type: \"message-updated\"; delta: string }\n\t/**\n\t * 模型还在生成这次调用,流式参数已解析出新的键。\n\t *\n\t * 用它做「agent 正在动某个目标」这类实时 UI:`edit` / `write` 真正耗时的是\n\t * 生成参数(一整份文件正文),执行只要几毫秒,等 `tool-call-start` 到手时活\n\t * 已经干完了。目标路径通常是参数里的第一个键,所以能提前几秒拿到。\n\t *\n\t * 天然是残缺的:后面的键还没到,正在生成的那个键也不含在内。要权威全量参数\n\t * 请用 `tool-call-start`。同一次调用会随键数增长发多次,不会逐 token 发。\n\t */\n\t| { type: \"tool-call-args\"; toolCallId: string; toolName: string; args: Record<string, unknown> }\n\t| { type: \"tool-call-start\"; toolCallId: string; toolName: string; args?: Record<string, unknown> }\n\t| { type: \"tool-call-end\"; toolCallId: string; toolName: string; isError: boolean }\n\t| { type: \"conversation-changed\"; conversation: ConversationState }\n\t| { type: \"queue-changed\"; queue: ConversationQueueState };\n\n/** 会话输入队列快照(ADR-0060):排队中的 prompt 与暂停状态。 */\nexport interface ConversationQueueState {\n\t/** abort/error 后队列暂停;恢复由用户在宿主 UI 操作。 */\n\tpaused: boolean;\n\titems: Array<{ id: string; displayText: string }>;\n}\n\n/**\n * sendPrompt 的回执(ADR-0060)。streaming 中发送不再静默排队:返回 `queued` 与\n * 队列条目 id,插件可结合 `queue-changed` 事件呈现「已排队/已发出/被移除」状态。\n */\nexport interface SendPromptResult {\n\tstatus: \"sent\" | \"queued\" | \"failed\";\n\terror?: { message: string };\n\tqueueItemId?: string;\n}\n\n/** createSession 的可选项。 */\nexport interface CreateSessionOptions {\n\t/**\n\t * false 时会话照常创建并设为活跃,但宿主停留在当前路由(后台任务用)。\n\t * 默认 true:与用户在新会话页手动发送的观感一致,发出去就进对话页。\n\t */\n\tnavigate?: boolean;\n}\n\nexport interface PluginConversationApi {\n\t/**\n\t * Send a prompt into the active conversation (renders as a user turn).\n\t * Streaming 中会进入会话队列并立即 resolve `{ status: \"queued\" }`;\n\t * 队列在本轮自然停止点接力消费,abort/error 后暂停待用户处置。\n\t *\n\t * 没有活跃会话时抛错。插件若想在这种情况下也把话说出去,先 {@link createSession}。\n\t */\n\tsendPrompt(text: string): Promise<SendPromptResult>;\n\t/**\n\t * Create a conversation in `cwd` and make it active, resolving once it is ready\n\t * to receive prompts — `await createSession(cwd)` 后可以直接 {@link sendPrompt}。\n\t *\n\t * 用于宿主此刻没有活跃会话的场景(例如用户停在新会话页,插件侧却已经产生了要\n\t * 交给 agent 的工作)。已有活跃会话时照样新建一个,不做复用判断——要不要新开由\n\t * 插件按自己的语义决定。\n\t *\n\t * 执行模式跟随宿主当前选择,插件不感知。\n\t */\n\tcreateSession(cwd: string, options?: CreateSessionOptions): Promise<ConversationState>;\n\t/** Fill the input bar without sending; the user can edit and send. */\n\tinsertText(text: string): void;\n\t/** Abort the active conversation's current turn. */\n\tabort(): Promise<void>;\n\t/**\n\t * Subscribe to real-time conversation events. The listener is replayed one\n\t * `conversation-changed` with the current state right after subscribing (in a\n\t * microtask), so logic keyed off the active conversation — e.g. deciding\n\t * whether an activity tab belongs in the tab bar for this cwd — runs without\n\t * waiting for the next session switch.\n\t */\n\ton(listener: (event: ConversationEvent) => void): Disposable;\n\t/**\n\t * 当前活动会话的生成指标快照(首字延迟、tok/s、token 用量),口径见 {@link GenerationMetricsSnapshot}。\n\t * 需要 `agent.session.metrics`(或 `agent.session.read`)。Plugin API `^2.12.0`;旧宿主上为 `undefined`。\n\t */\n\tgetGenerationMetrics(): GenerationMetricsSnapshot;\n\t/**\n\t * 订阅生成指标。生成中宿主限频推送(约每 250ms 一次),阶段切换、调用结束、切换会话时立即推送;\n\t * 订阅后在微任务里回放一次当前快照。权限与版本要求同 {@link getGenerationMetrics}。\n\t */\n\tonGenerationMetrics(listener: (snapshot: GenerationMetricsSnapshot) => void): Disposable;\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export type { PluginFileExplorerEntry, PluginWorkspaceRoot, PluginFileExplorerWh
|
|
|
14
14
|
export type { PluginFileIconAssociations, PluginFileIconTheme } from "./file-explorer.js";
|
|
15
15
|
export type { ConversationState, ConversationMessage, ConversationEvent, ConversationQueueState, CreateSessionOptions, PluginConversationApi, SendPromptResult, } from "./conversation.js";
|
|
16
16
|
export type { GenerationCallMetrics, GenerationMetricsSnapshot, GenerationPhase, GenerationTokenUsage, GenerationTurnMetrics, } from "./generation-metrics.js";
|
|
17
|
-
export type { PluginGlobalSlotContribution, PluginAbilityDetailSlotContribution, PluginAbilityDetailSlotProps, PluginNavBadge, PluginNavBadgeTone, PluginWorkspaceViewProps, PluginWorkspaceViewContribution, PluginWorkspaceViewHeader, PluginSidebarState, PluginAudioMetadata, PluginPreviewUrlOptions, PluginPreviewFile, PluginPreviewFileRef, PluginFilePreviewProps, PluginFilePreviewContribution, PluginActivityTabContribution, PluginActivityTabMeta, PluginActivityTabMetaResult, PluginActivityTabScope, PluginBottomPanelContribution, PluginActivityTabRetention, PluginActivityTabTargetOptions, PluginCaptureRegion, PluginOpenActivityTabOptions, PluginPromptDecoration, PluginInputActionContribution, PluginHeaderActionContribution, PluginHeaderActionContext, PluginHeaderActionMenuItem, PluginHeaderActionMenuItemKind, PluginHeaderActionPopover, PluginHeaderActionPopoverHost, PluginHeaderActionPopoverProps, PluginHeaderActionPopoverSize, PluginHeaderActionState, PluginHeaderActionSurface, PluginHeaderActionTone, PluginNewSessionContext, PluginNewSessionContextActivation, PluginNewSessionContextContribution, PluginNewSessionTarget, CardDescriptor, PluginPendingToolCall, PluginCardProps, PluginCardRendererContribution, PluginToolCallSlotToolCall, PluginToolCallSlotProps, PluginToolCallSlotContribution, PluginTurnCardContribution, PluginNotifyOptions, PluginUiApi, } from "./ui.js";
|
|
17
|
+
export type { PluginGlobalSlotContribution, PluginAbilityDetailSlotContribution, PluginAbilityDetailSlotProps, PluginNavBadge, PluginNavBadgeTone, PluginWorkspaceViewProps, PluginWorkspaceViewContribution, PluginWorkspaceViewHeader, PluginSidebarState, PluginAudioMetadata, PluginPreviewUrlOptions, PluginPreviewFile, PluginPreviewFileRef, PluginFilePreviewProps, PluginFilePreviewContribution, PluginActivityTabContribution, PluginActivityTabMeta, PluginActivityTabMetaResult, PluginActivityTabScope, PluginBottomPanelContribution, PluginActivityTabRetention, PluginActivityTabTargetOptions, PluginCaptureRegion, PluginActivityPanelWidthOptions, PluginOpenActivityTabOptions, PluginPromptDecoration, PluginInputActionContribution, PluginHeaderActionContribution, PluginHeaderActionContext, PluginHeaderActionMenuItem, PluginHeaderActionMenuItemKind, PluginHeaderActionPopover, PluginHeaderActionPopoverHost, PluginHeaderActionPopoverProps, PluginHeaderActionPopoverSize, PluginHeaderActionState, PluginHeaderActionSurface, PluginHeaderActionTone, PluginNewSessionContext, PluginNewSessionContextActivation, PluginNewSessionContextContribution, PluginNewSessionTarget, CardDescriptor, PluginPendingToolCall, PluginCardProps, PluginCardRendererContribution, PluginToolCallSlotToolCall, PluginToolCallSlotProps, PluginToolCallSlotContribution, PluginTurnCardContribution, PluginNotifyOptions, PluginUiApi, } from "./ui.js";
|
|
18
18
|
export type { PluginShortcutScopeKind, PluginShortcutWhen, PluginShortcutBinding, PluginShortcutScopeContribution, PluginRegisterShortcutScope, UsePluginShortcutScopeOptions, } from "./shortcuts.js";
|
|
19
19
|
export { usePluginShortcutScope } from "./shortcuts.js";
|
|
20
20
|
export type { PluginJsonSchema, PluginAgentToolApi, PluginAgentToolRegistration, PluginSystemPromptBlock, PluginDynamicSystemPromptOperation, PluginSystemPromptMessage, PluginSystemPromptProviderContext, PluginSystemPromptBlockView, PluginAgentActions, PluginAgentHandlerContext, PluginAgentToolHandler, PluginCodingAgentHookEvent, PluginCodingAgentHookEventName, PluginCodingAgentHookEventOf, PluginCodingAgentHookHandler, PluginCodingAgentHookHandlerContext, PluginCodingAgentHookRegistration, PluginCodingAgentHookResult, PluginCodingAgentHookTool, PluginCodingAgentPermissionMode, PluginSystemPromptProviderHandler, PluginSystemPromptProviderRegistration, PluginContinuationResult, PluginContinuationHandler, PluginContinuationRegistration, PluginAgentApi, } from "./agent.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EACX,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,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AAiB,EACjB,cAAc,EACd,YAAY,EACZ,aAAa,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGxE,YAAY,EACX,mBAAmB,EACnB,SAAS,EACT,uBAAuB,EACvB,aAAa,EACb,gBAAgB,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,YAAY,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGzE,YAAY,EACX,6BAA6B,EAC7B,8BAA8B,EAC9B,4BAA4B,EAC5B,6BAA6B,EAC7B,6BAA6B,EAC7B,qBAAqB,EACrB,uBAAuB,EACvB,gCAAgC,GAChC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGzE,YAAY,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EACN,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,GACf,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["/**\n * @vetta-org/plugin-sdk public surface.\n *\n * Implementation is split by domain under `src/*.ts`; this barrel re-exports\n * the stable package API. Prefer importing from `@vetta-org/plugin-sdk` rather\n * than deep paths.\n */\n\n// Core primitives\nexport type { ConversationScenario } from \"./scenario.js\";\nexport { PLUGIN_PERMISSIONS } from \"./permissions.js\";\nexport type { PluginPermission } from \"./permissions.js\";\nexport type { Disposable } from \"./disposable.js\";\nexport type {\n\tPluginAgentManifest,\n\tPluginBrowserManifest,\n\tPluginCliProviderManifest,\n\tPluginServiceArtifact,\n\tPluginServicePlatform,\n\tPluginServiceProviderManifest,\n\tPluginServiceRuntimeKind,\n\tPluginManifest,\n\tPluginManifestInput,\n\tPluginManifestResourceReference,\n\tPluginMcpServerConfig,\n\tPluginNetworkManifest,\n\tPluginSkillPresentation,\n\tPluginSkillPresentationRule,\n} from \"./manifest.js\";\n\n// File explorer\nexport type {\n\tPluginFileExplorerEntry,\n\tPluginWorkspaceRoot,\n\tPluginFileExplorerWhen,\n\tPluginFileExplorerActionContext,\n\tPluginFileExplorerContextMenuContribution,\n\tPluginFileExplorerToolbarContext,\n\tPluginFileExplorerToolbarContribution,\n\tPluginFileExplorerDecoration,\n\tPluginFileExplorerDecorationProvider,\n\tPluginFileExplorerChange,\n\tPluginFileExplorerRevealOptions,\n\tPluginFileExplorerApi,\n} from \"./file-explorer.js\";\nexport type { PluginFileIconAssociations, PluginFileIconTheme } from \"./file-explorer.js\";\n\n// Conversation\nexport type {\n\tConversationState,\n\tConversationMessage,\n\tConversationEvent,\n\tConversationQueueState,\n\tCreateSessionOptions,\n\tPluginConversationApi,\n\tSendPromptResult,\n} from \"./conversation.js\";\nexport type {\n\tGenerationCallMetrics,\n\tGenerationMetricsSnapshot,\n\tGenerationPhase,\n\tGenerationTokenUsage,\n\tGenerationTurnMetrics,\n} from \"./generation-metrics.js\";\n\n// UI slots\nexport type {\n\tPluginGlobalSlotContribution,\n\tPluginAbilityDetailSlotContribution,\n\tPluginAbilityDetailSlotProps,\n\tPluginNavBadge,\n\tPluginNavBadgeTone,\n\tPluginWorkspaceViewProps,\n\tPluginWorkspaceViewContribution,\n\tPluginWorkspaceViewHeader,\n\tPluginSidebarState,\n\tPluginAudioMetadata,\n\tPluginPreviewUrlOptions,\n\tPluginPreviewFile,\n\tPluginPreviewFileRef,\n\tPluginFilePreviewProps,\n\tPluginFilePreviewContribution,\n\tPluginActivityTabContribution,\n\tPluginActivityTabMeta,\n\tPluginActivityTabMetaResult,\n\tPluginActivityTabScope,\n\tPluginBottomPanelContribution,\n\tPluginActivityTabRetention,\n\tPluginActivityTabTargetOptions,\n\tPluginCaptureRegion,\n\tPluginOpenActivityTabOptions,\n\tPluginPromptDecoration,\n\tPluginInputActionContribution,\n\tPluginHeaderActionContribution,\n\tPluginHeaderActionContext,\n\tPluginHeaderActionMenuItem,\n\tPluginHeaderActionMenuItemKind,\n\tPluginHeaderActionPopover,\n\tPluginHeaderActionPopoverHost,\n\tPluginHeaderActionPopoverProps,\n\tPluginHeaderActionPopoverSize,\n\tPluginHeaderActionState,\n\tPluginHeaderActionSurface,\n\tPluginHeaderActionTone,\n\tPluginNewSessionContext,\n\tPluginNewSessionContextActivation,\n\tPluginNewSessionContextContribution,\n\tPluginNewSessionTarget,\n\tCardDescriptor,\n\tPluginPendingToolCall,\n\tPluginCardProps,\n\tPluginCardRendererContribution,\n\tPluginToolCallSlotToolCall,\n\tPluginToolCallSlotProps,\n\tPluginToolCallSlotContribution,\n\tPluginTurnCardContribution,\n\tPluginNotifyOptions,\n\tPluginUiApi,\n} from \"./ui.js\";\n\n// Keyboard shortcuts (host ShortcutScopeStack)\nexport type {\n\tPluginShortcutScopeKind,\n\tPluginShortcutWhen,\n\tPluginShortcutBinding,\n\tPluginShortcutScopeContribution,\n\tPluginRegisterShortcutScope,\n\tUsePluginShortcutScopeOptions,\n} from \"./shortcuts.js\";\nexport { usePluginShortcutScope } from \"./shortcuts.js\";\n\n// Agent runtime\nexport type {\n\tPluginJsonSchema,\n\tPluginAgentToolApi,\n\tPluginAgentToolRegistration,\n\tPluginSystemPromptBlock,\n\tPluginDynamicSystemPromptOperation,\n\tPluginSystemPromptMessage,\n\tPluginSystemPromptProviderContext,\n\tPluginSystemPromptBlockView,\n\tPluginAgentActions,\n\tPluginAgentHandlerContext,\n\tPluginAgentToolHandler,\n\tPluginCodingAgentHookEvent,\n\tPluginCodingAgentHookEventName,\n\tPluginCodingAgentHookEventOf,\n\tPluginCodingAgentHookHandler,\n\tPluginCodingAgentHookHandlerContext,\n\tPluginCodingAgentHookRegistration,\n\tPluginCodingAgentHookResult,\n\tPluginCodingAgentHookTool,\n\tPluginCodingAgentPermissionMode,\n\tPluginSystemPromptProviderHandler,\n\tPluginSystemPromptProviderRegistration,\n\tPluginContinuationResult,\n\tPluginContinuationHandler,\n\tPluginContinuationRegistration,\n\tPluginAgentApi,\n} from \"./agent.js\";\nexport { PLUGIN_CODING_AGENT_HOOK_EVENT_NAMES } from \"./agent.js\";\n\n// App actions\nexport type {\n\tPluginAppActionEffect,\n\tPluginAppActionExample,\n\tPluginAppActionHandlerContext,\n\tPluginAppActionHandler,\n\tPluginAppActionReadyHandler,\n\tPluginAppActionApprovalPresentation,\n\tPluginAppActionApproval,\n\tPluginAppActionRegistration,\n\tPluginAppActionUsage,\n\tPluginAppActionsApi,\n} from \"./app-actions.js\";\nexport { PluginAppActionError } from \"./app-actions.js\";\n\n// Host-managed AI\nexport type {\n\tPluginAiApi,\n\tPluginAiChatAssistantMessage,\n\tPluginAiChatMessage,\n\tPluginAiChatRequest,\n\tPluginAiChatResult,\n\tPluginAiChatTool,\n\tPluginAiChatToolResultMessage,\n\tPluginAiChatUserMessage,\n\tPluginAiCompleteRequest,\n\tPluginAiCompleteResult,\n\tPluginAiStreamOptions,\n\tPluginAiTextDeltaEvent,\n\tPluginAiModel,\n\tPluginAiModelListResult,\n\tPluginAiToolCall,\n\tPluginAiUsage,\n} from \"./ai.js\";\n\n// Official host capabilities\nexport type {\n\tPluginOfficialGeneralSettings,\n\tPluginOfficialGeneralSettingsUpdate,\n\tPluginOfficialExperimentalSettings,\n\tPluginOfficialImageGenerationSettings,\n\tPluginOfficialImageGenerationSettingsUpdate,\n\tPluginOfficialDownloadItem,\n\tPluginOfficialUpdaterState,\n\tPluginOfficialWebhookKind,\n\tPluginOfficialWebhookEndpoint,\n\tPluginOfficialWebhookProvider,\n\tPluginOfficialWebhookCreateInput,\n\tPluginOfficialWebhookUpdateInput,\n\tPluginOfficialWebhookMessage,\n\tPluginOfficialWebhookSendResult,\n\tPluginOfficialSkillInfo,\n\tPluginOfficialInstalledSkill,\n\tPluginOfficialShortcutBinding,\n\tPluginOfficialImStatus,\n\tPluginOfficialImLog,\n\tPluginOfficialMcpServerSummary,\n\tPluginOfficialMcpTarget,\n\tPluginOfficialMcpServerDetail,\n\tPluginOfficialMcpUpsertData,\n\tPluginOfficialExecutionMode,\n\tPluginOfficialSelectedSkill,\n\tPluginOfficialBatchProjectCreateData,\n\tPluginOfficialBatchProjectUpdateData,\n\tPluginOfficialSchedulerModel,\n\tPluginOfficialSchedulerNotification,\n\tPluginOfficialSchedulerRunTarget,\n\tPluginOfficialSchedulerSchedule,\n\tPluginOfficialSchedulerTaskCreateData,\n\tPluginOfficialSchedulerTaskUpdateData,\n\tPluginOfficialModelSummary,\n\tPluginOfficialProviderSummary,\n\tPluginOfficialProviderDetail,\n\tPluginOfficialProviderUpsertData,\n\tPluginOfficialProjectEntry,\n\tPluginOfficialSessionHandle,\n\tPluginOfficialNavigationOpenInput,\n\tPluginOfficialOpenFilesOptions,\n\tPluginOfficialOpenedFile,\n\tPluginOfficialSessionAccess,\n\tPluginOfficialSessionRunningEvent,\n\tPluginOfficialSessionSummary,\n\tPluginOfficialPluginSummary,\n\tPluginOfficialKnowledgeBase,\n\tPluginOfficialKnowledgeProcessingSettings,\n\tPluginOfficialApi,\n} from \"./official.js\";\n\n// Files / command / images / secrets\nexport type {\n\tPluginFsEntry,\n\tPluginFsFileRef,\n\tPluginFsListFilesRecursiveOptions,\n\tPluginFsBinaryReadResult,\n\tPluginFsStatResult,\n\tPluginFsReadResult,\n\tPluginFsApi,\n} from \"./fs.js\";\nexport type {\n\tPluginCommandRunOptions,\n\tPluginCommandRunResult,\n\tPluginCommandSpawnOptions,\n\tPluginCommandSpawnExit,\n\tPluginCommandSpawnStatus,\n\tPluginCommandSpawnHandle,\n\tPluginCommandApi,\n} from \"./command.js\";\nexport type {\n\tPluginCliProviderApi,\n\tPluginCliProviderPhase,\n\tPluginCliProviderStatus,\n} from \"./cli-provider.js\";\nexport type {\n\tPluginServiceApi,\n\tPluginServiceArtifactPayload,\n\tPluginServiceConnection,\n\tPluginServiceHostPlatform,\n\tPluginServicePhase,\n\tPluginServiceRequest,\n\tPluginServiceResponse,\n\tPluginServiceStatus,\n\tPluginServiceDataEncoding,\n} from \"./service-provider.js\";\nexport type { PluginModelDefinition, PluginModelProviderConfig, PluginModelsApi } from \"./models.js\";\nexport type {\n\tPluginBrowserAction,\n\tPluginBrowserActionResult,\n\tPluginBrowserApi,\n\tPluginBrowserPageState,\n\tPluginBrowserProfile,\n\tPluginBrowserRuntimePhase,\n\tPluginBrowserRuntimeStatus,\n\tPluginBrowserScreenshot,\n\tPluginBrowserSession,\n\tPluginBrowserSessionOptions,\n\tPluginBrowserSessionStatus,\n\tPluginBrowserSnapshot,\n\tPluginBrowserSource,\n\tPluginBrowserTextContent,\n} from \"./browser.js\";\nexport type {\n\tPluginCaptureApi,\n\tPluginOffscreenCaptureOptions,\n\tPluginOffscreenCaptureResult,\n} from \"./capture.js\";\nexport type { PluginImageRef } from \"./images.js\";\nexport type {\n\tPluginArtifactDestination,\n\tPluginArtifactRef,\n\tPluginArtifactsApi,\n\tPluginPersistedArtifact,\n} from \"./artifacts.js\";\nexport type {\n\tPluginJob,\n\tPluginJobFailure,\n\tPluginJobProgress,\n\tPluginJobRef,\n\tPluginJobsApi,\n\tPluginJobStatus,\n\tPluginJobWaitOptions,\n} from \"./jobs.js\";\nexport type {\n\tPluginMediaApi,\n\tPluginMediaArtifact,\n\tPluginMediaCapability,\n\tPluginMediaComposeRequest,\n\tPluginMediaDimensions,\n\tPluginMediaErrorCode,\n\tPluginMediaFailure,\n\tPluginMediaGenerateRequest,\n\tPluginMediaGenerationInputSlot,\n\tPluginMediaGenerationMode,\n\tPluginMediaGenerationModeCapability,\n\tPluginMediaInput,\n\tPluginMediaInputSource,\n\tPluginMediaInputUploadRequest,\n\tPluginMediaJob,\n\tPluginMediaKind,\n\tPluginMediaOperation,\n\tPluginMediaOutput,\n\tPluginMediaOutputKind,\n\tPluginMediaProviderDescriptor,\n\tPluginMediaGenerationModelDescriptor,\n\tPluginMediaProviderArtifact,\n\tPluginMediaProviderArtifactSource,\n\tPluginMediaProviderHandlerContext,\n\tPluginMediaProviderInput,\n\tPluginMediaProviderJob,\n\tPluginMediaProviderRegistration,\n\tPluginMediaProviderSubmitRequest,\n\tPluginMediaSubmitRequest,\n\tPluginMediaTranscodeRequest,\n\tPluginMediaTransferResponse,\n} from \"./media.js\";\n// OCR Provider protocol\nexport type {\n\tOcrBlock,\n\tOcrClient,\n\tOcrErrorCode,\n\tOcrItemResult,\n\tOcrInput,\n\tOcrProgress,\n\tOcrProviderContext,\n\tOcrProviderDescriptor,\n\tOcrProviderInput,\n\tOcrProviderRegistration,\n\tOcrProviderRequest,\n\tOcrProviderResult,\n\tOcrRequest,\n\tOcrResult,\n\tOcrTransferResponse,\n\tOcrUploadRequest,\n} from \"./ocr.js\";\nexport { PluginMediaError } from \"./media.js\";\nexport type {\n\tPluginPromptAttachment,\n\tPluginPromptContext,\n\tPluginPromptContextJsonValue,\n} from \"./prompt-attachment.js\";\nexport { definePluginPromptContext } from \"./prompt-attachment.js\";\nexport type {\n\tPluginNetworkApi,\n\tPluginNetworkBody,\n\tPluginNetworkRequest,\n\tPluginNetworkResponse,\n} from \"./network.js\";\nexport type { PluginGatewayApi, PluginGatewayRequest, PluginGatewayResponse } from \"./gateway.js\";\nexport type {\n\tPluginPutBlobInput,\n\tPluginPutBlobFromFileInput,\n\tPluginStorageApi,\n\tPluginStorageChange,\n\tPluginStorageCommitOptions,\n\tPluginStorageCommitResult,\n\tPluginStorageEncoding,\n\tPluginStorageSnapshot,\n\tPluginStorageWrite,\n\tPluginStoredBlob,\n\tPluginStoredBlobRef,\n} from \"./storage.js\";\nexport { readJsonFile, writeJsonFile } from \"./storage.js\";\nexport type { PluginSecretsApi } from \"./secrets.js\";\n\n// i18n\nexport type {\n\tPluginLocaleCatalog,\n\tPluginLocales,\n\tPluginTranslate,\n\tPluginI18nApi,\n} from \"./i18n.js\";\nexport { interpolatePluginText, resolveCatalogKey, resolvePluginText } from \"./i18n.js\";\n\n// Build-bound logging\nexport type {\n\tPluginLogEntry,\n\tPluginLogFields,\n\tPluginLogIdentity,\n\tPluginLogLevel,\n\tPluginLogger,\n\tPluginLogSink,\n} from \"./logging.js\";\nexport { __createPluginLogger, __setPluginLogSink } from \"./logging.js\";\n\n// Context & lifecycle\nexport type {\n\tPluginPermissionApi,\n\tAgentMode,\n\tPluginActivationCleanup,\n\tPluginContext,\n\tPluginDefinition,\n} from \"./context.js\";\nexport { definePlugin } from \"./context.js\";\n\n// Host bridge (host-injected; plugins use hooks)\nexport type { PluginHostBridge } from \"./host-bridge.js\";\nexport { __setPluginHostBridge } from \"./host-bridge.js\";\n\n// Activity tab context\nexport type { ActivityTabContextValue } from \"./activity-tab.js\";\nexport { __ActivityTabContext, useActivityTab } from \"./activity-tab.js\";\n\n// Bottom panel context\nexport type {\n\tPluginBottomPanelCloseConfirm,\n\tPluginBottomPanelCloseDecision,\n\tPluginBottomPanelCloseReason,\n\tPluginBottomPanelCloseRequest,\n\tPluginBottomPanelContextValue,\n\tPluginBottomPanelMeta,\n\tPluginBottomPanelStatus,\n\tPluginBottomPanelTerminalRequest,\n} from \"./bottom-panel.js\";\nexport { __BottomPanelContext, useBottomPanel } from \"./bottom-panel.js\";\n\n// React hooks\nexport type { PluginI18nContextValue, PluginTranslation } from \"./hooks.js\";\nexport {\n\t__PluginI18nContext,\n\tuseTranslation,\n\tuseActiveConversation,\n\tuseConversationMessages,\n\tuseGenerationMetrics,\n\tusePromptAttachment,\n\tuseSidebarState,\n} from \"./hooks.js\";\n\n// Host-rendered model picker (same component as the chat input bar)\nexport type { PluginModelPickerProps, PluginModelPickerReasoning } from \"./model-picker.js\";\nexport { ModelPicker } from \"./model-picker.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,YAAY,EACX,mBAAmB,EACnB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,wBAAwB,EACxB,cAAc,EACd,mBAAmB,EACnB,+BAA+B,EAC/B,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,2BAA2B,GAC3B,MAAM,eAAe,CAAC;AAGvB,YAAY,EACX,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,+BAA+B,EAC/B,yCAAyC,EACzC,gCAAgC,EAChC,qCAAqC,EACrC,4BAA4B,EAC5B,oCAAoC,EACpC,wBAAwB,EACxB,+BAA+B,EAC/B,qBAAqB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAG1F,YAAY,EACX,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,GAChB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACX,qBAAqB,EACrB,yBAAyB,EACzB,eAAe,EACf,oBAAoB,EACpB,qBAAqB,GACrB,MAAM,yBAAyB,CAAC;AAGjC,YAAY,EACX,4BAA4B,EAC5B,mCAAmC,EACnC,4BAA4B,EAC5B,cAAc,EACd,kBAAk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EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC5E,OAAO,EACN,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,GACf,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["/**\n * @vetta-org/plugin-sdk public surface.\n *\n * Implementation is split by domain under `src/*.ts`; this barrel re-exports\n * the stable package API. Prefer importing from `@vetta-org/plugin-sdk` rather\n * than deep paths.\n */\n\n// Core primitives\nexport type { ConversationScenario } from \"./scenario.js\";\nexport { PLUGIN_PERMISSIONS } from \"./permissions.js\";\nexport type { PluginPermission } from \"./permissions.js\";\nexport type { Disposable } from \"./disposable.js\";\nexport type {\n\tPluginAgentManifest,\n\tPluginBrowserManifest,\n\tPluginCliProviderManifest,\n\tPluginServiceArtifact,\n\tPluginServicePlatform,\n\tPluginServiceProviderManifest,\n\tPluginServiceRuntimeKind,\n\tPluginManifest,\n\tPluginManifestInput,\n\tPluginManifestResourceReference,\n\tPluginMcpServerConfig,\n\tPluginNetworkManifest,\n\tPluginSkillPresentation,\n\tPluginSkillPresentationRule,\n} from \"./manifest.js\";\n\n// File explorer\nexport type {\n\tPluginFileExplorerEntry,\n\tPluginWorkspaceRoot,\n\tPluginFileExplorerWhen,\n\tPluginFileExplorerActionContext,\n\tPluginFileExplorerContextMenuContribution,\n\tPluginFileExplorerToolbarContext,\n\tPluginFileExplorerToolbarContribution,\n\tPluginFileExplorerDecoration,\n\tPluginFileExplorerDecorationProvider,\n\tPluginFileExplorerChange,\n\tPluginFileExplorerRevealOptions,\n\tPluginFileExplorerApi,\n} from \"./file-explorer.js\";\nexport type { PluginFileIconAssociations, PluginFileIconTheme } from \"./file-explorer.js\";\n\n// Conversation\nexport type {\n\tConversationState,\n\tConversationMessage,\n\tConversationEvent,\n\tConversationQueueState,\n\tCreateSessionOptions,\n\tPluginConversationApi,\n\tSendPromptResult,\n} from \"./conversation.js\";\nexport type {\n\tGenerationCallMetrics,\n\tGenerationMetricsSnapshot,\n\tGenerationPhase,\n\tGenerationTokenUsage,\n\tGenerationTurnMetrics,\n} from \"./generation-metrics.js\";\n\n// UI slots\nexport type {\n\tPluginGlobalSlotContribution,\n\tPluginAbilityDetailSlotContribution,\n\tPluginAbilityDetailSlotProps,\n\tPluginNavBadge,\n\tPluginNavBadgeTone,\n\tPluginWorkspaceViewProps,\n\tPluginWorkspaceViewContribution,\n\tPluginWorkspaceViewHeader,\n\tPluginSidebarState,\n\tPluginAudioMetadata,\n\tPluginPreviewUrlOptions,\n\tPluginPreviewFile,\n\tPluginPreviewFileRef,\n\tPluginFilePreviewProps,\n\tPluginFilePreviewContribution,\n\tPluginActivityTabContribution,\n\tPluginActivityTabMeta,\n\tPluginActivityTabMetaResult,\n\tPluginActivityTabScope,\n\tPluginBottomPanelContribution,\n\tPluginActivityTabRetention,\n\tPluginActivityTabTargetOptions,\n\tPluginCaptureRegion,\n\tPluginActivityPanelWidthOptions,\n\tPluginOpenActivityTabOptions,\n\tPluginPromptDecoration,\n\tPluginInputActionContribution,\n\tPluginHeaderActionContribution,\n\tPluginHeaderActionContext,\n\tPluginHeaderActionMenuItem,\n\tPluginHeaderActionMenuItemKind,\n\tPluginHeaderActionPopover,\n\tPluginHeaderActionPopoverHost,\n\tPluginHeaderActionPopoverProps,\n\tPluginHeaderActionPopoverSize,\n\tPluginHeaderActionState,\n\tPluginHeaderActionSurface,\n\tPluginHeaderActionTone,\n\tPluginNewSessionContext,\n\tPluginNewSessionContextActivation,\n\tPluginNewSessionContextContribution,\n\tPluginNewSessionTarget,\n\tCardDescriptor,\n\tPluginPendingToolCall,\n\tPluginCardProps,\n\tPluginCardRendererContribution,\n\tPluginToolCallSlotToolCall,\n\tPluginToolCallSlotProps,\n\tPluginToolCallSlotContribution,\n\tPluginTurnCardContribution,\n\tPluginNotifyOptions,\n\tPluginUiApi,\n} from \"./ui.js\";\n\n// Keyboard shortcuts (host ShortcutScopeStack)\nexport type {\n\tPluginShortcutScopeKind,\n\tPluginShortcutWhen,\n\tPluginShortcutBinding,\n\tPluginShortcutScopeContribution,\n\tPluginRegisterShortcutScope,\n\tUsePluginShortcutScopeOptions,\n} from \"./shortcuts.js\";\nexport { usePluginShortcutScope } from \"./shortcuts.js\";\n\n// Agent runtime\nexport type {\n\tPluginJsonSchema,\n\tPluginAgentToolApi,\n\tPluginAgentToolRegistration,\n\tPluginSystemPromptBlock,\n\tPluginDynamicSystemPromptOperation,\n\tPluginSystemPromptMessage,\n\tPluginSystemPromptProviderContext,\n\tPluginSystemPromptBlockView,\n\tPluginAgentActions,\n\tPluginAgentHandlerContext,\n\tPluginAgentToolHandler,\n\tPluginCodingAgentHookEvent,\n\tPluginCodingAgentHookEventName,\n\tPluginCodingAgentHookEventOf,\n\tPluginCodingAgentHookHandler,\n\tPluginCodingAgentHookHandlerContext,\n\tPluginCodingAgentHookRegistration,\n\tPluginCodingAgentHookResult,\n\tPluginCodingAgentHookTool,\n\tPluginCodingAgentPermissionMode,\n\tPluginSystemPromptProviderHandler,\n\tPluginSystemPromptProviderRegistration,\n\tPluginContinuationResult,\n\tPluginContinuationHandler,\n\tPluginContinuationRegistration,\n\tPluginAgentApi,\n} from \"./agent.js\";\nexport { PLUGIN_CODING_AGENT_HOOK_EVENT_NAMES } from \"./agent.js\";\n\n// App actions\nexport type {\n\tPluginAppActionEffect,\n\tPluginAppActionExample,\n\tPluginAppActionHandlerContext,\n\tPluginAppActionHandler,\n\tPluginAppActionReadyHandler,\n\tPluginAppActionApprovalPresentation,\n\tPluginAppActionApproval,\n\tPluginAppActionRegistration,\n\tPluginAppActionUsage,\n\tPluginAppActionsApi,\n} from \"./app-actions.js\";\nexport { PluginAppActionError } from \"./app-actions.js\";\n\n// Host-managed AI\nexport type {\n\tPluginAiApi,\n\tPluginAiChatAssistantMessage,\n\tPluginAiChatMessage,\n\tPluginAiChatRequest,\n\tPluginAiChatResult,\n\tPluginAiChatTool,\n\tPluginAiChatToolResultMessage,\n\tPluginAiChatUserMessage,\n\tPluginAiCompleteRequest,\n\tPluginAiCompleteResult,\n\tPluginAiStreamOptions,\n\tPluginAiTextDeltaEvent,\n\tPluginAiModel,\n\tPluginAiModelListResult,\n\tPluginAiToolCall,\n\tPluginAiUsage,\n} from \"./ai.js\";\n\n// Official host capabilities\nexport type {\n\tPluginOfficialGeneralSettings,\n\tPluginOfficialGeneralSettingsUpdate,\n\tPluginOfficialExperimentalSettings,\n\tPluginOfficialImageGenerationSettings,\n\tPluginOfficialImageGenerationSettingsUpdate,\n\tPluginOfficialDownloadItem,\n\tPluginOfficialUpdaterState,\n\tPluginOfficialWebhookKind,\n\tPluginOfficialWebhookEndpoint,\n\tPluginOfficialWebhookProvider,\n\tPluginOfficialWebhookCreateInput,\n\tPluginOfficialWebhookUpdateInput,\n\tPluginOfficialWebhookMessage,\n\tPluginOfficialWebhookSendResult,\n\tPluginOfficialSkillInfo,\n\tPluginOfficialInstalledSkill,\n\tPluginOfficialShortcutBinding,\n\tPluginOfficialImStatus,\n\tPluginOfficialImLog,\n\tPluginOfficialMcpServerSummary,\n\tPluginOfficialMcpTarget,\n\tPluginOfficialMcpServerDetail,\n\tPluginOfficialMcpUpsertData,\n\tPluginOfficialExecutionMode,\n\tPluginOfficialSelectedSkill,\n\tPluginOfficialBatchProjectCreateData,\n\tPluginOfficialBatchProjectUpdateData,\n\tPluginOfficialSchedulerModel,\n\tPluginOfficialSchedulerNotification,\n\tPluginOfficialSchedulerRunTarget,\n\tPluginOfficialSchedulerSchedule,\n\tPluginOfficialSchedulerTaskCreateData,\n\tPluginOfficialSchedulerTaskUpdateData,\n\tPluginOfficialModelSummary,\n\tPluginOfficialProviderSummary,\n\tPluginOfficialProviderDetail,\n\tPluginOfficialProviderUpsertData,\n\tPluginOfficialProjectEntry,\n\tPluginOfficialSessionHandle,\n\tPluginOfficialNavigationOpenInput,\n\tPluginOfficialOpenFilesOptions,\n\tPluginOfficialOpenedFile,\n\tPluginOfficialSessionAccess,\n\tPluginOfficialSessionRunningEvent,\n\tPluginOfficialSessionSummary,\n\tPluginOfficialPluginSummary,\n\tPluginOfficialKnowledgeBase,\n\tPluginOfficialKnowledgeProcessingSettings,\n\tPluginOfficialApi,\n} from \"./official.js\";\n\n// Files / command / images / secrets\nexport type {\n\tPluginFsEntry,\n\tPluginFsFileRef,\n\tPluginFsListFilesRecursiveOptions,\n\tPluginFsBinaryReadResult,\n\tPluginFsStatResult,\n\tPluginFsReadResult,\n\tPluginFsApi,\n} from \"./fs.js\";\nexport type {\n\tPluginCommandRunOptions,\n\tPluginCommandRunResult,\n\tPluginCommandSpawnOptions,\n\tPluginCommandSpawnExit,\n\tPluginCommandSpawnStatus,\n\tPluginCommandSpawnHandle,\n\tPluginCommandApi,\n} from \"./command.js\";\nexport type {\n\tPluginCliProviderApi,\n\tPluginCliProviderPhase,\n\tPluginCliProviderStatus,\n} from \"./cli-provider.js\";\nexport type {\n\tPluginServiceApi,\n\tPluginServiceArtifactPayload,\n\tPluginServiceConnection,\n\tPluginServiceHostPlatform,\n\tPluginServicePhase,\n\tPluginServiceRequest,\n\tPluginServiceResponse,\n\tPluginServiceStatus,\n\tPluginServiceDataEncoding,\n} from \"./service-provider.js\";\nexport type { PluginModelDefinition, PluginModelProviderConfig, PluginModelsApi } from \"./models.js\";\nexport type {\n\tPluginBrowserAction,\n\tPluginBrowserActionResult,\n\tPluginBrowserApi,\n\tPluginBrowserPageState,\n\tPluginBrowserProfile,\n\tPluginBrowserRuntimePhase,\n\tPluginBrowserRuntimeStatus,\n\tPluginBrowserScreenshot,\n\tPluginBrowserSession,\n\tPluginBrowserSessionOptions,\n\tPluginBrowserSessionStatus,\n\tPluginBrowserSnapshot,\n\tPluginBrowserSource,\n\tPluginBrowserTextContent,\n} from \"./browser.js\";\nexport type {\n\tPluginCaptureApi,\n\tPluginOffscreenCaptureOptions,\n\tPluginOffscreenCaptureResult,\n} from \"./capture.js\";\nexport type { PluginImageRef } from \"./images.js\";\nexport type {\n\tPluginArtifactDestination,\n\tPluginArtifactRef,\n\tPluginArtifactsApi,\n\tPluginPersistedArtifact,\n} from \"./artifacts.js\";\nexport type {\n\tPluginJob,\n\tPluginJobFailure,\n\tPluginJobProgress,\n\tPluginJobRef,\n\tPluginJobsApi,\n\tPluginJobStatus,\n\tPluginJobWaitOptions,\n} from \"./jobs.js\";\nexport type {\n\tPluginMediaApi,\n\tPluginMediaArtifact,\n\tPluginMediaCapability,\n\tPluginMediaComposeRequest,\n\tPluginMediaDimensions,\n\tPluginMediaErrorCode,\n\tPluginMediaFailure,\n\tPluginMediaGenerateRequest,\n\tPluginMediaGenerationInputSlot,\n\tPluginMediaGenerationMode,\n\tPluginMediaGenerationModeCapability,\n\tPluginMediaInput,\n\tPluginMediaInputSource,\n\tPluginMediaInputUploadRequest,\n\tPluginMediaJob,\n\tPluginMediaKind,\n\tPluginMediaOperation,\n\tPluginMediaOutput,\n\tPluginMediaOutputKind,\n\tPluginMediaProviderDescriptor,\n\tPluginMediaGenerationModelDescriptor,\n\tPluginMediaProviderArtifact,\n\tPluginMediaProviderArtifactSource,\n\tPluginMediaProviderHandlerContext,\n\tPluginMediaProviderInput,\n\tPluginMediaProviderJob,\n\tPluginMediaProviderRegistration,\n\tPluginMediaProviderSubmitRequest,\n\tPluginMediaSubmitRequest,\n\tPluginMediaTranscodeRequest,\n\tPluginMediaTransferResponse,\n} from \"./media.js\";\n// OCR Provider protocol\nexport type {\n\tOcrBlock,\n\tOcrClient,\n\tOcrErrorCode,\n\tOcrItemResult,\n\tOcrInput,\n\tOcrProgress,\n\tOcrProviderContext,\n\tOcrProviderDescriptor,\n\tOcrProviderInput,\n\tOcrProviderRegistration,\n\tOcrProviderRequest,\n\tOcrProviderResult,\n\tOcrRequest,\n\tOcrResult,\n\tOcrTransferResponse,\n\tOcrUploadRequest,\n} from \"./ocr.js\";\nexport { PluginMediaError } from \"./media.js\";\nexport type {\n\tPluginPromptAttachment,\n\tPluginPromptContext,\n\tPluginPromptContextJsonValue,\n} from \"./prompt-attachment.js\";\nexport { definePluginPromptContext } from \"./prompt-attachment.js\";\nexport type {\n\tPluginNetworkApi,\n\tPluginNetworkBody,\n\tPluginNetworkRequest,\n\tPluginNetworkResponse,\n} from \"./network.js\";\nexport type { PluginGatewayApi, PluginGatewayRequest, PluginGatewayResponse } from \"./gateway.js\";\nexport type {\n\tPluginPutBlobInput,\n\tPluginPutBlobFromFileInput,\n\tPluginStorageApi,\n\tPluginStorageChange,\n\tPluginStorageCommitOptions,\n\tPluginStorageCommitResult,\n\tPluginStorageEncoding,\n\tPluginStorageSnapshot,\n\tPluginStorageWrite,\n\tPluginStoredBlob,\n\tPluginStoredBlobRef,\n} from \"./storage.js\";\nexport { readJsonFile, writeJsonFile } from \"./storage.js\";\nexport type { PluginSecretsApi } from \"./secrets.js\";\n\n// i18n\nexport type {\n\tPluginLocaleCatalog,\n\tPluginLocales,\n\tPluginTranslate,\n\tPluginI18nApi,\n} from \"./i18n.js\";\nexport { interpolatePluginText, resolveCatalogKey, resolvePluginText } from \"./i18n.js\";\n\n// Build-bound logging\nexport type {\n\tPluginLogEntry,\n\tPluginLogFields,\n\tPluginLogIdentity,\n\tPluginLogLevel,\n\tPluginLogger,\n\tPluginLogSink,\n} from \"./logging.js\";\nexport { __createPluginLogger, __setPluginLogSink } from \"./logging.js\";\n\n// Context & lifecycle\nexport type {\n\tPluginPermissionApi,\n\tAgentMode,\n\tPluginActivationCleanup,\n\tPluginContext,\n\tPluginDefinition,\n} from \"./context.js\";\nexport { definePlugin } from \"./context.js\";\n\n// Host bridge (host-injected; plugins use hooks)\nexport type { PluginHostBridge } from \"./host-bridge.js\";\nexport { __setPluginHostBridge } from \"./host-bridge.js\";\n\n// Activity tab context\nexport type { ActivityTabContextValue } from \"./activity-tab.js\";\nexport { __ActivityTabContext, useActivityTab } from \"./activity-tab.js\";\n\n// Bottom panel context\nexport type {\n\tPluginBottomPanelCloseConfirm,\n\tPluginBottomPanelCloseDecision,\n\tPluginBottomPanelCloseReason,\n\tPluginBottomPanelCloseRequest,\n\tPluginBottomPanelContextValue,\n\tPluginBottomPanelMeta,\n\tPluginBottomPanelStatus,\n\tPluginBottomPanelTerminalRequest,\n} from \"./bottom-panel.js\";\nexport { __BottomPanelContext, useBottomPanel } from \"./bottom-panel.js\";\n\n// React hooks\nexport type { PluginI18nContextValue, PluginTranslation } from \"./hooks.js\";\nexport {\n\t__PluginI18nContext,\n\tuseTranslation,\n\tuseActiveConversation,\n\tuseConversationMessages,\n\tuseGenerationMetrics,\n\tusePromptAttachment,\n\tuseSidebarState,\n} from \"./hooks.js\";\n\n// Host-rendered model picker (same component as the chat input bar)\nexport type { PluginModelPickerProps, PluginModelPickerReasoning } from \"./model-picker.js\";\nexport { ModelPicker } from \"./model-picker.js\";\n"]}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAuHtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AA+BxD,OAAO,EAAE,oCAAoC,EAAE,MAAM,YAAY,CAAC;AAelE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAwMxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAM9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAqBnE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAU3D,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAWxF,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAUxE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAIzD,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAazE,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIzE,OAAO,EACN,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,GACf,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["/**\n * @vetta-org/plugin-sdk public surface.\n *\n * Implementation is split by domain under `src/*.ts`; this barrel re-exports\n * the stable package API. Prefer importing from `@vetta-org/plugin-sdk` rather\n * than deep paths.\n */\n\n// Core primitives\nexport type { ConversationScenario } from \"./scenario.js\";\nexport { PLUGIN_PERMISSIONS } from \"./permissions.js\";\nexport type { PluginPermission } from \"./permissions.js\";\nexport type { Disposable } from \"./disposable.js\";\nexport type {\n\tPluginAgentManifest,\n\tPluginBrowserManifest,\n\tPluginCliProviderManifest,\n\tPluginServiceArtifact,\n\tPluginServicePlatform,\n\tPluginServiceProviderManifest,\n\tPluginServiceRuntimeKind,\n\tPluginManifest,\n\tPluginManifestInput,\n\tPluginManifestResourceReference,\n\tPluginMcpServerConfig,\n\tPluginNetworkManifest,\n\tPluginSkillPresentation,\n\tPluginSkillPresentationRule,\n} from \"./manifest.js\";\n\n// File explorer\nexport type {\n\tPluginFileExplorerEntry,\n\tPluginWorkspaceRoot,\n\tPluginFileExplorerWhen,\n\tPluginFileExplorerActionContext,\n\tPluginFileExplorerContextMenuContribution,\n\tPluginFileExplorerToolbarContext,\n\tPluginFileExplorerToolbarContribution,\n\tPluginFileExplorerDecoration,\n\tPluginFileExplorerDecorationProvider,\n\tPluginFileExplorerChange,\n\tPluginFileExplorerRevealOptions,\n\tPluginFileExplorerApi,\n} from \"./file-explorer.js\";\nexport type { PluginFileIconAssociations, PluginFileIconTheme } from \"./file-explorer.js\";\n\n// Conversation\nexport type {\n\tConversationState,\n\tConversationMessage,\n\tConversationEvent,\n\tConversationQueueState,\n\tCreateSessionOptions,\n\tPluginConversationApi,\n\tSendPromptResult,\n} from \"./conversation.js\";\nexport type {\n\tGenerationCallMetrics,\n\tGenerationMetricsSnapshot,\n\tGenerationPhase,\n\tGenerationTokenUsage,\n\tGenerationTurnMetrics,\n} from \"./generation-metrics.js\";\n\n// UI slots\nexport type {\n\tPluginGlobalSlotContribution,\n\tPluginAbilityDetailSlotContribution,\n\tPluginAbilityDetailSlotProps,\n\tPluginNavBadge,\n\tPluginNavBadgeTone,\n\tPluginWorkspaceViewProps,\n\tPluginWorkspaceViewContribution,\n\tPluginWorkspaceViewHeader,\n\tPluginSidebarState,\n\tPluginAudioMetadata,\n\tPluginPreviewUrlOptions,\n\tPluginPreviewFile,\n\tPluginPreviewFileRef,\n\tPluginFilePreviewProps,\n\tPluginFilePreviewContribution,\n\tPluginActivityTabContribution,\n\tPluginActivityTabMeta,\n\tPluginActivityTabMetaResult,\n\tPluginActivityTabScope,\n\tPluginBottomPanelContribution,\n\tPluginActivityTabRetention,\n\tPluginActivityTabTargetOptions,\n\tPluginCaptureRegion,\n\tPluginOpenActivityTabOptions,\n\tPluginPromptDecoration,\n\tPluginInputActionContribution,\n\tPluginHeaderActionContribution,\n\tPluginHeaderActionContext,\n\tPluginHeaderActionMenuItem,\n\tPluginHeaderActionMenuItemKind,\n\tPluginHeaderActionPopover,\n\tPluginHeaderActionPopoverHost,\n\tPluginHeaderActionPopoverProps,\n\tPluginHeaderActionPopoverSize,\n\tPluginHeaderActionState,\n\tPluginHeaderActionSurface,\n\tPluginHeaderActionTone,\n\tPluginNewSessionContext,\n\tPluginNewSessionContextActivation,\n\tPluginNewSessionContextContribution,\n\tPluginNewSessionTarget,\n\tCardDescriptor,\n\tPluginPendingToolCall,\n\tPluginCardProps,\n\tPluginCardRendererContribution,\n\tPluginToolCallSlotToolCall,\n\tPluginToolCallSlotProps,\n\tPluginToolCallSlotContribution,\n\tPluginTurnCardContribution,\n\tPluginNotifyOptions,\n\tPluginUiApi,\n} from \"./ui.js\";\n\n// Keyboard shortcuts (host ShortcutScopeStack)\nexport type {\n\tPluginShortcutScopeKind,\n\tPluginShortcutWhen,\n\tPluginShortcutBinding,\n\tPluginShortcutScopeContribution,\n\tPluginRegisterShortcutScope,\n\tUsePluginShortcutScopeOptions,\n} from \"./shortcuts.js\";\nexport { usePluginShortcutScope } from \"./shortcuts.js\";\n\n// Agent runtime\nexport type {\n\tPluginJsonSchema,\n\tPluginAgentToolApi,\n\tPluginAgentToolRegistration,\n\tPluginSystemPromptBlock,\n\tPluginDynamicSystemPromptOperation,\n\tPluginSystemPromptMessage,\n\tPluginSystemPromptProviderContext,\n\tPluginSystemPromptBlockView,\n\tPluginAgentActions,\n\tPluginAgentHandlerContext,\n\tPluginAgentToolHandler,\n\tPluginCodingAgentHookEvent,\n\tPluginCodingAgentHookEventName,\n\tPluginCodingAgentHookEventOf,\n\tPluginCodingAgentHookHandler,\n\tPluginCodingAgentHookHandlerContext,\n\tPluginCodingAgentHookRegistration,\n\tPluginCodingAgentHookResult,\n\tPluginCodingAgentHookTool,\n\tPluginCodingAgentPermissionMode,\n\tPluginSystemPromptProviderHandler,\n\tPluginSystemPromptProviderRegistration,\n\tPluginContinuationResult,\n\tPluginContinuationHandler,\n\tPluginContinuationRegistration,\n\tPluginAgentApi,\n} from \"./agent.js\";\nexport { PLUGIN_CODING_AGENT_HOOK_EVENT_NAMES } from \"./agent.js\";\n\n// App actions\nexport type {\n\tPluginAppActionEffect,\n\tPluginAppActionExample,\n\tPluginAppActionHandlerContext,\n\tPluginAppActionHandler,\n\tPluginAppActionReadyHandler,\n\tPluginAppActionApprovalPresentation,\n\tPluginAppActionApproval,\n\tPluginAppActionRegistration,\n\tPluginAppActionUsage,\n\tPluginAppActionsApi,\n} from \"./app-actions.js\";\nexport { PluginAppActionError } from \"./app-actions.js\";\n\n// Host-managed AI\nexport type {\n\tPluginAiApi,\n\tPluginAiChatAssistantMessage,\n\tPluginAiChatMessage,\n\tPluginAiChatRequest,\n\tPluginAiChatResult,\n\tPluginAiChatTool,\n\tPluginAiChatToolResultMessage,\n\tPluginAiChatUserMessage,\n\tPluginAiCompleteRequest,\n\tPluginAiCompleteResult,\n\tPluginAiStreamOptions,\n\tPluginAiTextDeltaEvent,\n\tPluginAiModel,\n\tPluginAiModelListResult,\n\tPluginAiToolCall,\n\tPluginAiUsage,\n} from \"./ai.js\";\n\n// Official host capabilities\nexport type {\n\tPluginOfficialGeneralSettings,\n\tPluginOfficialGeneralSettingsUpdate,\n\tPluginOfficialExperimentalSettings,\n\tPluginOfficialImageGenerationSettings,\n\tPluginOfficialImageGenerationSettingsUpdate,\n\tPluginOfficialDownloadItem,\n\tPluginOfficialUpdaterState,\n\tPluginOfficialWebhookKind,\n\tPluginOfficialWebhookEndpoint,\n\tPluginOfficialWebhookProvider,\n\tPluginOfficialWebhookCreateInput,\n\tPluginOfficialWebhookUpdateInput,\n\tPluginOfficialWebhookMessage,\n\tPluginOfficialWebhookSendResult,\n\tPluginOfficialSkillInfo,\n\tPluginOfficialInstalledSkill,\n\tPluginOfficialShortcutBinding,\n\tPluginOfficialImStatus,\n\tPluginOfficialImLog,\n\tPluginOfficialMcpServerSummary,\n\tPluginOfficialMcpTarget,\n\tPluginOfficialMcpServerDetail,\n\tPluginOfficialMcpUpsertData,\n\tPluginOfficialExecutionMode,\n\tPluginOfficialSelectedSkill,\n\tPluginOfficialBatchProjectCreateData,\n\tPluginOfficialBatchProjectUpdateData,\n\tPluginOfficialSchedulerModel,\n\tPluginOfficialSchedulerNotification,\n\tPluginOfficialSchedulerRunTarget,\n\tPluginOfficialSchedulerSchedule,\n\tPluginOfficialSchedulerTaskCreateData,\n\tPluginOfficialSchedulerTaskUpdateData,\n\tPluginOfficialModelSummary,\n\tPluginOfficialProviderSummary,\n\tPluginOfficialProviderDetail,\n\tPluginOfficialProviderUpsertData,\n\tPluginOfficialProjectEntry,\n\tPluginOfficialSessionHandle,\n\tPluginOfficialNavigationOpenInput,\n\tPluginOfficialOpenFilesOptions,\n\tPluginOfficialOpenedFile,\n\tPluginOfficialSessionAccess,\n\tPluginOfficialSessionRunningEvent,\n\tPluginOfficialSessionSummary,\n\tPluginOfficialPluginSummary,\n\tPluginOfficialKnowledgeBase,\n\tPluginOfficialKnowledgeProcessingSettings,\n\tPluginOfficialApi,\n} from \"./official.js\";\n\n// Files / command / images / secrets\nexport type {\n\tPluginFsEntry,\n\tPluginFsFileRef,\n\tPluginFsListFilesRecursiveOptions,\n\tPluginFsBinaryReadResult,\n\tPluginFsStatResult,\n\tPluginFsReadResult,\n\tPluginFsApi,\n} from \"./fs.js\";\nexport type {\n\tPluginCommandRunOptions,\n\tPluginCommandRunResult,\n\tPluginCommandSpawnOptions,\n\tPluginCommandSpawnExit,\n\tPluginCommandSpawnStatus,\n\tPluginCommandSpawnHandle,\n\tPluginCommandApi,\n} from \"./command.js\";\nexport type {\n\tPluginCliProviderApi,\n\tPluginCliProviderPhase,\n\tPluginCliProviderStatus,\n} from \"./cli-provider.js\";\nexport type {\n\tPluginServiceApi,\n\tPluginServiceArtifactPayload,\n\tPluginServiceConnection,\n\tPluginServiceHostPlatform,\n\tPluginServicePhase,\n\tPluginServiceRequest,\n\tPluginServiceResponse,\n\tPluginServiceStatus,\n\tPluginServiceDataEncoding,\n} from \"./service-provider.js\";\nexport type { PluginModelDefinition, PluginModelProviderConfig, PluginModelsApi } from \"./models.js\";\nexport type {\n\tPluginBrowserAction,\n\tPluginBrowserActionResult,\n\tPluginBrowserApi,\n\tPluginBrowserPageState,\n\tPluginBrowserProfile,\n\tPluginBrowserRuntimePhase,\n\tPluginBrowserRuntimeStatus,\n\tPluginBrowserScreenshot,\n\tPluginBrowserSession,\n\tPluginBrowserSessionOptions,\n\tPluginBrowserSessionStatus,\n\tPluginBrowserSnapshot,\n\tPluginBrowserSource,\n\tPluginBrowserTextContent,\n} from \"./browser.js\";\nexport type {\n\tPluginCaptureApi,\n\tPluginOffscreenCaptureOptions,\n\tPluginOffscreenCaptureResult,\n} from \"./capture.js\";\nexport type { PluginImageRef } from \"./images.js\";\nexport type {\n\tPluginArtifactDestination,\n\tPluginArtifactRef,\n\tPluginArtifactsApi,\n\tPluginPersistedArtifact,\n} from \"./artifacts.js\";\nexport type {\n\tPluginJob,\n\tPluginJobFailure,\n\tPluginJobProgress,\n\tPluginJobRef,\n\tPluginJobsApi,\n\tPluginJobStatus,\n\tPluginJobWaitOptions,\n} from \"./jobs.js\";\nexport type {\n\tPluginMediaApi,\n\tPluginMediaArtifact,\n\tPluginMediaCapability,\n\tPluginMediaComposeRequest,\n\tPluginMediaDimensions,\n\tPluginMediaErrorCode,\n\tPluginMediaFailure,\n\tPluginMediaGenerateRequest,\n\tPluginMediaGenerationInputSlot,\n\tPluginMediaGenerationMode,\n\tPluginMediaGenerationModeCapability,\n\tPluginMediaInput,\n\tPluginMediaInputSource,\n\tPluginMediaInputUploadRequest,\n\tPluginMediaJob,\n\tPluginMediaKind,\n\tPluginMediaOperation,\n\tPluginMediaOutput,\n\tPluginMediaOutputKind,\n\tPluginMediaProviderDescriptor,\n\tPluginMediaGenerationModelDescriptor,\n\tPluginMediaProviderArtifact,\n\tPluginMediaProviderArtifactSource,\n\tPluginMediaProviderHandlerContext,\n\tPluginMediaProviderInput,\n\tPluginMediaProviderJob,\n\tPluginMediaProviderRegistration,\n\tPluginMediaProviderSubmitRequest,\n\tPluginMediaSubmitRequest,\n\tPluginMediaTranscodeRequest,\n\tPluginMediaTransferResponse,\n} from \"./media.js\";\n// OCR Provider protocol\nexport type {\n\tOcrBlock,\n\tOcrClient,\n\tOcrErrorCode,\n\tOcrItemResult,\n\tOcrInput,\n\tOcrProgress,\n\tOcrProviderContext,\n\tOcrProviderDescriptor,\n\tOcrProviderInput,\n\tOcrProviderRegistration,\n\tOcrProviderRequest,\n\tOcrProviderResult,\n\tOcrRequest,\n\tOcrResult,\n\tOcrTransferResponse,\n\tOcrUploadRequest,\n} from \"./ocr.js\";\nexport { PluginMediaError } from \"./media.js\";\nexport type {\n\tPluginPromptAttachment,\n\tPluginPromptContext,\n\tPluginPromptContextJsonValue,\n} from \"./prompt-attachment.js\";\nexport { definePluginPromptContext } from \"./prompt-attachment.js\";\nexport type {\n\tPluginNetworkApi,\n\tPluginNetworkBody,\n\tPluginNetworkRequest,\n\tPluginNetworkResponse,\n} from \"./network.js\";\nexport type { PluginGatewayApi, PluginGatewayRequest, PluginGatewayResponse } from \"./gateway.js\";\nexport type {\n\tPluginPutBlobInput,\n\tPluginPutBlobFromFileInput,\n\tPluginStorageApi,\n\tPluginStorageChange,\n\tPluginStorageCommitOptions,\n\tPluginStorageCommitResult,\n\tPluginStorageEncoding,\n\tPluginStorageSnapshot,\n\tPluginStorageWrite,\n\tPluginStoredBlob,\n\tPluginStoredBlobRef,\n} from \"./storage.js\";\nexport { readJsonFile, writeJsonFile } from \"./storage.js\";\nexport type { PluginSecretsApi } from \"./secrets.js\";\n\n// i18n\nexport type {\n\tPluginLocaleCatalog,\n\tPluginLocales,\n\tPluginTranslate,\n\tPluginI18nApi,\n} from \"./i18n.js\";\nexport { interpolatePluginText, resolveCatalogKey, resolvePluginText } from \"./i18n.js\";\n\n// Build-bound logging\nexport type {\n\tPluginLogEntry,\n\tPluginLogFields,\n\tPluginLogIdentity,\n\tPluginLogLevel,\n\tPluginLogger,\n\tPluginLogSink,\n} from \"./logging.js\";\nexport { __createPluginLogger, __setPluginLogSink } from \"./logging.js\";\n\n// Context & lifecycle\nexport type {\n\tPluginPermissionApi,\n\tAgentMode,\n\tPluginActivationCleanup,\n\tPluginContext,\n\tPluginDefinition,\n} from \"./context.js\";\nexport { definePlugin } from \"./context.js\";\n\n// Host bridge (host-injected; plugins use hooks)\nexport type { PluginHostBridge } from \"./host-bridge.js\";\nexport { __setPluginHostBridge } from \"./host-bridge.js\";\n\n// Activity tab context\nexport type { ActivityTabContextValue } from \"./activity-tab.js\";\nexport { __ActivityTabContext, useActivityTab } from \"./activity-tab.js\";\n\n// Bottom panel context\nexport type {\n\tPluginBottomPanelCloseConfirm,\n\tPluginBottomPanelCloseDecision,\n\tPluginBottomPanelCloseReason,\n\tPluginBottomPanelCloseRequest,\n\tPluginBottomPanelContextValue,\n\tPluginBottomPanelMeta,\n\tPluginBottomPanelStatus,\n\tPluginBottomPanelTerminalRequest,\n} from \"./bottom-panel.js\";\nexport { __BottomPanelContext, useBottomPanel } from \"./bottom-panel.js\";\n\n// React hooks\nexport type { PluginI18nContextValue, PluginTranslation } from \"./hooks.js\";\nexport {\n\t__PluginI18nContext,\n\tuseTranslation,\n\tuseActiveConversation,\n\tuseConversationMessages,\n\tuseGenerationMetrics,\n\tusePromptAttachment,\n\tuseSidebarState,\n} from \"./hooks.js\";\n\n// Host-rendered model picker (same component as the chat input bar)\nexport type { PluginModelPickerProps, PluginModelPickerReasoning } from \"./model-picker.js\";\nexport { ModelPicker } from \"./model-picker.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAwHtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AA+BxD,OAAO,EAAE,oCAAoC,EAAE,MAAM,YAAY,CAAC;AAelE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAwMxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAM9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAqBnE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAU3D,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAWxF,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAUxE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAIzD,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAazE,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAIzE,OAAO,EACN,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,GACf,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["/**\n * @vetta-org/plugin-sdk public surface.\n *\n * Implementation is split by domain under `src/*.ts`; this barrel re-exports\n * the stable package API. Prefer importing from `@vetta-org/plugin-sdk` rather\n * than deep paths.\n */\n\n// Core primitives\nexport type { ConversationScenario } from \"./scenario.js\";\nexport { PLUGIN_PERMISSIONS } from \"./permissions.js\";\nexport type { PluginPermission } from \"./permissions.js\";\nexport type { Disposable } from \"./disposable.js\";\nexport type {\n\tPluginAgentManifest,\n\tPluginBrowserManifest,\n\tPluginCliProviderManifest,\n\tPluginServiceArtifact,\n\tPluginServicePlatform,\n\tPluginServiceProviderManifest,\n\tPluginServiceRuntimeKind,\n\tPluginManifest,\n\tPluginManifestInput,\n\tPluginManifestResourceReference,\n\tPluginMcpServerConfig,\n\tPluginNetworkManifest,\n\tPluginSkillPresentation,\n\tPluginSkillPresentationRule,\n} from \"./manifest.js\";\n\n// File explorer\nexport type {\n\tPluginFileExplorerEntry,\n\tPluginWorkspaceRoot,\n\tPluginFileExplorerWhen,\n\tPluginFileExplorerActionContext,\n\tPluginFileExplorerContextMenuContribution,\n\tPluginFileExplorerToolbarContext,\n\tPluginFileExplorerToolbarContribution,\n\tPluginFileExplorerDecoration,\n\tPluginFileExplorerDecorationProvider,\n\tPluginFileExplorerChange,\n\tPluginFileExplorerRevealOptions,\n\tPluginFileExplorerApi,\n} from \"./file-explorer.js\";\nexport type { PluginFileIconAssociations, PluginFileIconTheme } from \"./file-explorer.js\";\n\n// Conversation\nexport type {\n\tConversationState,\n\tConversationMessage,\n\tConversationEvent,\n\tConversationQueueState,\n\tCreateSessionOptions,\n\tPluginConversationApi,\n\tSendPromptResult,\n} from \"./conversation.js\";\nexport type {\n\tGenerationCallMetrics,\n\tGenerationMetricsSnapshot,\n\tGenerationPhase,\n\tGenerationTokenUsage,\n\tGenerationTurnMetrics,\n} from \"./generation-metrics.js\";\n\n// UI slots\nexport type {\n\tPluginGlobalSlotContribution,\n\tPluginAbilityDetailSlotContribution,\n\tPluginAbilityDetailSlotProps,\n\tPluginNavBadge,\n\tPluginNavBadgeTone,\n\tPluginWorkspaceViewProps,\n\tPluginWorkspaceViewContribution,\n\tPluginWorkspaceViewHeader,\n\tPluginSidebarState,\n\tPluginAudioMetadata,\n\tPluginPreviewUrlOptions,\n\tPluginPreviewFile,\n\tPluginPreviewFileRef,\n\tPluginFilePreviewProps,\n\tPluginFilePreviewContribution,\n\tPluginActivityTabContribution,\n\tPluginActivityTabMeta,\n\tPluginActivityTabMetaResult,\n\tPluginActivityTabScope,\n\tPluginBottomPanelContribution,\n\tPluginActivityTabRetention,\n\tPluginActivityTabTargetOptions,\n\tPluginCaptureRegion,\n\tPluginActivityPanelWidthOptions,\n\tPluginOpenActivityTabOptions,\n\tPluginPromptDecoration,\n\tPluginInputActionContribution,\n\tPluginHeaderActionContribution,\n\tPluginHeaderActionContext,\n\tPluginHeaderActionMenuItem,\n\tPluginHeaderActionMenuItemKind,\n\tPluginHeaderActionPopover,\n\tPluginHeaderActionPopoverHost,\n\tPluginHeaderActionPopoverProps,\n\tPluginHeaderActionPopoverSize,\n\tPluginHeaderActionState,\n\tPluginHeaderActionSurface,\n\tPluginHeaderActionTone,\n\tPluginNewSessionContext,\n\tPluginNewSessionContextActivation,\n\tPluginNewSessionContextContribution,\n\tPluginNewSessionTarget,\n\tCardDescriptor,\n\tPluginPendingToolCall,\n\tPluginCardProps,\n\tPluginCardRendererContribution,\n\tPluginToolCallSlotToolCall,\n\tPluginToolCallSlotProps,\n\tPluginToolCallSlotContribution,\n\tPluginTurnCardContribution,\n\tPluginNotifyOptions,\n\tPluginUiApi,\n} from \"./ui.js\";\n\n// Keyboard shortcuts (host ShortcutScopeStack)\nexport type {\n\tPluginShortcutScopeKind,\n\tPluginShortcutWhen,\n\tPluginShortcutBinding,\n\tPluginShortcutScopeContribution,\n\tPluginRegisterShortcutScope,\n\tUsePluginShortcutScopeOptions,\n} from \"./shortcuts.js\";\nexport { usePluginShortcutScope } from \"./shortcuts.js\";\n\n// Agent runtime\nexport type {\n\tPluginJsonSchema,\n\tPluginAgentToolApi,\n\tPluginAgentToolRegistration,\n\tPluginSystemPromptBlock,\n\tPluginDynamicSystemPromptOperation,\n\tPluginSystemPromptMessage,\n\tPluginSystemPromptProviderContext,\n\tPluginSystemPromptBlockView,\n\tPluginAgentActions,\n\tPluginAgentHandlerContext,\n\tPluginAgentToolHandler,\n\tPluginCodingAgentHookEvent,\n\tPluginCodingAgentHookEventName,\n\tPluginCodingAgentHookEventOf,\n\tPluginCodingAgentHookHandler,\n\tPluginCodingAgentHookHandlerContext,\n\tPluginCodingAgentHookRegistration,\n\tPluginCodingAgentHookResult,\n\tPluginCodingAgentHookTool,\n\tPluginCodingAgentPermissionMode,\n\tPluginSystemPromptProviderHandler,\n\tPluginSystemPromptProviderRegistration,\n\tPluginContinuationResult,\n\tPluginContinuationHandler,\n\tPluginContinuationRegistration,\n\tPluginAgentApi,\n} from \"./agent.js\";\nexport { PLUGIN_CODING_AGENT_HOOK_EVENT_NAMES } from \"./agent.js\";\n\n// App actions\nexport type {\n\tPluginAppActionEffect,\n\tPluginAppActionExample,\n\tPluginAppActionHandlerContext,\n\tPluginAppActionHandler,\n\tPluginAppActionReadyHandler,\n\tPluginAppActionApprovalPresentation,\n\tPluginAppActionApproval,\n\tPluginAppActionRegistration,\n\tPluginAppActionUsage,\n\tPluginAppActionsApi,\n} from \"./app-actions.js\";\nexport { PluginAppActionError } from \"./app-actions.js\";\n\n// Host-managed AI\nexport type {\n\tPluginAiApi,\n\tPluginAiChatAssistantMessage,\n\tPluginAiChatMessage,\n\tPluginAiChatRequest,\n\tPluginAiChatResult,\n\tPluginAiChatTool,\n\tPluginAiChatToolResultMessage,\n\tPluginAiChatUserMessage,\n\tPluginAiCompleteRequest,\n\tPluginAiCompleteResult,\n\tPluginAiStreamOptions,\n\tPluginAiTextDeltaEvent,\n\tPluginAiModel,\n\tPluginAiModelListResult,\n\tPluginAiToolCall,\n\tPluginAiUsage,\n} from \"./ai.js\";\n\n// Official host capabilities\nexport type {\n\tPluginOfficialGeneralSettings,\n\tPluginOfficialGeneralSettingsUpdate,\n\tPluginOfficialExperimentalSettings,\n\tPluginOfficialImageGenerationSettings,\n\tPluginOfficialImageGenerationSettingsUpdate,\n\tPluginOfficialDownloadItem,\n\tPluginOfficialUpdaterState,\n\tPluginOfficialWebhookKind,\n\tPluginOfficialWebhookEndpoint,\n\tPluginOfficialWebhookProvider,\n\tPluginOfficialWebhookCreateInput,\n\tPluginOfficialWebhookUpdateInput,\n\tPluginOfficialWebhookMessage,\n\tPluginOfficialWebhookSendResult,\n\tPluginOfficialSkillInfo,\n\tPluginOfficialInstalledSkill,\n\tPluginOfficialShortcutBinding,\n\tPluginOfficialImStatus,\n\tPluginOfficialImLog,\n\tPluginOfficialMcpServerSummary,\n\tPluginOfficialMcpTarget,\n\tPluginOfficialMcpServerDetail,\n\tPluginOfficialMcpUpsertData,\n\tPluginOfficialExecutionMode,\n\tPluginOfficialSelectedSkill,\n\tPluginOfficialBatchProjectCreateData,\n\tPluginOfficialBatchProjectUpdateData,\n\tPluginOfficialSchedulerModel,\n\tPluginOfficialSchedulerNotification,\n\tPluginOfficialSchedulerRunTarget,\n\tPluginOfficialSchedulerSchedule,\n\tPluginOfficialSchedulerTaskCreateData,\n\tPluginOfficialSchedulerTaskUpdateData,\n\tPluginOfficialModelSummary,\n\tPluginOfficialProviderSummary,\n\tPluginOfficialProviderDetail,\n\tPluginOfficialProviderUpsertData,\n\tPluginOfficialProjectEntry,\n\tPluginOfficialSessionHandle,\n\tPluginOfficialNavigationOpenInput,\n\tPluginOfficialOpenFilesOptions,\n\tPluginOfficialOpenedFile,\n\tPluginOfficialSessionAccess,\n\tPluginOfficialSessionRunningEvent,\n\tPluginOfficialSessionSummary,\n\tPluginOfficialPluginSummary,\n\tPluginOfficialKnowledgeBase,\n\tPluginOfficialKnowledgeProcessingSettings,\n\tPluginOfficialApi,\n} from \"./official.js\";\n\n// Files / command / images / secrets\nexport type {\n\tPluginFsEntry,\n\tPluginFsFileRef,\n\tPluginFsListFilesRecursiveOptions,\n\tPluginFsBinaryReadResult,\n\tPluginFsStatResult,\n\tPluginFsReadResult,\n\tPluginFsApi,\n} from \"./fs.js\";\nexport type {\n\tPluginCommandRunOptions,\n\tPluginCommandRunResult,\n\tPluginCommandSpawnOptions,\n\tPluginCommandSpawnExit,\n\tPluginCommandSpawnStatus,\n\tPluginCommandSpawnHandle,\n\tPluginCommandApi,\n} from \"./command.js\";\nexport type {\n\tPluginCliProviderApi,\n\tPluginCliProviderPhase,\n\tPluginCliProviderStatus,\n} from \"./cli-provider.js\";\nexport type {\n\tPluginServiceApi,\n\tPluginServiceArtifactPayload,\n\tPluginServiceConnection,\n\tPluginServiceHostPlatform,\n\tPluginServicePhase,\n\tPluginServiceRequest,\n\tPluginServiceResponse,\n\tPluginServiceStatus,\n\tPluginServiceDataEncoding,\n} from \"./service-provider.js\";\nexport type { PluginModelDefinition, PluginModelProviderConfig, PluginModelsApi } from \"./models.js\";\nexport type {\n\tPluginBrowserAction,\n\tPluginBrowserActionResult,\n\tPluginBrowserApi,\n\tPluginBrowserPageState,\n\tPluginBrowserProfile,\n\tPluginBrowserRuntimePhase,\n\tPluginBrowserRuntimeStatus,\n\tPluginBrowserScreenshot,\n\tPluginBrowserSession,\n\tPluginBrowserSessionOptions,\n\tPluginBrowserSessionStatus,\n\tPluginBrowserSnapshot,\n\tPluginBrowserSource,\n\tPluginBrowserTextContent,\n} from \"./browser.js\";\nexport type {\n\tPluginCaptureApi,\n\tPluginOffscreenCaptureOptions,\n\tPluginOffscreenCaptureResult,\n} from \"./capture.js\";\nexport type { PluginImageRef } from \"./images.js\";\nexport type {\n\tPluginArtifactDestination,\n\tPluginArtifactRef,\n\tPluginArtifactsApi,\n\tPluginPersistedArtifact,\n} from \"./artifacts.js\";\nexport type {\n\tPluginJob,\n\tPluginJobFailure,\n\tPluginJobProgress,\n\tPluginJobRef,\n\tPluginJobsApi,\n\tPluginJobStatus,\n\tPluginJobWaitOptions,\n} from \"./jobs.js\";\nexport type {\n\tPluginMediaApi,\n\tPluginMediaArtifact,\n\tPluginMediaCapability,\n\tPluginMediaComposeRequest,\n\tPluginMediaDimensions,\n\tPluginMediaErrorCode,\n\tPluginMediaFailure,\n\tPluginMediaGenerateRequest,\n\tPluginMediaGenerationInputSlot,\n\tPluginMediaGenerationMode,\n\tPluginMediaGenerationModeCapability,\n\tPluginMediaInput,\n\tPluginMediaInputSource,\n\tPluginMediaInputUploadRequest,\n\tPluginMediaJob,\n\tPluginMediaKind,\n\tPluginMediaOperation,\n\tPluginMediaOutput,\n\tPluginMediaOutputKind,\n\tPluginMediaProviderDescriptor,\n\tPluginMediaGenerationModelDescriptor,\n\tPluginMediaProviderArtifact,\n\tPluginMediaProviderArtifactSource,\n\tPluginMediaProviderHandlerContext,\n\tPluginMediaProviderInput,\n\tPluginMediaProviderJob,\n\tPluginMediaProviderRegistration,\n\tPluginMediaProviderSubmitRequest,\n\tPluginMediaSubmitRequest,\n\tPluginMediaTranscodeRequest,\n\tPluginMediaTransferResponse,\n} from \"./media.js\";\n// OCR Provider protocol\nexport type {\n\tOcrBlock,\n\tOcrClient,\n\tOcrErrorCode,\n\tOcrItemResult,\n\tOcrInput,\n\tOcrProgress,\n\tOcrProviderContext,\n\tOcrProviderDescriptor,\n\tOcrProviderInput,\n\tOcrProviderRegistration,\n\tOcrProviderRequest,\n\tOcrProviderResult,\n\tOcrRequest,\n\tOcrResult,\n\tOcrTransferResponse,\n\tOcrUploadRequest,\n} from \"./ocr.js\";\nexport { PluginMediaError } from \"./media.js\";\nexport type {\n\tPluginPromptAttachment,\n\tPluginPromptContext,\n\tPluginPromptContextJsonValue,\n} from \"./prompt-attachment.js\";\nexport { definePluginPromptContext } from \"./prompt-attachment.js\";\nexport type {\n\tPluginNetworkApi,\n\tPluginNetworkBody,\n\tPluginNetworkRequest,\n\tPluginNetworkResponse,\n} from \"./network.js\";\nexport type { PluginGatewayApi, PluginGatewayRequest, PluginGatewayResponse } from \"./gateway.js\";\nexport type {\n\tPluginPutBlobInput,\n\tPluginPutBlobFromFileInput,\n\tPluginStorageApi,\n\tPluginStorageChange,\n\tPluginStorageCommitOptions,\n\tPluginStorageCommitResult,\n\tPluginStorageEncoding,\n\tPluginStorageSnapshot,\n\tPluginStorageWrite,\n\tPluginStoredBlob,\n\tPluginStoredBlobRef,\n} from \"./storage.js\";\nexport { readJsonFile, writeJsonFile } from \"./storage.js\";\nexport type { PluginSecretsApi } from \"./secrets.js\";\n\n// i18n\nexport type {\n\tPluginLocaleCatalog,\n\tPluginLocales,\n\tPluginTranslate,\n\tPluginI18nApi,\n} from \"./i18n.js\";\nexport { interpolatePluginText, resolveCatalogKey, resolvePluginText } from \"./i18n.js\";\n\n// Build-bound logging\nexport type {\n\tPluginLogEntry,\n\tPluginLogFields,\n\tPluginLogIdentity,\n\tPluginLogLevel,\n\tPluginLogger,\n\tPluginLogSink,\n} from \"./logging.js\";\nexport { __createPluginLogger, __setPluginLogSink } from \"./logging.js\";\n\n// Context & lifecycle\nexport type {\n\tPluginPermissionApi,\n\tAgentMode,\n\tPluginActivationCleanup,\n\tPluginContext,\n\tPluginDefinition,\n} from \"./context.js\";\nexport { definePlugin } from \"./context.js\";\n\n// Host bridge (host-injected; plugins use hooks)\nexport type { PluginHostBridge } from \"./host-bridge.js\";\nexport { __setPluginHostBridge } from \"./host-bridge.js\";\n\n// Activity tab context\nexport type { ActivityTabContextValue } from \"./activity-tab.js\";\nexport { __ActivityTabContext, useActivityTab } from \"./activity-tab.js\";\n\n// Bottom panel context\nexport type {\n\tPluginBottomPanelCloseConfirm,\n\tPluginBottomPanelCloseDecision,\n\tPluginBottomPanelCloseReason,\n\tPluginBottomPanelCloseRequest,\n\tPluginBottomPanelContextValue,\n\tPluginBottomPanelMeta,\n\tPluginBottomPanelStatus,\n\tPluginBottomPanelTerminalRequest,\n} from \"./bottom-panel.js\";\nexport { __BottomPanelContext, useBottomPanel } from \"./bottom-panel.js\";\n\n// React hooks\nexport type { PluginI18nContextValue, PluginTranslation } from \"./hooks.js\";\nexport {\n\t__PluginI18nContext,\n\tuseTranslation,\n\tuseActiveConversation,\n\tuseConversationMessages,\n\tuseGenerationMetrics,\n\tusePromptAttachment,\n\tuseSidebarState,\n} from \"./hooks.js\";\n\n// Host-rendered model picker (same component as the chat input bar)\nexport type { PluginModelPickerProps, PluginModelPickerReasoning } from \"./model-picker.js\";\nexport { ModelPicker } from \"./model-picker.js\";\n"]}
|
package/dist/ui.d.ts
CHANGED
|
@@ -264,6 +264,14 @@ export interface PluginActivityTabMeta {
|
|
|
264
264
|
/** {@link PluginActivityTabContribution.useMeta} 的返回:null = 本帧不进入候选。 */
|
|
265
265
|
export type PluginActivityTabMetaResult = PluginActivityTabMeta | null;
|
|
266
266
|
export interface PluginActivityTabContribution {
|
|
267
|
+
/**
|
|
268
|
+
* 这张卡需要的面板宽度:像素值,或 `"max"`(跟随窗口拉满)。画布、预览这类宽内容卡声明它。
|
|
269
|
+
*
|
|
270
|
+
* 面板宽度按选中的标签卡决定:声明了 `defaultWidth` 的卡用它自己的宽度,用户在它上面拖出的
|
|
271
|
+
* 宽度也只记在这张卡上;没声明的卡共用用户给普通卡定的宽度(默认 360)。用户拖过就以用户为准,
|
|
272
|
+
* 双击分隔条回到这里声明的值。Plugin API `^2.14.0`;旧宿主忽略。
|
|
273
|
+
*/
|
|
274
|
+
defaultWidth?: number | "max";
|
|
267
275
|
/**
|
|
268
276
|
* 标签栏上的默认相对位置,越小越靠前;缺省 100(排在全部内置标签卡之后)。
|
|
269
277
|
*
|
|
@@ -364,18 +372,39 @@ export interface PluginActivityTabTargetOptions {
|
|
|
364
372
|
/** Options for {@link PluginUiApi.openActivityTab}. */
|
|
365
373
|
export interface PluginOpenActivityTabOptions extends PluginActivityTabTargetOptions {
|
|
366
374
|
/**
|
|
367
|
-
*
|
|
368
|
-
*
|
|
369
|
-
* user drags the divider. The host clamps to its min/max bounds. Omit to keep
|
|
370
|
-
* the user's current width.
|
|
375
|
+
* The width this tab wants: a pixel number, or `"max"` to track the widest
|
|
376
|
+
* the window allows. The host clamps to its min/max bounds.
|
|
371
377
|
*
|
|
372
|
-
*
|
|
373
|
-
*
|
|
374
|
-
*
|
|
375
|
-
*
|
|
376
|
-
*
|
|
378
|
+
* Since Plugin API `^2.14.0` this is the tab's **default** width (same as
|
|
379
|
+
* `defaultWidth` on registration, which is the preferred place to declare
|
|
380
|
+
* it): the panel width follows the selected tab, a width the user dragged on
|
|
381
|
+
* this tab always wins, and other tabs keep their own widths. Repeating the
|
|
382
|
+
* call (including `activate` replays) never overrides the user. When this
|
|
383
|
+
* call opens the panel, it slides in at the tab's width in one motion. Older
|
|
384
|
+
* hosts apply it only on first attach or when opening a closed panel.
|
|
377
385
|
*/
|
|
378
386
|
width?: number | "max";
|
|
387
|
+
/**
|
|
388
|
+
* The session on whose behalf the tab opens — pass `session.id` from the
|
|
389
|
+
* tool handler context. When that session is not the one the user is
|
|
390
|
+
* looking at (several conversations running at once), the host only puts
|
|
391
|
+
* the tab on that session's tab bar — it does not open the panel, switch
|
|
392
|
+
* its tab or resize it in front of the user, and switching to that session
|
|
393
|
+
* later does not open it either: the user opens it from the tab bar (guide
|
|
394
|
+
* them with a turn card if needed). Omit for calls the user triggered
|
|
395
|
+
* directly (a button or menu in the foreground), which always open.
|
|
396
|
+
* Plugin API `^2.14.0`; older hosts ignore it and open immediately.
|
|
397
|
+
*/
|
|
398
|
+
sessionId?: string;
|
|
399
|
+
}
|
|
400
|
+
/** Options for {@link PluginUiApi.setActivityPanelWidth}. */
|
|
401
|
+
export interface PluginActivityPanelWidthOptions {
|
|
402
|
+
/**
|
|
403
|
+
* Same as {@link PluginOpenActivityTabOptions.sessionId}: when that session
|
|
404
|
+
* is in the background the call is ignored, so it never resizes the panel
|
|
405
|
+
* the user is looking at. Plugin API `^2.14.0`; older hosts ignore it.
|
|
406
|
+
*/
|
|
407
|
+
sessionId?: string;
|
|
379
408
|
}
|
|
380
409
|
export interface PluginCaptureRegion {
|
|
381
410
|
x: number;
|
|
@@ -940,7 +969,9 @@ export interface PluginUiApi {
|
|
|
940
969
|
* to leave the user's current width untouched.
|
|
941
970
|
*
|
|
942
971
|
* Omit `options.cwd` for the conversation currently displayed by the host.
|
|
943
|
-
* Tool handlers and background work should pass their session cwd explicitly
|
|
972
|
+
* Tool handlers and background work should pass their session cwd explicitly,
|
|
973
|
+
* together with `options.sessionId`, so a tool running in a background
|
|
974
|
+
* conversation does not grab the panel the user is looking at.
|
|
944
975
|
*/
|
|
945
976
|
openActivityTab(tabId: string, options?: PluginOpenActivityTabOptions): void;
|
|
946
977
|
/**
|
|
@@ -956,18 +987,22 @@ export interface PluginUiApi {
|
|
|
956
987
|
*/
|
|
957
988
|
setActivityTabVisible(tabId: string, visible: boolean, options?: PluginActivityTabTargetOptions): void;
|
|
958
989
|
/**
|
|
959
|
-
*
|
|
960
|
-
*
|
|
961
|
-
*
|
|
962
|
-
* `"max"` 是一种持续状态而非一次性求值:窗口尺寸变化时面板跟着变宽变窄,直到
|
|
963
|
-
* 用户拖动分隔条或有人写入具体像素为止。传数字则是一次性的固定宽度。
|
|
990
|
+
* 给本插件**正在显示的**标签卡一个临时宽度:像素值,或 `"max"`(跟随窗口拉满,宿主仍会
|
|
991
|
+
* 夹到 min/max 内,必要时自动收起侧边栏)。用于标签卡内部切换模式时(如进出全宽的图谱视图)。
|
|
964
992
|
*
|
|
965
|
-
*
|
|
966
|
-
*
|
|
967
|
-
*
|
|
968
|
-
*
|
|
993
|
+
* Plugin API `^2.14.0` 起:只在面板当前选中的是本插件的卡时生效;切走这张卡即失效、
|
|
994
|
+
* 不落盘,也不改用户给面板定的宽度(用户拖一下就以用户为准)。这张卡**一直**需要的宽度
|
|
995
|
+
* 请用注册时的 `defaultWidth` 声明,不要在挂载时调用本方法——那样每次激活都会冲掉用户
|
|
996
|
+
* 在这张卡上拖出的宽度。旧宿主上它直接改面板宽度。
|
|
997
|
+
*/
|
|
998
|
+
setActivityPanelWidth(width: number | "max", options?: PluginActivityPanelWidthOptions): void;
|
|
999
|
+
/**
|
|
1000
|
+
* 这个会话此刻是否在用户眼前:普通会话就是正在显示的那一个,团队会话里任一成员都算。
|
|
1001
|
+
* 传工具 handler 上下文里的 `session.id`。用来决定一个工具的副作用该不该落到用户
|
|
1002
|
+
* 眼前的界面上(例如把画布切到刚建好的设计),同时跑着几个会话时尤其要分清。
|
|
1003
|
+
* Plugin API `^2.14.0`;旧宿主没有这个方法,调用前先判断是否存在。
|
|
969
1004
|
*/
|
|
970
|
-
|
|
1005
|
+
isSessionInView?(sessionId: string): boolean;
|
|
971
1006
|
/**
|
|
972
1007
|
* Bind or clear plugin-owned context for outgoing prompts. The host renders
|
|
973
1008
|
* its label/icon and carries a structured `context` as a versioned snapshot.
|
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,mB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BAAkB,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 * (`labelRole: \"readout\"` 不受 4 格限制,见下)。\n\t */\n\tlabel?: string;\n\t/**\n\t * 文字的角色。默认 `\"caption\"`:文字是按钮名称的补充,顶栏超过 4 格时收起。\n\t * `\"readout\"`:文字就是要展示的、随时间变化的状态值(如 `≈123 tok/s`),顶栏超过 4 格时仍显示,\n\t * 被 `promoteWhenActive` 露出时也显示;被收纳或页头挤窄时照样只剩图标,所以读数仍要写进 `title`。\n\t * 只给读数用,命令名称不要标成 readout。Plugin API `^2.13.0`;旧宿主忽略此字段,表现与 `\"caption\"` 相同。\n\t */\n\tlabelRole?: \"caption\" | \"readout\";\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"]}
|
|
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,0DAA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AAE,MAAM,GAAG,OAAO,CAAC;IAC7C;;;;;OAKG;IACH,mBAAmB,CAAC,UAAU,EAAE,sBAAsB,GAAG,IAAI,GAAG,IAAI,CAAC;IACrE;;;;;;OAMG;IACH,YAAY,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IAClE;;;;;;;;;;;;;OAaG;IACH,WAAW,CAAC,IAAI,EAAE,oBAAoB,EAAE,KAAK,CAAC,EAAE,oBAAoB,EAAE,GAAG,IAAI,CAAC;IAC9E;;;;OAIG;IACH,aAAa,CAAC,IAAI,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC1F;;;;;OAKG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C;;;;;OAKG;IACH,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC;;;;;;;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 * 这张卡需要的面板宽度:像素值,或 `\"max\"`(跟随窗口拉满)。画布、预览这类宽内容卡声明它。\n\t *\n\t * 面板宽度按选中的标签卡决定:声明了 `defaultWidth` 的卡用它自己的宽度,用户在它上面拖出的\n\t * 宽度也只记在这张卡上;没声明的卡共用用户给普通卡定的宽度(默认 360)。用户拖过就以用户为准,\n\t * 双击分隔条回到这里声明的值。Plugin API `^2.14.0`;旧宿主忽略。\n\t */\n\tdefaultWidth?: number | \"max\";\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 * The width this tab wants: a pixel number, or `\"max\"` to track the widest\n\t * the window allows. The host clamps to its min/max bounds.\n\t *\n\t * Since Plugin API `^2.14.0` this is the tab's **default** width (same as\n\t * `defaultWidth` on registration, which is the preferred place to declare\n\t * it): the panel width follows the selected tab, a width the user dragged on\n\t * this tab always wins, and other tabs keep their own widths. Repeating the\n\t * call (including `activate` replays) never overrides the user. When this\n\t * call opens the panel, it slides in at the tab's width in one motion. Older\n\t * hosts apply it only on first attach or when opening a closed panel.\n\t */\n\twidth?: number | \"max\";\n\t/**\n\t * The session on whose behalf the tab opens — pass `session.id` from the\n\t * tool handler context. When that session is not the one the user is\n\t * looking at (several conversations running at once), the host only puts\n\t * the tab on that session's tab bar — it does not open the panel, switch\n\t * its tab or resize it in front of the user, and switching to that session\n\t * later does not open it either: the user opens it from the tab bar (guide\n\t * them with a turn card if needed). Omit for calls the user triggered\n\t * directly (a button or menu in the foreground), which always open.\n\t * Plugin API `^2.14.0`; older hosts ignore it and open immediately.\n\t */\n\tsessionId?: string;\n}\n\n/** Options for {@link PluginUiApi.setActivityPanelWidth}. */\nexport interface PluginActivityPanelWidthOptions {\n\t/**\n\t * Same as {@link PluginOpenActivityTabOptions.sessionId}: when that session\n\t * is in the background the call is ignored, so it never resizes the panel\n\t * the user is looking at. Plugin API `^2.14.0`; older hosts ignore it.\n\t */\n\tsessionId?: string;\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 * (`labelRole: \"readout\"` 不受 4 格限制,见下)。\n\t */\n\tlabel?: string;\n\t/**\n\t * 文字的角色。默认 `\"caption\"`:文字是按钮名称的补充,顶栏超过 4 格时收起。\n\t * `\"readout\"`:文字就是要展示的、随时间变化的状态值(如 `≈123 tok/s`),顶栏超过 4 格时仍显示,\n\t * 被 `promoteWhenActive` 露出时也显示;被收纳或页头挤窄时照样只剩图标,所以读数仍要写进 `title`。\n\t * 只给读数用,命令名称不要标成 readout。Plugin API `^2.13.0`;旧宿主忽略此字段,表现与 `\"caption\"` 相同。\n\t */\n\tlabelRole?: \"caption\" | \"readout\";\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 * together with `options.sessionId`, so a tool running in a background\n\t * conversation does not grab the panel the user is looking at.\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 * Plugin API `^2.14.0` 起:只在面板当前选中的是本插件的卡时生效;切走这张卡即失效、\n\t * 不落盘,也不改用户给面板定的宽度(用户拖一下就以用户为准)。这张卡**一直**需要的宽度\n\t * 请用注册时的 `defaultWidth` 声明,不要在挂载时调用本方法——那样每次激活都会冲掉用户\n\t * 在这张卡上拖出的宽度。旧宿主上它直接改面板宽度。\n\t */\n\tsetActivityPanelWidth(width: number | \"max\", options?: PluginActivityPanelWidthOptions): void;\n\t/**\n\t * 这个会话此刻是否在用户眼前:普通会话就是正在显示的那一个,团队会话里任一成员都算。\n\t * 传工具 handler 上下文里的 `session.id`。用来决定一个工具的副作用该不该落到用户\n\t * 眼前的界面上(例如把画布切到刚建好的设计),同时跑着几个会话时尤其要分清。\n\t * Plugin API `^2.14.0`;旧宿主没有这个方法,调用前先判断是否存在。\n\t */\n\tisSessionInView?(sessionId: string): boolean;\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"]}
|
package/dist/ui.js.map
CHANGED
|
@@ -1 +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 { 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 * (`labelRole: \"readout\"` 不受 4 格限制,见下)。\n\t */\n\tlabel?: string;\n\t/**\n\t * 文字的角色。默认 `\"caption\"`:文字是按钮名称的补充,顶栏超过 4 格时收起。\n\t * `\"readout\"`:文字就是要展示的、随时间变化的状态值(如 `≈123 tok/s`),顶栏超过 4 格时仍显示,\n\t * 被 `promoteWhenActive` 露出时也显示;被收纳或页头挤窄时照样只剩图标,所以读数仍要写进 `title`。\n\t * 只给读数用,命令名称不要标成 readout。Plugin API `^2.13.0`;旧宿主忽略此字段,表现与 `\"caption\"` 相同。\n\t */\n\tlabelRole?: \"caption\" | \"readout\";\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"]}
|
|
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 { 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 * 这张卡需要的面板宽度:像素值,或 `\"max\"`(跟随窗口拉满)。画布、预览这类宽内容卡声明它。\n\t *\n\t * 面板宽度按选中的标签卡决定:声明了 `defaultWidth` 的卡用它自己的宽度,用户在它上面拖出的\n\t * 宽度也只记在这张卡上;没声明的卡共用用户给普通卡定的宽度(默认 360)。用户拖过就以用户为准,\n\t * 双击分隔条回到这里声明的值。Plugin API `^2.14.0`;旧宿主忽略。\n\t */\n\tdefaultWidth?: number | \"max\";\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 * The width this tab wants: a pixel number, or `\"max\"` to track the widest\n\t * the window allows. The host clamps to its min/max bounds.\n\t *\n\t * Since Plugin API `^2.14.0` this is the tab's **default** width (same as\n\t * `defaultWidth` on registration, which is the preferred place to declare\n\t * it): the panel width follows the selected tab, a width the user dragged on\n\t * this tab always wins, and other tabs keep their own widths. Repeating the\n\t * call (including `activate` replays) never overrides the user. When this\n\t * call opens the panel, it slides in at the tab's width in one motion. Older\n\t * hosts apply it only on first attach or when opening a closed panel.\n\t */\n\twidth?: number | \"max\";\n\t/**\n\t * The session on whose behalf the tab opens — pass `session.id` from the\n\t * tool handler context. When that session is not the one the user is\n\t * looking at (several conversations running at once), the host only puts\n\t * the tab on that session's tab bar — it does not open the panel, switch\n\t * its tab or resize it in front of the user, and switching to that session\n\t * later does not open it either: the user opens it from the tab bar (guide\n\t * them with a turn card if needed). Omit for calls the user triggered\n\t * directly (a button or menu in the foreground), which always open.\n\t * Plugin API `^2.14.0`; older hosts ignore it and open immediately.\n\t */\n\tsessionId?: string;\n}\n\n/** Options for {@link PluginUiApi.setActivityPanelWidth}. */\nexport interface PluginActivityPanelWidthOptions {\n\t/**\n\t * Same as {@link PluginOpenActivityTabOptions.sessionId}: when that session\n\t * is in the background the call is ignored, so it never resizes the panel\n\t * the user is looking at. Plugin API `^2.14.0`; older hosts ignore it.\n\t */\n\tsessionId?: string;\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 * (`labelRole: \"readout\"` 不受 4 格限制,见下)。\n\t */\n\tlabel?: string;\n\t/**\n\t * 文字的角色。默认 `\"caption\"`:文字是按钮名称的补充,顶栏超过 4 格时收起。\n\t * `\"readout\"`:文字就是要展示的、随时间变化的状态值(如 `≈123 tok/s`),顶栏超过 4 格时仍显示,\n\t * 被 `promoteWhenActive` 露出时也显示;被收纳或页头挤窄时照样只剩图标,所以读数仍要写进 `title`。\n\t * 只给读数用,命令名称不要标成 readout。Plugin API `^2.13.0`;旧宿主忽略此字段,表现与 `\"caption\"` 相同。\n\t */\n\tlabelRole?: \"caption\" | \"readout\";\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 * together with `options.sessionId`, so a tool running in a background\n\t * conversation does not grab the panel the user is looking at.\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 * Plugin API `^2.14.0` 起:只在面板当前选中的是本插件的卡时生效;切走这张卡即失效、\n\t * 不落盘,也不改用户给面板定的宽度(用户拖一下就以用户为准)。这张卡**一直**需要的宽度\n\t * 请用注册时的 `defaultWidth` 声明,不要在挂载时调用本方法——那样每次激活都会冲掉用户\n\t * 在这张卡上拖出的宽度。旧宿主上它直接改面板宽度。\n\t */\n\tsetActivityPanelWidth(width: number | \"max\", options?: PluginActivityPanelWidthOptions): void;\n\t/**\n\t * 这个会话此刻是否在用户眼前:普通会话就是正在显示的那一个,团队会话里任一成员都算。\n\t * 传工具 handler 上下文里的 `session.id`。用来决定一个工具的副作用该不该落到用户\n\t * 眼前的界面上(例如把画布切到刚建好的设计),同时跑着几个会话时尤其要分清。\n\t * Plugin API `^2.14.0`;旧宿主没有这个方法,调用前先判断是否存在。\n\t */\n\tisSessionInView?(sessionId: string): boolean;\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"]}
|
|
@@ -512,12 +512,14 @@ interface PluginCaptureApi {
|
|
|
512
512
|
timeoutMs?: number; // 整体超时(上限 60s)
|
|
513
513
|
format?: "jpeg" | "png";
|
|
514
514
|
quality?: number; // 仅 jpeg,0–1
|
|
515
|
+
pixelRatio?: number; // 期望的设备像素比(只升不降,上限 4);旧宿主忽略
|
|
515
516
|
}): Promise<{ dataUrl: string; scaleFactor: number }>;
|
|
516
517
|
releaseOffscreen(sessionKey: string): Promise<void>; // 幂等;下次同 key 重新加载
|
|
517
518
|
}
|
|
518
519
|
```
|
|
519
520
|
|
|
520
|
-
- `scaleFactor`
|
|
521
|
+
- `scaleFactor` 是实际设备像素比。不传 `pixelRatio` 时跟随主显示器(Retina 为 2)。
|
|
522
|
+
- `pixelRatio` 用于需要比屏幕更锐的交付图:宿主把窗口与页面缩放同时放大,页面看到的 CSS 视口不变,只有位图更密。显示器本身已够就按显示器出;放大后窗口边长超出宿主上限时自动降低,实际倍率以 `scaleFactor` 为准。缩放按 `sessionKey` 隔离,需要指定倍率时请带 `sessionKey`(一次性请求共用一个分区,倍率不同的并发请求可能互相影响)。
|
|
521
523
|
- 会话窗口闲置约 30s 自动回收;插件禁用/卸载/重载、App 退出时统一清扫;每插件并存会话上限 4。
|
|
522
524
|
- `readyExpression` 求值抛错按「未就绪」处理并继续轮询,直到超时。
|
|
523
525
|
|
package/docs/ui-slots.md
CHANGED
|
@@ -442,16 +442,20 @@ ctx.ui.registerActivityTab({
|
|
|
442
442
|
### openActivityTab
|
|
443
443
|
|
|
444
444
|
```ts
|
|
445
|
-
ctx.ui.openActivityTab(tabId, options?: { width?: number | "max"; cwd?: string });
|
|
445
|
+
ctx.ui.openActivityTab(tabId, options?: { width?: number | "max"; cwd?: string; sessionId?: string });
|
|
446
446
|
```
|
|
447
447
|
|
|
448
448
|
编程方式 attach(如需)并激活本插件某个 tab;`width: "max"` 尽量拉满(宿主仍 clamp)。载荷经插件自己的内存状态传递。缺省作用于宿主当前显示的会话;tool handler 与后台任务应传入触发会话的 `cwd`,避免异步执行期间用户切换前台后串写到别的项目。
|
|
449
449
|
|
|
450
|
+
tool handler 还应传 `sessionId: session.id`(Plugin API `^2.14.0`)。用户可能同时开着好几个会话,面板开合与宽度却是全局一份:请求来自用户正在看的会话时照常打开;来自后台会话时宿主只把 tab 上到那个会话的标签栏,不在用户眼前打开面板、切走标签卡或改宽度;用户之后切到那个会话也不会自动展开——切换会话从不替用户打开面板,需要引导时用 turn 卡放一个入口。用户在前台点按钮、菜单触发的打开不传 `sessionId`,总是立即打开。`setActivityPanelWidth(width, { sessionId })` 来自后台会话时直接忽略。
|
|
451
|
+
|
|
450
452
|
```ts
|
|
451
|
-
ctx.ui.openActivityTab("preview", { width: "max", cwd: session.cwd });
|
|
453
|
+
ctx.ui.openActivityTab("preview", { width: "max", cwd: session.cwd, sessionId: session.id });
|
|
452
454
|
```
|
|
453
455
|
|
|
454
|
-
|
|
456
|
+
工具的其它副作用要不要落到用户眼前,用 `ctx.ui.isSessionInView?.(session.id)` 判断(普通会话即正在显示的那一个,团队会话含全部成员;旧宿主没有这个方法)。
|
|
457
|
+
|
|
458
|
+
面板宽度跟着选中的标签卡走(Plugin API `^2.14.0`):`width` 是这张卡的**默认宽度**,与注册时的 `defaultWidth` 同义(首选在注册时声明)。用户在这张卡上拖过就以用户为准,别的标签卡各用各的宽度;重复调用(含 `activate()` 重放)不会冲掉用户的宽度。没有声明宽度的卡共用用户给普通卡定的宽度(默认 360),双击分隔条回到默认。标签卡内部切换模式时的临时宽度用 `setActivityPanelWidth`:只对本插件正在显示的卡生效,切走即失效。
|
|
455
459
|
|
|
456
460
|
示例:`packages/plugins/presets/git`、`externals/mobile-ui-preview`。
|
|
457
461
|
|