@elaraai/e3-types 0.0.2-beta.2 → 0.0.2-beta.20

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.
@@ -35,13 +35,13 @@ import { VariantType, StringType, NullType, ValueTypeOf, StructType, EastType }
35
35
  */
36
36
  export declare const DataRefType: VariantType<{
37
37
  /** Unassigned value (e.g., pending task output) */
38
- unassigned: NullType;
38
+ readonly unassigned: NullType;
39
39
  /** Inline null value (optimization for NullType) */
40
- null: NullType;
40
+ readonly null: NullType;
41
41
  /** Hash of a beast2 value blob in objects/ */
42
- value: StringType;
42
+ readonly value: StringType;
43
43
  /** Hash of a tree object in objects/ */
44
- tree: StringType;
44
+ readonly tree: StringType;
45
45
  }>;
46
46
  export type DataRefType = typeof DataRefType;
47
47
  export type DataRef = ValueTypeOf<typeof DataRefType>;
@@ -30,50 +30,50 @@ import { VariantType, StructType, ArrayType, StringType, IntegerType, DateTimeTy
30
30
  */
31
31
  export declare const ExecutionStatusType: VariantType<{
32
32
  /** Task has been launched but not yet completed */
33
- running: StructType<{
33
+ readonly running: StructType<{
34
34
  /** Input dataset hashes */
35
- inputHashes: ArrayType<StringType>;
35
+ readonly inputHashes: ArrayType<StringType>;
36
36
  /** When execution started */
37
- startedAt: DateTimeType;
37
+ readonly startedAt: DateTimeType;
38
38
  /** Process ID of the runner */
39
- pid: IntegerType;
39
+ readonly pid: IntegerType;
40
40
  /** Process start time in jiffies since boot (from /proc/<pid>/stat field 22) */
41
- pidStartTime: IntegerType;
41
+ readonly pidStartTime: IntegerType;
42
42
  /** System boot ID (from /proc/sys/kernel/random/boot_id) */
43
- bootId: StringType;
43
+ readonly bootId: StringType;
44
44
  }>;
45
45
  /** Task ran and returned exit code 0 */
46
- success: StructType<{
46
+ readonly success: StructType<{
47
47
  /** Input dataset hashes */
48
- inputHashes: ArrayType<StringType>;
48
+ readonly inputHashes: ArrayType<StringType>;
49
49
  /** Hash of the output dataset */
50
- outputHash: StringType;
50
+ readonly outputHash: StringType;
51
51
  /** When execution started */
52
- startedAt: DateTimeType;
52
+ readonly startedAt: DateTimeType;
53
53
  /** When execution completed */
54
- completedAt: DateTimeType;
54
+ readonly completedAt: DateTimeType;
55
55
  }>;
56
56
  /** Task ran and returned non-zero exit code */
57
- failed: StructType<{
57
+ readonly failed: StructType<{
58
58
  /** Input dataset hashes */
59
- inputHashes: ArrayType<StringType>;
59
+ readonly inputHashes: ArrayType<StringType>;
60
60
  /** When execution started */
61
- startedAt: DateTimeType;
61
+ readonly startedAt: DateTimeType;
62
62
  /** When execution completed */
63
- completedAt: DateTimeType;
63
+ readonly completedAt: DateTimeType;
64
64
  /** Process exit code */
65
- exitCode: IntegerType;
65
+ readonly exitCode: IntegerType;
66
66
  }>;
67
67
  /** e3 execution engine had an internal error */
68
- error: StructType<{
68
+ readonly error: StructType<{
69
69
  /** Input dataset hashes */
70
- inputHashes: ArrayType<StringType>;
70
+ readonly inputHashes: ArrayType<StringType>;
71
71
  /** When execution started */
72
- startedAt: DateTimeType;
72
+ readonly startedAt: DateTimeType;
73
73
  /** When execution completed */
74
- completedAt: DateTimeType;
74
+ readonly completedAt: DateTimeType;
75
75
  /** Error message describing what went wrong */
76
- message: StringType;
76
+ readonly message: StringType;
77
77
  }>;
78
78
  }>;
79
79
  export type ExecutionStatus = ValueTypeOf<typeof ExecutionStatusType>;
@@ -26,4 +26,5 @@ export { StructureType, type Structure, PathSegmentType, type PathSegment, TreeP
26
26
  export { PackageDataType, type PackageData, PackageObjectType, type PackageObject, PackageDatasetsType, type PackageDatasets, } from './package.js';
27
27
  export { WorkspaceStateType, type WorkspaceState, } from './workspace.js';
28
28
  export { ExecutionStatusType, type ExecutionStatus, } from './execution.js';
29
+ export { LockOperationType, type LockOperation, ProcessHolderType, type ProcessHolder, LockStateType, type LockState, } from './lock.js';
29
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EAEjB,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"}
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,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EAEjB,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;AAGxB,OAAO,EACL,iBAAiB,EACjB,KAAK,aAAa,EAClB,iBAAiB,EACjB,KAAK,aAAa,EAClB,aAAa,EACb,KAAK,SAAS,GACf,MAAM,WAAW,CAAC"}
package/dist/src/index.js CHANGED
@@ -36,4 +36,6 @@ PackageDatasetsType, } from './package.js';
36
36
  export { WorkspaceStateType, } from './workspace.js';
37
37
  // Execution status
38
38
  export { ExecutionStatusType, } from './execution.js';
39
+ // Lock state
40
+ export { LockOperationType, ProcessHolderType, LockStateType, } from './lock.js';
39
41
  //# sourceMappingURL=index.js.map
@@ -1 +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,EAKZ,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,iBAAiB;AACjB,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"}
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,EAKZ,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,iBAAiB;AACjB,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;AAExB,aAAa;AACb,OAAO,EACL,iBAAiB,EAEjB,iBAAiB,EAEjB,aAAa,GAEd,MAAM,WAAW,CAAC"}
@@ -0,0 +1,81 @@
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
+ * Lock state type definitions.
7
+ *
8
+ * A lock provides exclusive access to a workspace. The state tracks:
9
+ * - What operation acquired the lock (dataflow, deployment, etc.)
10
+ * - Who holds the lock (East text-encoded string)
11
+ * - When it was acquired
12
+ * - Optional expiry (for cloud TTL-based locks)
13
+ *
14
+ * Lock file location: workspaces/<name>.lock
15
+ *
16
+ * The holder field is an East text-encoded string, allowing different backends
17
+ * to encode their own holder identification. Common patterns:
18
+ * - Local: `.process (pid=1234, bootId="abc-123", startTime=98765, command="e3 start")`
19
+ * - Cloud: `.lambda (requestId="req-123", functionName="e3-api")`
20
+ */
21
+ import { VariantType, StructType, StringType, IntegerType, DateTimeType, OptionType, NullType, ValueTypeOf } from '@elaraai/east';
22
+ /**
23
+ * Lock operation - what acquired the lock.
24
+ */
25
+ export declare const LockOperationType: VariantType<{
26
+ /** Running a dataflow */
27
+ readonly dataflow: NullType;
28
+ /** Deploying a package to the workspace */
29
+ readonly deployment: NullType;
30
+ /** Removing the workspace */
31
+ readonly removal: NullType;
32
+ /** Writing to a dataset */
33
+ readonly dataset_write: NullType;
34
+ }>;
35
+ export type LockOperation = ValueTypeOf<typeof LockOperationType>;
36
+ /**
37
+ * Process holder schema - for local filesystem backends.
38
+ * Used to encode/decode the holder string.
39
+ */
40
+ export declare const ProcessHolderType: StructType<{
41
+ /** Process ID */
42
+ readonly pid: IntegerType;
43
+ /** System boot ID (from /proc/sys/kernel/random/boot_id) */
44
+ readonly bootId: StringType;
45
+ /** Process start time in jiffies since boot */
46
+ readonly startTime: IntegerType;
47
+ /** Command that acquired the lock (for debugging) */
48
+ readonly command: StringType;
49
+ }>;
50
+ export type ProcessHolder = ValueTypeOf<typeof ProcessHolderType>;
51
+ /**
52
+ * Lock state stored in workspaces/<name>.lock
53
+ *
54
+ * Represents an advisory lock on a workspace. The actual locking mechanism
55
+ * is platform-specific (flock on Linux, DynamoDB conditional writes in cloud),
56
+ * but the lock content follows this schema.
57
+ *
58
+ * The holder field is an East text-encoded string representing a variant value.
59
+ * Use `printFor`/`parseInferred` from @elaraai/east to encode/decode.
60
+ */
61
+ export declare const LockStateType: StructType<{
62
+ /** What operation acquired the lock */
63
+ readonly operation: VariantType<{
64
+ /** Running a dataflow */
65
+ readonly dataflow: NullType;
66
+ /** Deploying a package to the workspace */
67
+ readonly deployment: NullType;
68
+ /** Removing the workspace */
69
+ readonly removal: NullType;
70
+ /** Writing to a dataset */
71
+ readonly dataset_write: NullType;
72
+ }>;
73
+ /** Who holds the lock - East text-encoded variant (e.g., `.process (...)`) */
74
+ readonly holder: StringType;
75
+ /** When the lock was acquired */
76
+ readonly acquiredAt: DateTimeType;
77
+ /** When the lock expires (for cloud TTL-based locks) */
78
+ readonly expiresAt: OptionType<DateTimeType>;
79
+ }>;
80
+ export type LockState = ValueTypeOf<typeof LockStateType>;
81
+ //# sourceMappingURL=lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../src/lock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,WAAW,EACZ,MAAM,eAAe,CAAC;AAEvB;;GAEG;AACH,eAAO,MAAM,iBAAiB;IAC5B,yBAAyB;;IAEzB,2CAA2C;;IAE3C,6BAA6B;;IAE7B,2BAA2B;;EAE3B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,iBAAiB;IAC5B,iBAAiB;;IAEjB,4DAA4D;;IAE5D,+CAA+C;;IAE/C,qDAAqD;;EAErD,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAElE;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa;IACxB,uCAAuC;;QAxCvC,yBAAyB;;QAEzB,2CAA2C;;QAE3C,6BAA6B;;QAE7B,2BAA2B;;;IAoC3B,8EAA8E;;IAE9E,iCAAiC;;IAEjC,wDAAwD;;EAExD,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,WAAW,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -0,0 +1,69 @@
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
+ * Lock state type definitions.
7
+ *
8
+ * A lock provides exclusive access to a workspace. The state tracks:
9
+ * - What operation acquired the lock (dataflow, deployment, etc.)
10
+ * - Who holds the lock (East text-encoded string)
11
+ * - When it was acquired
12
+ * - Optional expiry (for cloud TTL-based locks)
13
+ *
14
+ * Lock file location: workspaces/<name>.lock
15
+ *
16
+ * The holder field is an East text-encoded string, allowing different backends
17
+ * to encode their own holder identification. Common patterns:
18
+ * - Local: `.process (pid=1234, bootId="abc-123", startTime=98765, command="e3 start")`
19
+ * - Cloud: `.lambda (requestId="req-123", functionName="e3-api")`
20
+ */
21
+ import { VariantType, StructType, StringType, IntegerType, DateTimeType, OptionType, NullType, } from '@elaraai/east';
22
+ /**
23
+ * Lock operation - what acquired the lock.
24
+ */
25
+ export const LockOperationType = VariantType({
26
+ /** Running a dataflow */
27
+ dataflow: NullType,
28
+ /** Deploying a package to the workspace */
29
+ deployment: NullType,
30
+ /** Removing the workspace */
31
+ removal: NullType,
32
+ /** Writing to a dataset */
33
+ dataset_write: NullType,
34
+ });
35
+ /**
36
+ * Process holder schema - for local filesystem backends.
37
+ * Used to encode/decode the holder string.
38
+ */
39
+ export const ProcessHolderType = StructType({
40
+ /** Process ID */
41
+ pid: IntegerType,
42
+ /** System boot ID (from /proc/sys/kernel/random/boot_id) */
43
+ bootId: StringType,
44
+ /** Process start time in jiffies since boot */
45
+ startTime: IntegerType,
46
+ /** Command that acquired the lock (for debugging) */
47
+ command: StringType,
48
+ });
49
+ /**
50
+ * Lock state stored in workspaces/<name>.lock
51
+ *
52
+ * Represents an advisory lock on a workspace. The actual locking mechanism
53
+ * is platform-specific (flock on Linux, DynamoDB conditional writes in cloud),
54
+ * but the lock content follows this schema.
55
+ *
56
+ * The holder field is an East text-encoded string representing a variant value.
57
+ * Use `printFor`/`parseInferred` from @elaraai/east to encode/decode.
58
+ */
59
+ export const LockStateType = StructType({
60
+ /** What operation acquired the lock */
61
+ operation: LockOperationType,
62
+ /** Who holds the lock - East text-encoded variant (e.g., `.process (...)`) */
63
+ holder: StringType,
64
+ /** When the lock was acquired */
65
+ acquiredAt: DateTimeType,
66
+ /** When the lock expires (for cloud TTL-based locks) */
67
+ expiresAt: OptionType(DateTimeType),
68
+ });
69
+ //# sourceMappingURL=lock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lock.js","sourceRoot":"","sources":["../../src/lock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,UAAU,EACV,QAAQ,GAET,MAAM,eAAe,CAAC;AAEvB;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,WAAW,CAAC;IAC3C,yBAAyB;IACzB,QAAQ,EAAE,QAAQ;IAClB,2CAA2C;IAC3C,UAAU,EAAE,QAAQ;IACpB,6BAA6B;IAC7B,OAAO,EAAE,QAAQ;IACjB,2BAA2B;IAC3B,aAAa,EAAE,QAAQ;CACxB,CAAC,CAAC;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;IAC1C,iBAAiB;IACjB,GAAG,EAAE,WAAW;IAChB,4DAA4D;IAC5D,MAAM,EAAE,UAAU;IAClB,+CAA+C;IAC/C,SAAS,EAAE,WAAW;IACtB,qDAAqD;IACrD,OAAO,EAAE,UAAU;CACpB,CAAC,CAAC;AAIH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;IACtC,uCAAuC;IACvC,SAAS,EAAE,iBAAiB;IAC5B,8EAA8E;IAC9E,MAAM,EAAE,UAAU;IAClB,iCAAiC;IACjC,UAAU,EAAE,YAAY;IACxB,wDAAwD;IACxD,SAAS,EAAE,UAAU,CAAC,YAAY,CAAC;CACpC,CAAC,CAAC"}
@@ -44,90 +44,90 @@ import { StructType, StringType, DictType, ValueTypeOf } from '@elaraai/east';
44
44
  */
45
45
  export declare const PackageDataType: StructType<{
46
46
  /** Structure defining tree shape (what's a group vs dataset) */
47
- structure: import("@elaraai/east").RecursiveType<import("@elaraai/east").VariantType<{
48
- value: import("@elaraai/east").RecursiveType<import("@elaraai/east").VariantType<{
49
- Never: import("@elaraai/east").NullType;
50
- Null: import("@elaraai/east").NullType;
51
- Boolean: import("@elaraai/east").NullType;
52
- Integer: import("@elaraai/east").NullType;
53
- Float: import("@elaraai/east").NullType;
54
- String: import("@elaraai/east").NullType;
55
- DateTime: import("@elaraai/east").NullType;
56
- Blob: import("@elaraai/east").NullType;
57
- Ref: import("@elaraai/east").RecursiveTypeMarker;
58
- Array: import("@elaraai/east").RecursiveTypeMarker;
59
- Set: import("@elaraai/east").RecursiveTypeMarker;
60
- Dict: StructType<{
61
- key: import("@elaraai/east").RecursiveTypeMarker;
62
- value: import("@elaraai/east").RecursiveTypeMarker;
47
+ readonly structure: import("@elaraai/east").RecursiveType<import("@elaraai/east").VariantType<{
48
+ readonly value: import("@elaraai/east").RecursiveType<import("@elaraai/east").VariantType<{
49
+ readonly Never: import("@elaraai/east").NullType;
50
+ readonly Null: import("@elaraai/east").NullType;
51
+ readonly Boolean: import("@elaraai/east").NullType;
52
+ readonly Integer: import("@elaraai/east").NullType;
53
+ readonly Float: import("@elaraai/east").NullType;
54
+ readonly String: import("@elaraai/east").NullType;
55
+ readonly DateTime: import("@elaraai/east").NullType;
56
+ readonly Blob: import("@elaraai/east").NullType;
57
+ readonly Ref: import("@elaraai/east").RecursiveTypeMarker;
58
+ readonly Array: import("@elaraai/east").RecursiveTypeMarker;
59
+ readonly Set: import("@elaraai/east").RecursiveTypeMarker;
60
+ readonly Dict: StructType<{
61
+ readonly key: import("@elaraai/east").RecursiveTypeMarker;
62
+ readonly value: import("@elaraai/east").RecursiveTypeMarker;
63
63
  }>;
64
- Struct: import("@elaraai/east").ArrayType<StructType<{
65
- name: StringType;
66
- type: import("@elaraai/east").RecursiveTypeMarker;
64
+ readonly Struct: import("@elaraai/east").ArrayType<StructType<{
65
+ readonly name: StringType;
66
+ readonly type: import("@elaraai/east").RecursiveTypeMarker;
67
67
  }>>;
68
- Variant: import("@elaraai/east").ArrayType<StructType<{
69
- name: StringType;
70
- type: import("@elaraai/east").RecursiveTypeMarker;
68
+ readonly Variant: import("@elaraai/east").ArrayType<StructType<{
69
+ readonly name: StringType;
70
+ readonly type: import("@elaraai/east").RecursiveTypeMarker;
71
71
  }>>;
72
- Recursive: import("@elaraai/east").IntegerType;
73
- Function: StructType<{
74
- inputs: import("@elaraai/east").ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
75
- output: import("@elaraai/east").RecursiveTypeMarker;
72
+ readonly Recursive: import("@elaraai/east").IntegerType;
73
+ readonly Function: StructType<{
74
+ readonly inputs: import("@elaraai/east").ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
75
+ readonly output: import("@elaraai/east").RecursiveTypeMarker;
76
76
  }>;
77
- AsyncFunction: StructType<{
78
- inputs: import("@elaraai/east").ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
79
- output: import("@elaraai/east").RecursiveTypeMarker;
77
+ readonly AsyncFunction: StructType<{
78
+ readonly inputs: import("@elaraai/east").ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
79
+ readonly output: import("@elaraai/east").RecursiveTypeMarker;
80
80
  }>;
81
81
  }>>;
82
- struct: DictType<StringType, import("@elaraai/east").RecursiveTypeMarker>;
82
+ readonly struct: DictType<StringType, import("@elaraai/east").RecursiveTypeMarker>;
83
83
  }>>;
84
84
  /** Hash of the root tree object containing initial/default values */
85
- value: StringType;
85
+ readonly value: StringType;
86
86
  }>;
87
87
  export type PackageDataType = typeof PackageDataType;
88
88
  export type PackageData = ValueTypeOf<typeof PackageDataType>;
89
89
  /** @deprecated Use PackageDataType instead */
90
90
  export declare const PackageDatasetsType: StructType<{
91
91
  /** Structure defining tree shape (what's a group vs dataset) */
92
- structure: import("@elaraai/east").RecursiveType<import("@elaraai/east").VariantType<{
93
- value: import("@elaraai/east").RecursiveType<import("@elaraai/east").VariantType<{
94
- Never: import("@elaraai/east").NullType;
95
- Null: import("@elaraai/east").NullType;
96
- Boolean: import("@elaraai/east").NullType;
97
- Integer: import("@elaraai/east").NullType;
98
- Float: import("@elaraai/east").NullType;
99
- String: import("@elaraai/east").NullType;
100
- DateTime: import("@elaraai/east").NullType;
101
- Blob: import("@elaraai/east").NullType;
102
- Ref: import("@elaraai/east").RecursiveTypeMarker;
103
- Array: import("@elaraai/east").RecursiveTypeMarker;
104
- Set: import("@elaraai/east").RecursiveTypeMarker;
105
- Dict: StructType<{
106
- key: import("@elaraai/east").RecursiveTypeMarker;
107
- value: import("@elaraai/east").RecursiveTypeMarker;
92
+ readonly structure: import("@elaraai/east").RecursiveType<import("@elaraai/east").VariantType<{
93
+ readonly value: import("@elaraai/east").RecursiveType<import("@elaraai/east").VariantType<{
94
+ readonly Never: import("@elaraai/east").NullType;
95
+ readonly Null: import("@elaraai/east").NullType;
96
+ readonly Boolean: import("@elaraai/east").NullType;
97
+ readonly Integer: import("@elaraai/east").NullType;
98
+ readonly Float: import("@elaraai/east").NullType;
99
+ readonly String: import("@elaraai/east").NullType;
100
+ readonly DateTime: import("@elaraai/east").NullType;
101
+ readonly Blob: import("@elaraai/east").NullType;
102
+ readonly Ref: import("@elaraai/east").RecursiveTypeMarker;
103
+ readonly Array: import("@elaraai/east").RecursiveTypeMarker;
104
+ readonly Set: import("@elaraai/east").RecursiveTypeMarker;
105
+ readonly Dict: StructType<{
106
+ readonly key: import("@elaraai/east").RecursiveTypeMarker;
107
+ readonly value: import("@elaraai/east").RecursiveTypeMarker;
108
108
  }>;
109
- Struct: import("@elaraai/east").ArrayType<StructType<{
110
- name: StringType;
111
- type: import("@elaraai/east").RecursiveTypeMarker;
109
+ readonly Struct: import("@elaraai/east").ArrayType<StructType<{
110
+ readonly name: StringType;
111
+ readonly type: import("@elaraai/east").RecursiveTypeMarker;
112
112
  }>>;
113
- Variant: import("@elaraai/east").ArrayType<StructType<{
114
- name: StringType;
115
- type: import("@elaraai/east").RecursiveTypeMarker;
113
+ readonly Variant: import("@elaraai/east").ArrayType<StructType<{
114
+ readonly name: StringType;
115
+ readonly type: import("@elaraai/east").RecursiveTypeMarker;
116
116
  }>>;
117
- Recursive: import("@elaraai/east").IntegerType;
118
- Function: StructType<{
119
- inputs: import("@elaraai/east").ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
120
- output: import("@elaraai/east").RecursiveTypeMarker;
117
+ readonly Recursive: import("@elaraai/east").IntegerType;
118
+ readonly Function: StructType<{
119
+ readonly inputs: import("@elaraai/east").ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
120
+ readonly output: import("@elaraai/east").RecursiveTypeMarker;
121
121
  }>;
122
- AsyncFunction: StructType<{
123
- inputs: import("@elaraai/east").ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
124
- output: import("@elaraai/east").RecursiveTypeMarker;
122
+ readonly AsyncFunction: StructType<{
123
+ readonly inputs: import("@elaraai/east").ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
124
+ readonly output: import("@elaraai/east").RecursiveTypeMarker;
125
125
  }>;
126
126
  }>>;
127
- struct: DictType<StringType, import("@elaraai/east").RecursiveTypeMarker>;
127
+ readonly struct: DictType<StringType, import("@elaraai/east").RecursiveTypeMarker>;
128
128
  }>>;
129
129
  /** Hash of the root tree object containing initial/default values */
130
- value: StringType;
130
+ readonly value: StringType;
131
131
  }>;
132
132
  /** @deprecated Use PackageData instead */
133
133
  export type PackageDatasetsType = PackageDataType;
@@ -160,49 +160,49 @@ export type PackageDatasets = PackageData;
160
160
  */
161
161
  export declare const PackageObjectType: StructType<{
162
162
  /** Tasks defined in this package: name -> task object hash */
163
- tasks: DictType<StringType, StringType>;
163
+ readonly tasks: DictType<StringType, StringType>;
164
164
  /** Data structure and initial values */
165
- data: StructType<{
165
+ readonly data: StructType<{
166
166
  /** Structure defining tree shape (what's a group vs dataset) */
167
- structure: import("@elaraai/east").RecursiveType<import("@elaraai/east").VariantType<{
168
- value: import("@elaraai/east").RecursiveType<import("@elaraai/east").VariantType<{
169
- Never: import("@elaraai/east").NullType;
170
- Null: import("@elaraai/east").NullType;
171
- Boolean: import("@elaraai/east").NullType;
172
- Integer: import("@elaraai/east").NullType;
173
- Float: import("@elaraai/east").NullType;
174
- String: import("@elaraai/east").NullType;
175
- DateTime: import("@elaraai/east").NullType;
176
- Blob: import("@elaraai/east").NullType;
177
- Ref: import("@elaraai/east").RecursiveTypeMarker;
178
- Array: import("@elaraai/east").RecursiveTypeMarker;
179
- Set: import("@elaraai/east").RecursiveTypeMarker;
180
- Dict: StructType<{
181
- key: import("@elaraai/east").RecursiveTypeMarker;
182
- value: import("@elaraai/east").RecursiveTypeMarker;
167
+ readonly structure: import("@elaraai/east").RecursiveType<import("@elaraai/east").VariantType<{
168
+ readonly value: import("@elaraai/east").RecursiveType<import("@elaraai/east").VariantType<{
169
+ readonly Never: import("@elaraai/east").NullType;
170
+ readonly Null: import("@elaraai/east").NullType;
171
+ readonly Boolean: import("@elaraai/east").NullType;
172
+ readonly Integer: import("@elaraai/east").NullType;
173
+ readonly Float: import("@elaraai/east").NullType;
174
+ readonly String: import("@elaraai/east").NullType;
175
+ readonly DateTime: import("@elaraai/east").NullType;
176
+ readonly Blob: import("@elaraai/east").NullType;
177
+ readonly Ref: import("@elaraai/east").RecursiveTypeMarker;
178
+ readonly Array: import("@elaraai/east").RecursiveTypeMarker;
179
+ readonly Set: import("@elaraai/east").RecursiveTypeMarker;
180
+ readonly Dict: StructType<{
181
+ readonly key: import("@elaraai/east").RecursiveTypeMarker;
182
+ readonly value: import("@elaraai/east").RecursiveTypeMarker;
183
183
  }>;
184
- Struct: import("@elaraai/east").ArrayType<StructType<{
185
- name: StringType;
186
- type: import("@elaraai/east").RecursiveTypeMarker;
184
+ readonly Struct: import("@elaraai/east").ArrayType<StructType<{
185
+ readonly name: StringType;
186
+ readonly type: import("@elaraai/east").RecursiveTypeMarker;
187
187
  }>>;
188
- Variant: import("@elaraai/east").ArrayType<StructType<{
189
- name: StringType;
190
- type: import("@elaraai/east").RecursiveTypeMarker;
188
+ readonly Variant: import("@elaraai/east").ArrayType<StructType<{
189
+ readonly name: StringType;
190
+ readonly type: import("@elaraai/east").RecursiveTypeMarker;
191
191
  }>>;
192
- Recursive: import("@elaraai/east").IntegerType;
193
- Function: StructType<{
194
- inputs: import("@elaraai/east").ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
195
- output: import("@elaraai/east").RecursiveTypeMarker;
192
+ readonly Recursive: import("@elaraai/east").IntegerType;
193
+ readonly Function: StructType<{
194
+ readonly inputs: import("@elaraai/east").ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
195
+ readonly output: import("@elaraai/east").RecursiveTypeMarker;
196
196
  }>;
197
- AsyncFunction: StructType<{
198
- inputs: import("@elaraai/east").ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
199
- output: import("@elaraai/east").RecursiveTypeMarker;
197
+ readonly AsyncFunction: StructType<{
198
+ readonly inputs: import("@elaraai/east").ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
199
+ readonly output: import("@elaraai/east").RecursiveTypeMarker;
200
200
  }>;
201
201
  }>>;
202
- struct: DictType<StringType, import("@elaraai/east").RecursiveTypeMarker>;
202
+ readonly struct: DictType<StringType, import("@elaraai/east").RecursiveTypeMarker>;
203
203
  }>>;
204
204
  /** Hash of the root tree object containing initial/default values */
205
- value: StringType;
205
+ readonly value: StringType;
206
206
  }>;
207
207
  }>;
208
208
  export type PackageObjectType = typeof PackageObjectType;
@@ -45,84 +45,84 @@ import { VariantType, StringType, ArrayType, DictType, RecursiveType, ValueTypeO
45
45
  */
46
46
  export declare const StructureType: RecursiveType<VariantType<{
47
47
  /** Dataset: East type of the value (homoiconic EastTypeValue) */
48
- value: RecursiveType<VariantType<{
49
- Never: import("@elaraai/east").NullType;
50
- Null: import("@elaraai/east").NullType;
51
- Boolean: import("@elaraai/east").NullType;
52
- Integer: import("@elaraai/east").NullType;
53
- Float: import("@elaraai/east").NullType;
54
- String: import("@elaraai/east").NullType;
55
- DateTime: import("@elaraai/east").NullType;
56
- Blob: import("@elaraai/east").NullType;
57
- Ref: import("@elaraai/east").RecursiveTypeMarker;
58
- Array: import("@elaraai/east").RecursiveTypeMarker;
59
- Set: import("@elaraai/east").RecursiveTypeMarker;
60
- Dict: import("@elaraai/east").StructType<{
61
- key: import("@elaraai/east").RecursiveTypeMarker;
62
- value: import("@elaraai/east").RecursiveTypeMarker;
48
+ readonly value: RecursiveType<VariantType<{
49
+ readonly Never: import("@elaraai/east").NullType;
50
+ readonly Null: import("@elaraai/east").NullType;
51
+ readonly Boolean: import("@elaraai/east").NullType;
52
+ readonly Integer: import("@elaraai/east").NullType;
53
+ readonly Float: import("@elaraai/east").NullType;
54
+ readonly String: import("@elaraai/east").NullType;
55
+ readonly DateTime: import("@elaraai/east").NullType;
56
+ readonly Blob: import("@elaraai/east").NullType;
57
+ readonly Ref: import("@elaraai/east").RecursiveTypeMarker;
58
+ readonly Array: import("@elaraai/east").RecursiveTypeMarker;
59
+ readonly Set: import("@elaraai/east").RecursiveTypeMarker;
60
+ readonly Dict: import("@elaraai/east").StructType<{
61
+ readonly key: import("@elaraai/east").RecursiveTypeMarker;
62
+ readonly value: import("@elaraai/east").RecursiveTypeMarker;
63
63
  }>;
64
- Struct: ArrayType<import("@elaraai/east").StructType<{
65
- name: StringType;
66
- type: import("@elaraai/east").RecursiveTypeMarker;
64
+ readonly Struct: ArrayType<import("@elaraai/east").StructType<{
65
+ readonly name: StringType;
66
+ readonly type: import("@elaraai/east").RecursiveTypeMarker;
67
67
  }>>;
68
- Variant: ArrayType<import("@elaraai/east").StructType<{
69
- name: StringType;
70
- type: import("@elaraai/east").RecursiveTypeMarker;
68
+ readonly Variant: ArrayType<import("@elaraai/east").StructType<{
69
+ readonly name: StringType;
70
+ readonly type: import("@elaraai/east").RecursiveTypeMarker;
71
71
  }>>;
72
- Recursive: import("@elaraai/east").IntegerType;
73
- Function: import("@elaraai/east").StructType<{
74
- inputs: ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
75
- output: import("@elaraai/east").RecursiveTypeMarker;
72
+ readonly Recursive: import("@elaraai/east").IntegerType;
73
+ readonly Function: import("@elaraai/east").StructType<{
74
+ readonly inputs: ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
75
+ readonly output: import("@elaraai/east").RecursiveTypeMarker;
76
76
  }>;
77
- AsyncFunction: import("@elaraai/east").StructType<{
78
- inputs: ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
79
- output: import("@elaraai/east").RecursiveTypeMarker;
77
+ readonly AsyncFunction: import("@elaraai/east").StructType<{
78
+ readonly inputs: ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
79
+ readonly output: import("@elaraai/east").RecursiveTypeMarker;
80
80
  }>;
81
81
  }>>;
82
82
  /** Struct tree: named children mapping to child structures */
83
- struct: DictType<StringType, import("@elaraai/east").RecursiveTypeMarker>;
83
+ readonly struct: DictType<StringType, import("@elaraai/east").RecursiveTypeMarker>;
84
84
  }>>;
85
85
  export type StructureType = typeof StructureType;
86
86
  export type Structure = ValueTypeOf<typeof StructureType>;
87
87
  /** @deprecated Use StructureType instead */
88
88
  export declare const DatasetSchemaType: RecursiveType<VariantType<{
89
89
  /** Dataset: East type of the value (homoiconic EastTypeValue) */
90
- value: RecursiveType<VariantType<{
91
- Never: import("@elaraai/east").NullType;
92
- Null: import("@elaraai/east").NullType;
93
- Boolean: import("@elaraai/east").NullType;
94
- Integer: import("@elaraai/east").NullType;
95
- Float: import("@elaraai/east").NullType;
96
- String: import("@elaraai/east").NullType;
97
- DateTime: import("@elaraai/east").NullType;
98
- Blob: import("@elaraai/east").NullType;
99
- Ref: import("@elaraai/east").RecursiveTypeMarker;
100
- Array: import("@elaraai/east").RecursiveTypeMarker;
101
- Set: import("@elaraai/east").RecursiveTypeMarker;
102
- Dict: import("@elaraai/east").StructType<{
103
- key: import("@elaraai/east").RecursiveTypeMarker;
104
- value: import("@elaraai/east").RecursiveTypeMarker;
90
+ readonly value: RecursiveType<VariantType<{
91
+ readonly Never: import("@elaraai/east").NullType;
92
+ readonly Null: import("@elaraai/east").NullType;
93
+ readonly Boolean: import("@elaraai/east").NullType;
94
+ readonly Integer: import("@elaraai/east").NullType;
95
+ readonly Float: import("@elaraai/east").NullType;
96
+ readonly String: import("@elaraai/east").NullType;
97
+ readonly DateTime: import("@elaraai/east").NullType;
98
+ readonly Blob: import("@elaraai/east").NullType;
99
+ readonly Ref: import("@elaraai/east").RecursiveTypeMarker;
100
+ readonly Array: import("@elaraai/east").RecursiveTypeMarker;
101
+ readonly Set: import("@elaraai/east").RecursiveTypeMarker;
102
+ readonly Dict: import("@elaraai/east").StructType<{
103
+ readonly key: import("@elaraai/east").RecursiveTypeMarker;
104
+ readonly value: import("@elaraai/east").RecursiveTypeMarker;
105
105
  }>;
106
- Struct: ArrayType<import("@elaraai/east").StructType<{
107
- name: StringType;
108
- type: import("@elaraai/east").RecursiveTypeMarker;
106
+ readonly Struct: ArrayType<import("@elaraai/east").StructType<{
107
+ readonly name: StringType;
108
+ readonly type: import("@elaraai/east").RecursiveTypeMarker;
109
109
  }>>;
110
- Variant: ArrayType<import("@elaraai/east").StructType<{
111
- name: StringType;
112
- type: import("@elaraai/east").RecursiveTypeMarker;
110
+ readonly Variant: ArrayType<import("@elaraai/east").StructType<{
111
+ readonly name: StringType;
112
+ readonly type: import("@elaraai/east").RecursiveTypeMarker;
113
113
  }>>;
114
- Recursive: import("@elaraai/east").IntegerType;
115
- Function: import("@elaraai/east").StructType<{
116
- inputs: ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
117
- output: import("@elaraai/east").RecursiveTypeMarker;
114
+ readonly Recursive: import("@elaraai/east").IntegerType;
115
+ readonly Function: import("@elaraai/east").StructType<{
116
+ readonly inputs: ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
117
+ readonly output: import("@elaraai/east").RecursiveTypeMarker;
118
118
  }>;
119
- AsyncFunction: import("@elaraai/east").StructType<{
120
- inputs: ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
121
- output: import("@elaraai/east").RecursiveTypeMarker;
119
+ readonly AsyncFunction: import("@elaraai/east").StructType<{
120
+ readonly inputs: ArrayType<import("@elaraai/east").RecursiveTypeMarker>;
121
+ readonly output: import("@elaraai/east").RecursiveTypeMarker;
122
122
  }>;
123
123
  }>>;
124
124
  /** Struct tree: named children mapping to child structures */
125
- struct: DictType<StringType, import("@elaraai/east").RecursiveTypeMarker>;
125
+ readonly struct: DictType<StringType, import("@elaraai/east").RecursiveTypeMarker>;
126
126
  }>>;
127
127
  /** @deprecated Use Structure instead */
128
128
  export type DatasetSchemaType = StructureType;
@@ -147,7 +147,7 @@ export type DatasetSchema = Structure;
147
147
  */
148
148
  export declare const PathSegmentType: VariantType<{
149
149
  /** Struct field access by name */
150
- field: StringType;
150
+ readonly field: StringType;
151
151
  }>;
152
152
  export type PathSegmentType = typeof PathSegmentType;
153
153
  export type PathSegment = ValueTypeOf<typeof PathSegmentType>;
@@ -169,7 +169,7 @@ export type PathSegment = ValueTypeOf<typeof PathSegmentType>;
169
169
  */
170
170
  export declare const TreePathType: ArrayType<VariantType<{
171
171
  /** Struct field access by name */
172
- field: StringType;
172
+ readonly field: StringType;
173
173
  }>>;
174
174
  export type TreePathType = typeof TreePathType;
175
175
  export type TreePath = ValueTypeOf<typeof TreePathType>;
@@ -51,14 +51,14 @@ import { StructType, StringType, ArrayType, ValueTypeOf } from '@elaraai/east';
51
51
  */
52
52
  export declare const TaskObjectType: StructType<{
53
53
  /** Hash of East IR that generates exec args: (inputs, output) -> Array<String> */
54
- commandIr: StringType;
54
+ readonly commandIr: StringType;
55
55
  /** Input paths: where to read each input dataset from the data tree */
56
- inputs: ArrayType<ArrayType<import("@elaraai/east").VariantType<{
57
- field: StringType;
56
+ readonly inputs: ArrayType<ArrayType<import("@elaraai/east").VariantType<{
57
+ readonly field: StringType;
58
58
  }>>>;
59
59
  /** Output path: where to write the output dataset in the data tree */
60
- output: ArrayType<import("@elaraai/east").VariantType<{
61
- field: StringType;
60
+ readonly output: ArrayType<import("@elaraai/east").VariantType<{
61
+ readonly field: StringType;
62
62
  }>>;
63
63
  }>;
64
64
  export type TaskObjectType = typeof TaskObjectType;
@@ -33,17 +33,17 @@ import { StructType, StringType, DateTimeType, ValueTypeOf } from '@elaraai/east
33
33
  */
34
34
  export declare const WorkspaceStateType: StructType<{
35
35
  /** Name of the deployed package */
36
- packageName: StringType;
36
+ readonly packageName: StringType;
37
37
  /** Version of the deployed package */
38
- packageVersion: StringType;
38
+ readonly packageVersion: StringType;
39
39
  /** Hash of the package object at deploy time (immutable reference) */
40
- packageHash: StringType;
40
+ readonly packageHash: StringType;
41
41
  /** UTC datetime when the package was deployed */
42
- deployedAt: DateTimeType;
42
+ readonly deployedAt: DateTimeType;
43
43
  /** Current root data tree hash */
44
- rootHash: StringType;
44
+ readonly rootHash: StringType;
45
45
  /** UTC datetime when root was last updated */
46
- rootUpdatedAt: DateTimeType;
46
+ readonly rootUpdatedAt: DateTimeType;
47
47
  }>;
48
48
  export type WorkspaceState = ValueTypeOf<typeof WorkspaceStateType>;
49
49
  //# sourceMappingURL=workspace.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elaraai/e3-types",
3
- "version": "0.0.2-beta.2",
3
+ "version": "0.0.2-beta.20",
4
4
  "description": "Shared type definitions for e3 (East Execution Engine)",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -23,7 +23,7 @@
23
23
  "directory": "packages/e3-types"
24
24
  },
25
25
  "peerDependencies": {
26
- "@elaraai/east": "^0.0.1-beta.16"
26
+ "@elaraai/east": "^0.0.1-beta.31"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@typescript-eslint/eslint-plugin": "^8.47.0",
package/src/index.ts CHANGED
@@ -81,3 +81,13 @@ export {
81
81
  ExecutionStatusType,
82
82
  type ExecutionStatus,
83
83
  } from './execution.js';
84
+
85
+ // Lock state
86
+ export {
87
+ LockOperationType,
88
+ type LockOperation,
89
+ ProcessHolderType,
90
+ type ProcessHolder,
91
+ LockStateType,
92
+ type LockState,
93
+ } from './lock.js';
package/src/lock.ts ADDED
@@ -0,0 +1,88 @@
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
+ /**
7
+ * Lock state type definitions.
8
+ *
9
+ * A lock provides exclusive access to a workspace. The state tracks:
10
+ * - What operation acquired the lock (dataflow, deployment, etc.)
11
+ * - Who holds the lock (East text-encoded string)
12
+ * - When it was acquired
13
+ * - Optional expiry (for cloud TTL-based locks)
14
+ *
15
+ * Lock file location: workspaces/<name>.lock
16
+ *
17
+ * The holder field is an East text-encoded string, allowing different backends
18
+ * to encode their own holder identification. Common patterns:
19
+ * - Local: `.process (pid=1234, bootId="abc-123", startTime=98765, command="e3 start")`
20
+ * - Cloud: `.lambda (requestId="req-123", functionName="e3-api")`
21
+ */
22
+
23
+ import {
24
+ VariantType,
25
+ StructType,
26
+ StringType,
27
+ IntegerType,
28
+ DateTimeType,
29
+ OptionType,
30
+ NullType,
31
+ ValueTypeOf,
32
+ } from '@elaraai/east';
33
+
34
+ /**
35
+ * Lock operation - what acquired the lock.
36
+ */
37
+ export const LockOperationType = VariantType({
38
+ /** Running a dataflow */
39
+ dataflow: NullType,
40
+ /** Deploying a package to the workspace */
41
+ deployment: NullType,
42
+ /** Removing the workspace */
43
+ removal: NullType,
44
+ /** Writing to a dataset */
45
+ dataset_write: NullType,
46
+ });
47
+
48
+ export type LockOperation = ValueTypeOf<typeof LockOperationType>;
49
+
50
+ /**
51
+ * Process holder schema - for local filesystem backends.
52
+ * Used to encode/decode the holder string.
53
+ */
54
+ export const ProcessHolderType = StructType({
55
+ /** Process ID */
56
+ pid: IntegerType,
57
+ /** System boot ID (from /proc/sys/kernel/random/boot_id) */
58
+ bootId: StringType,
59
+ /** Process start time in jiffies since boot */
60
+ startTime: IntegerType,
61
+ /** Command that acquired the lock (for debugging) */
62
+ command: StringType,
63
+ });
64
+
65
+ export type ProcessHolder = ValueTypeOf<typeof ProcessHolderType>;
66
+
67
+ /**
68
+ * Lock state stored in workspaces/<name>.lock
69
+ *
70
+ * Represents an advisory lock on a workspace. The actual locking mechanism
71
+ * is platform-specific (flock on Linux, DynamoDB conditional writes in cloud),
72
+ * but the lock content follows this schema.
73
+ *
74
+ * The holder field is an East text-encoded string representing a variant value.
75
+ * Use `printFor`/`parseInferred` from @elaraai/east to encode/decode.
76
+ */
77
+ export const LockStateType = StructType({
78
+ /** What operation acquired the lock */
79
+ operation: LockOperationType,
80
+ /** Who holds the lock - East text-encoded variant (e.g., `.process (...)`) */
81
+ holder: StringType,
82
+ /** When the lock was acquired */
83
+ acquiredAt: DateTimeType,
84
+ /** When the lock expires (for cloud TTL-based locks) */
85
+ expiresAt: OptionType(DateTimeType),
86
+ });
87
+
88
+ export type LockState = ValueTypeOf<typeof LockStateType>;