@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,551 @@
1
+ /** GENERATED FILE. Do not edit directly. */
2
+ /**
3
+ * 不透明标识符。
4
+ */
5
+ export type Identifier = string;
6
+ /**
7
+ * 运行模式:preview 或 published。
8
+ */
9
+ export type Mode = ("preview" | "published");
10
+ /**
11
+ * UTC 时间戳:YYYY-MM-DD + T + 非空格字符,以 Z 结尾。
12
+ */
13
+ export type Timestamp = string;
14
+ /**
15
+ * 隔离域运行源地址。
16
+ */
17
+ export type RuntimeOrigin = string;
18
+ /**
19
+ * 正整数。
20
+ */
21
+ export type PositiveInteger = number;
22
+ /**
23
+ * 内容摘要;形如 sha256:<hex>。
24
+ */
25
+ export type Digest = string;
26
+ /**
27
+ * 构建该 Widget 时使用的 SDK 精确 SemVer 版本,不接受范围。
28
+ */
29
+ export type WidgetSdkVersion = string;
30
+ /**
31
+ * 包内 ESM 入口路径;仅允许包内相对 POSIX 路径。
32
+ */
33
+ export type EntryPath = string;
34
+ /**
35
+ * 作者声明的扩展点配置:file-preview 声明扩展名集合,panel 绑定既有 Panel。
36
+ */
37
+ export type WidgetContributionConfig = ({
38
+ type: "file-preview";
39
+ /**
40
+ * @minItems 1
41
+ */
42
+ extensions: [string, ...(string)[]];
43
+ } | PanelContributionConfig);
44
+ /**
45
+ * 声明 Host 何时允许激活该 Widget;激活条件不授予事件读取能力。
46
+ *
47
+ * @minItems 1
48
+ * @maxItems 16
49
+ */
50
+ 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)];
51
+ /**
52
+ * Widget 申请的 Host 用户数据权限列表。
53
+ *
54
+ * @minItems 1
55
+ * @maxItems 2
56
+ */
57
+ export type HostUserPermissions = [HostUserPermission] | [HostUserPermission, HostUserPermission];
58
+ /**
59
+ * Widget 可申请读取的 Host 用户数据权限名:个人资料或邮箱。
60
+ */
61
+ export type HostUserPermission = ("host.user.profile.read" | "host.user.email.read");
62
+ /**
63
+ * 同版本 RenderRequest 测试样例;至少一个,request 为相对 .json 路径。
64
+ *
65
+ * @minItems 1
66
+ */
67
+ export type Samples = [
68
+ {
69
+ id: string;
70
+ title: string;
71
+ request: string;
72
+ },
73
+ ...({
74
+ id: string;
75
+ title: string;
76
+ request: string;
77
+ })[]
78
+ ];
79
+ /**
80
+ * Host 已授予的能力;多数分支附带调用与预算限制(ui.presentation / ui.region 除外)。
81
+ */
82
+ export type GrantedCapability = ({
83
+ name: "service.invoke";
84
+ services: WidgetServicePermissions;
85
+ limits: {
86
+ callsPerMinute: number;
87
+ requestBytes: number;
88
+ responseBytes: number;
89
+ };
90
+ } | {
91
+ name: "files.list";
92
+ limits: {
93
+ pageSize: number;
94
+ callsPerMinute: number;
95
+ };
96
+ } | {
97
+ name: "files.download";
98
+ limits: {
99
+ bytesPerRun: number;
100
+ callsPerMinute: number;
101
+ };
102
+ } | {
103
+ name: "files.metadata";
104
+ limits: {
105
+ callsPerMinute: number;
106
+ };
107
+ } | {
108
+ name: "files.read";
109
+ limits: {
110
+ bytesPerRequest: number;
111
+ /**
112
+ * @deprecated
113
+ * 历史读取累计额度字段,仅为兼容旧配置保留;当前 files.read 不累计或执行此额度,新宿主不再下发。
114
+ */
115
+ bytesPerRun?: number;
116
+ callsPerMinute: number;
117
+ };
118
+ } | {
119
+ name: "files.write";
120
+ limits: {
121
+ bytesPerRequest: number;
122
+ bytesPerRun: number;
123
+ callsPerMinute: number;
124
+ };
125
+ } | {
126
+ name: "events.read";
127
+ /**
128
+ * @minItems 1
129
+ * @maxItems 32
130
+ */
131
+ topics: [string, ...(string)[]];
132
+ limits: {
133
+ callsPerMinute: number;
134
+ pageSize: number;
135
+ minPollMs: number;
136
+ };
137
+ } | {
138
+ name: "tasks.list";
139
+ limits: {
140
+ callsPerMinute: number;
141
+ pageSize: number;
142
+ minPollMs: number;
143
+ };
144
+ } | {
145
+ name: "tasks.watch";
146
+ limits: {
147
+ callsPerMinute: number;
148
+ pageSize: number;
149
+ minPollMs: number;
150
+ };
151
+ } | {
152
+ name: "ui.state";
153
+ limits: {
154
+ callsPerMinute: number;
155
+ bytesPerRun: number;
156
+ maxValueBytes: number;
157
+ };
158
+ } | {
159
+ name: "actions.invoke";
160
+ /**
161
+ * @minItems 1
162
+ * @maxItems 32
163
+ */
164
+ actions: [string, ...(string)[]];
165
+ limits: {
166
+ callsPerMinute: number;
167
+ };
168
+ } | {
169
+ name: "network.fetch";
170
+ limits: WidgetNetworkLimits;
171
+ } | GrantedPresentationCapability | GrantedRegionCapability);
172
+ /**
173
+ * 服务权限列表。
174
+ *
175
+ * @minItems 1
176
+ * @maxItems 32
177
+ */
178
+ export type WidgetServicePermissions = [WidgetServicePermission, ...(WidgetServicePermission)[]];
179
+ /**
180
+ * 已授予能力列表。
181
+ */
182
+ export type GrantedCapabilities = GrantedCapability[];
183
+ /**
184
+ * Host-only evidence bound to the exact reviewed Widget bundle and current user grant.
185
+ */
186
+ export type HostServiceAuthorization = (HostServiceAuthorizationRequired | HostServiceAuthorizationGranted);
187
+ /**
188
+ * 降级原因枚举。
189
+ */
190
+ export type FallbackReason = ("not-authorized" | "not-approved" | "delisted-for-new-use" | "revoked" | "host-api-unsupported" | "preview-not-allowed");
191
+ /**
192
+ * Host 为一次 Widget 运行签发并下发给 agent-widget 的运行时配置,不直接发给 Widget。
193
+ */
194
+ export interface WidgetHostRuntimeConfig {
195
+ schemaVersion: 1;
196
+ hostApiVersion: 1;
197
+ configId: Identifier;
198
+ hostId?: Identifier;
199
+ runId: Identifier;
200
+ mode: Mode;
201
+ issuedAt: Timestamp;
202
+ expiresAt: Timestamp;
203
+ recheckAt: Timestamp;
204
+ securityProfile: "runtime-security-profile-v1";
205
+ resourceBudget: ResourceBudget;
206
+ runtime: RuntimeAuthority;
207
+ network: NetworkAuthority;
208
+ bindings: (LoadableBinding | FallbackBinding)[];
209
+ }
210
+ /**
211
+ * Host 为当前运行签发的资源预算:包、Bridge、文件、超时、并发、重试与失败。
212
+ */
213
+ export interface ResourceBudget {
214
+ version: 1;
215
+ bundle: {
216
+ compressedBytes: number;
217
+ expandedBytes: number;
218
+ fileCount: number;
219
+ singleFileBytes: number;
220
+ };
221
+ bridge: {
222
+ messageBytes: number;
223
+ messagesPerSecond: number;
224
+ pendingRequests: number;
225
+ };
226
+ files: {
227
+ readBytesPerRequest: number;
228
+ /**
229
+ * @deprecated
230
+ * 历史读取累计额度字段,仅为兼容旧配置保留;当前 files.read 不累计或执行此额度,新宿主不再下发。
231
+ */
232
+ readBytesPerRun?: number;
233
+ callsPerMinute: number;
234
+ listPageSize: number;
235
+ /**
236
+ * 写入单次原始字节上限;未签发时不得授权 files.write。
237
+ */
238
+ writeBytesPerRequest?: number;
239
+ /**
240
+ * 当前运行的累计写入原始字节上限;未签发时不得授权 files.write。
241
+ */
242
+ writeBytesPerRun?: number;
243
+ };
244
+ timeouts: {
245
+ bundleLoadMs: number;
246
+ handshakeMs: number;
247
+ firstRenderMs: number;
248
+ updateMs: number;
249
+ capabilityMs: number;
250
+ disposeGraceMs: number;
251
+ };
252
+ concurrency: {
253
+ activeIframesPerPage: number;
254
+ activeIframesPerRun: number;
255
+ hiddenRecycleMs: number;
256
+ };
257
+ retry: {
258
+ maxAttempts: number;
259
+ initialDelayMs: number;
260
+ maxDelayMs: number;
261
+ totalMs: number;
262
+ };
263
+ failure: {
264
+ consecutiveFailures: number;
265
+ windowMs: number;
266
+ };
267
+ }
268
+ /**
269
+ * 运行域授权:origin 与 catalogRevision。
270
+ */
271
+ export interface RuntimeAuthority {
272
+ origin: RuntimeOrigin;
273
+ catalogRevision: string;
274
+ profile?: ("public-isolated" | "first-party-private");
275
+ }
276
+ /**
277
+ * 网络授权:mode、policyVersion 与限制。
278
+ */
279
+ export interface NetworkAuthority {
280
+ mode: ("runtime-consent" | "unavailable");
281
+ policyVersion: string;
282
+ limits: WidgetNetworkLimits;
283
+ }
284
+ /**
285
+ * Host 托管网络的限制项:超时、并发、频率与字节数。
286
+ */
287
+ export interface WidgetNetworkLimits {
288
+ timeoutMs: PositiveInteger;
289
+ maxRedirects: PositiveInteger;
290
+ maxConcurrentRequests: PositiveInteger;
291
+ callsPerMinute: PositiveInteger;
292
+ requestHeaderBytes: PositiveInteger;
293
+ responseHeaderBytes: PositiveInteger;
294
+ requestBodyBytes: PositiveInteger;
295
+ responseBodyBytes: PositiveInteger;
296
+ }
297
+ /**
298
+ * 可加载绑定:状态为 loadable,携带冻结版本、摘要、Manifest、启动地址与能力授权。
299
+ */
300
+ export interface LoadableBinding {
301
+ status: "loadable";
302
+ bindingId: Identifier;
303
+ widgetId: Identifier;
304
+ widgetVersionId: Identifier;
305
+ digest: Digest;
306
+ /**
307
+ * 控制面确认的信任等级;作者不能自行声明。
308
+ */
309
+ trustClass?: ("external" | "first-party");
310
+ /**
311
+ * 控制面选择的部署配置;不授予 Cookie 或 Token 读取权限。
312
+ */
313
+ runtimeProfile?: ("public-isolated" | "first-party-private");
314
+ manifest: WidgetManifest;
315
+ launch: Launch;
316
+ grantedCapabilities: GrantedCapabilities;
317
+ serviceAccess?: WidgetServiceAccess;
318
+ serviceAuthorization?: HostServiceAuthorization;
319
+ }
320
+ /**
321
+ * 打包阶段生成的宿主 Widget 清单;name / description 仅用于首次展示默认值,widgetConfig 为冻结运行配置。
322
+ */
323
+ export interface WidgetManifest {
324
+ name: string;
325
+ description?: string;
326
+ widgetConfig: WidgetConfig;
327
+ }
328
+ /**
329
+ * 打包阶段生成的冻结 Widget 运行配置;字段由 CLI 从作者清单写入,作者不得再直接覆盖。
330
+ */
331
+ export interface WidgetConfig {
332
+ schemaVersion: 1;
333
+ hostApiVersion: 1;
334
+ widgetSdkVersion: WidgetSdkVersion;
335
+ entry: EntryPath;
336
+ contribution: WidgetContributionConfig;
337
+ activationEvents?: ActivationEvents;
338
+ requestedCapabilities?: RequestedCapabilities;
339
+ requestedPermissions?: HostUserPermissions;
340
+ runtime?: RuntimeOptions;
341
+ samples: Samples;
342
+ }
343
+ /**
344
+ * 绑定 Agent Widget 既有 Panel 的配置。
345
+ */
346
+ export interface PanelContributionConfig {
347
+ /**
348
+ * Panel 贡献类型。
349
+ */
350
+ type: "panel";
351
+ /**
352
+ * Host 注册和查找 Panel 时使用的稳定类型标识。
353
+ */
354
+ id: string;
355
+ placement?: ({
356
+ kind: "panel";
357
+ } | {
358
+ kind: "region";
359
+ region: "session.rightRail";
360
+ mode: "replace";
361
+ });
362
+ }
363
+ /**
364
+ * Widget 申请的能力集合;声明仅表示申请,最终由 Host 按次授权。
365
+ */
366
+ export interface RequestedCapabilities {
367
+ files?: FilesCapabilityRequest;
368
+ events?: EventsCapabilityRequest;
369
+ tasks?: TasksCapabilityRequest;
370
+ state?: StateCapabilityRequest;
371
+ actions?: ActionsCapabilityRequest;
372
+ network?: NetworkCapabilityRequest;
373
+ presentation?: RequestedPresentationCapability;
374
+ region?: RequestedRegionCapability;
375
+ }
376
+ /**
377
+ * 文件能力的独立申请开关;保存已有文件必须单独申请 files.write 并获得 Host 授权,可写范围由 Host grant 决定。
378
+ */
379
+ export interface FilesCapabilityRequest {
380
+ list?: boolean;
381
+ metadata?: boolean;
382
+ read?: boolean;
383
+ download?: boolean;
384
+ write?: boolean;
385
+ }
386
+ /**
387
+ * 事件读取能力的申请;topics 声明要读取的事件主题。
388
+ */
389
+ export interface EventsCapabilityRequest {
390
+ /**
391
+ * @minItems 1
392
+ * @maxItems 32
393
+ */
394
+ topics: [string, ...(string)[]];
395
+ }
396
+ /**
397
+ * 任务发现与观察能力的申请;list / watch 至少显式申请一项,已申请项固定为 true。
398
+ */
399
+ export interface TasksCapabilityRequest {
400
+ list?: true;
401
+ watch?: true;
402
+ }
403
+ /**
404
+ * 受限 UI 状态读写能力的申请;read / write 分别声明。
405
+ */
406
+ export interface StateCapabilityRequest {
407
+ read: boolean;
408
+ write: boolean;
409
+ }
410
+ /**
411
+ * Host 自定义动作调用能力的申请;names 声明可调用的动作名。
412
+ */
413
+ export interface ActionsCapabilityRequest {
414
+ /**
415
+ * @minItems 1
416
+ * @maxItems 32
417
+ */
418
+ names: [string, ...(string)[]];
419
+ }
420
+ /**
421
+ * Host 托管网络能力的申请;fetch 固定为 true,目标域名由 Host 运行时按请求授权。
422
+ */
423
+ export interface NetworkCapabilityRequest {
424
+ fetch: true;
425
+ }
426
+ /**
427
+ * 呈现能力的申请;surfaces 声明期望的呈现表面。
428
+ */
429
+ export interface RequestedPresentationCapability {
430
+ /**
431
+ * @minItems 1
432
+ * @maxItems 2
433
+ */
434
+ surfaces: [("floating" | "overlay")] | [("floating" | "overlay"), ("floating" | "overlay")];
435
+ }
436
+ /**
437
+ * 会话右侧区域替换能力的申请;当前仅支持 session.rightRail + replace。
438
+ */
439
+ export interface RequestedRegionCapability {
440
+ /**
441
+ * @minItems 1
442
+ * @maxItems 1
443
+ */
444
+ regions: ["session.rightRail"];
445
+ mode: "replace";
446
+ }
447
+ /**
448
+ * 运行时申请;worker 与 webAssembly 均为可选布尔开关。
449
+ */
450
+ export interface RuntimeOptions {
451
+ worker?: boolean;
452
+ webAssembly?: boolean;
453
+ }
454
+ /**
455
+ * 一次性启动地址与有效期。
456
+ */
457
+ export interface Launch {
458
+ url: string;
459
+ expiresAt: Timestamp;
460
+ }
461
+ /**
462
+ * 单条服务权限:服务名 + 允许的动作列表。
463
+ */
464
+ export interface WidgetServicePermission {
465
+ service: string;
466
+ /**
467
+ * @minItems 1
468
+ * @maxItems 32
469
+ */
470
+ actions: [string, ...(string)[]];
471
+ }
472
+ /**
473
+ * 已授予的呈现能力;含 surfaces,requiresHostConfirmation 恒为 true。
474
+ */
475
+ export interface GrantedPresentationCapability {
476
+ name: "ui.presentation";
477
+ /**
478
+ * @minItems 1
479
+ * @maxItems 2
480
+ */
481
+ surfaces: [("floating" | "overlay")] | [("floating" | "overlay"), ("floating" | "overlay")];
482
+ requiresHostConfirmation: true;
483
+ }
484
+ /**
485
+ * 已授予的会话右侧区域替换能力。
486
+ */
487
+ export interface GrantedRegionCapability {
488
+ name: "ui.region";
489
+ /**
490
+ * @minItems 1
491
+ * @maxItems 1
492
+ */
493
+ regions: ["session.rightRail"];
494
+ mode: "replace";
495
+ requiresHostConfirmation: true;
496
+ }
497
+ /**
498
+ * 绑定当前不可变版本与摘要的审核投影;服务端每次调用仍须复核撤销和用户权限。
499
+ */
500
+ export interface WidgetServiceAccess {
501
+ approvalId: Identifier;
502
+ revision: Identifier;
503
+ appId: Identifier;
504
+ policyVersion: Identifier;
505
+ expiresAt: Timestamp;
506
+ }
507
+ /**
508
+ * 需用户授权的 Host 服务证据:状态为 authorization-required。
509
+ */
510
+ export interface HostServiceAuthorizationRequired {
511
+ kind: "host-service-authorization";
512
+ policy: "host-user-data-v1";
513
+ status: "authorization-required";
514
+ hostId: Identifier;
515
+ widgetVersionId: Identifier;
516
+ bundleDigest: Digest;
517
+ reviewRevision: Identifier;
518
+ reviewedPermissions: HostUserPermissions;
519
+ /**
520
+ * @maxItems 0
521
+ */
522
+ grantedPermissions: [];
523
+ expiresAt: Timestamp;
524
+ }
525
+ /**
526
+ * 已授予的 Host 服务证据:状态为 granted。
527
+ */
528
+ export interface HostServiceAuthorizationGranted {
529
+ kind: "host-service-authorization";
530
+ policy: "host-user-data-v1";
531
+ status: "granted";
532
+ hostId: Identifier;
533
+ widgetVersionId: Identifier;
534
+ bundleDigest: Digest;
535
+ reviewRevision: Identifier;
536
+ grantRevision: Identifier;
537
+ reviewedPermissions: HostUserPermissions;
538
+ grantedPermissions: HostUserPermissions;
539
+ expiresAt: Timestamp;
540
+ }
541
+ /**
542
+ * 降级绑定:状态为 fallback,不含 Bundle 地址、摘要、Manifest 或能力授权。
543
+ */
544
+ export interface FallbackBinding {
545
+ status: "fallback";
546
+ bindingId: Identifier;
547
+ widgetId: Identifier;
548
+ widgetVersionId: Identifier;
549
+ contribution: WidgetContributionConfig;
550
+ reason: FallbackReason;
551
+ }