@vetta-org/plugin-sdk 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity-tab.d.ts +2 -0
- package/dist/activity-tab.d.ts.map +1 -1
- package/dist/activity-tab.js +1 -1
- package/dist/activity-tab.js.map +1 -1
- package/dist/agent.d.ts +158 -2
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +14 -1
- package/dist/agent.js.map +1 -1
- package/dist/ai.d.ts +93 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +2 -0
- package/dist/ai.js.map +1 -0
- package/dist/app-actions.d.ts +9 -0
- package/dist/app-actions.d.ts.map +1 -1
- package/dist/app-actions.js.map +1 -1
- package/dist/artifacts.d.ts +31 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/artifacts.js +2 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/browser.d.ts +119 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +2 -0
- package/dist/browser.js.map +1 -0
- package/dist/capture.d.ts +64 -0
- package/dist/capture.d.ts.map +1 -0
- package/dist/capture.js +2 -0
- package/dist/capture.js.map +1 -0
- package/dist/context.d.ts +46 -5
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js.map +1 -1
- package/dist/conversation.d.ts +66 -2
- package/dist/conversation.d.ts.map +1 -1
- package/dist/conversation.js.map +1 -1
- package/dist/gateway.d.ts +37 -0
- package/dist/gateway.d.ts.map +1 -0
- package/dist/gateway.js +14 -0
- package/dist/gateway.js.map +1 -0
- package/dist/index.d.ts +20 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/jobs.d.ts +34 -0
- package/dist/jobs.d.ts.map +1 -0
- package/dist/jobs.js +2 -0
- package/dist/jobs.js.map +1 -0
- package/dist/manifest-schema.d.ts +234 -0
- package/dist/manifest-schema.d.ts.map +1 -0
- package/dist/manifest-schema.js +145 -0
- package/dist/manifest-schema.js.map +1 -0
- package/dist/manifest.d.ts +21 -55
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +342 -1
- package/dist/manifest.js.map +1 -1
- package/dist/media.d.ts +193 -0
- package/dist/media.d.ts.map +1 -0
- package/dist/media.js +11 -0
- package/dist/media.js.map +1 -0
- package/dist/network.d.ts +2 -1
- package/dist/network.d.ts.map +1 -1
- package/dist/network.js.map +1 -1
- package/dist/npm-package.d.ts +17 -0
- package/dist/npm-package.d.ts.map +1 -0
- package/dist/npm-package.js +38 -0
- package/dist/npm-package.js.map +1 -0
- package/dist/official.d.ts +218 -10
- package/dist/official.d.ts.map +1 -1
- package/dist/official.js.map +1 -1
- package/dist/permissions.d.ts +2 -1
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +54 -1
- package/dist/permissions.js.map +1 -1
- package/dist/prompt-attachment.d.ts +30 -6
- package/dist/prompt-attachment.d.ts.map +1 -1
- package/dist/prompt-attachment.js +35 -1
- package/dist/prompt-attachment.js.map +1 -1
- package/dist/quickjs.d.ts +147 -0
- package/dist/quickjs.d.ts.map +1 -0
- package/dist/quickjs.js +2 -0
- package/dist/quickjs.js.map +1 -0
- package/dist/storage.d.ts +7 -0
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js.map +1 -1
- package/dist/ui.d.ts +223 -15
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js.map +1 -1
- package/package.json +21 -2
- package/src/tailwind-theme.css +30 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../src/artifacts.ts"],"names":[],"mappings":"","sourcesContent":["export interface PluginArtifactRef {\n\tid: string;\n\tmimeType: string;\n\tsizeBytes: number;\n\tlifetime: \"temporary\";\n\tname?: string;\n}\n\nexport type PluginArtifactDestination =\n\t| { type: \"plugin-blob\"; blobId?: string }\n\t| { type: \"workspace-file\"; path: string };\n\nexport type PluginPersistedArtifact =\n\t| {\n\t\t\ttype: \"plugin-blob\";\n\t\t\tblobId: string;\n\t\t\turl: string;\n\t\t\tmimeType: string;\n\t\t\tsizeBytes: number;\n\t }\n\t| {\n\t\t\ttype: \"workspace-file\";\n\t\t\tpath: string;\n\t\t\tmimeType: string;\n\t\t\tsizeBytes: number;\n\t };\n\nexport interface PluginArtifactsApi {\n\tpersist(\n\t\tartifact: PluginArtifactRef | string,\n\t\tdestination: PluginArtifactDestination,\n\t): Promise<PluginPersistedArtifact>;\n\trelease(artifact: PluginArtifactRef | string): Promise<void>;\n}\n"]}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export type PluginBrowserSource = "managed" | "attach";
|
|
2
|
+
export type PluginBrowserRuntimePhase = "checking" | "missing" | "outdated" | "browser-missing" | "ready" | "installing-runtime" | "installing-browser" | "error";
|
|
3
|
+
export interface PluginBrowserRuntimeStatus {
|
|
4
|
+
phase: PluginBrowserRuntimePhase;
|
|
5
|
+
version?: string;
|
|
6
|
+
message?: string;
|
|
7
|
+
recentOutput?: string;
|
|
8
|
+
}
|
|
9
|
+
export type PluginBrowserProfile = {
|
|
10
|
+
type: "ephemeral";
|
|
11
|
+
} | {
|
|
12
|
+
type: "persistent";
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
15
|
+
export type PluginBrowserSessionStatus = "starting" | "ready" | "closed" | "error";
|
|
16
|
+
export interface PluginBrowserSession {
|
|
17
|
+
id: string;
|
|
18
|
+
source: PluginBrowserSource;
|
|
19
|
+
profile: PluginBrowserProfile;
|
|
20
|
+
headed: boolean;
|
|
21
|
+
status: PluginBrowserSessionStatus;
|
|
22
|
+
createdAt: number;
|
|
23
|
+
}
|
|
24
|
+
export interface PluginBrowserSessionOptions {
|
|
25
|
+
source?: PluginBrowserSource;
|
|
26
|
+
profile?: PluginBrowserProfile;
|
|
27
|
+
headed?: boolean;
|
|
28
|
+
/** Optional subset of plugin.json browser.allowedHosts for this session. */
|
|
29
|
+
allowedHosts?: string[];
|
|
30
|
+
}
|
|
31
|
+
export interface PluginBrowserPageState {
|
|
32
|
+
sessionId: string;
|
|
33
|
+
revision: number;
|
|
34
|
+
url: string;
|
|
35
|
+
title?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface PluginBrowserSnapshot extends PluginBrowserPageState {
|
|
38
|
+
content: string;
|
|
39
|
+
}
|
|
40
|
+
export interface PluginBrowserTextContent {
|
|
41
|
+
sessionId: string;
|
|
42
|
+
url: string;
|
|
43
|
+
title?: string;
|
|
44
|
+
text: string;
|
|
45
|
+
truncated: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface PluginBrowserScreenshot {
|
|
48
|
+
sessionId: string;
|
|
49
|
+
revision: number;
|
|
50
|
+
dataUrl: string;
|
|
51
|
+
}
|
|
52
|
+
export type PluginBrowserAction = {
|
|
53
|
+
type: "click";
|
|
54
|
+
target: string;
|
|
55
|
+
} | {
|
|
56
|
+
type: "fill";
|
|
57
|
+
target: string;
|
|
58
|
+
value: string;
|
|
59
|
+
} | {
|
|
60
|
+
type: "type";
|
|
61
|
+
target: string;
|
|
62
|
+
value: string;
|
|
63
|
+
} | {
|
|
64
|
+
type: "select";
|
|
65
|
+
target: string;
|
|
66
|
+
value: string;
|
|
67
|
+
} | {
|
|
68
|
+
type: "check";
|
|
69
|
+
target: string;
|
|
70
|
+
checked: boolean;
|
|
71
|
+
} | {
|
|
72
|
+
type: "press";
|
|
73
|
+
key: string;
|
|
74
|
+
} | {
|
|
75
|
+
type: "scroll";
|
|
76
|
+
direction: "up" | "down" | "left" | "right";
|
|
77
|
+
amount?: number;
|
|
78
|
+
} | {
|
|
79
|
+
type: "wait";
|
|
80
|
+
milliseconds?: number;
|
|
81
|
+
target?: string;
|
|
82
|
+
} | {
|
|
83
|
+
type: "back";
|
|
84
|
+
} | {
|
|
85
|
+
type: "reload";
|
|
86
|
+
};
|
|
87
|
+
export interface PluginBrowserActionResult extends PluginBrowserPageState {
|
|
88
|
+
output?: string;
|
|
89
|
+
}
|
|
90
|
+
export interface PluginBrowserApi {
|
|
91
|
+
/**
|
|
92
|
+
* Open a URL in the host's built-in browser panel. This is a display-only
|
|
93
|
+
* operation; it does not grant page content access or automation privileges.
|
|
94
|
+
*/
|
|
95
|
+
open(url: string): void;
|
|
96
|
+
runtime: {
|
|
97
|
+
status(): Promise<PluginBrowserRuntimeStatus>;
|
|
98
|
+
install(step: "runtime" | "browser"): Promise<PluginBrowserRuntimeStatus>;
|
|
99
|
+
};
|
|
100
|
+
sessions: {
|
|
101
|
+
create(options?: PluginBrowserSessionOptions): Promise<PluginBrowserSession>;
|
|
102
|
+
get(sessionId: string): Promise<PluginBrowserSession>;
|
|
103
|
+
close(sessionId: string): Promise<void>;
|
|
104
|
+
};
|
|
105
|
+
navigate(sessionId: string, url: string): Promise<PluginBrowserPageState>;
|
|
106
|
+
snapshot(sessionId: string, options?: {
|
|
107
|
+
interactiveOnly?: boolean;
|
|
108
|
+
}): Promise<PluginBrowserSnapshot>;
|
|
109
|
+
readText(sessionId: string, options?: {
|
|
110
|
+
maxChars?: number;
|
|
111
|
+
}): Promise<PluginBrowserTextContent>;
|
|
112
|
+
screenshot(sessionId: string, options?: {
|
|
113
|
+
fullPage?: boolean;
|
|
114
|
+
}): Promise<PluginBrowserScreenshot>;
|
|
115
|
+
act(sessionId: string, action: PluginBrowserAction, options?: {
|
|
116
|
+
snapshotRevision?: number;
|
|
117
|
+
}): Promise<PluginBrowserActionResult>;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,QAAQ,CAAC;AACvD,MAAM,MAAM,yBAAyB,GAClC,UAAU,GACV,SAAS,GACT,UAAU,GACV,iBAAiB,GACjB,OAAO,GACP,oBAAoB,GACpB,oBAAoB,GACpB,OAAO,CAAC;AAEX,M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"missing\"\n\t| \"outdated\"\n\t| \"browser-missing\"\n\t| \"ready\"\n\t| \"installing-runtime\"\n\t| \"installing-browser\"\n\t| \"error\";\n\nexport interface PluginBrowserRuntimeStatus {\n\tphase: PluginBrowserRuntimePhase;\n\tversion?: string;\n\tmessage?: string;\n\trecentOutput?: string;\n}\n\nexport type PluginBrowserProfile = { type: \"ephemeral\" } | { type: \"persistent\"; id: string };\nexport type PluginBrowserSessionStatus = \"starting\" | \"ready\" | \"closed\" | \"error\";\n\nexport interface PluginBrowserSession {\n\tid: string;\n\tsource: PluginBrowserSource;\n\tprofile: PluginBrowserProfile;\n\theaded: boolean;\n\tstatus: PluginBrowserSessionStatus;\n\tcreatedAt: number;\n}\n\nexport interface PluginBrowserSessionOptions {\n\tsource?: PluginBrowserSource;\n\tprofile?: PluginBrowserProfile;\n\theaded?: boolean;\n\t/** Optional subset of plugin.json browser.allowedHosts for this session. */\n\tallowedHosts?: string[];\n}\n\nexport interface PluginBrowserPageState {\n\tsessionId: string;\n\trevision: number;\n\turl: string;\n\ttitle?: string;\n}\n\nexport interface PluginBrowserSnapshot extends PluginBrowserPageState {\n\tcontent: string;\n}\n\nexport interface PluginBrowserTextContent {\n\tsessionId: string;\n\turl: string;\n\ttitle?: string;\n\ttext: string;\n\ttruncated: boolean;\n}\n\nexport interface PluginBrowserScreenshot {\n\tsessionId: string;\n\trevision: number;\n\tdataUrl: string;\n}\n\nexport type PluginBrowserAction =\n\t| { type: \"click\"; target: string }\n\t| { type: \"fill\"; target: string; value: string }\n\t| { type: \"type\"; target: string; value: string }\n\t| { type: \"select\"; target: string; value: string }\n\t| { type: \"check\"; target: string; checked: boolean }\n\t| { type: \"press\"; key: string }\n\t| { type: \"scroll\"; direction: \"up\" | \"down\" | \"left\" | \"right\"; amount?: number }\n\t| { type: \"wait\"; milliseconds?: number; target?: string }\n\t| { type: \"back\" }\n\t| { type: \"reload\" };\n\nexport interface PluginBrowserActionResult extends PluginBrowserPageState {\n\toutput?: string;\n}\n\nexport interface PluginBrowserApi {\n\t/**\n\t * Open a URL in the host's built-in browser panel. This is a display-only\n\t * operation; it does not grant page content access or automation privileges.\n\t */\n\topen(url: string): void;\n\truntime: {\n\t\tstatus(): Promise<PluginBrowserRuntimeStatus>;\n\t\tinstall(step: \"runtime\" | \"browser\"): Promise<PluginBrowserRuntimeStatus>;\n\t};\n\tsessions: {\n\t\tcreate(options?: PluginBrowserSessionOptions): Promise<PluginBrowserSession>;\n\t\tget(sessionId: string): Promise<PluginBrowserSession>;\n\t\tclose(sessionId: string): Promise<void>;\n\t};\n\tnavigate(sessionId: string, url: string): Promise<PluginBrowserPageState>;\n\tsnapshot(sessionId: string, options?: { interactiveOnly?: boolean }): Promise<PluginBrowserSnapshot>;\n\treadText(sessionId: string, options?: { maxChars?: number }): Promise<PluginBrowserTextContent>;\n\tscreenshot(sessionId: string, options?: { fullPage?: boolean }): Promise<PluginBrowserScreenshot>;\n\tact(\n\t\tsessionId: string,\n\t\taction: PluginBrowserAction,\n\t\toptions?: { snapshotRevision?: number },\n\t): Promise<PluginBrowserActionResult>;\n}\n"]}
|
package/dist/browser.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"","sourcesContent":["export type PluginBrowserSource = \"managed\" | \"attach\";\nexport type PluginBrowserRuntimePhase =\n\t| \"checking\"\n\t| \"missing\"\n\t| \"outdated\"\n\t| \"browser-missing\"\n\t| \"ready\"\n\t| \"installing-runtime\"\n\t| \"installing-browser\"\n\t| \"error\";\n\nexport interface PluginBrowserRuntimeStatus {\n\tphase: PluginBrowserRuntimePhase;\n\tversion?: string;\n\tmessage?: string;\n\trecentOutput?: string;\n}\n\nexport type PluginBrowserProfile = { type: \"ephemeral\" } | { type: \"persistent\"; id: string };\nexport type PluginBrowserSessionStatus = \"starting\" | \"ready\" | \"closed\" | \"error\";\n\nexport interface PluginBrowserSession {\n\tid: string;\n\tsource: PluginBrowserSource;\n\tprofile: PluginBrowserProfile;\n\theaded: boolean;\n\tstatus: PluginBrowserSessionStatus;\n\tcreatedAt: number;\n}\n\nexport interface PluginBrowserSessionOptions {\n\tsource?: PluginBrowserSource;\n\tprofile?: PluginBrowserProfile;\n\theaded?: boolean;\n\t/** Optional subset of plugin.json browser.allowedHosts for this session. */\n\tallowedHosts?: string[];\n}\n\nexport interface PluginBrowserPageState {\n\tsessionId: string;\n\trevision: number;\n\turl: string;\n\ttitle?: string;\n}\n\nexport interface PluginBrowserSnapshot extends PluginBrowserPageState {\n\tcontent: string;\n}\n\nexport interface PluginBrowserTextContent {\n\tsessionId: string;\n\turl: string;\n\ttitle?: string;\n\ttext: string;\n\ttruncated: boolean;\n}\n\nexport interface PluginBrowserScreenshot {\n\tsessionId: string;\n\trevision: number;\n\tdataUrl: string;\n}\n\nexport type PluginBrowserAction =\n\t| { type: \"click\"; target: string }\n\t| { type: \"fill\"; target: string; value: string }\n\t| { type: \"type\"; target: string; value: string }\n\t| { type: \"select\"; target: string; value: string }\n\t| { type: \"check\"; target: string; checked: boolean }\n\t| { type: \"press\"; key: string }\n\t| { type: \"scroll\"; direction: \"up\" | \"down\" | \"left\" | \"right\"; amount?: number }\n\t| { type: \"wait\"; milliseconds?: number; target?: string }\n\t| { type: \"back\" }\n\t| { type: \"reload\" };\n\nexport interface PluginBrowserActionResult extends PluginBrowserPageState {\n\toutput?: string;\n}\n\nexport interface PluginBrowserApi {\n\t/**\n\t * Open a URL in the host's built-in browser panel. This is a display-only\n\t * operation; it does not grant page content access or automation privileges.\n\t */\n\topen(url: string): void;\n\truntime: {\n\t\tstatus(): Promise<PluginBrowserRuntimeStatus>;\n\t\tinstall(step: \"runtime\" | \"browser\"): Promise<PluginBrowserRuntimeStatus>;\n\t};\n\tsessions: {\n\t\tcreate(options?: PluginBrowserSessionOptions): Promise<PluginBrowserSession>;\n\t\tget(sessionId: string): Promise<PluginBrowserSession>;\n\t\tclose(sessionId: string): Promise<void>;\n\t};\n\tnavigate(sessionId: string, url: string): Promise<PluginBrowserPageState>;\n\tsnapshot(sessionId: string, options?: { interactiveOnly?: boolean }): Promise<PluginBrowserSnapshot>;\n\treadText(sessionId: string, options?: { maxChars?: number }): Promise<PluginBrowserTextContent>;\n\tscreenshot(sessionId: string, options?: { fullPage?: boolean }): Promise<PluginBrowserScreenshot>;\n\tact(\n\t\tsessionId: string,\n\t\taction: PluginBrowserAction,\n\t\toptions?: { snapshotRevision?: number },\n\t): Promise<PluginBrowserActionResult>;\n}\n"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export interface PluginOffscreenCaptureOptions {
|
|
2
|
+
/** 目标页面地址,仅允许 http(s)(如插件自己 spawn 的本地 dev server)。 */
|
|
3
|
+
url: string;
|
|
4
|
+
/** 视口宽度(CSS 像素)。 */
|
|
5
|
+
width: number;
|
|
6
|
+
/** 视口高度(CSS 像素)。 */
|
|
7
|
+
height: number;
|
|
8
|
+
/**
|
|
9
|
+
* 复用键。同 key 的请求串行执行并复用同一个离屏窗口:url 未变时跳过重新加载,
|
|
10
|
+
* SPA 页面可用 `prepareScript` 做客户端路由切换,省掉整页加载。省略则本次
|
|
11
|
+
* 请求独占一个窗口、用完即毁。窗口闲置一段时间后由宿主自动回收。
|
|
12
|
+
*/
|
|
13
|
+
sessionKey?: string;
|
|
14
|
+
/** 页面加载完成(或复用窗口)后注入执行的脚本,如 postMessage 切路由。 */
|
|
15
|
+
prepareScript?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 就绪表达式。宿主轮询它直到真值才截图,用于等待页面自己的「渲染完成」信号
|
|
18
|
+
* (如 `window.__ready === true`)。省略则加载完成即视为就绪。
|
|
19
|
+
*/
|
|
20
|
+
readyExpression?: string;
|
|
21
|
+
/** 就绪后的静置时间(毫秒),等图片解码、过渡动画落定。 */
|
|
22
|
+
settleMs?: number;
|
|
23
|
+
/**
|
|
24
|
+
* 探针表达式。在**截图的同一时刻**(就绪 + 静置之后)对页面求值,结果经
|
|
25
|
+
* `JSON.stringify` 回传到 `PluginOffscreenCaptureResult.probe`。
|
|
26
|
+
*
|
|
27
|
+
* 存在的理由:渲染是这条链上最贵的一步,而位图是它最难用的产物——「这段文字换了
|
|
28
|
+
* 行没有」「这两条边对齐没有」在 DOM 里是确定的度量,在图里只能靠看。同一次渲染
|
|
29
|
+
* 顺带把度量取回来,比让调用方再渲染一次或让模型看图去猜都更可靠。
|
|
30
|
+
*
|
|
31
|
+
* 求值失败(抛错、返回不可序列化的值)不影响截图:`probe` 为 `undefined`,
|
|
32
|
+
* 位图照常返回。探针是搭车的附加信息,不是截图的前置条件。
|
|
33
|
+
*/
|
|
34
|
+
probeScript?: string;
|
|
35
|
+
/** 整体超时(毫秒,含加载与就绪等待),宿主按自身上限收紧。 */
|
|
36
|
+
timeoutMs?: number;
|
|
37
|
+
format?: "jpeg" | "png";
|
|
38
|
+
/** 仅 jpeg 生效,0–1。 */
|
|
39
|
+
quality?: number;
|
|
40
|
+
}
|
|
41
|
+
export interface PluginOffscreenCaptureResult {
|
|
42
|
+
dataUrl: string;
|
|
43
|
+
/**
|
|
44
|
+
* 实际生效的设备像素比:位图物理像素 = CSS 尺寸 × 此值。离屏窗口跟随主显示器
|
|
45
|
+
* 的缩放(Retina 为 2),插件不可指定——按需自行缩放位图。
|
|
46
|
+
*/
|
|
47
|
+
scaleFactor: number;
|
|
48
|
+
/**
|
|
49
|
+
* `probeScript` 的求值结果,经 JSON 往返。没传探针、求值抛错或结果不可序列化时
|
|
50
|
+
* 为 `undefined`——调用方无法从这里区分三者,探针本就不该承担错误报告。
|
|
51
|
+
*/
|
|
52
|
+
probe?: unknown;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 主进程离屏窗口截图。与 DOM 克隆类方案(html-to-image 等)不同,这里走真实的
|
|
56
|
+
* Chromium 渲染管线,产出与页面在屏显示逐像素一致的位图,不存在克隆重排带来的
|
|
57
|
+
* 断行/亚像素偏差。需要 `capture.offscreen` 权限。
|
|
58
|
+
*/
|
|
59
|
+
export interface PluginCaptureApi {
|
|
60
|
+
offscreen(options: PluginOffscreenCaptureOptions): Promise<PluginOffscreenCaptureResult>;
|
|
61
|
+
/** 释放 sessionKey 对应的离屏窗口;下次同 key 请求会重新加载页面。幂等。 */
|
|
62
|
+
releaseOffscreen(sessionKey: string): Promise<void>;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=capture.d.ts.map
|
|
@@ -0,0 +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;CACjB;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}\n\nexport interface PluginOffscreenCaptureResult {\n\tdataUrl: string;\n\t/**\n\t * 实际生效的设备像素比:位图物理像素 = CSS 尺寸 × 此值。离屏窗口跟随主显示器\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
ADDED
|
@@ -0,0 +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 尺寸 × 此值。离屏窗口跟随主显示器\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/context.d.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import type { PluginAgentApi } from "./agent.js";
|
|
2
|
+
import type { PluginAiApi } from "./ai.js";
|
|
2
3
|
import type { PluginAppActionsApi } from "./app-actions.js";
|
|
4
|
+
import type { PluginArtifactsApi } from "./artifacts.js";
|
|
5
|
+
import type { PluginBrowserApi } from "./browser.js";
|
|
6
|
+
import type { PluginCaptureApi } from "./capture.js";
|
|
3
7
|
import type { PluginCommandApi } from "./command.js";
|
|
4
8
|
import type { PluginConversationApi } from "./conversation.js";
|
|
5
9
|
import type { Disposable } from "./disposable.js";
|
|
6
10
|
import type { PluginFileExplorerApi } from "./file-explorer.js";
|
|
7
11
|
import type { PluginFsApi } from "./fs.js";
|
|
12
|
+
import type { PluginGatewayApi } from "./gateway.js";
|
|
8
13
|
import type { PluginI18nApi } from "./i18n.js";
|
|
14
|
+
import type { PluginJobsApi } from "./jobs.js";
|
|
15
|
+
import type { PluginMediaApi } from "./media.js";
|
|
9
16
|
import type { PluginNetworkApi } from "./network.js";
|
|
10
17
|
import type { PluginOfficialApi } from "./official.js";
|
|
11
18
|
import type { PluginPermission } from "./permissions.js";
|
|
@@ -16,12 +23,21 @@ export interface PluginPermissionApi {
|
|
|
16
23
|
has(permission: PluginPermission): boolean;
|
|
17
24
|
require(permission: PluginPermission): void;
|
|
18
25
|
}
|
|
19
|
-
/**
|
|
20
|
-
|
|
26
|
+
/**
|
|
27
|
+
* 工作模式 id。合法值由宿主的模式注册表定义(ADR-0071),插件不应硬编码枚举;
|
|
28
|
+
* 需要区分模式时按 id 字符串比较,未知 id 一律按通用处理。
|
|
29
|
+
*/
|
|
30
|
+
export type AgentMode = string;
|
|
21
31
|
export interface PluginContext {
|
|
22
32
|
plugin: {
|
|
23
33
|
id: string;
|
|
24
34
|
version: string;
|
|
35
|
+
/**
|
|
36
|
+
* Host-resolved brand icon from `plugin.json#icon` (if declared).
|
|
37
|
+
* Opaque string for `<img src>` / Iconify — plugins must not invent
|
|
38
|
+
* host protocols; use this or omit Activity Tab `icon` to inherit it.
|
|
39
|
+
*/
|
|
40
|
+
iconUrl?: string;
|
|
25
41
|
};
|
|
26
42
|
permissions: PluginPermissionApi;
|
|
27
43
|
ui: PluginUiApi;
|
|
@@ -29,20 +45,45 @@ export interface PluginContext {
|
|
|
29
45
|
conversation: PluginConversationApi;
|
|
30
46
|
agent: PluginAgentApi;
|
|
31
47
|
appActions: PluginAppActionsApi;
|
|
48
|
+
ai: PluginAiApi;
|
|
32
49
|
official: PluginOfficialApi;
|
|
33
50
|
fs: PluginFsApi;
|
|
34
51
|
command: PluginCommandApi;
|
|
52
|
+
media: PluginMediaApi;
|
|
53
|
+
jobs: PluginJobsApi;
|
|
54
|
+
artifacts: PluginArtifactsApi;
|
|
55
|
+
/** 主进程离屏窗口截图(`capture.offscreen` 权限)。旧宿主上为 `undefined`,使用前判空。 */
|
|
56
|
+
capture?: PluginCaptureApi;
|
|
57
|
+
/** 宿主管理的浏览器能力;各具体方法会根据插件权限单独校验。 */
|
|
58
|
+
browser: PluginBrowserApi;
|
|
35
59
|
network: PluginNetworkApi;
|
|
60
|
+
/**
|
|
61
|
+
* Vetta 服务端网关调用(ADR-0056)。**仅内置 official 插件可用**,
|
|
62
|
+
* 第三方插件读到 `undefined`,故使用前必须判空。
|
|
63
|
+
*/
|
|
64
|
+
gateway?: PluginGatewayApi;
|
|
36
65
|
storage: PluginStorageApi;
|
|
37
66
|
settings: PluginSettingsApi;
|
|
38
67
|
i18n: PluginI18nApi;
|
|
39
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* 当前的**新会话默认工作模式**(agent_mode 轴,见 ADR-0046 及其 2026-08 修订)。
|
|
70
|
+
*
|
|
71
|
+
* 工作模式只在会话创建时固化,之后会话内不可变,因此这里读到的是用户此刻的设置值,
|
|
72
|
+
* **不是**某个已存在会话正在使用的模式,不要用它推断进行中的会话。
|
|
73
|
+
* 模式也不再隐藏任何插件能力,只适合做展示层的软性定制,不要据此隐藏功能入口。
|
|
74
|
+
*/
|
|
40
75
|
getAgentMode(): AgentMode;
|
|
41
|
-
/**
|
|
76
|
+
/** 订阅默认工作模式变更(用户改设置时触发)。返回 Disposable 取消订阅。 */
|
|
42
77
|
onAgentModeChanged(listener: (mode: AgentMode) => void): Disposable;
|
|
43
78
|
}
|
|
79
|
+
export type PluginActivationCleanup = Disposable | (() => void | Promise<void>);
|
|
44
80
|
export interface PluginDefinition {
|
|
45
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Activate one plugin instance. Returning a cleanup binds resource ownership to
|
|
83
|
+
* this specific activation, including overlapping hot-reload activations.
|
|
84
|
+
*/
|
|
85
|
+
activate(ctx: PluginContext): void | PluginActivationCleanup | Promise<void | PluginActivationCleanup>;
|
|
86
|
+
/** Legacy module-level cleanup. Prefer an activation-scoped cleanup return value. */
|
|
46
87
|
deactivate?(): void | Promise<void>;
|
|
47
88
|
}
|
|
48
89
|
export declare function definePlugin(plugin: PluginDefinition): PluginDefinition;
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,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CAAC;IAChB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,KAAK,EAAE,cAAc,CAAC;IACtB,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,EAAE,kBAAkB,CAAC;IAC9B,qHAAiE;IACjE,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,2FAAmC;IACnC,OAAO,EAAE,gBAAgB,CAAC;IAC1B,OAAO,EAAE,gBAAgB,CAAC;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,IAAI,EAAE,aAAa,CAAC;IACpB;;;;;;OAMG;IACH,YAAY,IAAI,SAAS,CAAC;IAC1B,uGAA+C;IAC/C,kBAAkB,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,GAAG,UAAU,CAAC;CACpE;AAED,MAAM,MAAM,uBAAuB,GAAG,UAAU,GAAG,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAEhF,MAAM,WAAW,gBAAgB;IAChC;;;OAGG;IACH,QAAQ,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,GAAG,uBAAuB,GAAG,OAAO,CAAC,IAAI,GAAG,uBAAuB,CAAC,CAAC;IACvG,qFAAqF;IACrF,UAAU,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,gBAAgB,CAEvE","sourcesContent":["import type { PluginAgentApi } from \"./agent.js\";\nimport type { PluginAiApi } from \"./ai.js\";\nimport type { PluginAppActionsApi } from \"./app-actions.js\";\nimport type { PluginArtifactsApi } from \"./artifacts.js\";\nimport type { PluginBrowserApi } from \"./browser.js\";\nimport type { PluginCaptureApi } from \"./capture.js\";\nimport type { PluginCommandApi } from \"./command.js\";\nimport type { PluginConversationApi } from \"./conversation.js\";\nimport type { Disposable } from \"./disposable.js\";\nimport type { PluginFileExplorerApi } from \"./file-explorer.js\";\nimport type { PluginFsApi } from \"./fs.js\";\nimport type { PluginGatewayApi } from \"./gateway.js\";\nimport type { PluginI18nApi } from \"./i18n.js\";\nimport type { PluginJobsApi } from \"./jobs.js\";\nimport type { PluginMediaApi } from \"./media.js\";\nimport type { PluginNetworkApi } from \"./network.js\";\nimport type { PluginOfficialApi } from \"./official.js\";\nimport type { PluginPermission } from \"./permissions.js\";\nimport type { PluginSettingsApi } from \"./settings.js\";\nimport type { PluginStorageApi } from \"./storage.js\";\nimport type { PluginUiApi } from \"./ui.js\";\n\nexport interface PluginPermissionApi {\n\thas(permission: PluginPermission): boolean;\n\trequire(permission: PluginPermission): void;\n}\n\n/**\n * 工作模式 id。合法值由宿主的模式注册表定义(ADR-0071),插件不应硬编码枚举;\n * 需要区分模式时按 id 字符串比较,未知 id 一律按通用处理。\n */\nexport type AgentMode = string;\n\nexport interface PluginContext {\n\tplugin: {\n\t\tid: string;\n\t\tversion: string;\n\t\t/**\n\t\t * Host-resolved brand icon from `plugin.json#icon` (if declared).\n\t\t * Opaque string for `<img src>` / Iconify — plugins must not invent\n\t\t * host protocols; use this or omit Activity Tab `icon` to inherit it.\n\t\t */\n\t\ticonUrl?: string;\n\t};\n\tpermissions: PluginPermissionApi;\n\tui: PluginUiApi;\n\tfileExplorer: PluginFileExplorerApi;\n\tconversation: PluginConversationApi;\n\tagent: PluginAgentApi;\n\tappActions: PluginAppActionsApi;\n\tai: PluginAiApi;\n\tofficial: PluginOfficialApi;\n\tfs: PluginFsApi;\n\tcommand: PluginCommandApi;\n\tmedia: PluginMediaApi;\n\tjobs: PluginJobsApi;\n\tartifacts: PluginArtifactsApi;\n\t/** 主进程离屏窗口截图(`capture.offscreen` 权限)。旧宿主上为 `undefined`,使用前判空。 */\n\tcapture?: PluginCaptureApi;\n\t/** 宿主管理的浏览器能力;各具体方法会根据插件权限单独校验。 */\n\tbrowser: PluginBrowserApi;\n\tnetwork: PluginNetworkApi;\n\t/**\n\t * Vetta 服务端网关调用(ADR-0056)。**仅内置 official 插件可用**,\n\t * 第三方插件读到 `undefined`,故使用前必须判空。\n\t */\n\tgateway?: PluginGatewayApi;\n\tstorage: PluginStorageApi;\n\tsettings: PluginSettingsApi;\n\ti18n: PluginI18nApi;\n\t/**\n\t * 当前的**新会话默认工作模式**(agent_mode 轴,见 ADR-0046 及其 2026-08 修订)。\n\t *\n\t * 工作模式只在会话创建时固化,之后会话内不可变,因此这里读到的是用户此刻的设置值,\n\t * **不是**某个已存在会话正在使用的模式,不要用它推断进行中的会话。\n\t * 模式也不再隐藏任何插件能力,只适合做展示层的软性定制,不要据此隐藏功能入口。\n\t */\n\tgetAgentMode(): AgentMode;\n\t/** 订阅默认工作模式变更(用户改设置时触发)。返回 Disposable 取消订阅。 */\n\tonAgentModeChanged(listener: (mode: AgentMode) => void): Disposable;\n}\n\nexport type PluginActivationCleanup = Disposable | (() => void | Promise<void>);\n\nexport interface PluginDefinition {\n\t/**\n\t * Activate one plugin instance. Returning a cleanup binds resource ownership to\n\t * this specific activation, including overlapping hot-reload activations.\n\t */\n\tactivate(ctx: PluginContext): void | PluginActivationCleanup | Promise<void | PluginActivationCleanup>;\n\t/** Legacy module-level cleanup. Prefer an activation-scoped cleanup return value. */\n\tdeactivate?(): void | Promise<void>;\n}\n\nexport function definePlugin(plugin: PluginDefinition): PluginDefinition {\n\treturn plugin;\n}\n"]}
|
package/dist/context.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AA8FA,MAAM,UAAU,YAAY,CAAC,MAAwB,EAAoB;IACxE,OAAO,MAAM,CAAC;AAAA,CACd","sourcesContent":["import type { PluginAgentApi } from \"./agent.js\";\nimport type { PluginAiApi } from \"./ai.js\";\nimport type { PluginAppActionsApi } from \"./app-actions.js\";\nimport type { PluginArtifactsApi } from \"./artifacts.js\";\nimport type { PluginBrowserApi } from \"./browser.js\";\nimport type { PluginCaptureApi } from \"./capture.js\";\nimport type { PluginCommandApi } from \"./command.js\";\nimport type { PluginConversationApi } from \"./conversation.js\";\nimport type { Disposable } from \"./disposable.js\";\nimport type { PluginFileExplorerApi } from \"./file-explorer.js\";\nimport type { PluginFsApi } from \"./fs.js\";\nimport type { PluginGatewayApi } from \"./gateway.js\";\nimport type { PluginI18nApi } from \"./i18n.js\";\nimport type { PluginJobsApi } from \"./jobs.js\";\nimport type { PluginMediaApi } from \"./media.js\";\nimport type { PluginNetworkApi } from \"./network.js\";\nimport type { PluginOfficialApi } from \"./official.js\";\nimport type { PluginPermission } from \"./permissions.js\";\nimport type { PluginSettingsApi } from \"./settings.js\";\nimport type { PluginStorageApi } from \"./storage.js\";\nimport type { PluginUiApi } from \"./ui.js\";\n\nexport interface PluginPermissionApi {\n\thas(permission: PluginPermission): boolean;\n\trequire(permission: PluginPermission): void;\n}\n\n/**\n * 工作模式 id。合法值由宿主的模式注册表定义(ADR-0071),插件不应硬编码枚举;\n * 需要区分模式时按 id 字符串比较,未知 id 一律按通用处理。\n */\nexport type AgentMode = string;\n\nexport interface PluginContext {\n\tplugin: {\n\t\tid: string;\n\t\tversion: string;\n\t\t/**\n\t\t * Host-resolved brand icon from `plugin.json#icon` (if declared).\n\t\t * Opaque string for `<img src>` / Iconify — plugins must not invent\n\t\t * host protocols; use this or omit Activity Tab `icon` to inherit it.\n\t\t */\n\t\ticonUrl?: string;\n\t};\n\tpermissions: PluginPermissionApi;\n\tui: PluginUiApi;\n\tfileExplorer: PluginFileExplorerApi;\n\tconversation: PluginConversationApi;\n\tagent: PluginAgentApi;\n\tappActions: PluginAppActionsApi;\n\tai: PluginAiApi;\n\tofficial: PluginOfficialApi;\n\tfs: PluginFsApi;\n\tcommand: PluginCommandApi;\n\tmedia: PluginMediaApi;\n\tjobs: PluginJobsApi;\n\tartifacts: PluginArtifactsApi;\n\t/** 主进程离屏窗口截图(`capture.offscreen` 权限)。旧宿主上为 `undefined`,使用前判空。 */\n\tcapture?: PluginCaptureApi;\n\t/** 宿主管理的浏览器能力;各具体方法会根据插件权限单独校验。 */\n\tbrowser: PluginBrowserApi;\n\tnetwork: PluginNetworkApi;\n\t/**\n\t * Vetta 服务端网关调用(ADR-0056)。**仅内置 official 插件可用**,\n\t * 第三方插件读到 `undefined`,故使用前必须判空。\n\t */\n\tgateway?: PluginGatewayApi;\n\tstorage: PluginStorageApi;\n\tsettings: PluginSettingsApi;\n\ti18n: PluginI18nApi;\n\t/**\n\t * 当前的**新会话默认工作模式**(agent_mode 轴,见 ADR-0046 及其 2026-08 修订)。\n\t *\n\t * 工作模式只在会话创建时固化,之后会话内不可变,因此这里读到的是用户此刻的设置值,\n\t * **不是**某个已存在会话正在使用的模式,不要用它推断进行中的会话。\n\t * 模式也不再隐藏任何插件能力,只适合做展示层的软性定制,不要据此隐藏功能入口。\n\t */\n\tgetAgentMode(): AgentMode;\n\t/** 订阅默认工作模式变更(用户改设置时触发)。返回 Disposable 取消订阅。 */\n\tonAgentModeChanged(listener: (mode: AgentMode) => void): Disposable;\n}\n\nexport type PluginActivationCleanup = Disposable | (() => void | Promise<void>);\n\nexport interface PluginDefinition {\n\t/**\n\t * Activate one plugin instance. Returning a cleanup binds resource ownership to\n\t * this specific activation, including overlapping hot-reload activations.\n\t */\n\tactivate(ctx: PluginContext): void | PluginActivationCleanup | Promise<void | PluginActivationCleanup>;\n\t/** Legacy module-level cleanup. Prefer an activation-scoped cleanup return value. */\n\tdeactivate?(): void | Promise<void>;\n}\n\nexport function definePlugin(plugin: PluginDefinition): PluginDefinition {\n\treturn plugin;\n}\n"]}
|
package/dist/conversation.d.ts
CHANGED
|
@@ -24,6 +24,22 @@ export type ConversationEvent = {
|
|
|
24
24
|
} | {
|
|
25
25
|
type: "message-updated";
|
|
26
26
|
delta: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 模型还在生成这次调用,流式参数已解析出新的键。
|
|
30
|
+
*
|
|
31
|
+
* 用它做「agent 正在动某个目标」这类实时 UI:`edit` / `write` 真正耗时的是
|
|
32
|
+
* 生成参数(一整份文件正文),执行只要几毫秒,等 `tool-call-start` 到手时活
|
|
33
|
+
* 已经干完了。目标路径通常是参数里的第一个键,所以能提前几秒拿到。
|
|
34
|
+
*
|
|
35
|
+
* 天然是残缺的:后面的键还没到,正在生成的那个键也不含在内。要权威全量参数
|
|
36
|
+
* 请用 `tool-call-start`。同一次调用会随键数增长发多次,不会逐 token 发。
|
|
37
|
+
*/
|
|
38
|
+
| {
|
|
39
|
+
type: "tool-call-args";
|
|
40
|
+
toolCallId: string;
|
|
41
|
+
toolName: string;
|
|
42
|
+
args: Record<string, unknown>;
|
|
27
43
|
} | {
|
|
28
44
|
type: "tool-call-start";
|
|
29
45
|
toolCallId: string;
|
|
@@ -37,10 +53,58 @@ export type ConversationEvent = {
|
|
|
37
53
|
} | {
|
|
38
54
|
type: "conversation-changed";
|
|
39
55
|
conversation: ConversationState;
|
|
56
|
+
} | {
|
|
57
|
+
type: "queue-changed";
|
|
58
|
+
queue: ConversationQueueState;
|
|
40
59
|
};
|
|
60
|
+
/** 会话输入队列快照(ADR-0060):排队中的 prompt 与暂停状态。 */
|
|
61
|
+
export interface ConversationQueueState {
|
|
62
|
+
/** abort/error 后队列暂停;恢复由用户在宿主 UI 操作。 */
|
|
63
|
+
paused: boolean;
|
|
64
|
+
items: Array<{
|
|
65
|
+
id: string;
|
|
66
|
+
displayText: string;
|
|
67
|
+
}>;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* sendPrompt 的回执(ADR-0060)。streaming 中发送不再静默排队:返回 `queued` 与
|
|
71
|
+
* 队列条目 id,插件可结合 `queue-changed` 事件呈现「已排队/已发出/被移除」状态。
|
|
72
|
+
*/
|
|
73
|
+
export interface SendPromptResult {
|
|
74
|
+
status: "sent" | "queued" | "failed";
|
|
75
|
+
error?: {
|
|
76
|
+
message: string;
|
|
77
|
+
};
|
|
78
|
+
queueItemId?: string;
|
|
79
|
+
}
|
|
80
|
+
/** createSession 的可选项。 */
|
|
81
|
+
export interface CreateSessionOptions {
|
|
82
|
+
/**
|
|
83
|
+
* false 时会话照常创建并设为活跃,但宿主停留在当前路由(后台任务用)。
|
|
84
|
+
* 默认 true:与用户在新会话页手动发送的观感一致,发出去就进对话页。
|
|
85
|
+
*/
|
|
86
|
+
navigate?: boolean;
|
|
87
|
+
}
|
|
41
88
|
export interface PluginConversationApi {
|
|
42
|
-
/**
|
|
43
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Send a prompt into the active conversation (renders as a user turn).
|
|
91
|
+
* Streaming 中会进入会话队列并立即 resolve `{ status: "queued" }`;
|
|
92
|
+
* 队列在本轮自然停止点接力消费,abort/error 后暂停待用户处置。
|
|
93
|
+
*
|
|
94
|
+
* 没有活跃会话时抛错。插件若想在这种情况下也把话说出去,先 {@link createSession}。
|
|
95
|
+
*/
|
|
96
|
+
sendPrompt(text: string): Promise<SendPromptResult>;
|
|
97
|
+
/**
|
|
98
|
+
* Create a conversation in `cwd` and make it active, resolving once it is ready
|
|
99
|
+
* to receive prompts — `await createSession(cwd)` 后可以直接 {@link sendPrompt}。
|
|
100
|
+
*
|
|
101
|
+
* 用于宿主此刻没有活跃会话的场景(例如用户停在新会话页,插件侧却已经产生了要
|
|
102
|
+
* 交给 agent 的工作)。已有活跃会话时照样新建一个,不做复用判断——要不要新开由
|
|
103
|
+
* 插件按自己的语义决定。
|
|
104
|
+
*
|
|
105
|
+
* 执行模式跟随宿主当前选择,插件不感知。
|
|
106
|
+
*/
|
|
107
|
+
createSession(cwd: string, options?: CreateSessionOptions): Promise<ConversationState>;
|
|
44
108
|
/** Fill the input bar without sending; the user can edit and send. */
|
|
45
109
|
insertText(text: string): void;
|
|
46
110
|
/** Abort the active conversation's current turn. */
|
|
@@ -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;AAElD,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,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,YAAY,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,iBAAiB,GAC1B;IAAE,IAAI,EAAE,YAAY,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../src/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,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,CA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AAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACrC,KAAK,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,oCAA0B;AAC1B,MAAM,WAAW,oBAAoB;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACrC;;;;;;OAMG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACpD;;;;;;;;;OASG;IACH,aAAa,CAAC,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;CAC7D","sourcesContent":["import type { Disposable } from \"./disposable.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}\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\";\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| { 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\nexport interface
|
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../src/conversation.ts"],"names":[],"mappings":"","sourcesContent":["import type { Disposable } from \"./disposable.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}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vetta 服务端网关调用(ADR-0056)。
|
|
3
|
+
*
|
|
4
|
+
* 与 `ctx.network.request` 的关键区别:插件只给出 **相对 `/api/v1` 的路径**,
|
|
5
|
+
* 服务端地址与登录凭据由宿主主进程解析注入,401 也由宿主刷新后重试。插件拿不到
|
|
6
|
+
* token,也拼不出指向其它接口的 URL——把 JWT 交给插件进程等于开放全部 `/api/v1`
|
|
7
|
+
* 的越权面,因此 SDK 不提供「取 token 自己拼」的口子。
|
|
8
|
+
*
|
|
9
|
+
* 只有随包分发的内置(official)插件能拿到 `ctx.gateway`,第三方插件读到
|
|
10
|
+
* `undefined`。风险性质不是越权(服务端档位授权限定了可用模型,消耗的是用户自己
|
|
11
|
+
* 的额度),而是插件偷跑烧光用户配额;在缺少插件签名与审核机制前先按来源收口。
|
|
12
|
+
*/
|
|
13
|
+
export interface PluginGatewayRequest {
|
|
14
|
+
/** 相对 `/api/v1` 的路径,如 `images/generate`。不接受绝对 URL。 */
|
|
15
|
+
path: string;
|
|
16
|
+
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
17
|
+
/** JSON 请求体;宿主负责序列化并设置 content-type。 */
|
|
18
|
+
body?: unknown;
|
|
19
|
+
timeoutMs?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 业务信封已由宿主拆开:`ok` 为 true 时 `data` 有值,否则看 `code` / `message`。
|
|
23
|
+
* 不抛异常——配额用尽、档位无权限这类结果是常规业务分支,插件要据此渲染引导而非报错。
|
|
24
|
+
*/
|
|
25
|
+
export interface PluginGatewayResponse<T = unknown> {
|
|
26
|
+
ok: boolean;
|
|
27
|
+
/** HTTP 状态码;网络层失败为 0。 */
|
|
28
|
+
status: number;
|
|
29
|
+
/** 业务错误码(服务端 errcode),成功为 0。 */
|
|
30
|
+
code: number;
|
|
31
|
+
message: string;
|
|
32
|
+
data?: T;
|
|
33
|
+
}
|
|
34
|
+
export interface PluginGatewayApi {
|
|
35
|
+
request<T = unknown>(request: PluginGatewayRequest): Promise<PluginGatewayResponse<T>>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=gateway.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../src/gateway.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,oBAAoB;IACpC,kFAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IACrD,sEAAwC;IACxC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB,CAAC,CAAC,GAAG,OAAO;IACjD,EAAE,EAAE,OAAO,CAAC;IACZ,+CAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,8DAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,CAAC,CAAC;CACT;AAED,MAAM,WAAW,gBAAgB;IAChC,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC;CACvF","sourcesContent":["/**\n * Vetta 服务端网关调用(ADR-0056)。\n *\n * 与 `ctx.network.request` 的关键区别:插件只给出 **相对 `/api/v1` 的路径**,\n * 服务端地址与登录凭据由宿主主进程解析注入,401 也由宿主刷新后重试。插件拿不到\n * token,也拼不出指向其它接口的 URL——把 JWT 交给插件进程等于开放全部 `/api/v1`\n * 的越权面,因此 SDK 不提供「取 token 自己拼」的口子。\n *\n * 只有随包分发的内置(official)插件能拿到 `ctx.gateway`,第三方插件读到\n * `undefined`。风险性质不是越权(服务端档位授权限定了可用模型,消耗的是用户自己\n * 的额度),而是插件偷跑烧光用户配额;在缺少插件签名与审核机制前先按来源收口。\n */\n\nexport interface PluginGatewayRequest {\n\t/** 相对 `/api/v1` 的路径,如 `images/generate`。不接受绝对 URL。 */\n\tpath: string;\n\tmethod?: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\";\n\t/** JSON 请求体;宿主负责序列化并设置 content-type。 */\n\tbody?: unknown;\n\ttimeoutMs?: number;\n}\n\n/**\n * 业务信封已由宿主拆开:`ok` 为 true 时 `data` 有值,否则看 `code` / `message`。\n * 不抛异常——配额用尽、档位无权限这类结果是常规业务分支,插件要据此渲染引导而非报错。\n */\nexport interface PluginGatewayResponse<T = unknown> {\n\tok: boolean;\n\t/** HTTP 状态码;网络层失败为 0。 */\n\tstatus: number;\n\t/** 业务错误码(服务端 errcode),成功为 0。 */\n\tcode: number;\n\tmessage: string;\n\tdata?: T;\n}\n\nexport interface PluginGatewayApi {\n\trequest<T = unknown>(request: PluginGatewayRequest): Promise<PluginGatewayResponse<T>>;\n}\n"]}
|
package/dist/gateway.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vetta 服务端网关调用(ADR-0056)。
|
|
3
|
+
*
|
|
4
|
+
* 与 `ctx.network.request` 的关键区别:插件只给出 **相对 `/api/v1` 的路径**,
|
|
5
|
+
* 服务端地址与登录凭据由宿主主进程解析注入,401 也由宿主刷新后重试。插件拿不到
|
|
6
|
+
* token,也拼不出指向其它接口的 URL——把 JWT 交给插件进程等于开放全部 `/api/v1`
|
|
7
|
+
* 的越权面,因此 SDK 不提供「取 token 自己拼」的口子。
|
|
8
|
+
*
|
|
9
|
+
* 只有随包分发的内置(official)插件能拿到 `ctx.gateway`,第三方插件读到
|
|
10
|
+
* `undefined`。风险性质不是越权(服务端档位授权限定了可用模型,消耗的是用户自己
|
|
11
|
+
* 的额度),而是插件偷跑烧光用户配额;在缺少插件签名与审核机制前先按来源收口。
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=gateway.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../src/gateway.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG","sourcesContent":["/**\n * Vetta 服务端网关调用(ADR-0056)。\n *\n * 与 `ctx.network.request` 的关键区别:插件只给出 **相对 `/api/v1` 的路径**,\n * 服务端地址与登录凭据由宿主主进程解析注入,401 也由宿主刷新后重试。插件拿不到\n * token,也拼不出指向其它接口的 URL——把 JWT 交给插件进程等于开放全部 `/api/v1`\n * 的越权面,因此 SDK 不提供「取 token 自己拼」的口子。\n *\n * 只有随包分发的内置(official)插件能拿到 `ctx.gateway`,第三方插件读到\n * `undefined`。风险性质不是越权(服务端档位授权限定了可用模型,消耗的是用户自己\n * 的额度),而是插件偷跑烧光用户配额;在缺少插件签名与审核机制前先按来源收口。\n */\n\nexport interface PluginGatewayRequest {\n\t/** 相对 `/api/v1` 的路径,如 `images/generate`。不接受绝对 URL。 */\n\tpath: string;\n\tmethod?: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\";\n\t/** JSON 请求体;宿主负责序列化并设置 content-type。 */\n\tbody?: unknown;\n\ttimeoutMs?: number;\n}\n\n/**\n * 业务信封已由宿主拆开:`ok` 为 true 时 `data` 有值,否则看 `code` / `message`。\n * 不抛异常——配额用尽、档位无权限这类结果是常规业务分支,插件要据此渲染引导而非报错。\n */\nexport interface PluginGatewayResponse<T = unknown> {\n\tok: boolean;\n\t/** HTTP 状态码;网络层失败为 0。 */\n\tstatus: number;\n\t/** 业务错误码(服务端 errcode),成功为 0。 */\n\tcode: number;\n\tmessage: string;\n\tdata?: T;\n}\n\nexport interface PluginGatewayApi {\n\trequest<T = unknown>(request: PluginGatewayRequest): Promise<PluginGatewayResponse<T>>;\n}\n"]}
|