@dp-bohrium/widget-cli 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +13 -5
- package/CHANGELOG.md +28 -0
- package/assets/schemas/widget-runtime-contracts.schema.json +906 -0
- package/assets/toolchain.json +8 -8
- package/dist/cli.mjs +299 -28
- package/dist/core.d.mts +16 -361
- package/dist/core.mjs +1 -1
- package/dist/development-host.d.mts +40 -4
- package/dist/{dsh-BkPMTfZ_.mjs → dsh-BL6cMLrg.mjs} +11087 -10124
- package/dist/generated-runtime-contracts-CbZY-iss.d.mts +500 -0
- package/llms.txt +2 -2
- package/package.json +8 -11
- package/assets/licenses/widget-contracts.LICENSE +0 -21
package/dist/core.d.mts
CHANGED
|
@@ -1,353 +1,6 @@
|
|
|
1
|
+
import { t as RenderRequest } from "./generated-runtime-contracts-CbZY-iss.mjs";
|
|
1
2
|
import { Buffer } from "node:buffer";
|
|
2
|
-
//#region ../
|
|
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
|
|
3
|
+
//#region ../widget-sdk/src/protocol/generated-manifest.d.ts
|
|
351
4
|
/** GENERATED FILE. Do not edit directly. */
|
|
352
5
|
/**
|
|
353
6
|
* 构建该 Widget 时使用的 SDK 精确 SemVer 版本,不接受范围。
|
|
@@ -538,7 +191,7 @@ interface RuntimeOptions$1 {
|
|
|
538
191
|
webAssembly?: boolean;
|
|
539
192
|
}
|
|
540
193
|
//#endregion
|
|
541
|
-
//#region ../
|
|
194
|
+
//#region ../widget-sdk/src/protocol/generated-plugin-manifest.d.ts
|
|
542
195
|
/** GENERATED FILE. Do not edit directly. */
|
|
543
196
|
/**
|
|
544
197
|
* Host 可用于启动 Widget 的公开激活信号。多个值表示任一信号命中即可激活;它们不授予 events.read 权限。工具名形式为 tool-call-<阶段>:<工具名>。
|
|
@@ -713,7 +366,7 @@ interface RuntimeOptions {
|
|
|
713
366
|
webAssembly?: boolean;
|
|
714
367
|
}
|
|
715
368
|
//#endregion
|
|
716
|
-
//#region ../
|
|
369
|
+
//#region ../widget-sdk/src/protocol/plugin-manifest.d.ts
|
|
717
370
|
/** 工具调用事件阶段;用于拼出 `tool-call-<phase>:<toolName>` 形式的激活事件。 */
|
|
718
371
|
type WidgetToolPhase = "generating" | "waiting" | "running" | "result" | "error";
|
|
719
372
|
/**
|
|
@@ -734,7 +387,7 @@ type WidgetPluginManifest = Omit<WidgetPluginManifest$1, "activationEvents"> & {
|
|
|
734
387
|
readonly activationEvents?: WidgetActivationEvents;
|
|
735
388
|
};
|
|
736
389
|
//#endregion
|
|
737
|
-
//#region
|
|
390
|
+
//#region src/project/project.d.mts
|
|
738
391
|
/** 工程检查摘要;Gallery 状态和终端输出只依赖这些字段。 */
|
|
739
392
|
interface CheckResult {
|
|
740
393
|
ok: boolean;
|
|
@@ -810,7 +463,17 @@ interface WidgetProjectCheckFailure extends WidgetProjectCheckDetails {
|
|
|
810
463
|
}
|
|
811
464
|
type WidgetProjectCheckResult = WidgetProjectCheckSuccess | WidgetProjectCheckFailure;
|
|
812
465
|
//#endregion
|
|
813
|
-
//#region
|
|
466
|
+
//#region src/project/check.d.mts
|
|
467
|
+
declare function checkWidgetProject(projectRoot: string, options?: CheckWidgetProjectOptions): Promise<WidgetProjectCheckResult>;
|
|
468
|
+
declare function resolveWidgetProjects(input: string, root?: string): string[];
|
|
469
|
+
//#endregion
|
|
470
|
+
//#region src/project/manifest.d.mts
|
|
471
|
+
declare function compileAuthorManifest(manifest: unknown, options?: ManifestCompilerOptions & {
|
|
472
|
+
sdkVersion?: string;
|
|
473
|
+
compiler?: WidgetManifestCompiler;
|
|
474
|
+
}): unknown;
|
|
475
|
+
//#endregion
|
|
476
|
+
//#region src/project/packaging.d.mts
|
|
814
477
|
/** 打包只依赖工程位置与已编译清单,不依赖 Gallery 的路由或展示状态。 */
|
|
815
478
|
interface WidgetPackageInput {
|
|
816
479
|
projectRoot: string;
|
|
@@ -824,14 +487,6 @@ interface WidgetPackageOptions {
|
|
|
824
487
|
/** 保留旧的同步 ZIP 返回值。 */
|
|
825
488
|
declare function buildWidgetPackage(project: WidgetPackageInput, options?: WidgetPackageOptions): Buffer;
|
|
826
489
|
//#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
490
|
//#region src/core.d.mts
|
|
836
491
|
interface WidgetTemplateContext {
|
|
837
492
|
readonly name: string;
|
package/dist/core.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as compileAuthorManifest, n as scaffoldDshWidget, o as checkWidgetProject, r as buildWidgetPackage, s as resolveWidgetProjects, t as auditDshPlugin } from "./dsh-BL6cMLrg.mjs";
|
|
2
2
|
//#region src/core.mjs
|
|
3
3
|
/** Validate a community template before registering it in a custom CLI. */
|
|
4
4
|
function defineWidgetTemplate(template) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { i as WidgetRenderResult, n as WidgetDevelopmentDiagnostic, r as WidgetRecoveryPlan } from "./generated-runtime-contracts-CbZY-iss.mjs";
|
|
1
2
|
//#region src/development-host.d.mts
|
|
2
3
|
interface WidgetDevelopmentEndpointSetV1 {
|
|
3
4
|
readonly claim: string;
|
|
@@ -54,6 +55,36 @@ interface WidgetDevelopmentRuntimeDescriptorV1 {
|
|
|
54
55
|
readonly panel?: WidgetDevelopmentPanelProjectionV1;
|
|
55
56
|
readonly presentationRequests?: readonly WidgetDevelopmentPresentationRequestV1[];
|
|
56
57
|
}
|
|
58
|
+
interface WidgetDevelopmentObservationV1 {
|
|
59
|
+
readonly generation: number;
|
|
60
|
+
readonly attemptId: string;
|
|
61
|
+
readonly instanceId: string;
|
|
62
|
+
readonly sequence: number;
|
|
63
|
+
readonly event: {
|
|
64
|
+
readonly type: "connected";
|
|
65
|
+
readonly supported: boolean;
|
|
66
|
+
} | {
|
|
67
|
+
readonly type: "diagnostic";
|
|
68
|
+
readonly diagnostic: WidgetDevelopmentDiagnostic;
|
|
69
|
+
} | {
|
|
70
|
+
readonly type: "render-result";
|
|
71
|
+
readonly result: WidgetRenderResult;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
interface WidgetDevelopmentRuntimeStateV1 {
|
|
75
|
+
readonly state: "unknown" | "unsupported" | "connected" | "failed" | "handled";
|
|
76
|
+
readonly cursor: number;
|
|
77
|
+
readonly oldestCursor: number;
|
|
78
|
+
readonly generation: number;
|
|
79
|
+
readonly attemptId?: string;
|
|
80
|
+
readonly instanceId?: string;
|
|
81
|
+
readonly diagnostic?: WidgetDevelopmentDiagnostic;
|
|
82
|
+
readonly recovery?: WidgetRecoveryPlan;
|
|
83
|
+
readonly renderResult?: WidgetRenderResult;
|
|
84
|
+
readonly entries: readonly (WidgetDevelopmentObservationV1 & {
|
|
85
|
+
readonly cursor: number;
|
|
86
|
+
})[];
|
|
87
|
+
}
|
|
57
88
|
interface WidgetDevelopmentStatusV1 {
|
|
58
89
|
readonly protocolVersion: 1;
|
|
59
90
|
readonly state: "ready" | "stopping" | "build-failed";
|
|
@@ -67,6 +98,7 @@ interface WidgetDevelopmentStatusV1 {
|
|
|
67
98
|
readonly assets: readonly WidgetDevelopmentAssetV1[];
|
|
68
99
|
readonly watch: boolean;
|
|
69
100
|
readonly lastBuild: Readonly<Record<string, unknown>>;
|
|
101
|
+
readonly runtime?: WidgetDevelopmentRuntimeStateV1;
|
|
70
102
|
readonly lastBuildError: Readonly<Record<string, unknown>> | null;
|
|
71
103
|
}
|
|
72
104
|
type WidgetDevelopmentEventTypeV1 = "generation-ready" | "generation-failed" | "reload-requested" | "session-stopping" | "disconnected";
|
|
@@ -76,10 +108,14 @@ interface WidgetDevelopmentEventV1 {
|
|
|
76
108
|
readonly type: WidgetDevelopmentEventTypeV1;
|
|
77
109
|
readonly data: Readonly<Record<string, unknown>>;
|
|
78
110
|
}
|
|
79
|
-
|
|
111
|
+
type WidgetDevelopmentControlRequestV1 = {
|
|
80
112
|
readonly protocolVersion: 1;
|
|
81
|
-
readonly action: "reload" | "disconnect";
|
|
82
|
-
}
|
|
113
|
+
readonly action: "reload" | "disconnect" | "refresh-built-output";
|
|
114
|
+
} | {
|
|
115
|
+
readonly protocolVersion: 1;
|
|
116
|
+
readonly action: "report-runtime";
|
|
117
|
+
readonly observation: WidgetDevelopmentObservationV1;
|
|
118
|
+
};
|
|
83
119
|
interface WidgetDevelopmentBridgeRequestV1 {
|
|
84
120
|
readonly protocol: "bohrium.widget-development-host";
|
|
85
121
|
readonly protocolVersion: 1;
|
|
@@ -99,4 +135,4 @@ interface WidgetDevelopmentCliEnvelopeV1<T = Readonly<Record<string, unknown>>>
|
|
|
99
135
|
readonly data: T;
|
|
100
136
|
}
|
|
101
137
|
//#endregion
|
|
102
|
-
export { WidgetDevelopmentAssetV1, WidgetDevelopmentBridgeRequestV1, WidgetDevelopmentBridgeResponseV1, WidgetDevelopmentClaimV1, WidgetDevelopmentCliEnvelopeV1, WidgetDevelopmentControlRequestV1, WidgetDevelopmentDescriptorV1, WidgetDevelopmentEndpointSetV1, WidgetDevelopmentEventTypeV1, WidgetDevelopmentEventV1, WidgetDevelopmentPanelProjectionV1, WidgetDevelopmentPresentationRequestV1, WidgetDevelopmentRuntimeDescriptorV1, WidgetDevelopmentStatusV1 };
|
|
138
|
+
export { WidgetDevelopmentAssetV1, WidgetDevelopmentBridgeRequestV1, WidgetDevelopmentBridgeResponseV1, WidgetDevelopmentClaimV1, WidgetDevelopmentCliEnvelopeV1, WidgetDevelopmentControlRequestV1, WidgetDevelopmentDescriptorV1, WidgetDevelopmentEndpointSetV1, WidgetDevelopmentEventTypeV1, WidgetDevelopmentEventV1, WidgetDevelopmentObservationV1, WidgetDevelopmentPanelProjectionV1, WidgetDevelopmentPresentationRequestV1, WidgetDevelopmentRuntimeDescriptorV1, WidgetDevelopmentRuntimeStateV1, WidgetDevelopmentStatusV1 };
|