@dp-bohrium/widget-cli 0.3.0 → 0.5.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.
@@ -0,0 +1,867 @@
1
+ import { Buffer } from "node:buffer";
2
+ //#region ../contracts/dist/generated-runtime-contracts.d.ts
3
+ /**
4
+ * 完整渲染请求联合:tool-result(内部)/ file-preview / panel。
5
+ */
6
+ type RenderRequest = (ToolResultRenderRequest | FilePreviewRenderRequest | PanelRenderRequest);
7
+ /**
8
+ * 历史 Host 投影类型;仅供受信任的内部 Host 与协议验证。Forge 新插件不得声明或挂载 tool-result,工具结果应由 Runtime 逻辑映射到自定义 Panel。
9
+ */
10
+ type ToolResultRenderRequest = (RenderRequestBase & {
11
+ contribution: "tool-result";
12
+ content: ToolResultContent;
13
+ });
14
+ /**
15
+ * 渲染状态:loading / partial / complete / error。
16
+ */
17
+ type RenderState = ("loading" | "partial" | "complete" | "error");
18
+ /**
19
+ * 主题模式:light 或 dark。
20
+ */
21
+ type ThemeMode = ("light" | "dark");
22
+ /**
23
+ * Host 已授予的能力;多数分支附带调用与预算限制(ui.presentation / ui.region 除外)。
24
+ */
25
+ type GrantedCapability = ({
26
+ name: "service.invoke";
27
+ services: WidgetServicePermissions;
28
+ limits: {
29
+ callsPerMinute: number;
30
+ requestBytes: number;
31
+ responseBytes: number;
32
+ };
33
+ } | {
34
+ name: "files.list";
35
+ limits: {
36
+ pageSize: number;
37
+ callsPerMinute: number;
38
+ };
39
+ } | {
40
+ name: "files.download";
41
+ limits: {
42
+ bytesPerRun: number;
43
+ callsPerMinute: number;
44
+ };
45
+ } | {
46
+ name: "files.metadata";
47
+ limits: {
48
+ callsPerMinute: number;
49
+ };
50
+ } | {
51
+ name: "files.read";
52
+ limits: {
53
+ bytesPerRequest: number;
54
+ /**
55
+ * @deprecated
56
+ * 历史读取累计额度字段,仅为兼容旧配置保留;当前 files.read 不累计或执行此额度,新宿主不再下发。
57
+ */
58
+ bytesPerRun?: number;
59
+ callsPerMinute: number;
60
+ };
61
+ } | {
62
+ name: "files.write";
63
+ limits: {
64
+ bytesPerRequest: number;
65
+ bytesPerRun: number;
66
+ callsPerMinute: number;
67
+ };
68
+ } | {
69
+ name: "events.read";
70
+ /**
71
+ * @minItems 1
72
+ * @maxItems 32
73
+ */
74
+ topics: [string, ...(string)[]];
75
+ limits: {
76
+ callsPerMinute: number;
77
+ pageSize: number;
78
+ minPollMs: number;
79
+ };
80
+ } | {
81
+ name: "tasks.list";
82
+ limits: {
83
+ callsPerMinute: number;
84
+ pageSize: number;
85
+ minPollMs: number;
86
+ };
87
+ } | {
88
+ name: "tasks.watch";
89
+ limits: {
90
+ callsPerMinute: number;
91
+ pageSize: number;
92
+ minPollMs: number;
93
+ };
94
+ } | {
95
+ name: "ui.state";
96
+ limits: {
97
+ callsPerMinute: number;
98
+ bytesPerRun: number;
99
+ maxValueBytes: number;
100
+ };
101
+ } | {
102
+ name: "actions.invoke";
103
+ /**
104
+ * @minItems 1
105
+ * @maxItems 32
106
+ */
107
+ actions: [string, ...(string)[]];
108
+ limits: {
109
+ callsPerMinute: number;
110
+ };
111
+ } | {
112
+ name: "network.fetch";
113
+ limits: WidgetNetworkLimits;
114
+ } | GrantedPresentationCapability | GrantedRegionCapability);
115
+ /**
116
+ * 服务权限列表。
117
+ *
118
+ * @minItems 1
119
+ * @maxItems 32
120
+ */
121
+ type WidgetServicePermissions = [WidgetServicePermission, ...(WidgetServicePermission)[]];
122
+ /**
123
+ * 正整数。
124
+ */
125
+ type PositiveInteger = number;
126
+ /**
127
+ * 可序列化为 JSON 的任意值;null / boolean / number / string / 数组 / 对象的递归联合。
128
+ */
129
+ type JsonValue = (null | boolean | number | string | JsonValue[] | {
130
+ [k: string]: JsonValue;
131
+ });
132
+ /**
133
+ * 文件预览渲染请求:公共字段 + contribution=file-preview + content。
134
+ */
135
+ type FilePreviewRenderRequest = (RenderRequestBase & {
136
+ contribution: "file-preview";
137
+ content: FilePreviewContent;
138
+ });
139
+ /**
140
+ * 由存储执行端签发的文件内容版本,用于条件读取和保存;不是 RenderRequest.revision。
141
+ */
142
+ type FileRevision = string;
143
+ /**
144
+ * 面板渲染请求:公共字段 + contribution=panel + content。
145
+ */
146
+ type PanelRenderRequest = (RenderRequestBase & {
147
+ contribution: "panel";
148
+ content: PanelContent;
149
+ });
150
+ /**
151
+ * 渲染请求公共字段:schemaVersion、requestId、instanceId、revision、state、context。
152
+ */
153
+ interface RenderRequestBase {
154
+ schemaVersion: 1;
155
+ requestId: string;
156
+ instanceId: string;
157
+ revision: number;
158
+ state: RenderState;
159
+ context: WidgetRenderContext;
160
+ }
161
+ /**
162
+ * 渲染上下文:locale、theme、viewport、能力与关联 id。
163
+ */
164
+ interface WidgetRenderContext {
165
+ locale: string;
166
+ theme: Theme;
167
+ viewport: {
168
+ width: number;
169
+ height: number;
170
+ };
171
+ capabilities: GrantedCapability[];
172
+ correlationId: string;
173
+ }
174
+ /**
175
+ * 渲染上下文中的主题:mode 与设计令牌表。
176
+ */
177
+ interface Theme {
178
+ mode: ThemeMode;
179
+ tokens: {
180
+ background: string;
181
+ foreground: string;
182
+ muted: string;
183
+ mutedForeground: string;
184
+ border: string;
185
+ primary: string;
186
+ danger: string;
187
+ };
188
+ }
189
+ /**
190
+ * 单条服务权限:服务名 + 允许的动作列表。
191
+ */
192
+ interface WidgetServicePermission {
193
+ service: string;
194
+ /**
195
+ * @minItems 1
196
+ * @maxItems 32
197
+ */
198
+ actions: [string, ...(string)[]];
199
+ }
200
+ /**
201
+ * Host 托管网络的限制项:超时、并发、频率与字节数。
202
+ */
203
+ interface WidgetNetworkLimits {
204
+ timeoutMs: PositiveInteger;
205
+ maxRedirects: PositiveInteger;
206
+ maxConcurrentRequests: PositiveInteger;
207
+ callsPerMinute: PositiveInteger;
208
+ requestHeaderBytes: PositiveInteger;
209
+ responseHeaderBytes: PositiveInteger;
210
+ requestBodyBytes: PositiveInteger;
211
+ responseBodyBytes: PositiveInteger;
212
+ }
213
+ /**
214
+ * 已授予的呈现能力;含 surfaces,requiresHostConfirmation 恒为 true。
215
+ */
216
+ interface GrantedPresentationCapability {
217
+ name: "ui.presentation";
218
+ /**
219
+ * @minItems 1
220
+ * @maxItems 2
221
+ */
222
+ surfaces: [("floating" | "overlay")] | [("floating" | "overlay"), ("floating" | "overlay")];
223
+ requiresHostConfirmation: true;
224
+ }
225
+ /**
226
+ * 已授予的会话右侧区域替换能力。
227
+ */
228
+ interface GrantedRegionCapability {
229
+ name: "ui.region";
230
+ /**
231
+ * @minItems 1
232
+ * @maxItems 1
233
+ */
234
+ regions: ["session.rightRail"];
235
+ mode: "replace";
236
+ requiresHostConfirmation: true;
237
+ }
238
+ /**
239
+ * tool-result 渲染内容;仅内部通道使用,外部作者不挂载。
240
+ */
241
+ interface ToolResultContent {
242
+ contribution: "tool-result";
243
+ tool: {
244
+ name: string;
245
+ callId: string;
246
+ status: ("running" | "succeeded" | "failed" | "cancelled");
247
+ };
248
+ input: JsonValue;
249
+ result?: JsonValue;
250
+ envelope?: ToolResultEnvelope;
251
+ error?: {
252
+ code: string;
253
+ message: string;
254
+ };
255
+ }
256
+ /**
257
+ * 工具执行结果信封;仅供受信任的内部 Host 与 Agent 事件,不进入作者 Contribution。
258
+ */
259
+ interface ToolResultEnvelope {
260
+ schemaVersion: 1;
261
+ status: ("running" | "succeeded" | "failed" | "cancelled");
262
+ summary?: string;
263
+ data?: JsonValue;
264
+ /**
265
+ * @maxItems 64
266
+ */
267
+ metrics?: ToolResultMetric[];
268
+ /**
269
+ * @maxItems 64
270
+ */
271
+ artifacts?: ToolResultArtifact[];
272
+ /**
273
+ * @maxItems 32
274
+ */
275
+ provenance?: ToolResultProvenance[];
276
+ /**
277
+ * @maxItems 32
278
+ */
279
+ warnings?: ToolResultNotice[];
280
+ /**
281
+ * @maxItems 32
282
+ */
283
+ missing?: ToolResultNotice[];
284
+ }
285
+ /**
286
+ * 工具结果中的单个指标。
287
+ */
288
+ interface ToolResultMetric {
289
+ name: string;
290
+ value: number;
291
+ unit?: string;
292
+ label?: string;
293
+ }
294
+ /**
295
+ * 工具结果中的产物元数据,不含内容本身。
296
+ */
297
+ interface ToolResultArtifact {
298
+ id: string;
299
+ name: string;
300
+ kind?: ("file" | "directory");
301
+ mimeType?: string;
302
+ size?: number;
303
+ downloadable?: boolean;
304
+ }
305
+ /**
306
+ * 工具结果的来源信息。
307
+ */
308
+ interface ToolResultProvenance {
309
+ source: string;
310
+ kind?: string;
311
+ label?: string;
312
+ }
313
+ /**
314
+ * 工具结果中的提示或警告。
315
+ */
316
+ interface ToolResultNotice {
317
+ code: string;
318
+ message: string;
319
+ }
320
+ /**
321
+ * 文件预览内容;contribution 必须为 file-preview。
322
+ */
323
+ interface FilePreviewContent {
324
+ contribution: "file-preview";
325
+ file: FileReference;
326
+ preview?: JsonValue;
327
+ }
328
+ /**
329
+ * Host 签发的文件引用;仅含不透明 id、可选内容版本和展示元数据。引用本身不授予写权限,不含路径或 URL。
330
+ */
331
+ interface FileReference {
332
+ id: string;
333
+ kind: ("file" | "directory");
334
+ name: string;
335
+ extension?: string;
336
+ mimeType?: string;
337
+ size?: number;
338
+ revision?: FileRevision;
339
+ }
340
+ /**
341
+ * 面板内容;contribution 必须为 panel。
342
+ */
343
+ interface PanelContent {
344
+ contribution: "panel";
345
+ id: string;
346
+ title?: string;
347
+ data: JsonValue;
348
+ }
349
+ //#endregion
350
+ //#region ../contracts/dist/generated-manifest.d.ts
351
+ /** GENERATED FILE. Do not edit directly. */
352
+ /**
353
+ * 构建该 Widget 时使用的 SDK 精确 SemVer 版本,不接受范围。
354
+ */
355
+ type WidgetSdkVersion = string;
356
+ /**
357
+ * 包内 ESM 入口路径;仅允许包内相对 POSIX 路径。
358
+ */
359
+ type EntryPath = string;
360
+ /**
361
+ * 作者声明的扩展点配置:file-preview 声明扩展名集合,panel 绑定既有 Panel。
362
+ */
363
+ type WidgetContributionConfig = ({
364
+ type: "file-preview";
365
+ /**
366
+ * @minItems 1
367
+ */
368
+ extensions: [string, ...(string)[]];
369
+ } | PanelContributionConfig);
370
+ /**
371
+ * 声明 Host 何时允许激活该 Widget;激活条件不授予事件读取能力。
372
+ *
373
+ * @minItems 1
374
+ * @maxItems 16
375
+ */
376
+ type ActivationEvents$1 = [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];
377
+ /**
378
+ * 公开 Widget 激活信号。高层 WidgetContext.events 使用事件 type;低层 events.read 的 topic 不填写在这里。
379
+ */
380
+ 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);
381
+ /**
382
+ * Widget 申请的 Host 用户数据权限列表。
383
+ *
384
+ * @minItems 1
385
+ * @maxItems 2
386
+ */
387
+ type HostUserPermissions = [HostUserPermission] | [HostUserPermission, HostUserPermission];
388
+ /**
389
+ * Widget 可申请读取的 Host 用户数据权限名:个人资料或邮箱。
390
+ */
391
+ type HostUserPermission = ("host.user.profile.read" | "host.user.email.read");
392
+ /**
393
+ * 同版本 RenderRequest 测试样例;至少一个,request 为相对 .json 路径。
394
+ *
395
+ * @minItems 1
396
+ */
397
+ type Samples$1 = [{
398
+ id: string;
399
+ title: string;
400
+ request: string;
401
+ }, ...({
402
+ id: string;
403
+ title: string;
404
+ request: string;
405
+ })[]];
406
+ /**
407
+ * 打包阶段生成的宿主 Widget 清单;name / description 仅用于首次展示默认值,widgetConfig 为冻结运行配置。
408
+ */
409
+ interface WidgetManifest {
410
+ name: string;
411
+ description?: string;
412
+ widgetConfig: WidgetConfig;
413
+ }
414
+ /**
415
+ * 打包阶段生成的冻结 Widget 运行配置;字段由 CLI 从作者清单写入,作者不得再直接覆盖。
416
+ */
417
+ interface WidgetConfig {
418
+ schemaVersion: 1;
419
+ hostApiVersion: 1;
420
+ widgetSdkVersion: WidgetSdkVersion;
421
+ entry: EntryPath;
422
+ contribution: WidgetContributionConfig;
423
+ activationEvents?: ActivationEvents$1;
424
+ requestedCapabilities?: RequestedCapabilities$1;
425
+ requestedPermissions?: HostUserPermissions;
426
+ runtime?: RuntimeOptions$1;
427
+ samples: Samples$1;
428
+ }
429
+ /**
430
+ * 绑定 Agent Widget 既有 Panel 的配置。
431
+ */
432
+ interface PanelContributionConfig {
433
+ /**
434
+ * Panel 贡献类型。
435
+ */
436
+ type: "panel";
437
+ /**
438
+ * Host 注册和查找 Panel 时使用的稳定类型标识。
439
+ */
440
+ id: string;
441
+ placement?: ({
442
+ kind: "panel";
443
+ } | {
444
+ kind: "region";
445
+ region: "session.rightRail";
446
+ mode: "replace";
447
+ });
448
+ }
449
+ /**
450
+ * Widget 申请的能力集合;声明仅表示申请,最终由 Host 按次授权。
451
+ */
452
+ interface RequestedCapabilities$1 {
453
+ files?: FilesCapabilityRequest$1;
454
+ events?: EventsCapabilityRequest$1;
455
+ tasks?: TasksCapabilityRequest$1;
456
+ state?: StateCapabilityRequest$1;
457
+ actions?: ActionsCapabilityRequest$1;
458
+ network?: NetworkCapabilityRequest$1;
459
+ presentation?: RequestedPresentationCapability$1;
460
+ region?: RequestedRegionCapability$1;
461
+ }
462
+ /**
463
+ * 文件能力的独立申请开关;保存已有文件必须单独申请 files.write 并获得 Host 授权,可写范围由 Host grant 决定。
464
+ */
465
+ interface FilesCapabilityRequest$1 {
466
+ list?: boolean;
467
+ metadata?: boolean;
468
+ read?: boolean;
469
+ download?: boolean;
470
+ write?: boolean;
471
+ }
472
+ /**
473
+ * 事件读取能力的申请;topics 声明要读取的事件主题。
474
+ */
475
+ interface EventsCapabilityRequest$1 {
476
+ /**
477
+ * @minItems 1
478
+ * @maxItems 32
479
+ */
480
+ topics: [string, ...(string)[]];
481
+ }
482
+ /**
483
+ * 任务发现与观察能力的申请;list / watch 至少显式申请一项,已申请项固定为 true。
484
+ */
485
+ interface TasksCapabilityRequest$1 {
486
+ list?: true;
487
+ watch?: true;
488
+ }
489
+ /**
490
+ * 受限 UI 状态读写能力的申请;read / write 分别声明。
491
+ */
492
+ interface StateCapabilityRequest$1 {
493
+ read: boolean;
494
+ write: boolean;
495
+ }
496
+ /**
497
+ * Host 自定义动作调用能力的申请;names 声明可调用的动作名。
498
+ */
499
+ interface ActionsCapabilityRequest$1 {
500
+ /**
501
+ * @minItems 1
502
+ * @maxItems 32
503
+ */
504
+ names: [string, ...(string)[]];
505
+ }
506
+ /**
507
+ * Host 托管网络能力的申请;fetch 固定为 true,目标域名由 Host 运行时按请求授权。
508
+ */
509
+ interface NetworkCapabilityRequest$1 {
510
+ fetch: true;
511
+ }
512
+ /**
513
+ * 呈现能力的申请;surfaces 声明期望的呈现表面。
514
+ */
515
+ interface RequestedPresentationCapability$1 {
516
+ /**
517
+ * @minItems 1
518
+ * @maxItems 2
519
+ */
520
+ surfaces: [("floating" | "overlay")] | [("floating" | "overlay"), ("floating" | "overlay")];
521
+ }
522
+ /**
523
+ * 会话右侧区域替换能力的申请;当前仅支持 session.rightRail + replace。
524
+ */
525
+ interface RequestedRegionCapability$1 {
526
+ /**
527
+ * @minItems 1
528
+ * @maxItems 1
529
+ */
530
+ regions: ["session.rightRail"];
531
+ mode: "replace";
532
+ }
533
+ /**
534
+ * 运行时申请;worker 与 webAssembly 均为可选布尔开关。
535
+ */
536
+ interface RuntimeOptions$1 {
537
+ worker?: boolean;
538
+ webAssembly?: boolean;
539
+ }
540
+ //#endregion
541
+ //#region ../contracts/dist/generated-plugin-manifest.d.ts
542
+ /** GENERATED FILE. Do not edit directly. */
543
+ /**
544
+ * Host 可用于启动 Widget 的公开激活信号。多个值表示任一信号命中即可激活;它们不授予 events.read 权限。工具名形式为 tool-call-<阶段>:<工具名>。
545
+ *
546
+ * @minItems 1
547
+ * @maxItems 16
548
+ */
549
+ 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)];
550
+ /**
551
+ * 作者贡献点联合:以 type 判别 Panel 或文件预览。
552
+ */
553
+ type WidgetContribution = (WidgetPanelContribution | WidgetFilePreviewContribution);
554
+ /**
555
+ * 同版本 RenderRequest 测试样例;至少一个,request 为相对 .json 路径。
556
+ *
557
+ * @minItems 1
558
+ */
559
+ type Samples = [{
560
+ id: string;
561
+ title: string;
562
+ request: string;
563
+ }, ...({
564
+ id: string;
565
+ title: string;
566
+ request: string;
567
+ })[]];
568
+ /**
569
+ * 插件作者维护的插件清单;打包阶段会生成宿主清单的运行时字段。
570
+ */
571
+ interface WidgetPluginManifest$1 {
572
+ $schema?: string;
573
+ name: string;
574
+ version: string;
575
+ displayName?: string;
576
+ description?: string;
577
+ /**
578
+ * 插件源码入口;CLI 默认使用 src/widget.ts。
579
+ */
580
+ entry?: string;
581
+ activationEvents?: ActivationEvents;
582
+ contributes: WidgetPluginContributions;
583
+ capabilities?: RequestedCapabilities;
584
+ runtime?: RuntimeOptions;
585
+ samples?: Samples;
586
+ }
587
+ /**
588
+ * 插件声明的一组扩展点;当前仅支持 widget 贡献点。
589
+ */
590
+ interface WidgetPluginContributions {
591
+ widget: WidgetContribution;
592
+ }
593
+ /**
594
+ * 面板贡献:声明 panel 类型与 id;surfaces、title、placement 可选。
595
+ */
596
+ interface WidgetPanelContribution {
597
+ type: "panel";
598
+ id: string;
599
+ title?: string;
600
+ /**
601
+ * @minItems 1
602
+ * @maxItems 3
603
+ */
604
+ surfaces?: [("workspace" | "floating" | "overlay")] | [("workspace" | "floating" | "overlay"), ("workspace" | "floating" | "overlay")] | [("workspace" | "floating" | "overlay"), ("workspace" | "floating" | "overlay"), ("workspace" | "floating" | "overlay")];
605
+ placement?: ({
606
+ kind: "panel";
607
+ } | {
608
+ kind: "region";
609
+ region: "session.rightRail";
610
+ mode: "replace";
611
+ });
612
+ }
613
+ /**
614
+ * 文件预览贡献:声明一组小写且不含前导点的扩展名。
615
+ */
616
+ interface WidgetFilePreviewContribution {
617
+ type: "file-preview";
618
+ /**
619
+ * @minItems 1
620
+ * @maxItems 32
621
+ */
622
+ extensions: [string, ...(string)[]];
623
+ }
624
+ /**
625
+ * Widget 申请的能力集合;声明仅表示申请,最终由 Host 按次授权。
626
+ */
627
+ interface RequestedCapabilities {
628
+ files?: FilesCapabilityRequest;
629
+ events?: EventsCapabilityRequest;
630
+ tasks?: TasksCapabilityRequest;
631
+ state?: StateCapabilityRequest;
632
+ actions?: ActionsCapabilityRequest;
633
+ network?: NetworkCapabilityRequest;
634
+ presentation?: RequestedPresentationCapability;
635
+ region?: RequestedRegionCapability;
636
+ }
637
+ /**
638
+ * 文件能力的独立申请开关;保存已有文件必须单独申请 files.write 并获得 Host 授权,可写范围由 Host grant 决定。
639
+ */
640
+ interface FilesCapabilityRequest {
641
+ list?: boolean;
642
+ metadata?: boolean;
643
+ read?: boolean;
644
+ download?: boolean;
645
+ write?: boolean;
646
+ }
647
+ /**
648
+ * 事件读取能力的申请;topics 声明要读取的事件主题。
649
+ */
650
+ interface EventsCapabilityRequest {
651
+ /**
652
+ * @minItems 1
653
+ * @maxItems 32
654
+ */
655
+ topics: [string, ...(string)[]];
656
+ }
657
+ /**
658
+ * 任务发现与观察能力的申请;list / watch 至少显式申请一项,已申请项固定为 true。
659
+ */
660
+ interface TasksCapabilityRequest {
661
+ list?: true;
662
+ watch?: true;
663
+ }
664
+ /**
665
+ * 受限 UI 状态读写能力的申请;read / write 分别声明。
666
+ */
667
+ interface StateCapabilityRequest {
668
+ read: boolean;
669
+ write: boolean;
670
+ }
671
+ /**
672
+ * Host 自定义动作调用能力的申请;names 声明可调用的动作名。
673
+ */
674
+ interface ActionsCapabilityRequest {
675
+ /**
676
+ * @minItems 1
677
+ * @maxItems 32
678
+ */
679
+ names: [string, ...(string)[]];
680
+ }
681
+ /**
682
+ * Host 托管网络能力的申请;fetch 固定为 true,目标域名由 Host 运行时按请求授权。
683
+ */
684
+ interface NetworkCapabilityRequest {
685
+ fetch: true;
686
+ }
687
+ /**
688
+ * 呈现能力的申请;surfaces 声明期望的呈现表面。
689
+ */
690
+ interface RequestedPresentationCapability {
691
+ /**
692
+ * @minItems 1
693
+ * @maxItems 2
694
+ */
695
+ surfaces: [("floating" | "overlay")] | [("floating" | "overlay"), ("floating" | "overlay")];
696
+ }
697
+ /**
698
+ * 会话右侧区域替换能力的申请;当前仅支持 session.rightRail + replace。
699
+ */
700
+ interface RequestedRegionCapability {
701
+ /**
702
+ * @minItems 1
703
+ * @maxItems 1
704
+ */
705
+ regions: ["session.rightRail"];
706
+ mode: "replace";
707
+ }
708
+ /**
709
+ * 运行时申请;worker 与 webAssembly 均为可选布尔开关。
710
+ */
711
+ interface RuntimeOptions {
712
+ worker?: boolean;
713
+ webAssembly?: boolean;
714
+ }
715
+ //#endregion
716
+ //#region ../contracts/dist/plugin-manifest.d.ts
717
+ /** 工具调用事件阶段;用于拼出 `tool-call-<phase>:<toolName>` 形式的激活事件。 */
718
+ type WidgetToolPhase = "generating" | "waiting" | "running" | "result" | "error";
719
+ /**
720
+ * Widget Host 公开的固定激活事件。数组同时作为清单编辑器文档和 Host
721
+ * 运行时校验的单一事实源;带工具名的事件使用下方的动态形式。
722
+ */
723
+ declare const WIDGET_ACTIVATION_EVENTS: readonly ["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"];
724
+ type WidgetFixedActivationEvent = (typeof WIDGET_ACTIVATION_EVENTS)[number];
725
+ /**
726
+ * `activationEvents` 可声明的值:固定事件,或按工具名筛选的
727
+ * `tool-call-<phase>:<toolName>` 动态形式。
728
+ */
729
+ type WidgetActivationEvent = WidgetFixedActivationEvent | `tool-call-${WidgetToolPhase}:${string}`;
730
+ /** 至少一个元素、按声明顺序的只读激活事件元组(作者侧清单使用)。 */
731
+ type WidgetActivationEvents = readonly [WidgetActivationEvent, ...WidgetActivationEvent[]];
732
+ /** 作者侧 Manifest 类型;激活事件类型与 JSON Schema 共用同一事实源。 */
733
+ type WidgetPluginManifest = Omit<WidgetPluginManifest$1, "activationEvents"> & {
734
+ readonly activationEvents?: WidgetActivationEvents;
735
+ };
736
+ //#endregion
737
+ //#region ../widget-project/src/project.d.mts
738
+ /** 工程检查摘要;Gallery 状态和终端输出只依赖这些字段。 */
739
+ interface CheckResult {
740
+ ok: boolean;
741
+ label: string;
742
+ checks: Array<{
743
+ name: string;
744
+ ok: boolean;
745
+ detail?: string;
746
+ }>;
747
+ errors: string[];
748
+ }
749
+ type ContractValidationResult = {
750
+ ok: true;
751
+ } | {
752
+ ok: false;
753
+ errors: Array<{
754
+ instancePath: string;
755
+ message?: string;
756
+ keyword: string;
757
+ }>;
758
+ };
759
+ interface WidgetContractValidators {
760
+ validateWidgetManifest(value: unknown): ContractValidationResult;
761
+ validateRenderRequest(value: unknown): ContractValidationResult;
762
+ validateCapabilityResult(value: unknown): ContractValidationResult;
763
+ }
764
+ interface ManifestCompilerOptions {
765
+ hostEntry?: string;
766
+ samples?: NonNullable<WidgetPluginManifest["samples"]>;
767
+ }
768
+ type WidgetManifestCompiler = (manifest: WidgetPluginManifest, options?: ManifestCompilerOptions) => WidgetManifest;
769
+ interface WidgetProjectToolchain {
770
+ sdkVersion?: string;
771
+ compiler?: WidgetManifestCompiler;
772
+ validators?: WidgetContractValidators;
773
+ }
774
+ interface CheckWidgetProjectOptions extends ManifestCompilerOptions {
775
+ label?: string;
776
+ requireBuiltEntry?: boolean;
777
+ sdkVersion?: string;
778
+ compiler?: WidgetManifestCompiler;
779
+ validators?: WidgetContractValidators;
780
+ toolchain?: WidgetProjectToolchain;
781
+ }
782
+ interface CheckedWidgetSample {
783
+ sample: WidgetManifest["widgetConfig"]["samples"][number];
784
+ request: RenderRequest;
785
+ }
786
+ interface WidgetProjectCheckDetails extends CheckResult {
787
+ projectRoot: string;
788
+ sampleRequest: RenderRequest | null;
789
+ sampleRequests: CheckedWidgetSample[];
790
+ /** 夹具保留读取到的 JSON;失败结果中也可能存在未经验证的内容。 */
791
+ fixtures: unknown;
792
+ fixturesPath: string | null;
793
+ entryPath: string | null;
794
+ }
795
+ interface WidgetProjectCheckSuccess extends WidgetProjectCheckDetails {
796
+ ok: true;
797
+ manifest: WidgetManifest;
798
+ sourceManifest: unknown;
799
+ manifestKind: "author" | "host";
800
+ fixturesPath: string;
801
+ entryPath: string;
802
+ }
803
+ interface WidgetProjectCheckFailure extends WidgetProjectCheckDetails {
804
+ ok: false;
805
+ /** 清单缺失或 JSON 解析失败时为 null;校验失败时保留原始未知值。 */
806
+ manifest: unknown;
807
+ /** 尚未成功读取 JSON 的提前返回不包含这两个字段。 */
808
+ sourceManifest?: unknown;
809
+ manifestKind?: "author" | "host";
810
+ }
811
+ type WidgetProjectCheckResult = WidgetProjectCheckSuccess | WidgetProjectCheckFailure;
812
+ //#endregion
813
+ //#region ../widget-project/src/packaging.d.mts
814
+ /** 打包只依赖工程位置与已编译清单,不依赖 Gallery 的路由或展示状态。 */
815
+ interface WidgetPackageInput {
816
+ projectRoot: string;
817
+ manifest?: WidgetManifest;
818
+ }
819
+ interface WidgetPackageOptions {
820
+ includePreviewFixtures?: boolean;
821
+ /** 未提供已编译清单时,沿用作者清单编译器的入口选择。 */
822
+ hostEntry?: string;
823
+ }
824
+ /** 保留旧的同步 ZIP 返回值。 */
825
+ declare function buildWidgetPackage(project: WidgetPackageInput, options?: WidgetPackageOptions): Buffer;
826
+ //#endregion
827
+ //#region ../widget-project/src/index.d.mts
828
+ declare function compileAuthorManifest(manifest: unknown, options?: ManifestCompilerOptions & {
829
+ sdkVersion?: string;
830
+ compiler?: WidgetManifestCompiler;
831
+ }): unknown;
832
+ declare function checkWidgetProject(projectRoot: string, options?: CheckWidgetProjectOptions): Promise<WidgetProjectCheckResult>;
833
+ declare function resolveWidgetProjects(input: string, root?: string): string[];
834
+ //#endregion
835
+ //#region src/core.d.mts
836
+ interface WidgetTemplateContext {
837
+ readonly name: string;
838
+ readonly ui?: "vanilla" | "react" | string;
839
+ }
840
+ interface WidgetTemplate {
841
+ readonly id: string;
842
+ readonly description?: string;
843
+ manifest(context: WidgetTemplateContext): Record<string, unknown>;
844
+ sample(context: WidgetTemplateContext): Record<string, unknown>;
845
+ readonly source: string | ((context: WidgetTemplateContext) => string);
846
+ }
847
+ interface WidgetTemplateRegistry {
848
+ register(template: WidgetTemplate): WidgetTemplate;
849
+ get(id: string): WidgetTemplate | undefined;
850
+ list(): readonly WidgetTemplate[];
851
+ }
852
+ declare function defineWidgetTemplate(template: WidgetTemplate): WidgetTemplate;
853
+ declare function createWidgetTemplateRegistry(initialTemplates?: readonly WidgetTemplate[]): WidgetTemplateRegistry;
854
+ declare function auditDshPlugin(input: string): Promise<Record<string, unknown>>;
855
+ declare function scaffoldDshWidget(input: string, output: string, options?: Record<string, unknown>): Promise<Record<string, unknown>>;
856
+ declare const widgetCliCore: {
857
+ readonly buildWidgetPackage: typeof buildWidgetPackage;
858
+ readonly checkWidgetProject: typeof checkWidgetProject;
859
+ readonly compileAuthorManifest: typeof compileAuthorManifest;
860
+ readonly resolveWidgetProjects: typeof resolveWidgetProjects;
861
+ readonly createWidgetTemplateRegistry: typeof createWidgetTemplateRegistry;
862
+ readonly defineWidgetTemplate: typeof defineWidgetTemplate;
863
+ readonly auditDshPlugin: typeof auditDshPlugin;
864
+ readonly scaffoldDshWidget: typeof scaffoldDshWidget;
865
+ };
866
+ //#endregion
867
+ export { WidgetTemplate, WidgetTemplateContext, WidgetTemplateRegistry, auditDshPlugin, buildWidgetPackage, checkWidgetProject, compileAuthorManifest, createWidgetTemplateRegistry, defineWidgetTemplate, resolveWidgetProjects, scaffoldDshWidget, widgetCliCore };