@elaraai/e3-types 0.0.1-beta.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/LICENSE.md +31 -0
- package/README.md +33 -0
- package/dist/src/dataset.d.ts +109 -0
- package/dist/src/dataset.d.ts.map +1 -0
- package/dist/src/dataset.js +96 -0
- package/dist/src/dataset.js.map +1 -0
- package/dist/src/execution.d.ts +80 -0
- package/dist/src/execution.d.ts.map +1 -0
- package/dist/src/execution.js +79 -0
- package/dist/src/execution.js.map +1 -0
- package/dist/src/index.d.ts +29 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +39 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/package.d.ts +210 -0
- package/dist/src/package.d.ts.map +1 -0
- package/dist/src/package.js +86 -0
- package/dist/src/package.js.map +1 -0
- package/dist/src/structure.d.ts +254 -0
- package/dist/src/structure.d.ts.map +1 -0
- package/dist/src/structure.js +236 -0
- package/dist/src/structure.js.map +1 -0
- package/dist/src/task.d.ts +66 -0
- package/dist/src/task.d.ts.map +1 -0
- package/dist/src/task.js +61 -0
- package/dist/src/task.js.map +1 -0
- package/dist/src/workspace.d.ts +49 -0
- package/dist/src/workspace.d.ts.map +1 -0
- package/dist/src/workspace.js +48 -0
- package/dist/src/workspace.js.map +1 -0
- package/package.json +30 -0
- package/src/dataset.ts +126 -0
- package/src/execution.ts +91 -0
- package/src/index.ts +78 -0
- package/src/package.ts +100 -0
- package/src/structure.ts +270 -0
- package/src/task.ts +66 -0
- package/src/workspace.ts +52 -0
- package/tsconfig.json +21 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Copyright (c) 2025 Elara AI Pty Ltd
|
|
2
|
+
|
|
3
|
+
# Dual License
|
|
4
|
+
|
|
5
|
+
This software is available under two licenses. You may choose which license applies to your use:
|
|
6
|
+
|
|
7
|
+
## Option 1: AGPL-3.0 (Open Source)
|
|
8
|
+
|
|
9
|
+
You may use, modify, and distribute this software under the terms of the GNU Affero General Public License v3.0.
|
|
10
|
+
|
|
11
|
+
This requires that if you use this software in a network service, you must make your complete source code available under AGPL-3.0.
|
|
12
|
+
|
|
13
|
+
Full text: https://www.gnu.org/licenses/agpl-3.0.html
|
|
14
|
+
|
|
15
|
+
## Option 2: Commercial License
|
|
16
|
+
|
|
17
|
+
If you wish to use this software without the source code disclosure requirements of AGPL-3.0, you must obtain a commercial license from Elara AI Pty Ltd.
|
|
18
|
+
|
|
19
|
+
Contact: support@elara.ai
|
|
20
|
+
|
|
21
|
+
## Contributions
|
|
22
|
+
|
|
23
|
+
Contributions are welcome. By submitting a pull request, you agree to license your contribution under both AGPL-3.0 and our commercial license terms.
|
|
24
|
+
|
|
25
|
+
## Governing Law
|
|
26
|
+
|
|
27
|
+
This license is governed by the laws of New South Wales, Australia.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
*Elara AI Pty Ltd*
|
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @elaraai/e3-types
|
|
2
|
+
|
|
3
|
+
Shared type definitions for e3 (East Execution Engine).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @elaraai/e3-types
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Types
|
|
12
|
+
|
|
13
|
+
- **Repository** - Repository configuration and paths
|
|
14
|
+
- **Commit** - Task commit types (new, done, error)
|
|
15
|
+
- **Task** - Task definition and state
|
|
16
|
+
- **Package** - Package manifest and metadata
|
|
17
|
+
- **Dataset** - Dataset schemas and paths
|
|
18
|
+
- **Dataflow** - Dataflow definitions
|
|
19
|
+
- **Runner** - Runner configuration
|
|
20
|
+
|
|
21
|
+
## Related Repos
|
|
22
|
+
|
|
23
|
+
- **[east](https://github.com/elaraai/east)** - East language core
|
|
24
|
+
- **[east-node](https://github.com/elaraai/east-node)** - Node.js runtime and platform functions
|
|
25
|
+
- **[east-py](https://github.com/elaraai/east-py)** - Python runtime and data science
|
|
26
|
+
|
|
27
|
+
## About Elara
|
|
28
|
+
|
|
29
|
+
e3 is developed by [Elara AI](https://elaraai.com/), an AI-powered platform that creates economic digital twins of businesses. e3 powers the execution layer of Elara solutions, enabling durable and efficient execution of East programs across multiple runtimes.
|
|
30
|
+
|
|
31
|
+
## License
|
|
32
|
+
|
|
33
|
+
Dual AGPL-3.0 / Commercial. See [LICENSE.md](./LICENSE.md).
|
|
@@ -0,0 +1,109 @@
|
|
|
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
|
+
* Dataset reference and tree types for e3's persistent data structures.
|
|
7
|
+
*
|
|
8
|
+
* e3 stores data as persistent trees with structural sharing (like git trees).
|
|
9
|
+
* Each node is either a leaf (value) or a branch (tree of refs).
|
|
10
|
+
*/
|
|
11
|
+
import { VariantType, StringType, NullType, ValueTypeOf, StructType, EastType } from '@elaraai/east';
|
|
12
|
+
/**
|
|
13
|
+
* Reference to data in the object store.
|
|
14
|
+
*
|
|
15
|
+
* DataRef is the fundamental building block of e3's data trees.
|
|
16
|
+
* Each ref points to either a value or another tree node.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* - `unassigned`: Placeholder for pending task outputs
|
|
20
|
+
* - `null`: Inline null value (optimization)
|
|
21
|
+
* - `value`: Hash of a typed value blob in objects/
|
|
22
|
+
* - `tree`: Hash of a tree object in objects/
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* // Pending output
|
|
27
|
+
* const pending: DataRef = variant('unassigned', null);
|
|
28
|
+
*
|
|
29
|
+
* // Value reference
|
|
30
|
+
* const ref: DataRef = variant('value', 'abc123...');
|
|
31
|
+
*
|
|
32
|
+
* // Tree reference
|
|
33
|
+
* const treeRef: DataRef = variant('tree', 'def456...');
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare const DataRefType: VariantType<{
|
|
37
|
+
/** Unassigned value (e.g., pending task output) */
|
|
38
|
+
unassigned: NullType;
|
|
39
|
+
/** Inline null value (optimization for NullType) */
|
|
40
|
+
null: NullType;
|
|
41
|
+
/** Hash of a beast2 value blob in objects/ */
|
|
42
|
+
value: StringType;
|
|
43
|
+
/** Hash of a tree object in objects/ */
|
|
44
|
+
tree: StringType;
|
|
45
|
+
}>;
|
|
46
|
+
export type DataRefType = typeof DataRefType;
|
|
47
|
+
export type DataRef = ValueTypeOf<typeof DataRefType>;
|
|
48
|
+
/**
|
|
49
|
+
* Singleton DataRef representing an unassigned value.
|
|
50
|
+
*
|
|
51
|
+
* Used for dataset fields that have not yet been computed (e.g., pending task outputs).
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const tree = {
|
|
56
|
+
* computed: variant('value', 'abc123...'),
|
|
57
|
+
* pending: unassignedRef,
|
|
58
|
+
* };
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare const unassignedRef: DataRef;
|
|
62
|
+
/**
|
|
63
|
+
* Singleton DataRef representing an inline null value.
|
|
64
|
+
*
|
|
65
|
+
* Optimization for datasets with NullType fields - avoids storing a separate object.
|
|
66
|
+
*/
|
|
67
|
+
export declare const nullRef: DataRef;
|
|
68
|
+
/**
|
|
69
|
+
* Computes the DataTreeType for a given EastType.
|
|
70
|
+
*
|
|
71
|
+
* A DataTreeType is a StructType where each field is replaced with a DataRefType,
|
|
72
|
+
* enabling structural sharing in e3's persistent data trees.
|
|
73
|
+
*
|
|
74
|
+
* @typeParam T - The source EastType (must be a StructType for MVP)
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* Currently only StructType is supported. Future versions may support
|
|
78
|
+
* ArrayType, DictType, VariantType, and RecursiveType.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* const PersonType = StructType({ name: StringType, age: IntegerType });
|
|
83
|
+
* type PersonTree = DataTreeType<typeof PersonType>;
|
|
84
|
+
* // Equivalent to: StructType<{ name: DataRefType, age: DataRefType }>
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export type DataTreeType<T extends EastType> = T extends StructType<infer Fields> ? StructType<{
|
|
88
|
+
[K in keyof Fields]: DataRefType;
|
|
89
|
+
}> : never;
|
|
90
|
+
/**
|
|
91
|
+
* Creates a DataTreeType from an EastType at runtime.
|
|
92
|
+
*
|
|
93
|
+
* Transforms a StructType into a new StructType where each field
|
|
94
|
+
* is replaced with DataRefType.
|
|
95
|
+
*
|
|
96
|
+
* @param type - The source EastType (must be a StructType)
|
|
97
|
+
* @returns A new StructType with DataRefType fields
|
|
98
|
+
*
|
|
99
|
+
* @throws {Error} When the input type is not a StructType
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* ```ts
|
|
103
|
+
* const PersonType = StructType({ name: StringType, age: IntegerType });
|
|
104
|
+
* const PersonTreeType = DataTreeType(PersonType);
|
|
105
|
+
* // PersonTreeType.fields = { name: DataRefType, age: DataRefType }
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
export declare function DataTreeType<T extends EastType>(type: T): DataTreeType<T>;
|
|
109
|
+
//# sourceMappingURL=dataset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataset.d.ts","sourceRoot":"","sources":["../../src/dataset.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAW,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9G;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,WAAW;IACtB,mDAAmD;;IAEnD,oDAAoD;;IAEpD,8CAA8C;;IAE9C,wCAAwC;;EAExC,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC;AAE7C,MAAM,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,EAAE,OAAqC,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,OAA+B,CAAC;AAEtD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,QAAQ,IACzC,CAAC,SAAS,UAAU,CAAC,MAAM,MAAM,CAAC,GAAG,UAAU,CAAC;KAAG,CAAC,IAAI,MAAM,MAAM,GAAG,WAAW;CAAE,CAAC,GACrF,KAAK,CAAC;AAER;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAUzE"}
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
+
* Dataset reference and tree types for e3's persistent data structures.
|
|
7
|
+
*
|
|
8
|
+
* e3 stores data as persistent trees with structural sharing (like git trees).
|
|
9
|
+
* Each node is either a leaf (value) or a branch (tree of refs).
|
|
10
|
+
*/
|
|
11
|
+
import { VariantType, StringType, NullType, variant, StructType } from '@elaraai/east';
|
|
12
|
+
/**
|
|
13
|
+
* Reference to data in the object store.
|
|
14
|
+
*
|
|
15
|
+
* DataRef is the fundamental building block of e3's data trees.
|
|
16
|
+
* Each ref points to either a value or another tree node.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* - `unassigned`: Placeholder for pending task outputs
|
|
20
|
+
* - `null`: Inline null value (optimization)
|
|
21
|
+
* - `value`: Hash of a typed value blob in objects/
|
|
22
|
+
* - `tree`: Hash of a tree object in objects/
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* // Pending output
|
|
27
|
+
* const pending: DataRef = variant('unassigned', null);
|
|
28
|
+
*
|
|
29
|
+
* // Value reference
|
|
30
|
+
* const ref: DataRef = variant('value', 'abc123...');
|
|
31
|
+
*
|
|
32
|
+
* // Tree reference
|
|
33
|
+
* const treeRef: DataRef = variant('tree', 'def456...');
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export const DataRefType = VariantType({
|
|
37
|
+
/** Unassigned value (e.g., pending task output) */
|
|
38
|
+
unassigned: NullType,
|
|
39
|
+
/** Inline null value (optimization for NullType) */
|
|
40
|
+
null: NullType,
|
|
41
|
+
/** Hash of a beast2 value blob in objects/ */
|
|
42
|
+
value: StringType,
|
|
43
|
+
/** Hash of a tree object in objects/ */
|
|
44
|
+
tree: StringType,
|
|
45
|
+
});
|
|
46
|
+
/**
|
|
47
|
+
* Singleton DataRef representing an unassigned value.
|
|
48
|
+
*
|
|
49
|
+
* Used for dataset fields that have not yet been computed (e.g., pending task outputs).
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const tree = {
|
|
54
|
+
* computed: variant('value', 'abc123...'),
|
|
55
|
+
* pending: unassignedRef,
|
|
56
|
+
* };
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export const unassignedRef = variant('unassigned', null);
|
|
60
|
+
/**
|
|
61
|
+
* Singleton DataRef representing an inline null value.
|
|
62
|
+
*
|
|
63
|
+
* Optimization for datasets with NullType fields - avoids storing a separate object.
|
|
64
|
+
*/
|
|
65
|
+
export const nullRef = variant('null', null);
|
|
66
|
+
/**
|
|
67
|
+
* Creates a DataTreeType from an EastType at runtime.
|
|
68
|
+
*
|
|
69
|
+
* Transforms a StructType into a new StructType where each field
|
|
70
|
+
* is replaced with DataRefType.
|
|
71
|
+
*
|
|
72
|
+
* @param type - The source EastType (must be a StructType)
|
|
73
|
+
* @returns A new StructType with DataRefType fields
|
|
74
|
+
*
|
|
75
|
+
* @throws {Error} When the input type is not a StructType
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const PersonType = StructType({ name: StringType, age: IntegerType });
|
|
80
|
+
* const PersonTreeType = DataTreeType(PersonType);
|
|
81
|
+
* // PersonTreeType.fields = { name: DataRefType, age: DataRefType }
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export function DataTreeType(type) {
|
|
85
|
+
if (type.type === "Struct") {
|
|
86
|
+
const fields = {};
|
|
87
|
+
for (const key of Object.keys(type.fields)) {
|
|
88
|
+
fields[key] = DataRefType;
|
|
89
|
+
}
|
|
90
|
+
return StructType(fields);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
throw new Error(`DataTreeType not implemented for type .${type.type}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=dataset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataset.js","sourceRoot":"","sources":["../../src/dataset.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAe,OAAO,EAAE,UAAU,EAAY,MAAM,eAAe,CAAC;AAE9G;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAC;IACrC,mDAAmD;IACnD,UAAU,EAAE,QAAQ;IACpB,oDAAoD;IACpD,IAAI,EAAE,QAAQ;IACd,8CAA8C;IAC9C,KAAK,EAAE,UAAU;IACjB,wCAAwC;IACxC,IAAI,EAAE,UAAU;CACjB,CAAC,CAAC;AAKH;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,aAAa,GAAY,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAElE;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAY,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AAyBtD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,YAAY,CAAqB,IAAO;IACtD,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAgC,EAAE,CAAC;QAC/C,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YAC3C,MAAM,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;QAC5B,CAAC;QACD,OAAO,UAAU,CAAC,MAAM,CAAoB,CAAC;IAC/C,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,0CAA0C,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
* Execution status type definitions.
|
|
7
|
+
*
|
|
8
|
+
* An execution represents a single run of a task with specific inputs.
|
|
9
|
+
* Executions are stored at: executions/<taskHash>/<inputsHash>/
|
|
10
|
+
*
|
|
11
|
+
* The status file tracks:
|
|
12
|
+
* - For running: process identification for crash detection
|
|
13
|
+
* - For success: output hash and timing
|
|
14
|
+
* - For failed: exit code and timing
|
|
15
|
+
* - For error: internal error message and timing
|
|
16
|
+
*/
|
|
17
|
+
import { VariantType, StructType, ArrayType, StringType, IntegerType, DateTimeType, ValueTypeOf } from '@elaraai/east';
|
|
18
|
+
/**
|
|
19
|
+
* Execution status stored in executions/<taskHash>/<inputsHash>/status.beast2
|
|
20
|
+
*
|
|
21
|
+
* A variant type representing the four possible states of an execution:
|
|
22
|
+
*
|
|
23
|
+
* - `running`: Task has been launched but not yet completed
|
|
24
|
+
* - `success`: Task ran and returned exit code 0
|
|
25
|
+
* - `failed`: Task ran and returned non-zero exit code
|
|
26
|
+
* - `error`: e3 execution engine had an internal error (runner not found, output missing, etc.)
|
|
27
|
+
*
|
|
28
|
+
* The `running` state includes process identification fields (pid, pidStartTime, bootId)
|
|
29
|
+
* to enable detection of crashed executions. See design/e3-execution.md for details.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ExecutionStatusType: VariantType<{
|
|
32
|
+
/** Task has been launched but not yet completed */
|
|
33
|
+
running: StructType<{
|
|
34
|
+
/** Input dataset hashes */
|
|
35
|
+
inputHashes: ArrayType<StringType>;
|
|
36
|
+
/** When execution started */
|
|
37
|
+
startedAt: DateTimeType;
|
|
38
|
+
/** Process ID of the runner */
|
|
39
|
+
pid: IntegerType;
|
|
40
|
+
/** Process start time in jiffies since boot (from /proc/<pid>/stat field 22) */
|
|
41
|
+
pidStartTime: IntegerType;
|
|
42
|
+
/** System boot ID (from /proc/sys/kernel/random/boot_id) */
|
|
43
|
+
bootId: StringType;
|
|
44
|
+
}>;
|
|
45
|
+
/** Task ran and returned exit code 0 */
|
|
46
|
+
success: StructType<{
|
|
47
|
+
/** Input dataset hashes */
|
|
48
|
+
inputHashes: ArrayType<StringType>;
|
|
49
|
+
/** Hash of the output dataset */
|
|
50
|
+
outputHash: StringType;
|
|
51
|
+
/** When execution started */
|
|
52
|
+
startedAt: DateTimeType;
|
|
53
|
+
/** When execution completed */
|
|
54
|
+
completedAt: DateTimeType;
|
|
55
|
+
}>;
|
|
56
|
+
/** Task ran and returned non-zero exit code */
|
|
57
|
+
failed: StructType<{
|
|
58
|
+
/** Input dataset hashes */
|
|
59
|
+
inputHashes: ArrayType<StringType>;
|
|
60
|
+
/** When execution started */
|
|
61
|
+
startedAt: DateTimeType;
|
|
62
|
+
/** When execution completed */
|
|
63
|
+
completedAt: DateTimeType;
|
|
64
|
+
/** Process exit code */
|
|
65
|
+
exitCode: IntegerType;
|
|
66
|
+
}>;
|
|
67
|
+
/** e3 execution engine had an internal error */
|
|
68
|
+
error: StructType<{
|
|
69
|
+
/** Input dataset hashes */
|
|
70
|
+
inputHashes: ArrayType<StringType>;
|
|
71
|
+
/** When execution started */
|
|
72
|
+
startedAt: DateTimeType;
|
|
73
|
+
/** When execution completed */
|
|
74
|
+
completedAt: DateTimeType;
|
|
75
|
+
/** Error message describing what went wrong */
|
|
76
|
+
message: StringType;
|
|
77
|
+
}>;
|
|
78
|
+
}>;
|
|
79
|
+
export type ExecutionStatus = ValueTypeOf<typeof ExecutionStatusType>;
|
|
80
|
+
//# sourceMappingURL=execution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/execution.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACZ,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB;IAC9B,mDAAmD;;QAEjD,2BAA2B;;QAE3B,6BAA6B;;QAE7B,+BAA+B;;QAE/B,gFAAgF;;QAEhF,4DAA4D;;;IAG9D,wCAAwC;;QAEtC,2BAA2B;;QAE3B,iCAAiC;;QAEjC,6BAA6B;;QAE7B,+BAA+B;;;IAGjC,+CAA+C;;QAE7C,2BAA2B;;QAE3B,6BAA6B;;QAE7B,+BAA+B;;QAE/B,wBAAwB;;;IAG1B,gDAAgD;;QAE9C,2BAA2B;;QAE3B,6BAA6B;;QAE7B,+BAA+B;;QAE/B,+CAA+C;;;EAGjD,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
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
|
+
* Execution status type definitions.
|
|
7
|
+
*
|
|
8
|
+
* An execution represents a single run of a task with specific inputs.
|
|
9
|
+
* Executions are stored at: executions/<taskHash>/<inputsHash>/
|
|
10
|
+
*
|
|
11
|
+
* The status file tracks:
|
|
12
|
+
* - For running: process identification for crash detection
|
|
13
|
+
* - For success: output hash and timing
|
|
14
|
+
* - For failed: exit code and timing
|
|
15
|
+
* - For error: internal error message and timing
|
|
16
|
+
*/
|
|
17
|
+
import { VariantType, StructType, ArrayType, StringType, IntegerType, DateTimeType, } from '@elaraai/east';
|
|
18
|
+
/**
|
|
19
|
+
* Execution status stored in executions/<taskHash>/<inputsHash>/status.beast2
|
|
20
|
+
*
|
|
21
|
+
* A variant type representing the four possible states of an execution:
|
|
22
|
+
*
|
|
23
|
+
* - `running`: Task has been launched but not yet completed
|
|
24
|
+
* - `success`: Task ran and returned exit code 0
|
|
25
|
+
* - `failed`: Task ran and returned non-zero exit code
|
|
26
|
+
* - `error`: e3 execution engine had an internal error (runner not found, output missing, etc.)
|
|
27
|
+
*
|
|
28
|
+
* The `running` state includes process identification fields (pid, pidStartTime, bootId)
|
|
29
|
+
* to enable detection of crashed executions. See design/e3-execution.md for details.
|
|
30
|
+
*/
|
|
31
|
+
export const ExecutionStatusType = VariantType({
|
|
32
|
+
/** Task has been launched but not yet completed */
|
|
33
|
+
running: StructType({
|
|
34
|
+
/** Input dataset hashes */
|
|
35
|
+
inputHashes: ArrayType(StringType),
|
|
36
|
+
/** When execution started */
|
|
37
|
+
startedAt: DateTimeType,
|
|
38
|
+
/** Process ID of the runner */
|
|
39
|
+
pid: IntegerType,
|
|
40
|
+
/** Process start time in jiffies since boot (from /proc/<pid>/stat field 22) */
|
|
41
|
+
pidStartTime: IntegerType,
|
|
42
|
+
/** System boot ID (from /proc/sys/kernel/random/boot_id) */
|
|
43
|
+
bootId: StringType,
|
|
44
|
+
}),
|
|
45
|
+
/** Task ran and returned exit code 0 */
|
|
46
|
+
success: StructType({
|
|
47
|
+
/** Input dataset hashes */
|
|
48
|
+
inputHashes: ArrayType(StringType),
|
|
49
|
+
/** Hash of the output dataset */
|
|
50
|
+
outputHash: StringType,
|
|
51
|
+
/** When execution started */
|
|
52
|
+
startedAt: DateTimeType,
|
|
53
|
+
/** When execution completed */
|
|
54
|
+
completedAt: DateTimeType,
|
|
55
|
+
}),
|
|
56
|
+
/** Task ran and returned non-zero exit code */
|
|
57
|
+
failed: StructType({
|
|
58
|
+
/** Input dataset hashes */
|
|
59
|
+
inputHashes: ArrayType(StringType),
|
|
60
|
+
/** When execution started */
|
|
61
|
+
startedAt: DateTimeType,
|
|
62
|
+
/** When execution completed */
|
|
63
|
+
completedAt: DateTimeType,
|
|
64
|
+
/** Process exit code */
|
|
65
|
+
exitCode: IntegerType,
|
|
66
|
+
}),
|
|
67
|
+
/** e3 execution engine had an internal error */
|
|
68
|
+
error: StructType({
|
|
69
|
+
/** Input dataset hashes */
|
|
70
|
+
inputHashes: ArrayType(StringType),
|
|
71
|
+
/** When execution started */
|
|
72
|
+
startedAt: DateTimeType,
|
|
73
|
+
/** When execution completed */
|
|
74
|
+
completedAt: DateTimeType,
|
|
75
|
+
/** Error message describing what went wrong */
|
|
76
|
+
message: StringType,
|
|
77
|
+
}),
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../src/execution.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,EACV,WAAW,EACX,YAAY,GAEb,MAAM,eAAe,CAAC;AAEvB;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC;IAC7C,mDAAmD;IACnD,OAAO,EAAE,UAAU,CAAC;QAClB,2BAA2B;QAC3B,WAAW,EAAE,SAAS,CAAC,UAAU,CAAC;QAClC,6BAA6B;QAC7B,SAAS,EAAE,YAAY;QACvB,+BAA+B;QAC/B,GAAG,EAAE,WAAW;QAChB,gFAAgF;QAChF,YAAY,EAAE,WAAW;QACzB,4DAA4D;QAC5D,MAAM,EAAE,UAAU;KACnB,CAAC;IACF,wCAAwC;IACxC,OAAO,EAAE,UAAU,CAAC;QAClB,2BAA2B;QAC3B,WAAW,EAAE,SAAS,CAAC,UAAU,CAAC;QAClC,iCAAiC;QACjC,UAAU,EAAE,UAAU;QACtB,6BAA6B;QAC7B,SAAS,EAAE,YAAY;QACvB,+BAA+B;QAC/B,WAAW,EAAE,YAAY;KAC1B,CAAC;IACF,+CAA+C;IAC/C,MAAM,EAAE,UAAU,CAAC;QACjB,2BAA2B;QAC3B,WAAW,EAAE,SAAS,CAAC,UAAU,CAAC;QAClC,6BAA6B;QAC7B,SAAS,EAAE,YAAY;QACvB,+BAA+B;QAC/B,WAAW,EAAE,YAAY;QACzB,wBAAwB;QACxB,QAAQ,EAAE,WAAW;KACtB,CAAC;IACF,gDAAgD;IAChD,KAAK,EAAE,UAAU,CAAC;QAChB,2BAA2B;QAC3B,WAAW,EAAE,SAAS,CAAC,UAAU,CAAC;QAClC,6BAA6B;QAC7B,SAAS,EAAE,YAAY;QACvB,+BAA+B;QAC/B,WAAW,EAAE,YAAY;QACzB,+CAA+C;QAC/C,OAAO,EAAE,UAAU;KACpB,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
* e3-types: Shared type definitions for e3 (East Execution Engine)
|
|
7
|
+
*
|
|
8
|
+
* This package defines the East types used for serializing e3 objects:
|
|
9
|
+
* - Data references and tree structures
|
|
10
|
+
* - Task definitions (command IR, input/output paths)
|
|
11
|
+
* - Package objects
|
|
12
|
+
* - Data structure and paths
|
|
13
|
+
* - Workspace state
|
|
14
|
+
* - Execution status
|
|
15
|
+
*
|
|
16
|
+
* Terminology:
|
|
17
|
+
* - **Dataset**: A location holding a value (leaf node)
|
|
18
|
+
* - **Tree**: A location containing other locations (branch node)
|
|
19
|
+
* - **Structure**: The shape of the data tree
|
|
20
|
+
* - **Task**: A computation with command IR and input/output paths
|
|
21
|
+
* - **Path**: An address in the data tree
|
|
22
|
+
*/
|
|
23
|
+
export { DataRefType, type DataRef, unassignedRef, nullRef, DataTreeType, } from './dataset.js';
|
|
24
|
+
export { TaskObjectType, type TaskObject, } from './task.js';
|
|
25
|
+
export { StructureType, type Structure, PathSegmentType, type PathSegment, TreePathType, type TreePath, type ParsePathResult, treePath, pathToString, parsePath, DatasetSchemaType, type DatasetSchema, } from './structure.js';
|
|
26
|
+
export { PackageDataType, type PackageData, PackageObjectType, type PackageObject, PackageDatasetsType, type PackageDatasets, } from './package.js';
|
|
27
|
+
export { WorkspaceStateType, type WorkspaceState, } from './workspace.js';
|
|
28
|
+
export { ExecutionStatusType, type ExecutionStatus, } from './execution.js';
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EACL,WAAW,EACX,KAAK,OAAO,EACZ,aAAa,EACb,OAAO,EACP,YAAY,GACb,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,cAAc,EACd,KAAK,UAAU,GAChB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,aAAa,EACb,KAAK,SAAS,EACd,eAAe,EACf,KAAK,WAAW,EAChB,YAAY,EACZ,KAAK,QAAQ,EACb,KAAK,eAAe,EACpB,QAAQ,EACR,YAAY,EACZ,SAAS,EAET,iBAAiB,EACjB,KAAK,aAAa,GACnB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,eAAe,EACf,KAAK,WAAW,EAChB,iBAAiB,EACjB,KAAK,aAAa,EAElB,mBAAmB,EACnB,KAAK,eAAe,GACrB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,kBAAkB,EAClB,KAAK,cAAc,GACpB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,mBAAmB,EACnB,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
* e3-types: Shared type definitions for e3 (East Execution Engine)
|
|
7
|
+
*
|
|
8
|
+
* This package defines the East types used for serializing e3 objects:
|
|
9
|
+
* - Data references and tree structures
|
|
10
|
+
* - Task definitions (command IR, input/output paths)
|
|
11
|
+
* - Package objects
|
|
12
|
+
* - Data structure and paths
|
|
13
|
+
* - Workspace state
|
|
14
|
+
* - Execution status
|
|
15
|
+
*
|
|
16
|
+
* Terminology:
|
|
17
|
+
* - **Dataset**: A location holding a value (leaf node)
|
|
18
|
+
* - **Tree**: A location containing other locations (branch node)
|
|
19
|
+
* - **Structure**: The shape of the data tree
|
|
20
|
+
* - **Task**: A computation with command IR and input/output paths
|
|
21
|
+
* - **Path**: An address in the data tree
|
|
22
|
+
*/
|
|
23
|
+
// Data references and trees
|
|
24
|
+
export { DataRefType, unassignedRef, nullRef, DataTreeType, } from './dataset.js';
|
|
25
|
+
// Task definitions
|
|
26
|
+
export { TaskObjectType, } from './task.js';
|
|
27
|
+
// Data structure and paths
|
|
28
|
+
export { StructureType, PathSegmentType, TreePathType, treePath, pathToString, parsePath,
|
|
29
|
+
// Backwards compatibility
|
|
30
|
+
DatasetSchemaType, } from './structure.js';
|
|
31
|
+
// Package objects
|
|
32
|
+
export { PackageDataType, PackageObjectType,
|
|
33
|
+
// Backwards compatibility
|
|
34
|
+
PackageDatasetsType, } from './package.js';
|
|
35
|
+
// Workspace state
|
|
36
|
+
export { WorkspaceStateType, } from './workspace.js';
|
|
37
|
+
// Execution status
|
|
38
|
+
export { ExecutionStatusType, } from './execution.js';
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AAEH,4BAA4B;AAC5B,OAAO,EACL,WAAW,EAEX,aAAa,EACb,OAAO,EACP,YAAY,GACb,MAAM,cAAc,CAAC;AAEtB,mBAAmB;AACnB,OAAO,EACL,cAAc,GAEf,MAAM,WAAW,CAAC;AAEnB,2BAA2B;AAC3B,OAAO,EACL,aAAa,EAEb,eAAe,EAEf,YAAY,EAGZ,QAAQ,EACR,YAAY,EACZ,SAAS;AACT,0BAA0B;AAC1B,iBAAiB,GAElB,MAAM,gBAAgB,CAAC;AAExB,kBAAkB;AAClB,OAAO,EACL,eAAe,EAEf,iBAAiB;AAEjB,0BAA0B;AAC1B,mBAAmB,GAEpB,MAAM,cAAc,CAAC;AAEtB,kBAAkB;AAClB,OAAO,EACL,kBAAkB,GAEnB,MAAM,gBAAgB,CAAC;AAExB,mBAAmB;AACnB,OAAO,EACL,mBAAmB,GAEpB,MAAM,gBAAgB,CAAC"}
|