@rigkit/engine 0.0.0-canary-20260518T014918-c5bc0c2
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/README.md +5 -0
- package/package.json +34 -0
- package/src/authoring.ts +530 -0
- package/src/authoring.typecheck.ts +114 -0
- package/src/console-intercept.test.ts +121 -0
- package/src/console-intercept.ts +75 -0
- package/src/db/index.ts +157 -0
- package/src/db/schema/core.ts +71 -0
- package/src/db/schema/index.ts +7 -0
- package/src/engine.test.ts +1244 -0
- package/src/engine.ts +2604 -0
- package/src/env-file.ts +52 -0
- package/src/hash.ts +21 -0
- package/src/host-storage.ts +128 -0
- package/src/index.ts +46 -0
- package/src/provider/types.ts +113 -0
- package/src/state.ts +386 -0
- package/src/types.ts +873 -0
- package/src/version.ts +1 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,873 @@
|
|
|
1
|
+
export type JsonValue =
|
|
2
|
+
| null
|
|
3
|
+
| boolean
|
|
4
|
+
| number
|
|
5
|
+
| string
|
|
6
|
+
| JsonValue[]
|
|
7
|
+
| { [key: string]: JsonValue };
|
|
8
|
+
|
|
9
|
+
export type JsonObject = { [key: string]: JsonValue };
|
|
10
|
+
|
|
11
|
+
export type MaybePromise<T> = T | Promise<T>;
|
|
12
|
+
|
|
13
|
+
export type EnvResolver = {
|
|
14
|
+
(name: string, fallback?: string): string;
|
|
15
|
+
secret(name: string, fallback?: string): string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type Resolvable<T> = T | (() => MaybePromise<T>);
|
|
19
|
+
|
|
20
|
+
export type ResolvableObject<T> = {
|
|
21
|
+
[Key in keyof T]: T[Key] extends object
|
|
22
|
+
? T[Key] extends (...args: any[]) => unknown
|
|
23
|
+
? Resolvable<T[Key]>
|
|
24
|
+
: T[Key] extends readonly unknown[]
|
|
25
|
+
? Resolvable<T[Key]>
|
|
26
|
+
: ResolvableObject<T[Key]> | Resolvable<T[Key]>
|
|
27
|
+
: Resolvable<T[Key]>;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type ExecOutputStream = "stdout" | "stderr";
|
|
31
|
+
|
|
32
|
+
export type ExecOutputChunk = {
|
|
33
|
+
stream: ExecOutputStream;
|
|
34
|
+
data: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type ExecOptions = {
|
|
38
|
+
cwd?: string;
|
|
39
|
+
env?: Record<string, string | undefined>;
|
|
40
|
+
timeoutMs?: number;
|
|
41
|
+
onOutput?: (chunk: ExecOutputChunk) => MaybePromise<void>;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type ExecResult = {
|
|
45
|
+
stdout: string;
|
|
46
|
+
stderr: string;
|
|
47
|
+
exitCode: number;
|
|
48
|
+
ok: boolean;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type CommandOptions = ExecOptions & {
|
|
52
|
+
name?: string;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type LocalWorkspaceRuntime = {
|
|
56
|
+
open(target: string): MaybePromise<void>;
|
|
57
|
+
command?(input: LocalCommandRequest): MaybePromise<LocalCommandResult>;
|
|
58
|
+
requestCapability?<Result = unknown>(
|
|
59
|
+
capability: string,
|
|
60
|
+
params: unknown,
|
|
61
|
+
options?: LocalHostCapabilityRequestOptions,
|
|
62
|
+
): MaybePromise<Result>;
|
|
63
|
+
requestCapabilitySession?<Result = unknown>(
|
|
64
|
+
capability: string,
|
|
65
|
+
params: unknown,
|
|
66
|
+
options?: LocalHostCapabilityRequestOptions,
|
|
67
|
+
): MaybePromise<HostCapabilitySession<Result>>;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export type LocalHostCapabilityRequestOptions = {
|
|
71
|
+
nodePath?: string;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export type HostCapabilitySession<Result = unknown> = {
|
|
75
|
+
result: Result;
|
|
76
|
+
closed: Promise<void>;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export type LocalCommandRequest = {
|
|
80
|
+
argv: string[];
|
|
81
|
+
cwd?: string;
|
|
82
|
+
env?: Record<string, string | undefined>;
|
|
83
|
+
stdin?: string | null;
|
|
84
|
+
mode?: "capture" | "interactive";
|
|
85
|
+
reason?: string;
|
|
86
|
+
presentation?: {
|
|
87
|
+
visible?: boolean;
|
|
88
|
+
label?: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export type LocalCommandResult = {
|
|
93
|
+
exitCode: number;
|
|
94
|
+
stdout: string | null;
|
|
95
|
+
stderr: string | null;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export type WorkflowLogStream = "stdout" | "stderr" | "info" | "debug" | "warn";
|
|
99
|
+
|
|
100
|
+
export type WorkflowProviderDefinition<
|
|
101
|
+
ProviderId extends string = string,
|
|
102
|
+
Config extends object = Record<string, unknown>,
|
|
103
|
+
Runtime = unknown,
|
|
104
|
+
> = {
|
|
105
|
+
readonly kind: "rigkit.provider";
|
|
106
|
+
readonly providerId: ProviderId;
|
|
107
|
+
readonly config: ResolvableObject<Config>;
|
|
108
|
+
readonly plugin?: unknown;
|
|
109
|
+
readonly __runtime?: Runtime;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export type DevProviderDefinition<
|
|
113
|
+
ProviderId extends string = string,
|
|
114
|
+
Config extends object = Record<string, unknown>,
|
|
115
|
+
Runtime = unknown,
|
|
116
|
+
> = WorkflowProviderDefinition<ProviderId, Config, Runtime>;
|
|
117
|
+
|
|
118
|
+
export type LoadedProviderDefinition<
|
|
119
|
+
ProviderId extends string = string,
|
|
120
|
+
Config extends object = Record<string, unknown>,
|
|
121
|
+
> = {
|
|
122
|
+
providerId: ProviderId;
|
|
123
|
+
config: Config;
|
|
124
|
+
plugin?: unknown;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export type WorkflowProviderMap = Record<string, WorkflowProviderDefinition<string, any, any>>;
|
|
128
|
+
|
|
129
|
+
export type ProviderRuntimeOf<Provider> =
|
|
130
|
+
Provider extends WorkflowProviderDefinition<any, any, infer Runtime>
|
|
131
|
+
? Runtime
|
|
132
|
+
: never;
|
|
133
|
+
|
|
134
|
+
export type ProviderRuntimeMap<Providers extends WorkflowProviderMap> = {
|
|
135
|
+
readonly [Key in keyof Providers]: ProviderRuntimeOf<Providers[Key]>;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export type WorkflowRuntimeHelpers = {
|
|
139
|
+
readonly workflow: string;
|
|
140
|
+
readonly nodePath: string;
|
|
141
|
+
metadata(metadata: JsonObject): void;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export const STEP_INVALIDATION_KIND = "rigkit.step.invalidate" as const;
|
|
145
|
+
|
|
146
|
+
export type WorkflowStepInvalidation<Target extends string = string> = {
|
|
147
|
+
readonly kind: typeof STEP_INVALIDATION_KIND;
|
|
148
|
+
readonly target: Target;
|
|
149
|
+
readonly targetNodePath: string;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export type WorkflowStepRuntime<
|
|
153
|
+
Context extends JsonObject = JsonObject,
|
|
154
|
+
PreviousTaskIds extends string = string,
|
|
155
|
+
> = WorkflowRuntimeHelpers & {
|
|
156
|
+
readonly ctx: Readonly<Context>;
|
|
157
|
+
invalidate<const Target extends PreviousTaskIds>(target: Target): WorkflowStepInvalidation<Target>;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export type WorkflowTaskContextResult<Context extends JsonObject = JsonObject> = {
|
|
161
|
+
readonly ctx: Context;
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export type WorkflowTaskRuntime<
|
|
165
|
+
Providers extends WorkflowProviderMap,
|
|
166
|
+
Context extends JsonObject,
|
|
167
|
+
PreviousTaskIds extends string = string,
|
|
168
|
+
Config extends JsonObject = JsonObject,
|
|
169
|
+
> = ProviderRuntimeMap<Providers> & {
|
|
170
|
+
readonly providers: ProviderRuntimeMap<Providers>;
|
|
171
|
+
readonly step: WorkflowStepRuntime<Context, PreviousTaskIds>;
|
|
172
|
+
readonly config: Readonly<Config>;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export type WorkflowTaskResult =
|
|
176
|
+
| void
|
|
177
|
+
| undefined
|
|
178
|
+
| WorkflowTaskContextResult<JsonObject>
|
|
179
|
+
| WorkflowStepInvalidation<string>;
|
|
180
|
+
|
|
181
|
+
export type WorkflowTaskHandler<
|
|
182
|
+
Providers extends WorkflowProviderMap,
|
|
183
|
+
Context extends JsonObject,
|
|
184
|
+
PreviousTaskIds extends string = string,
|
|
185
|
+
Result extends WorkflowTaskResult = WorkflowTaskResult,
|
|
186
|
+
Config extends JsonObject = JsonObject,
|
|
187
|
+
> = (context: WorkflowTaskRuntime<Providers, Context, PreviousTaskIds, Config>) => MaybePromise<Result>;
|
|
188
|
+
|
|
189
|
+
export type WorkflowInputFieldKind = "workspace" | "string" | "boolean" | "number";
|
|
190
|
+
|
|
191
|
+
export type WorkflowInputFieldDefinition<Value = unknown> = {
|
|
192
|
+
readonly kind: WorkflowInputFieldKind;
|
|
193
|
+
readonly name: string;
|
|
194
|
+
readonly description?: string;
|
|
195
|
+
readonly position?: number;
|
|
196
|
+
readonly required?: boolean;
|
|
197
|
+
readonly defaultValue?: Value;
|
|
198
|
+
readonly __value?: Value;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export type WorkflowOperationWorkspaceInput<Name extends string> = {
|
|
202
|
+
[Key in Name]: WorkspaceRuntimeRecord;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
export type WorkflowInputShape = Record<string, WorkflowInputFieldDefinition<any>>;
|
|
206
|
+
|
|
207
|
+
export type WorkflowInputShapeContext<Shape extends WorkflowInputShape> = Simplify<{
|
|
208
|
+
[Key in keyof Shape & string]:
|
|
209
|
+
Shape[Key] extends WorkflowInputFieldDefinition<infer Value>
|
|
210
|
+
? Value
|
|
211
|
+
: unknown;
|
|
212
|
+
}>;
|
|
213
|
+
|
|
214
|
+
export type WorkflowOperationInputBuilder<Input extends object = {}> = {
|
|
215
|
+
readonly fields: readonly WorkflowInputFieldDefinition[];
|
|
216
|
+
readonly __input?: Input;
|
|
217
|
+
extend<const Shape extends WorkflowInputShape>(
|
|
218
|
+
shape: Shape,
|
|
219
|
+
): WorkflowOperationInputBuilder<Simplify<Input & WorkflowInputShapeContext<Shape>>>;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
export type WorkflowOperationInputHelpers = {
|
|
223
|
+
workspaceInput<const Name extends string>(options: {
|
|
224
|
+
name: Name;
|
|
225
|
+
description?: string;
|
|
226
|
+
position?: number;
|
|
227
|
+
required?: boolean;
|
|
228
|
+
}): WorkflowOperationInputBuilder<WorkflowOperationWorkspaceInput<Name>>;
|
|
229
|
+
|
|
230
|
+
string<const Name extends string>(options: {
|
|
231
|
+
name?: Name;
|
|
232
|
+
description?: string;
|
|
233
|
+
position?: number;
|
|
234
|
+
required?: boolean;
|
|
235
|
+
defaultValue?: string;
|
|
236
|
+
}): WorkflowInputFieldDefinition<string>;
|
|
237
|
+
|
|
238
|
+
boolean<const Name extends string>(options: {
|
|
239
|
+
name?: Name;
|
|
240
|
+
description?: string;
|
|
241
|
+
position?: number;
|
|
242
|
+
required?: boolean;
|
|
243
|
+
defaultValue?: boolean;
|
|
244
|
+
}): WorkflowInputFieldDefinition<boolean>;
|
|
245
|
+
|
|
246
|
+
number<const Name extends string>(options: {
|
|
247
|
+
name?: Name;
|
|
248
|
+
description?: string;
|
|
249
|
+
position?: number;
|
|
250
|
+
required?: boolean;
|
|
251
|
+
defaultValue?: number;
|
|
252
|
+
}): WorkflowInputFieldDefinition<number>;
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
export type WorkflowOperationRuntime<
|
|
256
|
+
Providers extends WorkflowProviderMap,
|
|
257
|
+
Input extends object,
|
|
258
|
+
> = ProviderRuntimeMap<Providers> & {
|
|
259
|
+
readonly input: Readonly<Input>;
|
|
260
|
+
readonly providers: ProviderRuntimeMap<Providers>;
|
|
261
|
+
readonly local: LocalWorkspaceRuntime;
|
|
262
|
+
readonly workflow: string;
|
|
263
|
+
readonly step: WorkflowStepRuntime;
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
export type WorkflowOperationResult = void | undefined | JsonValue;
|
|
267
|
+
|
|
268
|
+
export type WorkflowOperationHandler<
|
|
269
|
+
Providers extends WorkflowProviderMap,
|
|
270
|
+
Input extends object,
|
|
271
|
+
Result extends WorkflowOperationResult = WorkflowOperationResult,
|
|
272
|
+
> = (context: WorkflowOperationRuntime<Providers, Input>) => MaybePromise<Result>;
|
|
273
|
+
|
|
274
|
+
export type WorkflowRuntimeContext<Context extends JsonObject> = {
|
|
275
|
+
readonly name: string;
|
|
276
|
+
readonly ctx: Readonly<Context>;
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
export type ReadonlyWorkspaceContext<Context extends JsonObject> = {
|
|
280
|
+
readonly [Key in keyof Context]: Context[Key];
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
export type WorkspaceCreateRuntimeRecord = {
|
|
284
|
+
readonly name: string;
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
export type WorkspaceRuntimeRecord<Context extends object = JsonObject> = {
|
|
288
|
+
readonly name: string;
|
|
289
|
+
readonly ctx: Context;
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
export type WorkflowWorkspaceCreateRuntime<
|
|
293
|
+
Providers extends WorkflowProviderMap,
|
|
294
|
+
Context extends JsonObject,
|
|
295
|
+
> = ProviderRuntimeMap<Providers> & {
|
|
296
|
+
readonly workflow: WorkflowRuntimeContext<Context>;
|
|
297
|
+
readonly workspace: WorkspaceCreateRuntimeRecord;
|
|
298
|
+
readonly providers: ProviderRuntimeMap<Providers>;
|
|
299
|
+
readonly local: LocalWorkspaceRuntime;
|
|
300
|
+
readonly step: WorkflowStepRuntime;
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
export type WorkflowWorkspaceCreateHandler<
|
|
304
|
+
Providers extends WorkflowProviderMap,
|
|
305
|
+
Context extends JsonObject,
|
|
306
|
+
Data extends JsonObject,
|
|
307
|
+
> = (context: WorkflowWorkspaceCreateRuntime<Providers, Context>) => MaybePromise<Data>;
|
|
308
|
+
|
|
309
|
+
export type WorkflowWorkspaceRemoveRuntime<
|
|
310
|
+
Providers extends WorkflowProviderMap,
|
|
311
|
+
Context extends JsonObject,
|
|
312
|
+
Data extends JsonObject,
|
|
313
|
+
> = ProviderRuntimeMap<Providers> & {
|
|
314
|
+
readonly workflow: WorkflowRuntimeContext<Context>;
|
|
315
|
+
readonly workspace: WorkspaceRuntimeRecord<ReadonlyWorkspaceContext<Data>>;
|
|
316
|
+
readonly providers: ProviderRuntimeMap<Providers>;
|
|
317
|
+
readonly local: LocalWorkspaceRuntime;
|
|
318
|
+
readonly step: WorkflowStepRuntime;
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
export type WorkflowWorkspaceRemoveHandler<
|
|
322
|
+
Providers extends WorkflowProviderMap,
|
|
323
|
+
Context extends JsonObject,
|
|
324
|
+
Data extends JsonObject,
|
|
325
|
+
> = (context: WorkflowWorkspaceRemoveRuntime<Providers, Context, Data>) => MaybePromise<void>;
|
|
326
|
+
|
|
327
|
+
export type WorkflowWorkspaceOperationRuntime<
|
|
328
|
+
Providers extends WorkflowProviderMap,
|
|
329
|
+
Context extends JsonObject,
|
|
330
|
+
Data extends object,
|
|
331
|
+
Input extends object,
|
|
332
|
+
> = ProviderRuntimeMap<Providers> & {
|
|
333
|
+
readonly workflow: WorkflowRuntimeContext<Context>;
|
|
334
|
+
readonly input: Readonly<Input>;
|
|
335
|
+
readonly workspace: WorkspaceRuntimeRecord<Data>;
|
|
336
|
+
readonly providers: ProviderRuntimeMap<Providers>;
|
|
337
|
+
readonly local: LocalWorkspaceRuntime;
|
|
338
|
+
readonly step: WorkflowStepRuntime;
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
export type WorkflowWorkspaceOperationHandler<
|
|
342
|
+
Providers extends WorkflowProviderMap,
|
|
343
|
+
Context extends JsonObject,
|
|
344
|
+
Data extends object,
|
|
345
|
+
Input extends object,
|
|
346
|
+
Result extends WorkflowOperationResult = WorkflowOperationResult,
|
|
347
|
+
> = (context: WorkflowWorkspaceOperationRuntime<Providers, Context, Data, Input>) => MaybePromise<Result>;
|
|
348
|
+
|
|
349
|
+
export type WorkflowOperationOptions<
|
|
350
|
+
Providers extends WorkflowProviderMap,
|
|
351
|
+
Input extends object = {},
|
|
352
|
+
> = {
|
|
353
|
+
title?: string;
|
|
354
|
+
description?: string;
|
|
355
|
+
input?: WorkflowOperationInputBuilder<Input> | ((workflow: WorkflowOperationInputHelpers) => WorkflowOperationInputBuilder<Input>);
|
|
356
|
+
run: WorkflowOperationHandler<Providers, Input>;
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
export type WorkflowOperationDefinition<
|
|
360
|
+
Providers extends WorkflowProviderMap = WorkflowProviderMap,
|
|
361
|
+
Input extends object = object,
|
|
362
|
+
> = {
|
|
363
|
+
readonly id: string;
|
|
364
|
+
readonly title?: string;
|
|
365
|
+
readonly description?: string;
|
|
366
|
+
readonly input?: WorkflowOperationInputBuilder<Input>;
|
|
367
|
+
readonly run: WorkflowOperationHandler<Providers, Input>;
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
export type WorkflowWorkspaceOperationOptions<
|
|
371
|
+
Providers extends WorkflowProviderMap,
|
|
372
|
+
Context extends JsonObject,
|
|
373
|
+
Data extends object,
|
|
374
|
+
Input extends object = {},
|
|
375
|
+
> = {
|
|
376
|
+
title?: string;
|
|
377
|
+
description?: string;
|
|
378
|
+
input?: WorkflowOperationInputBuilder<Input> | ((workflow: WorkflowOperationInputHelpers) => WorkflowOperationInputBuilder<Input>);
|
|
379
|
+
run: WorkflowWorkspaceOperationHandler<Providers, Context, Data, Input>;
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
export type WorkflowWorkspaceOperationDefinition<
|
|
383
|
+
Providers extends WorkflowProviderMap = WorkflowProviderMap,
|
|
384
|
+
Context extends JsonObject = JsonObject,
|
|
385
|
+
Data extends object = JsonObject,
|
|
386
|
+
Input extends object = object,
|
|
387
|
+
> = {
|
|
388
|
+
readonly id: string;
|
|
389
|
+
readonly title?: string;
|
|
390
|
+
readonly description?: string;
|
|
391
|
+
readonly input?: WorkflowOperationInputBuilder<Input>;
|
|
392
|
+
readonly run: WorkflowWorkspaceOperationHandler<Providers, Context, Data, Input>;
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
export type OutputSchema<Output extends JsonObject = JsonObject> =
|
|
396
|
+
| { parse(value: unknown): Output }
|
|
397
|
+
| {
|
|
398
|
+
safeParse(value: unknown):
|
|
399
|
+
| { success: true; data: Output }
|
|
400
|
+
| { success: false; error: unknown };
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
export type OutputSchemaValue<Schema> =
|
|
404
|
+
Schema extends { parse(value: unknown): infer Output }
|
|
405
|
+
? Output
|
|
406
|
+
: Schema extends { safeParse(value: unknown): infer Result }
|
|
407
|
+
? Result extends { success: true; data: infer Output }
|
|
408
|
+
? Output
|
|
409
|
+
: never
|
|
410
|
+
: never;
|
|
411
|
+
|
|
412
|
+
export type WorkflowTaskOptions<Output extends JsonObject = JsonObject> = {
|
|
413
|
+
output?: OutputSchema<Output>;
|
|
414
|
+
version?: string;
|
|
415
|
+
cacheTTL?: WorkflowTaskCacheTTL;
|
|
416
|
+
};
|
|
417
|
+
|
|
418
|
+
export type WorkflowTaskCacheTTL =
|
|
419
|
+
| number
|
|
420
|
+
| string
|
|
421
|
+
| {
|
|
422
|
+
seconds?: number;
|
|
423
|
+
minutes?: number;
|
|
424
|
+
hours?: number;
|
|
425
|
+
days?: number;
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
export type WorkflowNodeKind = "task" | "sequence" | "parallel";
|
|
429
|
+
export type WorkflowCacheScope = "local" | "global";
|
|
430
|
+
|
|
431
|
+
export type WorkflowDefinition<
|
|
432
|
+
Name extends string = string,
|
|
433
|
+
Providers extends WorkflowProviderMap = WorkflowProviderMap,
|
|
434
|
+
> = {
|
|
435
|
+
readonly kind: "rigkit.workflow";
|
|
436
|
+
readonly name: Name;
|
|
437
|
+
readonly providers: Providers;
|
|
438
|
+
|
|
439
|
+
sequence<InputContext extends JsonObject = {}>(name: string): WorkflowSequenceBuilder<
|
|
440
|
+
Providers,
|
|
441
|
+
InputContext,
|
|
442
|
+
InputContext,
|
|
443
|
+
JsonObject,
|
|
444
|
+
never,
|
|
445
|
+
never,
|
|
446
|
+
never
|
|
447
|
+
>;
|
|
448
|
+
|
|
449
|
+
task<Result extends WorkflowTaskResult>(
|
|
450
|
+
name: string,
|
|
451
|
+
handler: WorkflowTaskHandler<Providers, {}, never, Result>,
|
|
452
|
+
): WorkflowTaskNode<Providers, {}, TaskReturnContext<Result>>;
|
|
453
|
+
|
|
454
|
+
task<
|
|
455
|
+
Schema extends OutputSchema<JsonObject>,
|
|
456
|
+
Result extends MaybePromise<WorkflowTaskContextResult<OutputSchemaValue<Schema>> | WorkflowStepInvalidation<string> | void>,
|
|
457
|
+
>(
|
|
458
|
+
name: string,
|
|
459
|
+
options: WorkflowTaskOptions<OutputSchemaValue<Schema>>,
|
|
460
|
+
handler: WorkflowTaskHandler<Providers, {}, never, Awaited<Result> & WorkflowTaskResult>,
|
|
461
|
+
): WorkflowTaskNode<Providers, {}, TaskReturnContext<Result>>;
|
|
462
|
+
|
|
463
|
+
step<Result extends WorkflowTaskResult>(
|
|
464
|
+
name: string,
|
|
465
|
+
handler: WorkflowTaskHandler<Providers, {}, never, Result>,
|
|
466
|
+
): WorkflowTaskNode<Providers, {}, TaskReturnContext<Result>>;
|
|
467
|
+
|
|
468
|
+
step<
|
|
469
|
+
Schema extends OutputSchema<JsonObject>,
|
|
470
|
+
Result extends MaybePromise<WorkflowTaskContextResult<OutputSchemaValue<Schema>> | WorkflowStepInvalidation<string> | void>,
|
|
471
|
+
>(
|
|
472
|
+
name: string,
|
|
473
|
+
options: WorkflowTaskOptions<OutputSchemaValue<Schema>>,
|
|
474
|
+
handler: WorkflowTaskHandler<Providers, {}, never, Awaited<Result> & WorkflowTaskResult>,
|
|
475
|
+
): WorkflowTaskNode<Providers, {}, TaskReturnContext<Result>>;
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
export type RigkitConfigDefinition<
|
|
479
|
+
Providers extends WorkflowProviderMap = WorkflowProviderMap,
|
|
480
|
+
Workflows extends Record<string, WorkflowNodeDefinition<any, any, any>> = Record<string, WorkflowNodeDefinition<any, any, any>>,
|
|
481
|
+
> = {
|
|
482
|
+
readonly kind: "rigkit.config";
|
|
483
|
+
readonly providers: Providers;
|
|
484
|
+
readonly workflows: Workflows;
|
|
485
|
+
};
|
|
486
|
+
|
|
487
|
+
export type WorkflowNodeDefinition<
|
|
488
|
+
Providers extends WorkflowProviderMap = WorkflowProviderMap,
|
|
489
|
+
InputContext extends JsonObject = JsonObject,
|
|
490
|
+
OutputContext extends JsonObject = JsonObject,
|
|
491
|
+
> = {
|
|
492
|
+
readonly kind: "rigkit.workflow-node";
|
|
493
|
+
readonly nodeKind: WorkflowNodeKind;
|
|
494
|
+
readonly name: string;
|
|
495
|
+
readonly workflow: WorkflowDefinition<string, Providers>;
|
|
496
|
+
readonly cacheScope?: WorkflowCacheScope;
|
|
497
|
+
readonly config?: JsonObject;
|
|
498
|
+
readonly workspaceDefinition?: WorkflowWorkspaceDefinition<Providers, OutputContext>;
|
|
499
|
+
readonly operations?: readonly WorkflowOperationDefinition<Providers, any>[];
|
|
500
|
+
readonly workspaceOperations?: readonly WorkflowWorkspaceOperationDefinition<Providers, OutputContext, any, any>[];
|
|
501
|
+
readonly __providers?: Providers;
|
|
502
|
+
readonly __input?: InputContext;
|
|
503
|
+
readonly __output?: OutputContext;
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
export type WorkflowTaskNode<
|
|
507
|
+
Providers extends WorkflowProviderMap,
|
|
508
|
+
InputContext extends JsonObject,
|
|
509
|
+
OutputContext extends JsonObject,
|
|
510
|
+
Config extends JsonObject = {},
|
|
511
|
+
> = WorkflowNodeDefinition<Providers, InputContext, OutputContext> & {
|
|
512
|
+
readonly nodeKind: "task";
|
|
513
|
+
readonly options?: WorkflowTaskOptions;
|
|
514
|
+
readonly handler: WorkflowTaskHandler<Providers, InputContext, string, any, Config>;
|
|
515
|
+
|
|
516
|
+
global(): WorkflowTaskNode<Providers, InputContext, OutputContext, Config>;
|
|
517
|
+
local(): WorkflowTaskNode<Providers, InputContext, OutputContext, Config>;
|
|
518
|
+
configure<const NextConfig extends JsonObject>(
|
|
519
|
+
config: NextConfig,
|
|
520
|
+
): WorkflowTaskNode<Providers, InputContext, OutputContext, Merge<Config, NextConfig>>;
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
export type WorkflowSequenceBuilder<
|
|
524
|
+
Providers extends WorkflowProviderMap,
|
|
525
|
+
InputContext extends JsonObject,
|
|
526
|
+
OutputContext extends JsonObject,
|
|
527
|
+
WorkspaceData extends object = JsonObject,
|
|
528
|
+
OperationIds extends string = never,
|
|
529
|
+
WorkspaceOperationIds extends string = never,
|
|
530
|
+
PreviousTaskIds extends string = never,
|
|
531
|
+
Config extends JsonObject = {},
|
|
532
|
+
> = WorkflowNodeDefinition<Providers, InputContext, OutputContext> & {
|
|
533
|
+
readonly nodeKind: "sequence";
|
|
534
|
+
readonly children: readonly WorkflowNodeDefinition<Providers, any, any>[];
|
|
535
|
+
|
|
536
|
+
task<const Id extends string, Result extends WorkflowTaskResult>(
|
|
537
|
+
name: Id & WorkflowTaskIdConstraint<Id, PreviousTaskIds>,
|
|
538
|
+
handler: WorkflowTaskHandler<Providers, OutputContext, PreviousTaskIds, Result, Config>,
|
|
539
|
+
): WorkflowSequenceBuilder<
|
|
540
|
+
Providers,
|
|
541
|
+
InputContext,
|
|
542
|
+
TaskReturnContext<Result>,
|
|
543
|
+
WorkspaceData,
|
|
544
|
+
OperationIds,
|
|
545
|
+
WorkspaceOperationIds,
|
|
546
|
+
PreviousTaskIds | Id,
|
|
547
|
+
Config
|
|
548
|
+
>;
|
|
549
|
+
|
|
550
|
+
task<
|
|
551
|
+
const Id extends string,
|
|
552
|
+
Schema extends OutputSchema<JsonObject>,
|
|
553
|
+
Result extends MaybePromise<WorkflowTaskContextResult<OutputSchemaValue<Schema>> | WorkflowStepInvalidation<string> | void>,
|
|
554
|
+
>(
|
|
555
|
+
name: Id & WorkflowTaskIdConstraint<Id, PreviousTaskIds>,
|
|
556
|
+
options: WorkflowTaskOptions<OutputSchemaValue<Schema>>,
|
|
557
|
+
handler: WorkflowTaskHandler<Providers, OutputContext, PreviousTaskIds, Awaited<Result> & WorkflowTaskResult, Config>,
|
|
558
|
+
): WorkflowSequenceBuilder<
|
|
559
|
+
Providers,
|
|
560
|
+
InputContext,
|
|
561
|
+
TaskReturnContext<Result>,
|
|
562
|
+
WorkspaceData,
|
|
563
|
+
OperationIds,
|
|
564
|
+
WorkspaceOperationIds,
|
|
565
|
+
PreviousTaskIds | Id,
|
|
566
|
+
Config
|
|
567
|
+
>;
|
|
568
|
+
|
|
569
|
+
step<const Id extends string, Result extends WorkflowTaskResult>(
|
|
570
|
+
name: Id & WorkflowTaskIdConstraint<Id, PreviousTaskIds>,
|
|
571
|
+
handler: WorkflowTaskHandler<Providers, OutputContext, PreviousTaskIds, Result, Config>,
|
|
572
|
+
): WorkflowSequenceBuilder<
|
|
573
|
+
Providers,
|
|
574
|
+
InputContext,
|
|
575
|
+
TaskReturnContext<Result>,
|
|
576
|
+
WorkspaceData,
|
|
577
|
+
OperationIds,
|
|
578
|
+
WorkspaceOperationIds,
|
|
579
|
+
PreviousTaskIds | Id,
|
|
580
|
+
Config
|
|
581
|
+
>;
|
|
582
|
+
|
|
583
|
+
step<
|
|
584
|
+
const Id extends string,
|
|
585
|
+
Schema extends OutputSchema<JsonObject>,
|
|
586
|
+
Result extends MaybePromise<WorkflowTaskContextResult<OutputSchemaValue<Schema>> | WorkflowStepInvalidation<string> | void>,
|
|
587
|
+
>(
|
|
588
|
+
name: Id & WorkflowTaskIdConstraint<Id, PreviousTaskIds>,
|
|
589
|
+
options: WorkflowTaskOptions<OutputSchemaValue<Schema>>,
|
|
590
|
+
handler: WorkflowTaskHandler<Providers, OutputContext, PreviousTaskIds, Awaited<Result> & WorkflowTaskResult, Config>,
|
|
591
|
+
): WorkflowSequenceBuilder<
|
|
592
|
+
Providers,
|
|
593
|
+
InputContext,
|
|
594
|
+
TaskReturnContext<Result>,
|
|
595
|
+
WorkspaceData,
|
|
596
|
+
OperationIds,
|
|
597
|
+
WorkspaceOperationIds,
|
|
598
|
+
PreviousTaskIds | Id,
|
|
599
|
+
Config
|
|
600
|
+
>;
|
|
601
|
+
|
|
602
|
+
add<Node extends WorkflowNodeDefinition<Providers, any, any>>(
|
|
603
|
+
node: OutputContext extends WorkflowNodeInput<Node> ? Node : never,
|
|
604
|
+
): WorkflowSequenceBuilder<
|
|
605
|
+
Providers,
|
|
606
|
+
InputContext,
|
|
607
|
+
WorkflowNodeOutput<Node>,
|
|
608
|
+
WorkspaceData,
|
|
609
|
+
OperationIds,
|
|
610
|
+
WorkspaceOperationIds,
|
|
611
|
+
PreviousTaskIds,
|
|
612
|
+
Config
|
|
613
|
+
>;
|
|
614
|
+
|
|
615
|
+
parallel<const Branches extends Record<string, WorkflowNodeDefinition<Providers, any, any>>>(
|
|
616
|
+
branches: {
|
|
617
|
+
readonly [Key in keyof Branches]: OutputContext extends WorkflowNodeInput<Branches[Key]>
|
|
618
|
+
? Branches[Key]
|
|
619
|
+
: never;
|
|
620
|
+
},
|
|
621
|
+
): WorkflowSequenceBuilder<
|
|
622
|
+
Providers,
|
|
623
|
+
InputContext,
|
|
624
|
+
Merge<OutputContext, ParallelOutput<Branches>>,
|
|
625
|
+
WorkspaceData,
|
|
626
|
+
OperationIds,
|
|
627
|
+
WorkspaceOperationIds,
|
|
628
|
+
PreviousTaskIds,
|
|
629
|
+
Config
|
|
630
|
+
>;
|
|
631
|
+
|
|
632
|
+
workspace<Data extends JsonObject>(
|
|
633
|
+
definition: WorkflowWorkspaceDefinition<Providers, OutputContext, Data>,
|
|
634
|
+
): WorkflowSequenceBuilder<
|
|
635
|
+
Providers,
|
|
636
|
+
InputContext,
|
|
637
|
+
OutputContext,
|
|
638
|
+
ReadonlyWorkspaceContext<Data>,
|
|
639
|
+
OperationIds,
|
|
640
|
+
WorkspaceOperationIds,
|
|
641
|
+
PreviousTaskIds,
|
|
642
|
+
Config
|
|
643
|
+
>;
|
|
644
|
+
|
|
645
|
+
operation<const Id extends string, Input extends object = {}>(
|
|
646
|
+
id: Id & WorkflowOperationIdConstraint<Id, OperationIds>,
|
|
647
|
+
options: WorkflowOperationOptions<Providers, Input>,
|
|
648
|
+
): WorkflowSequenceBuilder<
|
|
649
|
+
Providers,
|
|
650
|
+
InputContext,
|
|
651
|
+
OutputContext,
|
|
652
|
+
WorkspaceData,
|
|
653
|
+
OperationIds | Id,
|
|
654
|
+
WorkspaceOperationIds,
|
|
655
|
+
PreviousTaskIds,
|
|
656
|
+
Config
|
|
657
|
+
>;
|
|
658
|
+
|
|
659
|
+
workspaceOperation<const Id extends string, Input extends object = {}>(
|
|
660
|
+
id: Id & WorkflowOperationIdConstraint<Id, WorkspaceOperationIds>,
|
|
661
|
+
options: WorkflowWorkspaceOperationOptions<Providers, OutputContext, WorkspaceData, Input>,
|
|
662
|
+
): WorkflowSequenceBuilder<
|
|
663
|
+
Providers,
|
|
664
|
+
InputContext,
|
|
665
|
+
OutputContext,
|
|
666
|
+
WorkspaceData,
|
|
667
|
+
OperationIds,
|
|
668
|
+
WorkspaceOperationIds | Id,
|
|
669
|
+
PreviousTaskIds,
|
|
670
|
+
Config
|
|
671
|
+
>;
|
|
672
|
+
|
|
673
|
+
global(): WorkflowSequenceBuilder<
|
|
674
|
+
Providers,
|
|
675
|
+
InputContext,
|
|
676
|
+
OutputContext,
|
|
677
|
+
WorkspaceData,
|
|
678
|
+
OperationIds,
|
|
679
|
+
WorkspaceOperationIds,
|
|
680
|
+
PreviousTaskIds,
|
|
681
|
+
Config
|
|
682
|
+
>;
|
|
683
|
+
|
|
684
|
+
local(): WorkflowSequenceBuilder<
|
|
685
|
+
Providers,
|
|
686
|
+
InputContext,
|
|
687
|
+
OutputContext,
|
|
688
|
+
WorkspaceData,
|
|
689
|
+
OperationIds,
|
|
690
|
+
WorkspaceOperationIds,
|
|
691
|
+
PreviousTaskIds,
|
|
692
|
+
Config
|
|
693
|
+
>;
|
|
694
|
+
|
|
695
|
+
configure<const NextConfig extends JsonObject>(config: NextConfig): WorkflowSequenceBuilder<
|
|
696
|
+
Providers,
|
|
697
|
+
InputContext,
|
|
698
|
+
OutputContext,
|
|
699
|
+
WorkspaceData,
|
|
700
|
+
OperationIds,
|
|
701
|
+
WorkspaceOperationIds,
|
|
702
|
+
PreviousTaskIds,
|
|
703
|
+
Merge<Config, NextConfig>
|
|
704
|
+
>;
|
|
705
|
+
};
|
|
706
|
+
|
|
707
|
+
export const RESERVED_WORKFLOW_OPERATION_IDS = [
|
|
708
|
+
"apply",
|
|
709
|
+
"completion",
|
|
710
|
+
"create",
|
|
711
|
+
"doctor",
|
|
712
|
+
"fork",
|
|
713
|
+
"help",
|
|
714
|
+
"init",
|
|
715
|
+
"ls",
|
|
716
|
+
"plan",
|
|
717
|
+
"projects",
|
|
718
|
+
"remove",
|
|
719
|
+
"run",
|
|
720
|
+
"version",
|
|
721
|
+
] as const;
|
|
722
|
+
|
|
723
|
+
export type ReservedWorkflowOperationId = typeof RESERVED_WORKFLOW_OPERATION_IDS[number];
|
|
724
|
+
|
|
725
|
+
type WorkflowOperationIdError<Message extends string> = {
|
|
726
|
+
readonly __rigkitOperationIdError: Message;
|
|
727
|
+
};
|
|
728
|
+
|
|
729
|
+
export type WorkflowOperationIdConstraint<
|
|
730
|
+
Id extends string,
|
|
731
|
+
Existing extends string,
|
|
732
|
+
> = string extends Id
|
|
733
|
+
? unknown
|
|
734
|
+
: Id extends Existing
|
|
735
|
+
? WorkflowOperationIdError<`Operation id "${Id}" is already defined`>
|
|
736
|
+
: Id extends ReservedWorkflowOperationId
|
|
737
|
+
? WorkflowOperationIdError<`Operation id "${Id}" is reserved by Rigkit`>
|
|
738
|
+
: Id extends `${string}/${string}`
|
|
739
|
+
? WorkflowOperationIdError<`Operation id "${Id}" cannot contain "/"`>
|
|
740
|
+
: unknown;
|
|
741
|
+
|
|
742
|
+
type WorkflowTaskIdError<Message extends string> = {
|
|
743
|
+
readonly __rigkitTaskIdError: Message;
|
|
744
|
+
};
|
|
745
|
+
|
|
746
|
+
export type WorkflowTaskIdConstraint<
|
|
747
|
+
Id extends string,
|
|
748
|
+
Existing extends string,
|
|
749
|
+
> = string extends Id
|
|
750
|
+
? unknown
|
|
751
|
+
: Id extends Existing
|
|
752
|
+
? WorkflowTaskIdError<`Task id "${Id}" is already defined`>
|
|
753
|
+
: Id extends ""
|
|
754
|
+
? WorkflowTaskIdError<"Task ids must be non-empty">
|
|
755
|
+
: unknown;
|
|
756
|
+
|
|
757
|
+
export type WorkflowNodeInput<Node> =
|
|
758
|
+
Node extends WorkflowNodeDefinition<any, infer Input extends JsonObject, any>
|
|
759
|
+
? Input
|
|
760
|
+
: never;
|
|
761
|
+
|
|
762
|
+
export type WorkflowNodeOutput<Node> =
|
|
763
|
+
Node extends WorkflowNodeDefinition<any, any, infer Output extends JsonObject>
|
|
764
|
+
? Output
|
|
765
|
+
: never;
|
|
766
|
+
|
|
767
|
+
export type ParallelOutput<Branches extends Record<string, WorkflowNodeDefinition<any, any, any>>> = {
|
|
768
|
+
[Key in keyof Branches & string]: WorkflowNodeOutput<Branches[Key]>;
|
|
769
|
+
};
|
|
770
|
+
|
|
771
|
+
export type TaskReturnContext<Return> =
|
|
772
|
+
Exclude<Awaited<Return>, void | undefined | WorkflowStepInvalidation<string>> extends infer Result
|
|
773
|
+
? [Result] extends [never]
|
|
774
|
+
? {}
|
|
775
|
+
: Result extends { ctx: infer Context extends JsonObject }
|
|
776
|
+
? Simplify<Context>
|
|
777
|
+
: never
|
|
778
|
+
: {};
|
|
779
|
+
|
|
780
|
+
export type Merge<Left extends JsonObject, Right extends JsonObject> =
|
|
781
|
+
Simplify<Omit<Left, keyof Right> & Right>;
|
|
782
|
+
|
|
783
|
+
export type Simplify<Value> = { [Key in keyof Value]: Value[Key] } & {};
|
|
784
|
+
|
|
785
|
+
export type WorkflowWorkspaceDefinition<
|
|
786
|
+
Providers extends WorkflowProviderMap = WorkflowProviderMap,
|
|
787
|
+
Context extends JsonObject = JsonObject,
|
|
788
|
+
Data extends JsonObject = JsonObject,
|
|
789
|
+
> = {
|
|
790
|
+
create: WorkflowWorkspaceCreateHandler<Providers, Context, Data>;
|
|
791
|
+
remove: WorkflowWorkspaceRemoveHandler<Providers, Context, Data>;
|
|
792
|
+
};
|
|
793
|
+
|
|
794
|
+
export type LoadedWorkflow = {
|
|
795
|
+
name: string;
|
|
796
|
+
providers: Record<string, LoadedProviderDefinition>;
|
|
797
|
+
root: WorkflowNodeDefinition<any, any, any>;
|
|
798
|
+
workspace?: WorkflowWorkspaceDefinition<any, any, any>;
|
|
799
|
+
operations: readonly WorkflowOperationDefinition<any, any>[];
|
|
800
|
+
workspaceOperations: readonly WorkflowWorkspaceOperationDefinition<any, any, any, any>[];
|
|
801
|
+
};
|
|
802
|
+
|
|
803
|
+
export type WorkflowPlanNode = {
|
|
804
|
+
index: number;
|
|
805
|
+
path: string;
|
|
806
|
+
name: string;
|
|
807
|
+
status: "cached" | "pending";
|
|
808
|
+
reason?: string;
|
|
809
|
+
runId?: string;
|
|
810
|
+
upstreamRunIds: string[];
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
export type WorkflowPlan = {
|
|
814
|
+
workflow: string;
|
|
815
|
+
providerFingerprint: string;
|
|
816
|
+
cachedNodeCount: number;
|
|
817
|
+
nodeCount: number;
|
|
818
|
+
nodes: WorkflowPlanNode[];
|
|
819
|
+
finalContext?: Record<string, JsonValue>;
|
|
820
|
+
};
|
|
821
|
+
|
|
822
|
+
export type MachinePlan = WorkflowPlan;
|
|
823
|
+
|
|
824
|
+
export type WorkspaceRecord = {
|
|
825
|
+
id: string;
|
|
826
|
+
name: string;
|
|
827
|
+
workflow: string;
|
|
828
|
+
workflowCtx: Record<string, JsonValue>;
|
|
829
|
+
ctx: Record<string, JsonValue>;
|
|
830
|
+
createdAt: string;
|
|
831
|
+
updatedAt: string;
|
|
832
|
+
};
|
|
833
|
+
|
|
834
|
+
export type WorkflowEvent =
|
|
835
|
+
| { type: "definition.loaded"; workflow: string }
|
|
836
|
+
| { type: "plan.created"; workflow: string; cachedNodeCount: number; nodeCount: number }
|
|
837
|
+
| { type: "node.cached"; nodePath: string; runId: string }
|
|
838
|
+
| { type: "node.started"; nodePath: string }
|
|
839
|
+
| { type: "node.completed"; nodePath: string; runId: string }
|
|
840
|
+
| { type: "vm.created"; providerId: string; vmId: string; fromSnapshotId?: string }
|
|
841
|
+
| { type: "command.started"; nodePath?: string; commandName: string; command: string }
|
|
842
|
+
| { type: "command.output"; nodePath?: string; commandName: string; stream: ExecOutputStream; data: string }
|
|
843
|
+
| { type: "command.completed"; nodePath?: string; commandName: string; exitCode: number }
|
|
844
|
+
| { type: "log.output"; nodePath: string; stream: WorkflowLogStream; label?: string; data: string }
|
|
845
|
+
| {
|
|
846
|
+
type: "interaction.awaiting_user";
|
|
847
|
+
nodePath: string;
|
|
848
|
+
interactionId: string;
|
|
849
|
+
label: string;
|
|
850
|
+
title: string;
|
|
851
|
+
url: string;
|
|
852
|
+
instructions?: string;
|
|
853
|
+
}
|
|
854
|
+
| {
|
|
855
|
+
type: "interaction.completed";
|
|
856
|
+
nodePath: string;
|
|
857
|
+
interactionId: string;
|
|
858
|
+
label: string;
|
|
859
|
+
title: string;
|
|
860
|
+
}
|
|
861
|
+
| { type: "artifact.created"; nodePath: string; providerId: string; kind: string; ref: JsonValue }
|
|
862
|
+
| { type: "workflow.apply.started"; workflow: string }
|
|
863
|
+
| { type: "workflow.apply.completed"; workflow: string; nodeCount: number; cachedNodeCount: number; durationMs: number }
|
|
864
|
+
| { type: "workspace.create.started"; workspaceName: string }
|
|
865
|
+
| { type: "workspace.ready"; workspaceId: string }
|
|
866
|
+
| { type: "workspace.remove.started"; workspaceName: string }
|
|
867
|
+
| { type: "workspace.remove.completed"; workspaceName: string }
|
|
868
|
+
| { type: "workspace.operation.started"; workspaceName: string; operationId: string }
|
|
869
|
+
| { type: "workspace.operation.completed"; workspaceName: string; operationId: string };
|
|
870
|
+
|
|
871
|
+
export type DevMachineEvent = WorkflowEvent;
|
|
872
|
+
|
|
873
|
+
export type EventHandler = (event: WorkflowEvent) => void;
|