@dp-bohrium/widget-sdk 0.6.0 → 0.7.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.
Files changed (36) hide show
  1. package/AGENTS.md +6 -3
  2. package/CHANGELOG.md +21 -0
  3. package/README.md +7 -16
  4. package/assets/schemas/widget-runtime-contracts.schema.json +7 -3
  5. package/assets/toolchain.json +13 -9
  6. package/dist/cli.mjs +155 -114
  7. package/dist/contracts.d.ts +1 -1
  8. package/dist/contracts.js +2 -1
  9. package/dist/index.d.ts +2 -2
  10. package/dist/index.js +17 -11
  11. package/dist/manifest.d.ts +1 -1
  12. package/dist/protocol/generated-host-runtime-config.d.ts +551 -0
  13. package/dist/protocol/generated-manifest.d.ts +192 -0
  14. package/dist/protocol/generated-plugin-manifest.d.ts +176 -0
  15. package/dist/protocol/generated-runtime-contracts.d.ts +1224 -0
  16. package/dist/protocol/index.d.ts +43 -0
  17. package/dist/protocol/plugin-manifest.d.ts +30 -0
  18. package/dist/protocol/widget-events.d.ts +13 -0
  19. package/dist/runtime/bootstrap.d.ts +1 -1
  20. package/dist/runtime/client.d.ts +1 -1
  21. package/dist/runtime/event-validation.d.ts +1 -1
  22. package/dist/runtime/events.d.ts +1 -1
  23. package/dist/runtime/files.d.ts +1 -1
  24. package/dist/runtime/index.d.ts +1 -1
  25. package/dist/runtime/index.js +1 -1
  26. package/dist/runtime/mock-host.d.ts +1 -1
  27. package/dist/runtime/network.d.ts +1 -1
  28. package/dist/runtime/protocol-endpoint.d.ts +1 -1
  29. package/dist/runtime/service.d.ts +2 -2
  30. package/dist/runtime/transport.d.ts +1 -1
  31. package/dist/{runtime-D7KxTtdu.js → runtime-DZA7Gqzl.js} +1 -1
  32. package/dist/widget-events-BT0QxR-H.js +65 -0
  33. package/dist/widget.d.ts +2 -2
  34. package/llms.txt +2 -3
  35. package/package.json +4 -6
  36. package/schemas/widget-runtime-contracts.schema.json +7 -3
@@ -0,0 +1,192 @@
1
+ /** GENERATED FILE. Do not edit directly. */
2
+ /**
3
+ * 构建该 Widget 时使用的 SDK 精确 SemVer 版本,不接受范围。
4
+ */
5
+ export type WidgetSdkVersion = string;
6
+ /**
7
+ * 包内 ESM 入口路径;仅允许包内相对 POSIX 路径。
8
+ */
9
+ export type EntryPath = string;
10
+ /**
11
+ * 作者声明的扩展点配置:file-preview 声明扩展名集合,panel 绑定既有 Panel。
12
+ */
13
+ export type WidgetContributionConfig = ({
14
+ type: "file-preview";
15
+ /**
16
+ * @minItems 1
17
+ */
18
+ extensions: [string, ...(string)[]];
19
+ } | PanelContributionConfig);
20
+ /**
21
+ * 声明 Host 何时允许激活该 Widget;激活条件不授予事件读取能力。
22
+ *
23
+ * @minItems 1
24
+ * @maxItems 16
25
+ */
26
+ export type ActivationEvents = [ActivationEvent] | [ActivationEvent, ActivationEvent] | [ActivationEvent, ActivationEvent, ActivationEvent] | [ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent] | [ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent] | [ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent] | [ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent] | [ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent] | [ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent] | [ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent] | [ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent] | [ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent] | [ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent] | [ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent] | [ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent] | [ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent, ActivationEvent];
27
+ /**
28
+ * 公开 Widget 激活信号。高层 WidgetContext.events 使用事件 type;低层 events.read 的 topic 不填写在这里。
29
+ */
30
+ export type ActivationEvent = (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string);
31
+ /**
32
+ * Widget 申请的 Host 用户数据权限列表。
33
+ *
34
+ * @minItems 1
35
+ * @maxItems 2
36
+ */
37
+ export type HostUserPermissions = [HostUserPermission] | [HostUserPermission, HostUserPermission];
38
+ /**
39
+ * Widget 可申请读取的 Host 用户数据权限名:个人资料或邮箱。
40
+ */
41
+ export type HostUserPermission = ("host.user.profile.read" | "host.user.email.read");
42
+ /**
43
+ * 同版本 RenderRequest 测试样例;至少一个,request 为相对 .json 路径。
44
+ *
45
+ * @minItems 1
46
+ */
47
+ export type Samples = [
48
+ {
49
+ id: string;
50
+ title: string;
51
+ request: string;
52
+ },
53
+ ...({
54
+ id: string;
55
+ title: string;
56
+ request: string;
57
+ })[]
58
+ ];
59
+ /**
60
+ * 打包阶段生成的宿主 Widget 清单;name / description 仅用于首次展示默认值,widgetConfig 为冻结运行配置。
61
+ */
62
+ export interface WidgetManifest {
63
+ name: string;
64
+ description?: string;
65
+ widgetConfig: WidgetConfig;
66
+ }
67
+ /**
68
+ * 打包阶段生成的冻结 Widget 运行配置;字段由 CLI 从作者清单写入,作者不得再直接覆盖。
69
+ */
70
+ export interface WidgetConfig {
71
+ schemaVersion: 1;
72
+ hostApiVersion: 1;
73
+ widgetSdkVersion: WidgetSdkVersion;
74
+ entry: EntryPath;
75
+ contribution: WidgetContributionConfig;
76
+ activationEvents?: ActivationEvents;
77
+ requestedCapabilities?: RequestedCapabilities;
78
+ requestedPermissions?: HostUserPermissions;
79
+ runtime?: RuntimeOptions;
80
+ samples: Samples;
81
+ }
82
+ /**
83
+ * 绑定 Agent Widget 既有 Panel 的配置。
84
+ */
85
+ export interface PanelContributionConfig {
86
+ /**
87
+ * Panel 贡献类型。
88
+ */
89
+ type: "panel";
90
+ /**
91
+ * Host 注册和查找 Panel 时使用的稳定类型标识。
92
+ */
93
+ id: string;
94
+ placement?: ({
95
+ kind: "panel";
96
+ } | {
97
+ kind: "region";
98
+ region: "session.rightRail";
99
+ mode: "replace";
100
+ });
101
+ }
102
+ /**
103
+ * Widget 申请的能力集合;声明仅表示申请,最终由 Host 按次授权。
104
+ */
105
+ export interface RequestedCapabilities {
106
+ files?: FilesCapabilityRequest;
107
+ events?: EventsCapabilityRequest;
108
+ tasks?: TasksCapabilityRequest;
109
+ state?: StateCapabilityRequest;
110
+ actions?: ActionsCapabilityRequest;
111
+ network?: NetworkCapabilityRequest;
112
+ presentation?: RequestedPresentationCapability;
113
+ region?: RequestedRegionCapability;
114
+ }
115
+ /**
116
+ * 文件能力的独立申请开关;保存已有文件必须单独申请 files.write 并获得 Host 授权,可写范围由 Host grant 决定。
117
+ */
118
+ export interface FilesCapabilityRequest {
119
+ list?: boolean;
120
+ metadata?: boolean;
121
+ read?: boolean;
122
+ download?: boolean;
123
+ write?: boolean;
124
+ }
125
+ /**
126
+ * 事件读取能力的申请;topics 声明要读取的事件主题。
127
+ */
128
+ export interface EventsCapabilityRequest {
129
+ /**
130
+ * @minItems 1
131
+ * @maxItems 32
132
+ */
133
+ topics: [string, ...(string)[]];
134
+ }
135
+ /**
136
+ * 任务发现与观察能力的申请;list / watch 至少显式申请一项,已申请项固定为 true。
137
+ */
138
+ export interface TasksCapabilityRequest {
139
+ list?: true;
140
+ watch?: true;
141
+ }
142
+ /**
143
+ * 受限 UI 状态读写能力的申请;read / write 分别声明。
144
+ */
145
+ export interface StateCapabilityRequest {
146
+ read: boolean;
147
+ write: boolean;
148
+ }
149
+ /**
150
+ * Host 自定义动作调用能力的申请;names 声明可调用的动作名。
151
+ */
152
+ export interface ActionsCapabilityRequest {
153
+ /**
154
+ * @minItems 1
155
+ * @maxItems 32
156
+ */
157
+ names: [string, ...(string)[]];
158
+ }
159
+ /**
160
+ * Host 托管网络能力的申请;fetch 固定为 true,目标域名由 Host 运行时按请求授权。
161
+ */
162
+ export interface NetworkCapabilityRequest {
163
+ fetch: true;
164
+ }
165
+ /**
166
+ * 呈现能力的申请;surfaces 声明期望的呈现表面。
167
+ */
168
+ export interface RequestedPresentationCapability {
169
+ /**
170
+ * @minItems 1
171
+ * @maxItems 2
172
+ */
173
+ surfaces: [("floating" | "overlay")] | [("floating" | "overlay"), ("floating" | "overlay")];
174
+ }
175
+ /**
176
+ * 会话右侧区域替换能力的申请;当前仅支持 session.rightRail + replace。
177
+ */
178
+ export interface RequestedRegionCapability {
179
+ /**
180
+ * @minItems 1
181
+ * @maxItems 1
182
+ */
183
+ regions: ["session.rightRail"];
184
+ mode: "replace";
185
+ }
186
+ /**
187
+ * 运行时申请;worker 与 webAssembly 均为可选布尔开关。
188
+ */
189
+ export interface RuntimeOptions {
190
+ worker?: boolean;
191
+ webAssembly?: boolean;
192
+ }
@@ -0,0 +1,176 @@
1
+ /** GENERATED FILE. Do not edit directly. */
2
+ /**
3
+ * Host 可用于启动 Widget 的公开激活信号。多个值表示任一信号命中即可激活;它们不授予 events.read 权限。工具名形式为 tool-call-<阶段>:<工具名>。
4
+ *
5
+ * @minItems 1
6
+ * @maxItems 16
7
+ */
8
+ export type ActivationEvents = [(("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string)] | [(("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string)] | [(("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string)] | [(("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string)] | [(("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string)] | [(("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string)] | [(("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string)] | [(("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string)] | [(("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string)] | [(("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string)] | [(("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string)] | [(("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string)] | [(("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string)] | [(("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string)] | [(("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string)] | [(("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string), (("session.start" | "turn-start" | "turn-end" | "step-start" | "step-end" | "tool-call-generating" | "tool-call-waiting" | "tool-call-running" | "tool-call-result" | "tool-call-error" | "workspace-file-changed" | "workspace-tree-refresh" | "workspace-file-opened" | "ui-tool-opened" | "ui-panel-focused" | "host-surface-changed") | string)];
9
+ /**
10
+ * 作者贡献点联合:以 type 判别 Panel 或文件预览。
11
+ */
12
+ export type WidgetContribution = (WidgetPanelContribution | WidgetFilePreviewContribution);
13
+ /**
14
+ * 同版本 RenderRequest 测试样例;至少一个,request 为相对 .json 路径。
15
+ *
16
+ * @minItems 1
17
+ */
18
+ export type Samples = [
19
+ {
20
+ id: string;
21
+ title: string;
22
+ request: string;
23
+ },
24
+ ...({
25
+ id: string;
26
+ title: string;
27
+ request: string;
28
+ })[]
29
+ ];
30
+ /**
31
+ * 插件作者维护的插件清单;打包阶段会生成宿主清单的运行时字段。
32
+ */
33
+ export interface WidgetPluginManifest {
34
+ $schema?: string;
35
+ name: string;
36
+ version: string;
37
+ displayName?: string;
38
+ description?: string;
39
+ /**
40
+ * 插件源码入口;CLI 默认使用 src/widget.ts。
41
+ */
42
+ entry?: string;
43
+ activationEvents?: ActivationEvents;
44
+ contributes: WidgetPluginContributions;
45
+ capabilities?: RequestedCapabilities;
46
+ runtime?: RuntimeOptions;
47
+ samples?: Samples;
48
+ }
49
+ /**
50
+ * 插件声明的一组扩展点;当前仅支持 widget 贡献点。
51
+ */
52
+ export interface WidgetPluginContributions {
53
+ widget: WidgetContribution;
54
+ }
55
+ /**
56
+ * 面板贡献:声明 panel 类型与 id;surfaces、title、placement 可选。
57
+ */
58
+ export interface WidgetPanelContribution {
59
+ type: "panel";
60
+ id: string;
61
+ title?: string;
62
+ /**
63
+ * @minItems 1
64
+ * @maxItems 3
65
+ */
66
+ surfaces?: [("workspace" | "floating" | "overlay")] | [("workspace" | "floating" | "overlay"), ("workspace" | "floating" | "overlay")] | [("workspace" | "floating" | "overlay"), ("workspace" | "floating" | "overlay"), ("workspace" | "floating" | "overlay")];
67
+ placement?: ({
68
+ kind: "panel";
69
+ } | {
70
+ kind: "region";
71
+ region: "session.rightRail";
72
+ mode: "replace";
73
+ });
74
+ }
75
+ /**
76
+ * 文件预览贡献:声明一组小写且不含前导点的扩展名。
77
+ */
78
+ export interface WidgetFilePreviewContribution {
79
+ type: "file-preview";
80
+ /**
81
+ * @minItems 1
82
+ * @maxItems 32
83
+ */
84
+ extensions: [string, ...(string)[]];
85
+ }
86
+ /**
87
+ * Widget 申请的能力集合;声明仅表示申请,最终由 Host 按次授权。
88
+ */
89
+ export interface RequestedCapabilities {
90
+ files?: FilesCapabilityRequest;
91
+ events?: EventsCapabilityRequest;
92
+ tasks?: TasksCapabilityRequest;
93
+ state?: StateCapabilityRequest;
94
+ actions?: ActionsCapabilityRequest;
95
+ network?: NetworkCapabilityRequest;
96
+ presentation?: RequestedPresentationCapability;
97
+ region?: RequestedRegionCapability;
98
+ }
99
+ /**
100
+ * 文件能力的独立申请开关;保存已有文件必须单独申请 files.write 并获得 Host 授权,可写范围由 Host grant 决定。
101
+ */
102
+ export interface FilesCapabilityRequest {
103
+ list?: boolean;
104
+ metadata?: boolean;
105
+ read?: boolean;
106
+ download?: boolean;
107
+ write?: boolean;
108
+ }
109
+ /**
110
+ * 事件读取能力的申请;topics 声明要读取的事件主题。
111
+ */
112
+ export interface EventsCapabilityRequest {
113
+ /**
114
+ * @minItems 1
115
+ * @maxItems 32
116
+ */
117
+ topics: [string, ...(string)[]];
118
+ }
119
+ /**
120
+ * 任务发现与观察能力的申请;list / watch 至少显式申请一项,已申请项固定为 true。
121
+ */
122
+ export interface TasksCapabilityRequest {
123
+ list?: true;
124
+ watch?: true;
125
+ }
126
+ /**
127
+ * 受限 UI 状态读写能力的申请;read / write 分别声明。
128
+ */
129
+ export interface StateCapabilityRequest {
130
+ read: boolean;
131
+ write: boolean;
132
+ }
133
+ /**
134
+ * Host 自定义动作调用能力的申请;names 声明可调用的动作名。
135
+ */
136
+ export interface ActionsCapabilityRequest {
137
+ /**
138
+ * @minItems 1
139
+ * @maxItems 32
140
+ */
141
+ names: [string, ...(string)[]];
142
+ }
143
+ /**
144
+ * Host 托管网络能力的申请;fetch 固定为 true,目标域名由 Host 运行时按请求授权。
145
+ */
146
+ export interface NetworkCapabilityRequest {
147
+ fetch: true;
148
+ }
149
+ /**
150
+ * 呈现能力的申请;surfaces 声明期望的呈现表面。
151
+ */
152
+ export interface RequestedPresentationCapability {
153
+ /**
154
+ * @minItems 1
155
+ * @maxItems 2
156
+ */
157
+ surfaces: [("floating" | "overlay")] | [("floating" | "overlay"), ("floating" | "overlay")];
158
+ }
159
+ /**
160
+ * 会话右侧区域替换能力的申请;当前仅支持 session.rightRail + replace。
161
+ */
162
+ export interface RequestedRegionCapability {
163
+ /**
164
+ * @minItems 1
165
+ * @maxItems 1
166
+ */
167
+ regions: ["session.rightRail"];
168
+ mode: "replace";
169
+ }
170
+ /**
171
+ * 运行时申请;worker 与 webAssembly 均为可选布尔开关。
172
+ */
173
+ export interface RuntimeOptions {
174
+ worker?: boolean;
175
+ webAssembly?: boolean;
176
+ }