@elaraai/e3-types 0.0.2-beta.4 → 0.0.2-beta.40

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 (49) hide show
  1. package/README.md +7 -4
  2. package/dist/src/dataflow.d.ts +574 -0
  3. package/dist/src/dataflow.d.ts.map +1 -0
  4. package/dist/src/dataflow.js +366 -0
  5. package/dist/src/dataflow.js.map +1 -0
  6. package/dist/src/dataset-ref.d.ts +86 -0
  7. package/dist/src/dataset-ref.d.ts.map +1 -0
  8. package/dist/src/dataset-ref.js +82 -0
  9. package/dist/src/dataset-ref.js.map +1 -0
  10. package/dist/src/dataset.d.ts +4 -4
  11. package/dist/src/execution.d.ts +29 -21
  12. package/dist/src/execution.d.ts.map +1 -1
  13. package/dist/src/execution.js +8 -0
  14. package/dist/src/execution.js.map +1 -1
  15. package/dist/src/index.d.ts +5 -1
  16. package/dist/src/index.d.ts.map +1 -1
  17. package/dist/src/index.js +13 -1
  18. package/dist/src/index.js.map +1 -1
  19. package/dist/src/lock.d.ts +81 -0
  20. package/dist/src/lock.d.ts.map +1 -0
  21. package/dist/src/lock.js +69 -0
  22. package/dist/src/lock.js.map +1 -0
  23. package/dist/src/package.d.ts +207 -134
  24. package/dist/src/package.d.ts.map +1 -1
  25. package/dist/src/package.js +43 -23
  26. package/dist/src/package.js.map +1 -1
  27. package/dist/src/structure.d.ts +87 -73
  28. package/dist/src/structure.d.ts.map +1 -1
  29. package/dist/src/structure.js +8 -3
  30. package/dist/src/structure.js.map +1 -1
  31. package/dist/src/task.d.ts +5 -5
  32. package/dist/src/transfer.d.ts +52 -0
  33. package/dist/src/transfer.d.ts.map +1 -0
  34. package/dist/src/transfer.js +49 -0
  35. package/dist/src/transfer.js.map +1 -0
  36. package/dist/src/workspace.d.ts +7 -9
  37. package/dist/src/workspace.d.ts.map +1 -1
  38. package/dist/src/workspace.js +3 -5
  39. package/dist/src/workspace.js.map +1 -1
  40. package/package.json +2 -2
  41. package/src/dataflow.ts +427 -0
  42. package/src/dataset-ref.ts +91 -0
  43. package/src/execution.ts +8 -0
  44. package/src/index.ts +68 -0
  45. package/src/lock.ts +88 -0
  46. package/src/package.ts +58 -23
  47. package/src/structure.ts +8 -3
  48. package/src/transfer.ts +56 -0
  49. package/src/workspace.ts +3 -5
package/README.md CHANGED
@@ -11,11 +11,14 @@ npm install @elaraai/e3-types
11
11
  ## Types
12
12
 
13
13
  - **Repository** - Repository configuration and paths
14
- - **Commit** - Task commit types (new, done, error)
15
- - **Task** - Task definition and state
16
14
  - **Package** - Package manifest and metadata
17
15
  - **Dataset** - Dataset schemas and paths
18
- - **Dataflow** - Dataflow definitions
16
+ - **Task** - Task definition and configuration
17
+ - **Dataflow** - Dataflow graph and execution state
18
+ - `TaskStateType` - Individual task execution state
19
+ - `DataflowGraphType` - Task dependency graph
20
+ - `ExecutionEventType` - Execution progress events
21
+ - `DataflowExecutionStateType` - Full execution state
19
22
  - **Runner** - Runner configuration
20
23
 
21
24
 
@@ -41,7 +44,7 @@ Dual AGPL-3.0 / Commercial. See [LICENSE.md](./LICENSE.md).
41
44
  - [@elaraai/e3](https://www.npmjs.com/package/@elaraai/e3): SDK for authoring e3 packages with typed tasks and pipelines
42
45
  - [@elaraai/e3-core](https://www.npmjs.com/package/@elaraai/e3-core): Git-like object store, task queue, result caching
43
46
  - [@elaraai/e3-types](https://www.npmjs.com/package/@elaraai/e3-types): Shared type definitions for e3 packages
44
- - [@elaraai/e3-cli](https://www.npmjs.com/package/@elaraai/e3-cli): `e3 init`, `e3 run`, `e3 logs` commands for managing and monitoring tasks
47
+ - [@elaraai/e3-cli](https://www.npmjs.com/package/@elaraai/e3-cli): `e3 repo`, `e3 workspace`, `e3 start`, `e3 logs` commands for managing repositories, workspaces, and tasks
45
48
  - [@elaraai/e3-api-client](https://www.npmjs.com/package/@elaraai/e3-api-client): HTTP client for remote e3 servers
46
49
  - [@elaraai/e3-api-server](https://www.npmjs.com/package/@elaraai/e3-api-server): REST API server for e3 repositories
47
50
 
@@ -0,0 +1,574 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * Dataflow execution state type definitions.
7
+ *
8
+ * These types define the persistent state for dataflow execution,
9
+ * stored in workspaces/<ws>/execution.beast2
10
+ *
11
+ * Key design decisions:
12
+ * - Dates are Date objects (via DateTimeType), not strings
13
+ * - Events stored inline as array (single file, not separate JSONL)
14
+ * - Tasks stored as Dict (not Map) for beast2 compatibility
15
+ */
16
+ import { StructType, VariantType, ArrayType, DictType, StringType, IntegerType, BooleanType, DateTimeType, OptionType, ValueTypeOf } from '@elaraai/east';
17
+ /**
18
+ * Status of a dataflow execution.
19
+ */
20
+ export type DataflowExecutionStatus = 'running' | 'completed' | 'failed' | 'cancelled';
21
+ /**
22
+ * Status of an individual task within an execution.
23
+ */
24
+ export type TaskStatus = 'pending' | 'ready' | 'in_progress' | 'completed' | 'failed' | 'skipped' | 'deferred';
25
+ /**
26
+ * Information about a task's execution state.
27
+ *
28
+ * Stored in the tasks Dict of DataflowExecutionStateType.
29
+ */
30
+ export declare const TaskStateType: StructType<{
31
+ /** Task name */
32
+ readonly name: StringType;
33
+ /** Current status (TaskStatus as string) */
34
+ readonly status: StringType;
35
+ /** Whether the result was served from cache */
36
+ readonly cached: OptionType<BooleanType>;
37
+ /** Output hash if completed successfully */
38
+ readonly outputHash: OptionType<StringType>;
39
+ /** Error message if failed */
40
+ readonly error: OptionType<StringType>;
41
+ /** Exit code if task process failed */
42
+ readonly exitCode: OptionType<IntegerType>;
43
+ /** When the task started */
44
+ readonly startedAt: OptionType<DateTimeType>;
45
+ /** When the task completed */
46
+ readonly completedAt: OptionType<DateTimeType>;
47
+ /** Duration in milliseconds */
48
+ readonly duration: OptionType<IntegerType>;
49
+ }>;
50
+ export type TaskState = ValueTypeOf<typeof TaskStateType>;
51
+ /**
52
+ * A task within the dataflow graph.
53
+ */
54
+ export declare const DataflowGraphTaskType: StructType<{
55
+ /** Task name */
56
+ readonly name: StringType;
57
+ /** Task object hash */
58
+ readonly hash: StringType;
59
+ /** Input dataset paths */
60
+ readonly inputs: ArrayType<StringType>;
61
+ /** Output dataset path */
62
+ readonly output: StringType;
63
+ /** Names of tasks this depends on */
64
+ readonly dependsOn: ArrayType<StringType>;
65
+ }>;
66
+ export type DataflowGraphTask = ValueTypeOf<typeof DataflowGraphTaskType>;
67
+ /**
68
+ * The complete dataflow dependency graph.
69
+ */
70
+ export declare const DataflowGraphType: StructType<{
71
+ /** All tasks in the graph */
72
+ readonly tasks: ArrayType<StructType<{
73
+ /** Task name */
74
+ readonly name: StringType;
75
+ /** Task object hash */
76
+ readonly hash: StringType;
77
+ /** Input dataset paths */
78
+ readonly inputs: ArrayType<StringType>;
79
+ /** Output dataset path */
80
+ readonly output: StringType;
81
+ /** Names of tasks this depends on */
82
+ readonly dependsOn: ArrayType<StringType>;
83
+ }>>;
84
+ }>;
85
+ export type DataflowGraph = ValueTypeOf<typeof DataflowGraphType>;
86
+ /**
87
+ * Execution events (VariantType for discriminated union).
88
+ *
89
+ * Events track the progress of a dataflow execution and are stored
90
+ * inline in the execution state (not as a separate JSONL file).
91
+ */
92
+ export declare const ExecutionEventType: VariantType<{
93
+ /** Execution started */
94
+ readonly execution_started: StructType<{
95
+ /** Event sequence number */
96
+ readonly seq: IntegerType;
97
+ /** When the event occurred */
98
+ readonly timestamp: DateTimeType;
99
+ /** Execution ID */
100
+ readonly executionId: StringType;
101
+ /** Total number of tasks in the graph */
102
+ readonly totalTasks: IntegerType;
103
+ }>;
104
+ /** Task became ready to execute */
105
+ readonly task_ready: StructType<{
106
+ /** Event sequence number */
107
+ readonly seq: IntegerType;
108
+ /** When the event occurred */
109
+ readonly timestamp: DateTimeType;
110
+ /** Task name */
111
+ readonly task: StringType;
112
+ }>;
113
+ /** Task execution started */
114
+ readonly task_started: StructType<{
115
+ /** Event sequence number */
116
+ readonly seq: IntegerType;
117
+ /** When the event occurred */
118
+ readonly timestamp: DateTimeType;
119
+ /** Task name */
120
+ readonly task: StringType;
121
+ }>;
122
+ /** Task completed successfully */
123
+ readonly task_completed: StructType<{
124
+ /** Event sequence number */
125
+ readonly seq: IntegerType;
126
+ /** When the event occurred */
127
+ readonly timestamp: DateTimeType;
128
+ /** Task name */
129
+ readonly task: StringType;
130
+ /** Whether the result was served from cache */
131
+ readonly cached: BooleanType;
132
+ /** Output hash */
133
+ readonly outputHash: StringType;
134
+ /** Duration in milliseconds */
135
+ readonly duration: IntegerType;
136
+ }>;
137
+ /** Task failed */
138
+ readonly task_failed: StructType<{
139
+ /** Event sequence number */
140
+ readonly seq: IntegerType;
141
+ /** When the event occurred */
142
+ readonly timestamp: DateTimeType;
143
+ /** Task name */
144
+ readonly task: StringType;
145
+ /** Error message */
146
+ readonly error: OptionType<StringType>;
147
+ /** Exit code if task process failed */
148
+ readonly exitCode: OptionType<IntegerType>;
149
+ /** Duration in milliseconds */
150
+ readonly duration: IntegerType;
151
+ }>;
152
+ /** Task was skipped due to upstream failure */
153
+ readonly task_skipped: StructType<{
154
+ /** Event sequence number */
155
+ readonly seq: IntegerType;
156
+ /** When the event occurred */
157
+ readonly timestamp: DateTimeType;
158
+ /** Task name */
159
+ readonly task: StringType;
160
+ /** Name of the upstream task that caused the skip */
161
+ readonly cause: StringType;
162
+ }>;
163
+ /** Execution completed */
164
+ readonly execution_completed: StructType<{
165
+ /** Event sequence number */
166
+ readonly seq: IntegerType;
167
+ /** When the event occurred */
168
+ readonly timestamp: DateTimeType;
169
+ /** Whether all tasks succeeded */
170
+ readonly success: BooleanType;
171
+ /** Number of tasks executed (not from cache) */
172
+ readonly executed: IntegerType;
173
+ /** Number of tasks served from cache */
174
+ readonly cached: IntegerType;
175
+ /** Number of tasks that failed */
176
+ readonly failed: IntegerType;
177
+ /** Number of tasks skipped */
178
+ readonly skipped: IntegerType;
179
+ /** Total duration in milliseconds */
180
+ readonly duration: IntegerType;
181
+ }>;
182
+ /** Execution was cancelled */
183
+ readonly execution_cancelled: StructType<{
184
+ /** Event sequence number */
185
+ readonly seq: IntegerType;
186
+ /** When the event occurred */
187
+ readonly timestamp: DateTimeType;
188
+ /** Reason for cancellation */
189
+ readonly reason: OptionType<StringType>;
190
+ }>;
191
+ /** An input dataset changed during execution (reactive dataflow) */
192
+ readonly input_changed: StructType<{
193
+ /** Event sequence number */
194
+ readonly seq: IntegerType;
195
+ /** When the event occurred */
196
+ readonly timestamp: DateTimeType;
197
+ /** Path of the changed input dataset */
198
+ readonly path: StringType;
199
+ /** Previous hash (empty string if was unassigned) */
200
+ readonly previousHash: StringType;
201
+ /** New hash */
202
+ readonly newHash: StringType;
203
+ }>;
204
+ /** A task was invalidated due to upstream input change */
205
+ readonly task_invalidated: StructType<{
206
+ /** Event sequence number */
207
+ readonly seq: IntegerType;
208
+ /** When the event occurred */
209
+ readonly timestamp: DateTimeType;
210
+ /** Task name */
211
+ readonly task: StringType;
212
+ /** Reason for invalidation */
213
+ readonly reason: StringType;
214
+ }>;
215
+ /** A task was deferred due to inconsistent input versions */
216
+ readonly task_deferred: StructType<{
217
+ /** Event sequence number */
218
+ readonly seq: IntegerType;
219
+ /** When the event occurred */
220
+ readonly timestamp: DateTimeType;
221
+ /** Task name */
222
+ readonly task: StringType;
223
+ /** Path where version conflict was detected */
224
+ readonly conflictPath: StringType;
225
+ }>;
226
+ }>;
227
+ export type ExecutionEvent = ValueTypeOf<typeof ExecutionEventType>;
228
+ /**
229
+ * Persistent state for a dataflow execution.
230
+ *
231
+ * Stored in workspaces/<ws>/execution.beast2
232
+ *
233
+ * @remarks
234
+ * - Tasks are stored as a Dict (serializes as object, not array of tuples)
235
+ * - Events are stored inline (not as separate JSONL file)
236
+ * - Dates are Date objects (via DateTimeType)
237
+ */
238
+ export declare const DataflowExecutionStateType: StructType<{
239
+ /** Unique execution ID (local: auto-increment, cloud: UUID) */
240
+ readonly id: StringType;
241
+ /** Repository identifier */
242
+ readonly repo: StringType;
243
+ /** Workspace name */
244
+ readonly workspace: StringType;
245
+ /** When the execution started */
246
+ readonly startedAt: DateTimeType;
247
+ /** Maximum concurrent task executions */
248
+ readonly concurrency: IntegerType;
249
+ /** Force re-execution even if cached */
250
+ readonly force: BooleanType;
251
+ /** Filter to run only specific task(s) by exact name */
252
+ readonly filter: OptionType<StringType>;
253
+ /** The dependency graph (for local execution) */
254
+ readonly graph: OptionType<StructType<{
255
+ /** All tasks in the graph */
256
+ readonly tasks: ArrayType<StructType<{
257
+ /** Task name */
258
+ readonly name: StringType;
259
+ /** Task object hash */
260
+ readonly hash: StringType;
261
+ /** Input dataset paths */
262
+ readonly inputs: ArrayType<StringType>;
263
+ /** Output dataset path */
264
+ readonly output: StringType;
265
+ /** Names of tasks this depends on */
266
+ readonly dependsOn: ArrayType<StringType>;
267
+ }>>;
268
+ }>>;
269
+ /** Hash/key referencing a separately stored graph (for cloud) */
270
+ readonly graphHash: OptionType<StringType>;
271
+ /** Map of task name -> task state */
272
+ readonly tasks: DictType<StringType, StructType<{
273
+ /** Task name */
274
+ readonly name: StringType;
275
+ /** Current status (TaskStatus as string) */
276
+ readonly status: StringType;
277
+ /** Whether the result was served from cache */
278
+ readonly cached: OptionType<BooleanType>;
279
+ /** Output hash if completed successfully */
280
+ readonly outputHash: OptionType<StringType>;
281
+ /** Error message if failed */
282
+ readonly error: OptionType<StringType>;
283
+ /** Exit code if task process failed */
284
+ readonly exitCode: OptionType<IntegerType>;
285
+ /** When the task started */
286
+ readonly startedAt: OptionType<DateTimeType>;
287
+ /** When the task completed */
288
+ readonly completedAt: OptionType<DateTimeType>;
289
+ /** Duration in milliseconds */
290
+ readonly duration: OptionType<IntegerType>;
291
+ }>>;
292
+ /** Number of tasks executed (not from cache) */
293
+ readonly executed: IntegerType;
294
+ /** Number of tasks served from cache */
295
+ readonly cached: IntegerType;
296
+ /** Number of tasks that failed */
297
+ readonly failed: IntegerType;
298
+ /** Number of tasks skipped due to upstream failure */
299
+ readonly skipped: IntegerType;
300
+ /** Current execution status */
301
+ readonly status: StringType;
302
+ /** When the execution completed */
303
+ readonly completedAt: OptionType<DateTimeType>;
304
+ /** Error message if status is 'failed' */
305
+ readonly error: OptionType<StringType>;
306
+ /** Version vectors: dataset keypath -> VersionVector (root input path -> hash) */
307
+ readonly versionVectors: DictType<StringType, DictType<StringType, StringType>>;
308
+ /** Input snapshot: root input keypath -> hash at time of last check */
309
+ readonly inputSnapshot: DictType<StringType, StringType>;
310
+ /** Set of dataset keypaths that are task outputs */
311
+ readonly taskOutputPaths: ArrayType<StringType>;
312
+ /** Number of tasks re-executed due to input changes */
313
+ readonly reexecuted: IntegerType;
314
+ /** All events for this execution */
315
+ readonly events: ArrayType<VariantType<{
316
+ /** Execution started */
317
+ readonly execution_started: StructType<{
318
+ /** Event sequence number */
319
+ readonly seq: IntegerType;
320
+ /** When the event occurred */
321
+ readonly timestamp: DateTimeType;
322
+ /** Execution ID */
323
+ readonly executionId: StringType;
324
+ /** Total number of tasks in the graph */
325
+ readonly totalTasks: IntegerType;
326
+ }>;
327
+ /** Task became ready to execute */
328
+ readonly task_ready: StructType<{
329
+ /** Event sequence number */
330
+ readonly seq: IntegerType;
331
+ /** When the event occurred */
332
+ readonly timestamp: DateTimeType;
333
+ /** Task name */
334
+ readonly task: StringType;
335
+ }>;
336
+ /** Task execution started */
337
+ readonly task_started: StructType<{
338
+ /** Event sequence number */
339
+ readonly seq: IntegerType;
340
+ /** When the event occurred */
341
+ readonly timestamp: DateTimeType;
342
+ /** Task name */
343
+ readonly task: StringType;
344
+ }>;
345
+ /** Task completed successfully */
346
+ readonly task_completed: StructType<{
347
+ /** Event sequence number */
348
+ readonly seq: IntegerType;
349
+ /** When the event occurred */
350
+ readonly timestamp: DateTimeType;
351
+ /** Task name */
352
+ readonly task: StringType;
353
+ /** Whether the result was served from cache */
354
+ readonly cached: BooleanType;
355
+ /** Output hash */
356
+ readonly outputHash: StringType;
357
+ /** Duration in milliseconds */
358
+ readonly duration: IntegerType;
359
+ }>;
360
+ /** Task failed */
361
+ readonly task_failed: StructType<{
362
+ /** Event sequence number */
363
+ readonly seq: IntegerType;
364
+ /** When the event occurred */
365
+ readonly timestamp: DateTimeType;
366
+ /** Task name */
367
+ readonly task: StringType;
368
+ /** Error message */
369
+ readonly error: OptionType<StringType>;
370
+ /** Exit code if task process failed */
371
+ readonly exitCode: OptionType<IntegerType>;
372
+ /** Duration in milliseconds */
373
+ readonly duration: IntegerType;
374
+ }>;
375
+ /** Task was skipped due to upstream failure */
376
+ readonly task_skipped: StructType<{
377
+ /** Event sequence number */
378
+ readonly seq: IntegerType;
379
+ /** When the event occurred */
380
+ readonly timestamp: DateTimeType;
381
+ /** Task name */
382
+ readonly task: StringType;
383
+ /** Name of the upstream task that caused the skip */
384
+ readonly cause: StringType;
385
+ }>;
386
+ /** Execution completed */
387
+ readonly execution_completed: StructType<{
388
+ /** Event sequence number */
389
+ readonly seq: IntegerType;
390
+ /** When the event occurred */
391
+ readonly timestamp: DateTimeType;
392
+ /** Whether all tasks succeeded */
393
+ readonly success: BooleanType;
394
+ /** Number of tasks executed (not from cache) */
395
+ readonly executed: IntegerType;
396
+ /** Number of tasks served from cache */
397
+ readonly cached: IntegerType;
398
+ /** Number of tasks that failed */
399
+ readonly failed: IntegerType;
400
+ /** Number of tasks skipped */
401
+ readonly skipped: IntegerType;
402
+ /** Total duration in milliseconds */
403
+ readonly duration: IntegerType;
404
+ }>;
405
+ /** Execution was cancelled */
406
+ readonly execution_cancelled: StructType<{
407
+ /** Event sequence number */
408
+ readonly seq: IntegerType;
409
+ /** When the event occurred */
410
+ readonly timestamp: DateTimeType;
411
+ /** Reason for cancellation */
412
+ readonly reason: OptionType<StringType>;
413
+ }>;
414
+ /** An input dataset changed during execution (reactive dataflow) */
415
+ readonly input_changed: StructType<{
416
+ /** Event sequence number */
417
+ readonly seq: IntegerType;
418
+ /** When the event occurred */
419
+ readonly timestamp: DateTimeType;
420
+ /** Path of the changed input dataset */
421
+ readonly path: StringType;
422
+ /** Previous hash (empty string if was unassigned) */
423
+ readonly previousHash: StringType;
424
+ /** New hash */
425
+ readonly newHash: StringType;
426
+ }>;
427
+ /** A task was invalidated due to upstream input change */
428
+ readonly task_invalidated: StructType<{
429
+ /** Event sequence number */
430
+ readonly seq: IntegerType;
431
+ /** When the event occurred */
432
+ readonly timestamp: DateTimeType;
433
+ /** Task name */
434
+ readonly task: StringType;
435
+ /** Reason for invalidation */
436
+ readonly reason: StringType;
437
+ }>;
438
+ /** A task was deferred due to inconsistent input versions */
439
+ readonly task_deferred: StructType<{
440
+ /** Event sequence number */
441
+ readonly seq: IntegerType;
442
+ /** When the event occurred */
443
+ readonly timestamp: DateTimeType;
444
+ /** Task name */
445
+ readonly task: StringType;
446
+ /** Path where version conflict was detected */
447
+ readonly conflictPath: StringType;
448
+ }>;
449
+ }>>;
450
+ /** Sequence number for next event (auto-increment) */
451
+ readonly eventSeq: IntegerType;
452
+ }>;
453
+ export type DataflowExecutionState = ValueTypeOf<typeof DataflowExecutionStateType>;
454
+ /**
455
+ * Status of a dataflow run.
456
+ */
457
+ export declare const DataflowRunStatusType: VariantType<{
458
+ /** Run is currently executing */
459
+ readonly running: StructType<{}>;
460
+ /** Run completed successfully */
461
+ readonly completed: StructType<{}>;
462
+ /** Run failed with a task error */
463
+ readonly failed: StructType<{
464
+ /** Name of the task that failed */
465
+ readonly failedTask: StringType;
466
+ /** Error message */
467
+ readonly error: StringType;
468
+ }>;
469
+ /** Run was cancelled */
470
+ readonly cancelled: StructType<{}>;
471
+ }>;
472
+ export type DataflowRunStatus = ValueTypeOf<typeof DataflowRunStatusType>;
473
+ /**
474
+ * Record of a task execution within a dataflow run.
475
+ */
476
+ export declare const TaskExecutionRecordType: StructType<{
477
+ /** Execution ID (UUIDv7) */
478
+ readonly executionId: StringType;
479
+ /** Whether this was a cache hit */
480
+ readonly cached: BooleanType;
481
+ /** Output version vector (which root input versions produced this output) */
482
+ readonly outputVersions: DictType<StringType, StringType>;
483
+ /** Number of times this task was executed (including re-executions due to input changes) */
484
+ readonly executionCount: IntegerType;
485
+ }>;
486
+ export type TaskExecutionRecord = ValueTypeOf<typeof TaskExecutionRecordType>;
487
+ /**
488
+ * Summary statistics for a dataflow run.
489
+ */
490
+ export declare const DataflowRunSummaryType: StructType<{
491
+ /** Total number of tasks */
492
+ readonly total: IntegerType;
493
+ /** Number of completed tasks */
494
+ readonly completed: IntegerType;
495
+ /** Number of cached tasks */
496
+ readonly cached: IntegerType;
497
+ /** Number of failed tasks */
498
+ readonly failed: IntegerType;
499
+ /** Number of skipped tasks */
500
+ readonly skipped: IntegerType;
501
+ /** Number of tasks re-executed due to input changes */
502
+ readonly reexecuted: IntegerType;
503
+ }>;
504
+ export type DataflowRunSummary = ValueTypeOf<typeof DataflowRunSummaryType>;
505
+ /**
506
+ * A dataflow run record, tracking one execution of a workspace's dataflow.
507
+ *
508
+ * Stored in: dataflows/<workspace>/<runId>.beast2
509
+ *
510
+ * This provides execution history and provenance tracking:
511
+ * - Which tasks ran and which were cached
512
+ * - Input/output snapshots for reproducibility
513
+ * - Timing information for performance analysis
514
+ */
515
+ export declare const DataflowRunType: StructType<{
516
+ /** Run ID (UUIDv7) */
517
+ readonly runId: StringType;
518
+ /** Workspace name */
519
+ readonly workspaceName: StringType;
520
+ /** Package reference at run time (name@version) */
521
+ readonly packageRef: StringType;
522
+ /** When the run started */
523
+ readonly startedAt: DateTimeType;
524
+ /** When the run completed (null if still running) */
525
+ readonly completedAt: OptionType<DateTimeType>;
526
+ /** Current status of the run */
527
+ readonly status: VariantType<{
528
+ /** Run is currently executing */
529
+ readonly running: StructType<{}>;
530
+ /** Run completed successfully */
531
+ readonly completed: StructType<{}>;
532
+ /** Run failed with a task error */
533
+ readonly failed: StructType<{
534
+ /** Name of the task that failed */
535
+ readonly failedTask: StringType;
536
+ /** Error message */
537
+ readonly error: StringType;
538
+ }>;
539
+ /** Run was cancelled */
540
+ readonly cancelled: StructType<{}>;
541
+ }>;
542
+ /** Input version snapshot at start (root input path -> hash) */
543
+ readonly inputVersions: DictType<StringType, StringType>;
544
+ /** Output version snapshot at end (null if still running) */
545
+ readonly outputVersions: OptionType<DictType<StringType, StringType>>;
546
+ /** Map of task name -> execution record */
547
+ readonly taskExecutions: DictType<StringType, StructType<{
548
+ /** Execution ID (UUIDv7) */
549
+ readonly executionId: StringType;
550
+ /** Whether this was a cache hit */
551
+ readonly cached: BooleanType;
552
+ /** Output version vector (which root input versions produced this output) */
553
+ readonly outputVersions: DictType<StringType, StringType>;
554
+ /** Number of times this task was executed (including re-executions due to input changes) */
555
+ readonly executionCount: IntegerType;
556
+ }>>;
557
+ /** Summary statistics */
558
+ readonly summary: StructType<{
559
+ /** Total number of tasks */
560
+ readonly total: IntegerType;
561
+ /** Number of completed tasks */
562
+ readonly completed: IntegerType;
563
+ /** Number of cached tasks */
564
+ readonly cached: IntegerType;
565
+ /** Number of failed tasks */
566
+ readonly failed: IntegerType;
567
+ /** Number of skipped tasks */
568
+ readonly skipped: IntegerType;
569
+ /** Number of tasks re-executed due to input changes */
570
+ readonly reexecuted: IntegerType;
571
+ }>;
572
+ }>;
573
+ export type DataflowRun = ValueTypeOf<typeof DataflowRunType>;
574
+ //# sourceMappingURL=dataflow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataflow.d.ts","sourceRoot":"","sources":["../../src/dataflow.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH,OAAO,EACL,UAAU,EACV,WAAW,EACX,SAAS,EACT,QAAQ,EACR,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACZ,UAAU,EACV,WAAW,EACZ,MAAM,eAAe,CAAC;AAMvB;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEvF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,GAAG,WAAW,GA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