@elaraai/e3-core 0.0.2-beta.3 → 0.0.2-beta.30

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 (184) hide show
  1. package/README.md +25 -22
  2. package/dist/src/dataflow/api-compat.d.ts +90 -0
  3. package/dist/src/dataflow/api-compat.d.ts.map +1 -0
  4. package/dist/src/dataflow/api-compat.js +134 -0
  5. package/dist/src/dataflow/api-compat.js.map +1 -0
  6. package/dist/src/dataflow/index.d.ts +18 -0
  7. package/dist/src/dataflow/index.d.ts.map +1 -0
  8. package/dist/src/dataflow/index.js +23 -0
  9. package/dist/src/dataflow/index.js.map +1 -0
  10. package/dist/src/dataflow/orchestrator/LocalOrchestrator.d.ts +53 -0
  11. package/dist/src/dataflow/orchestrator/LocalOrchestrator.d.ts.map +1 -0
  12. package/dist/src/dataflow/orchestrator/LocalOrchestrator.js +416 -0
  13. package/dist/src/dataflow/orchestrator/LocalOrchestrator.js.map +1 -0
  14. package/dist/src/dataflow/orchestrator/index.d.ts +12 -0
  15. package/dist/src/dataflow/orchestrator/index.d.ts.map +1 -0
  16. package/dist/src/dataflow/orchestrator/index.js +12 -0
  17. package/dist/src/dataflow/orchestrator/index.js.map +1 -0
  18. package/dist/src/dataflow/orchestrator/interfaces.d.ts +157 -0
  19. package/dist/src/dataflow/orchestrator/interfaces.d.ts.map +1 -0
  20. package/dist/src/dataflow/orchestrator/interfaces.js +51 -0
  21. package/dist/src/dataflow/orchestrator/interfaces.js.map +1 -0
  22. package/dist/src/dataflow/state-store/FileStateStore.d.ts +67 -0
  23. package/dist/src/dataflow/state-store/FileStateStore.d.ts.map +1 -0
  24. package/dist/src/dataflow/state-store/FileStateStore.js +286 -0
  25. package/dist/src/dataflow/state-store/FileStateStore.js.map +1 -0
  26. package/dist/src/dataflow/state-store/InMemoryStateStore.d.ts +42 -0
  27. package/dist/src/dataflow/state-store/InMemoryStateStore.d.ts.map +1 -0
  28. package/dist/src/dataflow/state-store/InMemoryStateStore.js +214 -0
  29. package/dist/src/dataflow/state-store/InMemoryStateStore.js.map +1 -0
  30. package/dist/src/dataflow/state-store/index.d.ts +13 -0
  31. package/dist/src/dataflow/state-store/index.d.ts.map +1 -0
  32. package/dist/src/dataflow/state-store/index.js +13 -0
  33. package/dist/src/dataflow/state-store/index.js.map +1 -0
  34. package/dist/src/dataflow/state-store/interfaces.d.ts +159 -0
  35. package/dist/src/dataflow/state-store/interfaces.d.ts.map +1 -0
  36. package/dist/src/dataflow/state-store/interfaces.js +6 -0
  37. package/dist/src/dataflow/state-store/interfaces.js.map +1 -0
  38. package/dist/src/dataflow/steps.d.ts +176 -0
  39. package/dist/src/dataflow/steps.d.ts.map +1 -0
  40. package/dist/src/dataflow/steps.js +528 -0
  41. package/dist/src/dataflow/steps.js.map +1 -0
  42. package/dist/src/dataflow/types.d.ts +116 -0
  43. package/dist/src/dataflow/types.d.ts.map +1 -0
  44. package/dist/src/dataflow/types.js +7 -0
  45. package/dist/src/dataflow/types.js.map +1 -0
  46. package/dist/src/dataflow.d.ts +142 -9
  47. package/dist/src/dataflow.d.ts.map +1 -1
  48. package/dist/src/dataflow.js +427 -64
  49. package/dist/src/dataflow.js.map +1 -1
  50. package/dist/src/errors.d.ts +39 -9
  51. package/dist/src/errors.d.ts.map +1 -1
  52. package/dist/src/errors.js +51 -8
  53. package/dist/src/errors.js.map +1 -1
  54. package/dist/src/execution/LocalTaskRunner.d.ts +73 -0
  55. package/dist/src/execution/LocalTaskRunner.d.ts.map +1 -0
  56. package/dist/src/execution/LocalTaskRunner.js +399 -0
  57. package/dist/src/execution/LocalTaskRunner.js.map +1 -0
  58. package/dist/src/execution/MockTaskRunner.d.ts +49 -0
  59. package/dist/src/execution/MockTaskRunner.d.ts.map +1 -0
  60. package/dist/src/execution/MockTaskRunner.js +55 -0
  61. package/dist/src/execution/MockTaskRunner.js.map +1 -0
  62. package/dist/src/execution/index.d.ts +16 -0
  63. package/dist/src/execution/index.d.ts.map +1 -0
  64. package/dist/src/execution/index.js +8 -0
  65. package/dist/src/execution/index.js.map +1 -0
  66. package/dist/src/execution/interfaces.d.ts +246 -0
  67. package/dist/src/execution/interfaces.d.ts.map +1 -0
  68. package/dist/src/execution/interfaces.js +6 -0
  69. package/dist/src/execution/interfaces.js.map +1 -0
  70. package/dist/src/execution/processHelpers.d.ts +20 -0
  71. package/dist/src/execution/processHelpers.d.ts.map +1 -0
  72. package/dist/src/execution/processHelpers.js +62 -0
  73. package/dist/src/execution/processHelpers.js.map +1 -0
  74. package/dist/src/executions.d.ts +71 -104
  75. package/dist/src/executions.d.ts.map +1 -1
  76. package/dist/src/executions.js +110 -476
  77. package/dist/src/executions.js.map +1 -1
  78. package/dist/src/index.d.ts +17 -9
  79. package/dist/src/index.d.ts.map +1 -1
  80. package/dist/src/index.js +44 -18
  81. package/dist/src/index.js.map +1 -1
  82. package/dist/src/objects.d.ts +6 -53
  83. package/dist/src/objects.d.ts.map +1 -1
  84. package/dist/src/objects.js +11 -232
  85. package/dist/src/objects.js.map +1 -1
  86. package/dist/src/packages.d.ts +22 -14
  87. package/dist/src/packages.d.ts.map +1 -1
  88. package/dist/src/packages.js +116 -83
  89. package/dist/src/packages.js.map +1 -1
  90. package/dist/src/storage/in-memory/InMemoryRepoStore.d.ts +35 -0
  91. package/dist/src/storage/in-memory/InMemoryRepoStore.d.ts.map +1 -0
  92. package/dist/src/storage/in-memory/InMemoryRepoStore.js +107 -0
  93. package/dist/src/storage/in-memory/InMemoryRepoStore.js.map +1 -0
  94. package/dist/src/storage/in-memory/InMemoryStorage.d.ts +114 -0
  95. package/dist/src/storage/in-memory/InMemoryStorage.d.ts.map +1 -0
  96. package/dist/src/storage/in-memory/InMemoryStorage.js +349 -0
  97. package/dist/src/storage/in-memory/InMemoryStorage.js.map +1 -0
  98. package/dist/src/storage/in-memory/index.d.ts +12 -0
  99. package/dist/src/storage/in-memory/index.d.ts.map +1 -0
  100. package/dist/src/storage/in-memory/index.js +12 -0
  101. package/dist/src/storage/in-memory/index.js.map +1 -0
  102. package/dist/src/storage/index.d.ts +18 -0
  103. package/dist/src/storage/index.d.ts.map +1 -0
  104. package/dist/src/storage/index.js +10 -0
  105. package/dist/src/storage/index.js.map +1 -0
  106. package/dist/src/storage/interfaces.d.ts +520 -0
  107. package/dist/src/storage/interfaces.d.ts.map +1 -0
  108. package/dist/src/storage/interfaces.js +6 -0
  109. package/dist/src/storage/interfaces.js.map +1 -0
  110. package/dist/src/storage/local/LocalBackend.d.ts +54 -0
  111. package/dist/src/storage/local/LocalBackend.d.ts.map +1 -0
  112. package/dist/src/storage/local/LocalBackend.js +141 -0
  113. package/dist/src/storage/local/LocalBackend.js.map +1 -0
  114. package/dist/src/storage/local/LocalLockService.d.ts +105 -0
  115. package/dist/src/storage/local/LocalLockService.d.ts.map +1 -0
  116. package/dist/src/storage/local/LocalLockService.js +342 -0
  117. package/dist/src/storage/local/LocalLockService.js.map +1 -0
  118. package/dist/src/storage/local/LocalLogStore.d.ts +23 -0
  119. package/dist/src/storage/local/LocalLogStore.d.ts.map +1 -0
  120. package/dist/src/storage/local/LocalLogStore.js +66 -0
  121. package/dist/src/storage/local/LocalLogStore.js.map +1 -0
  122. package/dist/src/storage/local/LocalObjectStore.d.ts +52 -0
  123. package/dist/src/storage/local/LocalObjectStore.d.ts.map +1 -0
  124. package/dist/src/storage/local/LocalObjectStore.js +287 -0
  125. package/dist/src/storage/local/LocalObjectStore.js.map +1 -0
  126. package/dist/src/storage/local/LocalRefStore.d.ts +50 -0
  127. package/dist/src/storage/local/LocalRefStore.d.ts.map +1 -0
  128. package/dist/src/storage/local/LocalRefStore.js +337 -0
  129. package/dist/src/storage/local/LocalRefStore.js.map +1 -0
  130. package/dist/src/storage/local/LocalRepoStore.d.ts +53 -0
  131. package/dist/src/storage/local/LocalRepoStore.d.ts.map +1 -0
  132. package/dist/src/storage/local/LocalRepoStore.js +353 -0
  133. package/dist/src/storage/local/LocalRepoStore.js.map +1 -0
  134. package/dist/src/storage/local/gc.d.ts +92 -0
  135. package/dist/src/storage/local/gc.d.ts.map +1 -0
  136. package/dist/src/storage/local/gc.js +322 -0
  137. package/dist/src/storage/local/gc.js.map +1 -0
  138. package/dist/src/storage/local/index.d.ts +17 -0
  139. package/dist/src/storage/local/index.d.ts.map +1 -0
  140. package/dist/src/storage/local/index.js +17 -0
  141. package/dist/src/storage/local/index.js.map +1 -0
  142. package/dist/src/storage/local/localHelpers.d.ts +25 -0
  143. package/dist/src/storage/local/localHelpers.d.ts.map +1 -0
  144. package/dist/src/storage/local/localHelpers.js +69 -0
  145. package/dist/src/storage/local/localHelpers.js.map +1 -0
  146. package/dist/src/{repository.d.ts → storage/local/repository.d.ts} +8 -4
  147. package/dist/src/storage/local/repository.d.ts.map +1 -0
  148. package/dist/src/{repository.js → storage/local/repository.js} +31 -29
  149. package/dist/src/storage/local/repository.js.map +1 -0
  150. package/dist/src/tasks.d.ts +16 -10
  151. package/dist/src/tasks.d.ts.map +1 -1
  152. package/dist/src/tasks.js +35 -41
  153. package/dist/src/tasks.js.map +1 -1
  154. package/dist/src/test-helpers.d.ts +4 -4
  155. package/dist/src/test-helpers.d.ts.map +1 -1
  156. package/dist/src/test-helpers.js +7 -21
  157. package/dist/src/test-helpers.js.map +1 -1
  158. package/dist/src/trees.d.ts +89 -27
  159. package/dist/src/trees.d.ts.map +1 -1
  160. package/dist/src/trees.js +218 -100
  161. package/dist/src/trees.js.map +1 -1
  162. package/dist/src/uuid.d.ts +26 -0
  163. package/dist/src/uuid.d.ts.map +1 -0
  164. package/dist/src/uuid.js +80 -0
  165. package/dist/src/uuid.js.map +1 -0
  166. package/dist/src/workspaceStatus.d.ts +6 -4
  167. package/dist/src/workspaceStatus.d.ts.map +1 -1
  168. package/dist/src/workspaceStatus.js +43 -49
  169. package/dist/src/workspaceStatus.js.map +1 -1
  170. package/dist/src/workspaces.d.ts +35 -26
  171. package/dist/src/workspaces.d.ts.map +1 -1
  172. package/dist/src/workspaces.js +169 -118
  173. package/dist/src/workspaces.js.map +1 -1
  174. package/package.json +4 -4
  175. package/dist/src/gc.d.ts +0 -54
  176. package/dist/src/gc.d.ts.map +0 -1
  177. package/dist/src/gc.js +0 -233
  178. package/dist/src/gc.js.map +0 -1
  179. package/dist/src/repository.d.ts.map +0 -1
  180. package/dist/src/repository.js.map +0 -1
  181. package/dist/src/workspaceLock.d.ts +0 -67
  182. package/dist/src/workspaceLock.d.ts.map +0 -1
  183. package/dist/src/workspaceLock.js +0 -217
  184. package/dist/src/workspaceLock.js.map +0 -1
@@ -0,0 +1,520 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Licensed under BSL 1.1. See LICENSE for details.
4
+ */
5
+ /**
6
+ * Storage abstraction interfaces for e3 repositories.
7
+ *
8
+ * These interfaces enable e3-core logic to work against different backends:
9
+ * - LocalBackend: Filesystem (default, for CLI and local dev)
10
+ * - EfsBackend: AWS EFS (for Lambda/Fargate cloud deployment)
11
+ * - S3DynamoBackend: S3 + DynamoDB (future optimization)
12
+ *
13
+ * The core insight: e3-core business logic is storage-agnostic. By injecting
14
+ * a StorageBackend, the same code can run locally or in the cloud.
15
+ */
16
+ import type { ExecutionStatus, LockState, LockOperation, DataflowRun } from '@elaraai/e3-types';
17
+ import type { LockHolderInfo } from '../errors.js';
18
+ export type { LockState, LockOperation, LockHolderInfo };
19
+ /**
20
+ * Repository status for lifecycle tracking.
21
+ *
22
+ * - 'creating': Repository is being initialized
23
+ * - 'active': Repository is ready for use
24
+ * - 'gc': Garbage collection is in progress
25
+ * - 'deleting': Repository is being deleted
26
+ */
27
+ export type RepoStatus = 'creating' | 'active' | 'gc' | 'deleting';
28
+ /**
29
+ * Repository metadata.
30
+ */
31
+ export interface RepoMetadata {
32
+ /** Repository name */
33
+ name: string;
34
+ /** Current status */
35
+ status: RepoStatus;
36
+ /** When the repository was created (ISO 8601) */
37
+ createdAt: string;
38
+ /** When the status last changed (ISO 8601) */
39
+ statusChangedAt: string;
40
+ }
41
+ /**
42
+ * Result from batch operations (resumable pattern).
43
+ *
44
+ * Operations return { status: 'continue', cursor } if more work remains,
45
+ * or { status: 'done' } when complete. This enables Step Functions orchestration.
46
+ */
47
+ export interface BatchResult {
48
+ /** 'continue' if more batches remain, 'done' if complete */
49
+ status: 'continue' | 'done';
50
+ /** Opaque cursor for next batch (only present if status='continue') */
51
+ cursor?: string;
52
+ /** Number of items deleted in this batch */
53
+ deleted: number;
54
+ }
55
+ /**
56
+ * A single object entry returned by gcScanObjects.
57
+ */
58
+ export interface GcObjectEntry {
59
+ /** SHA256 hash of the object */
60
+ hash: string;
61
+ /** Last modification time (epoch ms) */
62
+ lastModified: number;
63
+ /** Size of the object in bytes */
64
+ size: number;
65
+ }
66
+ /**
67
+ * Result from scanning root hashes for GC (paginated).
68
+ */
69
+ export interface GcRootScanResult {
70
+ /** Root object hashes in this batch */
71
+ roots: string[];
72
+ /** Opaque cursor for next batch; undefined means scan is complete */
73
+ cursor?: unknown;
74
+ }
75
+ /**
76
+ * Result from scanning objects for GC.
77
+ */
78
+ export interface GcObjectScanResult {
79
+ /** Object entries in this batch */
80
+ objects: GcObjectEntry[];
81
+ /** Opaque cursor for next batch; undefined means scan is complete */
82
+ cursor?: unknown;
83
+ }
84
+ /**
85
+ * Content-addressed object storage.
86
+ *
87
+ * Objects are immutable and identified by their SHA256 hash.
88
+ * The store handles deduplication automatically.
89
+ *
90
+ * All methods take `repo` as first parameter to identify the repository.
91
+ * For local storage, `repo` is the path to the e3 repository directory.
92
+ * For cloud storage, `repo` is a repository identifier used as a key prefix.
93
+ */
94
+ export interface ObjectStore {
95
+ /**
96
+ * Write data to the object store.
97
+ * @param repo - Repository identifier
98
+ * @param data - Raw bytes to store
99
+ * @returns SHA256 hash of the data
100
+ */
101
+ write(repo: string, data: Uint8Array): Promise<string>;
102
+ /**
103
+ * Write data from a stream to the object store.
104
+ * @param repo - Repository identifier
105
+ * @param stream - Async iterable of chunks
106
+ * @returns SHA256 hash of the data
107
+ */
108
+ writeStream(repo: string, stream: AsyncIterable<Uint8Array>): Promise<string>;
109
+ /**
110
+ * Read an object by hash.
111
+ * @param repo - Repository identifier
112
+ * @param hash - SHA256 hash of the object
113
+ * @returns Raw bytes
114
+ * @throws {ObjectNotFoundError} If object doesn't exist
115
+ */
116
+ read(repo: string, hash: string): Promise<Uint8Array>;
117
+ /**
118
+ * Check if an object exists.
119
+ * @param repo - Repository identifier
120
+ * @param hash - SHA256 hash of the object
121
+ * @returns true if object exists
122
+ */
123
+ exists(repo: string, hash: string): Promise<boolean>;
124
+ /**
125
+ * List all object hashes in the store.
126
+ * Used for garbage collection.
127
+ * @param repo - Repository identifier
128
+ * @returns Array of hashes
129
+ */
130
+ list(repo: string): Promise<string[]>;
131
+ /**
132
+ * Count objects in the store.
133
+ * More efficient than list() when only the count is needed.
134
+ * @param repo - Repository identifier
135
+ * @returns Number of objects
136
+ */
137
+ count(repo: string): Promise<number>;
138
+ }
139
+ /**
140
+ * Mutable reference storage for packages, workspaces, and executions.
141
+ *
142
+ * Unlike objects, references can be updated and deleted.
143
+ * All methods take `repo` as first parameter to identify the repository.
144
+ */
145
+ export interface RefStore {
146
+ /**
147
+ * List all packages with their versions.
148
+ * @param repo - Repository identifier
149
+ * @returns Array of {name, version} pairs
150
+ */
151
+ packageList(repo: string): Promise<{
152
+ name: string;
153
+ version: string;
154
+ }[]>;
155
+ /**
156
+ * Resolve a package reference to its hash.
157
+ * @param repo - Repository identifier
158
+ * @param name - Package name
159
+ * @param version - Package version
160
+ * @returns Package object hash, or null if not found
161
+ */
162
+ packageResolve(repo: string, name: string, version: string): Promise<string | null>;
163
+ /**
164
+ * Write a package reference.
165
+ * @param repo - Repository identifier
166
+ * @param name - Package name
167
+ * @param version - Package version
168
+ * @param hash - Package object hash
169
+ */
170
+ packageWrite(repo: string, name: string, version: string, hash: string): Promise<void>;
171
+ /**
172
+ * Remove a package reference.
173
+ * @param repo - Repository identifier
174
+ * @param name - Package name
175
+ * @param version - Package version
176
+ */
177
+ packageRemove(repo: string, name: string, version: string): Promise<void>;
178
+ /**
179
+ * List all workspace names.
180
+ * @param repo - Repository identifier
181
+ * @returns Array of workspace names
182
+ */
183
+ workspaceList(repo: string): Promise<string[]>;
184
+ /**
185
+ * Read workspace state.
186
+ * @param repo - Repository identifier
187
+ * @param name - Workspace name
188
+ * @returns Encoded workspace state, or null if not found
189
+ */
190
+ workspaceRead(repo: string, name: string): Promise<Uint8Array | null>;
191
+ /**
192
+ * Write workspace state.
193
+ * @param repo - Repository identifier
194
+ * @param name - Workspace name
195
+ * @param state - Encoded workspace state (empty = undeployed)
196
+ */
197
+ workspaceWrite(repo: string, name: string, state: Uint8Array): Promise<void>;
198
+ /**
199
+ * Remove a workspace.
200
+ * @param repo - Repository identifier
201
+ * @param name - Workspace name
202
+ */
203
+ workspaceRemove(repo: string, name: string): Promise<void>;
204
+ /**
205
+ * Get execution status for a specific execution.
206
+ * @param repo - Repository identifier
207
+ * @param taskHash - Task object hash
208
+ * @param inputsHash - Combined input hashes
209
+ * @param executionId - Execution ID (UUIDv7)
210
+ * @returns ExecutionStatus or null if not found
211
+ */
212
+ executionGet(repo: string, taskHash: string, inputsHash: string, executionId: string): Promise<ExecutionStatus | null>;
213
+ /**
214
+ * Write execution status.
215
+ * @param repo - Repository identifier
216
+ * @param taskHash - Task object hash
217
+ * @param inputsHash - Combined input hashes
218
+ * @param executionId - Execution ID (UUIDv7)
219
+ * @param status - Execution status
220
+ */
221
+ executionWrite(repo: string, taskHash: string, inputsHash: string, executionId: string, status: ExecutionStatus): Promise<void>;
222
+ /**
223
+ * List all execution IDs for a (taskHash, inputsHash) pair.
224
+ * @param repo - Repository identifier
225
+ * @param taskHash - Task object hash
226
+ * @param inputsHash - Combined input hashes
227
+ * @returns Array of executionId values (sorted lexicographically ascending)
228
+ */
229
+ executionListIds(repo: string, taskHash: string, inputsHash: string): Promise<string[]>;
230
+ /**
231
+ * Get the latest execution status (lexicographically greatest executionId).
232
+ * @param repo - Repository identifier
233
+ * @param taskHash - Task object hash
234
+ * @param inputsHash - Combined input hashes
235
+ * @returns ExecutionStatus or null if no executions exist
236
+ */
237
+ executionGetLatest(repo: string, taskHash: string, inputsHash: string): Promise<ExecutionStatus | null>;
238
+ /**
239
+ * Get the latest successful output hash (for cache lookup).
240
+ * Iterates from latest executionId backwards, returns first success.outputHash found.
241
+ * @param repo - Repository identifier
242
+ * @param taskHash - Task object hash
243
+ * @param inputsHash - Combined input hashes
244
+ * @returns Output hash or null if no successful execution exists
245
+ */
246
+ executionGetLatestOutput(repo: string, taskHash: string, inputsHash: string): Promise<string | null>;
247
+ /**
248
+ * List all executions in the repository.
249
+ * @param repo - Repository identifier
250
+ * @returns Array of {taskHash, inputsHash} pairs
251
+ */
252
+ executionList(repo: string): Promise<{
253
+ taskHash: string;
254
+ inputsHash: string;
255
+ }[]>;
256
+ /**
257
+ * List executions for a specific task.
258
+ * @param repo - Repository identifier
259
+ * @param taskHash - Task object hash
260
+ * @returns Array of inputsHash values
261
+ */
262
+ executionListForTask(repo: string, taskHash: string): Promise<string[]>;
263
+ /**
264
+ * Get a specific dataflow run.
265
+ * @param repo - Repository identifier
266
+ * @param workspace - Workspace name
267
+ * @param runId - Run ID (UUIDv7)
268
+ * @returns DataflowRun or null if not found
269
+ */
270
+ dataflowRunGet(repo: string, workspace: string, runId: string): Promise<DataflowRun | null>;
271
+ /**
272
+ * Write a dataflow run.
273
+ * @param repo - Repository identifier
274
+ * @param workspace - Workspace name
275
+ * @param run - The dataflow run record
276
+ */
277
+ dataflowRunWrite(repo: string, workspace: string, run: DataflowRun): Promise<void>;
278
+ /**
279
+ * List all run IDs for a workspace (sorted lexicographically ascending).
280
+ * @param repo - Repository identifier
281
+ * @param workspace - Workspace name
282
+ * @returns Array of runId values
283
+ */
284
+ dataflowRunList(repo: string, workspace: string): Promise<string[]>;
285
+ /**
286
+ * Get the latest dataflow run for a workspace.
287
+ * @param repo - Repository identifier
288
+ * @param workspace - Workspace name
289
+ * @returns DataflowRun or null if no runs exist
290
+ */
291
+ dataflowRunGetLatest(repo: string, workspace: string): Promise<DataflowRun | null>;
292
+ /**
293
+ * Delete a specific dataflow run.
294
+ * @param repo - Repository identifier
295
+ * @param workspace - Workspace name
296
+ * @param runId - Run ID (UUIDv7)
297
+ */
298
+ dataflowRunDelete(repo: string, workspace: string, runId: string): Promise<void>;
299
+ }
300
+ /**
301
+ * Handle to a held lock.
302
+ */
303
+ export interface LockHandle {
304
+ /** The resource this lock is for */
305
+ readonly resource: string;
306
+ /** Release the lock. Safe to call multiple times. */
307
+ release(): Promise<void>;
308
+ }
309
+ /**
310
+ * Distributed locking service for exclusive access.
311
+ *
312
+ * Used to prevent concurrent modifications to workspaces.
313
+ * The lock state is stored using the LockState type from e3-types,
314
+ * enabling cloud implementations to extend the holder variants.
315
+ * All methods (except isHolderAlive) take `repo` as first parameter.
316
+ */
317
+ export interface LockService {
318
+ /**
319
+ * Acquire an exclusive lock on a resource.
320
+ *
321
+ * The implementation gathers holder information (process ID for local,
322
+ * request ID for Lambda, etc.) and writes the lock state.
323
+ *
324
+ * @param repo - Repository identifier
325
+ * @param resource - Resource identifier (e.g., "workspaces/production")
326
+ * @param operation - What operation is acquiring the lock
327
+ * @param options - Lock options
328
+ * @returns Lock handle, or null if lock couldn't be acquired
329
+ */
330
+ acquire(repo: string, resource: string, operation: LockOperation, options?: {
331
+ wait?: boolean;
332
+ timeout?: number;
333
+ }): Promise<LockHandle | null>;
334
+ /**
335
+ * Get the current lock state.
336
+ * @param repo - Repository identifier
337
+ * @param resource - Resource identifier
338
+ * @returns Lock state, or null if not locked
339
+ */
340
+ getState(repo: string, resource: string): Promise<LockState | null>;
341
+ /**
342
+ * Check if a lock holder is still alive.
343
+ *
344
+ * For local process locks, checks if the PID is still running.
345
+ * For cloud locks, checks expiry or queries the cloud service.
346
+ *
347
+ * @param holder - East text-encoded holder string from LockState
348
+ * @returns true if the holder is still active
349
+ */
350
+ isHolderAlive(holder: string): Promise<boolean>;
351
+ }
352
+ /**
353
+ * A chunk of log output.
354
+ */
355
+ export interface LogChunk {
356
+ /** Log content (UTF-8) */
357
+ data: string;
358
+ /** Byte offset of this chunk */
359
+ offset: number;
360
+ /** Bytes in this chunk */
361
+ size: number;
362
+ /** Total log file size (for pagination) */
363
+ totalSize: number;
364
+ /** True if this is the end of the file */
365
+ complete: boolean;
366
+ }
367
+ /**
368
+ * Log storage for execution stdout/stderr.
369
+ * All methods take `repo` as first parameter to identify the repository.
370
+ */
371
+ export interface LogStore {
372
+ /**
373
+ * Append data to a log stream.
374
+ * @param repo - Repository identifier
375
+ * @param taskHash - Task object hash
376
+ * @param inputsHash - Combined input hashes
377
+ * @param executionId - Execution ID (UUIDv7)
378
+ * @param stream - 'stdout' or 'stderr'
379
+ * @param data - Data to append
380
+ */
381
+ append(repo: string, taskHash: string, inputsHash: string, executionId: string, stream: 'stdout' | 'stderr', data: string): Promise<void>;
382
+ /**
383
+ * Read from a log stream.
384
+ * @param repo - Repository identifier
385
+ * @param taskHash - Task object hash
386
+ * @param inputsHash - Combined input hashes
387
+ * @param executionId - Execution ID (UUIDv7)
388
+ * @param stream - 'stdout' or 'stderr'
389
+ * @param options - Read options
390
+ * @returns Log chunk
391
+ */
392
+ read(repo: string, taskHash: string, inputsHash: string, executionId: string, stream: 'stdout' | 'stderr', options?: {
393
+ offset?: number;
394
+ limit?: number;
395
+ }): Promise<LogChunk>;
396
+ }
397
+ /**
398
+ * Repository lifecycle management.
399
+ *
400
+ * Handles repo creation, deletion, status tracking, and GC.
401
+ * Follows the sub-interface pattern (storage.repos.*) like other stores.
402
+ */
403
+ export interface RepoStore {
404
+ /**
405
+ * List all repository names.
406
+ * @returns Array of repository names
407
+ */
408
+ list(): Promise<string[]>;
409
+ /**
410
+ * Check if a repository exists.
411
+ * @param repo - Repository name
412
+ * @returns true if repository exists
413
+ */
414
+ exists(repo: string): Promise<boolean>;
415
+ /**
416
+ * Get repository metadata.
417
+ * @param repo - Repository name
418
+ * @returns Metadata or null if not found
419
+ */
420
+ getMetadata(repo: string): Promise<RepoMetadata | null>;
421
+ /**
422
+ * Create a new repository.
423
+ * Sets status to 'active' after initialization.
424
+ * @param repo - Repository name
425
+ * @throws {RepoAlreadyExistsError} If repository already exists
426
+ */
427
+ create(repo: string): Promise<void>;
428
+ /**
429
+ * Atomically set repository status.
430
+ * Used for CAS (compare-and-swap) operations.
431
+ * @param repo - Repository name
432
+ * @param status - New status
433
+ * @param expected - Optional expected current status (single or array) for CAS
434
+ * @throws {RepoNotFoundError} If repository doesn't exist
435
+ * @throws {RepoStatusConflictError} If expected status doesn't match
436
+ */
437
+ setStatus(repo: string, status: RepoStatus, expected?: RepoStatus | RepoStatus[]): Promise<void>;
438
+ /**
439
+ * Remove repository metadata/tombstone.
440
+ * Called after GC completes for 'deleting' repos.
441
+ * @param repo - Repository name
442
+ */
443
+ remove(repo: string): Promise<void>;
444
+ /**
445
+ * Delete all refs for a repo in batches.
446
+ * Loop until status='done'.
447
+ * @param repo - Repository name
448
+ * @param cursor - Cursor from previous call (undefined for first call)
449
+ * @returns Batch result with status and optional cursor
450
+ */
451
+ deleteRefsBatch(repo: string, cursor?: string): Promise<BatchResult>;
452
+ /**
453
+ * Delete all objects for a repo in batches.
454
+ * Loop until status='done'.
455
+ * @param repo - Repository name
456
+ * @param cursor - Cursor from previous call (undefined for first call)
457
+ * @returns Batch result with status and optional cursor
458
+ */
459
+ deleteObjectsBatch(repo: string, cursor?: string): Promise<BatchResult>;
460
+ /**
461
+ * Scan package references for root hashes.
462
+ * @param repo - Repository name
463
+ * @param cursor - Opaque cursor from previous call (undefined for first call)
464
+ * @returns Root hashes and optional cursor for next batch
465
+ */
466
+ gcScanPackageRoots(repo: string, cursor?: unknown): Promise<GcRootScanResult>;
467
+ /**
468
+ * Scan workspace state for root hashes.
469
+ * @param repo - Repository name
470
+ * @param cursor - Opaque cursor from previous call (undefined for first call)
471
+ * @returns Root hashes and optional cursor for next batch
472
+ */
473
+ gcScanWorkspaceRoots(repo: string, cursor?: unknown): Promise<GcRootScanResult>;
474
+ /**
475
+ * Scan execution history for root hashes.
476
+ * @param repo - Repository name
477
+ * @param cursor - Opaque cursor from previous call (undefined for first call)
478
+ * @returns Root hashes and optional cursor for next batch
479
+ */
480
+ gcScanExecutionRoots(repo: string, cursor?: unknown): Promise<GcRootScanResult>;
481
+ /**
482
+ * Scan object catalogue entries for GC.
483
+ * @param repo - Repository name
484
+ * @param cursor - Opaque cursor from previous call (undefined for first call)
485
+ * @returns Object entries and optional cursor for next batch
486
+ */
487
+ gcScanObjects(repo: string, cursor?: unknown): Promise<GcObjectScanResult>;
488
+ /**
489
+ * Delete objects by hash. Idempotent — safe to retry on failure.
490
+ * @param repo - Repository name
491
+ * @param hashes - Object hashes to delete
492
+ */
493
+ gcDeleteObjects(repo: string, hashes: string[]): Promise<void>;
494
+ }
495
+ /**
496
+ * Complete storage backend combining all storage interfaces.
497
+ *
498
+ * This is the main abstraction point for e3-core. Functions receive a
499
+ * StorageBackend instead of a repoPath, allowing the same logic to work
500
+ * against different storage implementations.
501
+ */
502
+ export interface StorageBackend {
503
+ /** Content-addressed object storage */
504
+ readonly objects: ObjectStore;
505
+ /** Mutable reference storage */
506
+ readonly refs: RefStore;
507
+ /** Distributed locking service */
508
+ readonly locks: LockService;
509
+ /** Execution log storage */
510
+ readonly logs: LogStore;
511
+ /** Repository lifecycle management */
512
+ readonly repos: RepoStore;
513
+ /**
514
+ * Validate that a repository exists and is properly structured.
515
+ * @param repo - Repository identifier (path to e3 repository directory for local storage)
516
+ * @throws {RepoNotFoundError} If repository doesn't exist or is invalid
517
+ */
518
+ validateRepository(repo: string): Promise<void>;
519
+ }
520
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/storage/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,aAA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AgB,CAAC,CAAC;IAEhF;;;;;OAKG;IACH,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEhF;;;;;OAKG;IACH,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE3E;;;;OAIG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChE;AAMD;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,uCAAuC;IACvC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAE9B,gCAAgC;IAChC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAExB,kCAAkC;IAClC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAE5B,4BAA4B;IAC5B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAExB,sCAAsC;IACtC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAE1B;;;;OAIG;IACH,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Licensed under BSL 1.1. See LICENSE for details.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/storage/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Licensed under BSL 1.1. See LICENSE for details.
4
+ */
5
+ import type { StorageBackend, ObjectStore, RefStore, LockService, LogStore, RepoStore } from '../interfaces.js';
6
+ /**
7
+ * Local filesystem implementation of StorageBackend.
8
+ *
9
+ * This combines the local implementations of all storage interfaces,
10
+ * providing a complete backend for local e3 repositories.
11
+ *
12
+ * The `repo` parameter passed to each method is the path to the e3 repository directory.
13
+ * This allows a single LocalStorage instance to be used for multiple repositories.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * import { LocalStorage } from '@elaraai/e3-core';
18
+ *
19
+ * const storage = new LocalStorage();
20
+ * const repo = '/path/to/repo';
21
+ *
22
+ * // Use the backend with storage-agnostic functions
23
+ * const hash = await storage.objects.write(repo, data);
24
+ * const packages = await storage.refs.packageList(repo);
25
+ * ```
26
+ */
27
+ export declare class LocalStorage implements StorageBackend {
28
+ /** Content-addressed object storage */
29
+ readonly objects: ObjectStore;
30
+ /** Mutable reference storage */
31
+ readonly refs: RefStore;
32
+ /** Distributed locking service */
33
+ readonly locks: LockService;
34
+ /** Execution log storage */
35
+ readonly logs: LogStore;
36
+ /** Repository lifecycle management */
37
+ readonly repos: RepoStore;
38
+ /**
39
+ * Create a new LocalStorage instance.
40
+ *
41
+ * @param reposDir - Optional parent directory containing repositories.
42
+ * Required for repo lifecycle operations (repos.*).
43
+ * If not provided, repos.* methods will throw.
44
+ */
45
+ constructor(reposDir?: string);
46
+ /**
47
+ * Validate that a repository exists and is properly structured.
48
+ * @param repo - Path to the e3 repository directory
49
+ * @throws {RepoNotFoundError} If repository doesn't exist or is invalid
50
+ */
51
+ validateRepository(repo: string): Promise<void>;
52
+ }
53
+ export { LocalStorage as LocalBackend };
54
+ //# sourceMappingURL=LocalBackend.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LocalBackend.d.ts","sourceRoot":"","sources":["../../../../src/storage/local/LocalBackend.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAkBhH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,YAAa,YAAW,cAAc;IACjD,uCAAuC;IACvC,SAAgB,OAAO,EAAE,WAAW,CAAC;IAErC,gCAAgC;IAChC,SAAgB,IAAI,EAAE,QAAQ,CAAC;IAE/B,kCAAkC;IAClC,SAAgB,KAAK,EAAE,WAAW,CAAC;IAEnC,4BAA4B;IAC5B,SAAgB,IAAI,EAAE,QAAQ,CAAC;IAE/B,sCAAsC;IACtC,SAAgB,KAAK,EAAE,SAAS,CAAC;IAEjC;;;;;;OAMG;gBACS,QAAQ,CAAC,EAAE,MAAM;IAY7B;;;;OAIG;IACG,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAUtD;AAGD,OAAO,EAAE,YAAY,IAAI,YAAY,EAAE,CAAC"}