@elaraai/e3-core 0.0.2-beta.4 → 0.0.2-beta.41

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 (208) 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 +139 -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 +76 -0
  11. package/dist/src/dataflow/orchestrator/LocalOrchestrator.d.ts.map +1 -0
  12. package/dist/src/dataflow/orchestrator/LocalOrchestrator.js +695 -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 +163 -0
  19. package/dist/src/dataflow/orchestrator/interfaces.d.ts.map +1 -0
  20. package/dist/src/dataflow/orchestrator/interfaces.js +52 -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 +300 -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 +229 -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 +222 -0
  39. package/dist/src/dataflow/steps.d.ts.map +1 -0
  40. package/dist/src/dataflow/steps.js +707 -0
  41. package/dist/src/dataflow/steps.js.map +1 -0
  42. package/dist/src/dataflow/types.d.ts +127 -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 +113 -38
  47. package/dist/src/dataflow.d.ts.map +1 -1
  48. package/dist/src/dataflow.js +269 -416
  49. package/dist/src/dataflow.js.map +1 -1
  50. package/dist/src/dataset-refs.d.ts +124 -0
  51. package/dist/src/dataset-refs.d.ts.map +1 -0
  52. package/dist/src/dataset-refs.js +319 -0
  53. package/dist/src/dataset-refs.js.map +1 -0
  54. package/dist/src/errors.d.ts +39 -9
  55. package/dist/src/errors.d.ts.map +1 -1
  56. package/dist/src/errors.js +51 -8
  57. package/dist/src/errors.js.map +1 -1
  58. package/dist/src/execution/LocalTaskRunner.d.ts +73 -0
  59. package/dist/src/execution/LocalTaskRunner.d.ts.map +1 -0
  60. package/dist/src/execution/LocalTaskRunner.js +399 -0
  61. package/dist/src/execution/LocalTaskRunner.js.map +1 -0
  62. package/dist/src/execution/MockTaskRunner.d.ts +49 -0
  63. package/dist/src/execution/MockTaskRunner.d.ts.map +1 -0
  64. package/dist/src/execution/MockTaskRunner.js +54 -0
  65. package/dist/src/execution/MockTaskRunner.js.map +1 -0
  66. package/dist/src/execution/index.d.ts +16 -0
  67. package/dist/src/execution/index.d.ts.map +1 -0
  68. package/dist/src/execution/index.js +8 -0
  69. package/dist/src/execution/index.js.map +1 -0
  70. package/dist/src/execution/interfaces.d.ts +246 -0
  71. package/dist/src/execution/interfaces.d.ts.map +1 -0
  72. package/dist/src/execution/interfaces.js +6 -0
  73. package/dist/src/execution/interfaces.js.map +1 -0
  74. package/dist/src/execution/processHelpers.d.ts +20 -0
  75. package/dist/src/execution/processHelpers.d.ts.map +1 -0
  76. package/dist/src/execution/processHelpers.js +62 -0
  77. package/dist/src/execution/processHelpers.js.map +1 -0
  78. package/dist/src/executions.d.ts +71 -104
  79. package/dist/src/executions.d.ts.map +1 -1
  80. package/dist/src/executions.js +110 -476
  81. package/dist/src/executions.js.map +1 -1
  82. package/dist/src/index.d.ts +19 -9
  83. package/dist/src/index.d.ts.map +1 -1
  84. package/dist/src/index.js +48 -18
  85. package/dist/src/index.js.map +1 -1
  86. package/dist/src/objects.d.ts +8 -51
  87. package/dist/src/objects.d.ts.map +1 -1
  88. package/dist/src/objects.js +13 -230
  89. package/dist/src/objects.js.map +1 -1
  90. package/dist/src/packages.d.ts +22 -14
  91. package/dist/src/packages.d.ts.map +1 -1
  92. package/dist/src/packages.js +134 -88
  93. package/dist/src/packages.js.map +1 -1
  94. package/dist/src/storage/in-memory/InMemoryRepoStore.d.ts +35 -0
  95. package/dist/src/storage/in-memory/InMemoryRepoStore.d.ts.map +1 -0
  96. package/dist/src/storage/in-memory/InMemoryRepoStore.js +107 -0
  97. package/dist/src/storage/in-memory/InMemoryRepoStore.js.map +1 -0
  98. package/dist/src/storage/in-memory/InMemoryStorage.d.ts +139 -0
  99. package/dist/src/storage/in-memory/InMemoryStorage.d.ts.map +1 -0
  100. package/dist/src/storage/in-memory/InMemoryStorage.js +439 -0
  101. package/dist/src/storage/in-memory/InMemoryStorage.js.map +1 -0
  102. package/dist/src/storage/in-memory/index.d.ts +12 -0
  103. package/dist/src/storage/in-memory/index.d.ts.map +1 -0
  104. package/dist/src/storage/in-memory/index.js +12 -0
  105. package/dist/src/storage/in-memory/index.js.map +1 -0
  106. package/dist/src/storage/index.d.ts +18 -0
  107. package/dist/src/storage/index.d.ts.map +1 -0
  108. package/dist/src/storage/index.js +10 -0
  109. package/dist/src/storage/index.js.map +1 -0
  110. package/dist/src/storage/interfaces.d.ts +581 -0
  111. package/dist/src/storage/interfaces.d.ts.map +1 -0
  112. package/dist/src/storage/interfaces.js +6 -0
  113. package/dist/src/storage/interfaces.js.map +1 -0
  114. package/dist/src/storage/local/LocalBackend.d.ts +56 -0
  115. package/dist/src/storage/local/LocalBackend.d.ts.map +1 -0
  116. package/dist/src/storage/local/LocalBackend.js +145 -0
  117. package/dist/src/storage/local/LocalBackend.js.map +1 -0
  118. package/dist/src/storage/local/LocalDatasetRefStore.d.ts +22 -0
  119. package/dist/src/storage/local/LocalDatasetRefStore.d.ts.map +1 -0
  120. package/dist/src/storage/local/LocalDatasetRefStore.js +118 -0
  121. package/dist/src/storage/local/LocalDatasetRefStore.js.map +1 -0
  122. package/dist/src/storage/local/LocalLockService.d.ts +111 -0
  123. package/dist/src/storage/local/LocalLockService.d.ts.map +1 -0
  124. package/dist/src/storage/local/LocalLockService.js +355 -0
  125. package/dist/src/storage/local/LocalLockService.js.map +1 -0
  126. package/dist/src/storage/local/LocalLogStore.d.ts +23 -0
  127. package/dist/src/storage/local/LocalLogStore.d.ts.map +1 -0
  128. package/dist/src/storage/local/LocalLogStore.js +66 -0
  129. package/dist/src/storage/local/LocalLogStore.js.map +1 -0
  130. package/dist/src/storage/local/LocalObjectStore.d.ts +55 -0
  131. package/dist/src/storage/local/LocalObjectStore.d.ts.map +1 -0
  132. package/dist/src/storage/local/LocalObjectStore.js +300 -0
  133. package/dist/src/storage/local/LocalObjectStore.js.map +1 -0
  134. package/dist/src/storage/local/LocalRefStore.d.ts +50 -0
  135. package/dist/src/storage/local/LocalRefStore.d.ts.map +1 -0
  136. package/dist/src/storage/local/LocalRefStore.js +337 -0
  137. package/dist/src/storage/local/LocalRefStore.js.map +1 -0
  138. package/dist/src/storage/local/LocalRepoStore.d.ts +55 -0
  139. package/dist/src/storage/local/LocalRepoStore.d.ts.map +1 -0
  140. package/dist/src/storage/local/LocalRepoStore.js +365 -0
  141. package/dist/src/storage/local/LocalRepoStore.js.map +1 -0
  142. package/dist/src/storage/local/gc.d.ts +92 -0
  143. package/dist/src/storage/local/gc.d.ts.map +1 -0
  144. package/dist/src/storage/local/gc.js +377 -0
  145. package/dist/src/storage/local/gc.js.map +1 -0
  146. package/dist/src/storage/local/index.d.ts +18 -0
  147. package/dist/src/storage/local/index.d.ts.map +1 -0
  148. package/dist/src/storage/local/index.js +18 -0
  149. package/dist/src/storage/local/index.js.map +1 -0
  150. package/dist/src/storage/local/localHelpers.d.ts +25 -0
  151. package/dist/src/storage/local/localHelpers.d.ts.map +1 -0
  152. package/dist/src/storage/local/localHelpers.js +69 -0
  153. package/dist/src/storage/local/localHelpers.js.map +1 -0
  154. package/dist/src/{repository.d.ts → storage/local/repository.d.ts} +8 -4
  155. package/dist/src/storage/local/repository.d.ts.map +1 -0
  156. package/dist/src/{repository.js → storage/local/repository.js} +31 -29
  157. package/dist/src/storage/local/repository.js.map +1 -0
  158. package/dist/src/tasks.d.ts +16 -10
  159. package/dist/src/tasks.d.ts.map +1 -1
  160. package/dist/src/tasks.js +35 -41
  161. package/dist/src/tasks.js.map +1 -1
  162. package/dist/src/test-helpers.d.ts +5 -4
  163. package/dist/src/test-helpers.d.ts.map +1 -1
  164. package/dist/src/test-helpers.js +9 -21
  165. package/dist/src/test-helpers.js.map +1 -1
  166. package/dist/src/transfer/InMemoryTransferBackend.d.ts +66 -0
  167. package/dist/src/transfer/InMemoryTransferBackend.d.ts.map +1 -0
  168. package/dist/src/transfer/InMemoryTransferBackend.js +166 -0
  169. package/dist/src/transfer/InMemoryTransferBackend.js.map +1 -0
  170. package/dist/src/transfer/index.d.ts +8 -0
  171. package/dist/src/transfer/index.d.ts.map +1 -0
  172. package/dist/src/transfer/index.js +9 -0
  173. package/dist/src/transfer/index.js.map +1 -0
  174. package/dist/src/transfer/interfaces.d.ts +103 -0
  175. package/dist/src/transfer/interfaces.d.ts.map +1 -0
  176. package/dist/src/transfer/interfaces.js +6 -0
  177. package/dist/src/transfer/interfaces.js.map +1 -0
  178. package/dist/src/transfer/types.d.ts +79 -0
  179. package/dist/src/transfer/types.d.ts.map +1 -0
  180. package/dist/src/transfer/types.js +58 -0
  181. package/dist/src/transfer/types.js.map +1 -0
  182. package/dist/src/trees.d.ts +147 -59
  183. package/dist/src/trees.d.ts.map +1 -1
  184. package/dist/src/trees.js +372 -419
  185. package/dist/src/trees.js.map +1 -1
  186. package/dist/src/uuid.d.ts +26 -0
  187. package/dist/src/uuid.d.ts.map +1 -0
  188. package/dist/src/uuid.js +80 -0
  189. package/dist/src/uuid.js.map +1 -0
  190. package/dist/src/workspaceStatus.d.ts +6 -4
  191. package/dist/src/workspaceStatus.d.ts.map +1 -1
  192. package/dist/src/workspaceStatus.js +43 -49
  193. package/dist/src/workspaceStatus.js.map +1 -1
  194. package/dist/src/workspaces.d.ts +35 -47
  195. package/dist/src/workspaces.d.ts.map +1 -1
  196. package/dist/src/workspaces.js +194 -156
  197. package/dist/src/workspaces.js.map +1 -1
  198. package/package.json +4 -4
  199. package/dist/src/gc.d.ts +0 -54
  200. package/dist/src/gc.d.ts.map +0 -1
  201. package/dist/src/gc.js +0 -233
  202. package/dist/src/gc.js.map +0 -1
  203. package/dist/src/repository.d.ts.map +0 -1
  204. package/dist/src/repository.js.map +0 -1
  205. package/dist/src/workspaceLock.d.ts +0 -67
  206. package/dist/src/workspaceLock.d.ts.map +0 -1
  207. package/dist/src/workspaceLock.js +0 -217
  208. package/dist/src/workspaceLock.js.map +0 -1
@@ -12,12 +12,15 @@
12
12
  * tree node. This enables proper encoding/decoding with the correct StructType
13
13
  * and supports future tree types (array, variant, etc.).
14
14
  *
15
- * Low-level operations work with hashes directly (by-hash).
16
- * High-level operations traverse paths from a root (by-path).
15
+ * Workspace operations use per-dataset ref files (DatasetRef) instead of tree
16
+ * traversal. This enables concurrent writes without serialization.
17
+ *
18
+ * Low-level tree read/write operations remain for computing root hashes and
19
+ * for package operations.
17
20
  */
18
21
  import { type EastType, type EastTypeValue } from '@elaraai/east';
19
- import { type DataRef, type Structure, type TreePath } from '@elaraai/e3-types';
20
- import { type WorkspaceLockHandle } from './workspaceLock.js';
22
+ import { type DataRef, type Structure, type TreePath, type VersionVector } from '@elaraai/e3-types';
23
+ import type { StorageBackend, LockHandle } from './storage/interfaces.js';
21
24
  /**
22
25
  * A tree object: mapping of field names to data references.
23
26
  *
@@ -28,69 +31,51 @@ export type TreeObject = Record<string, DataRef>;
28
31
  /**
29
32
  * Read and decode a tree object from the object store.
30
33
  *
31
- * @param repoPath - Path to .e3 repository
34
+ * @param storage - Storage backend
35
+ * @param repo - Repository identifier
32
36
  * @param hash - Hash of the tree object
33
37
  * @param structure - The structure describing this tree node's shape
34
38
  * @returns The decoded tree object (field name -> DataRef)
35
39
  * @throws If object not found, structure is not a tree, or decoding fails
36
40
  */
37
- export declare function treeRead(repoPath: string, hash: string, structure: Structure): Promise<TreeObject>;
41
+ export declare function treeRead(storage: StorageBackend, repo: string, hash: string, structure: Structure): Promise<TreeObject>;
38
42
  /**
39
43
  * Encode and write a tree object to the object store.
40
44
  *
41
- * @param repoPath - Path to .e3 repository
45
+ * @param storage - Storage backend
46
+ * @param repo - Repository identifier
42
47
  * @param fields - Object mapping field names to DataRefs
43
48
  * @param structure - The structure describing this tree node's shape
44
49
  * @returns Hash of the written tree object
45
50
  * @throws If structure is not a tree or encoding fails
46
51
  */
47
- export declare function treeWrite(repoPath: string, fields: TreeObject, structure: Structure): Promise<string>;
52
+ export declare function treeWrite(storage: StorageBackend, repo: string, fields: TreeObject, structure: Structure): Promise<string>;
48
53
  /**
49
54
  * Read and decode a dataset value from the object store.
50
55
  *
51
56
  * The .beast2 format includes type information in the header, so values
52
57
  * can be decoded without knowing the schema in advance.
53
58
  *
54
- * @param repoPath - Path to .e3 repository
59
+ * @param storage - Storage backend
60
+ * @param repo - Repository identifier
55
61
  * @param hash - Hash of the dataset value
56
62
  * @returns The decoded value and its type
57
63
  * @throws If object not found or not a valid beast2 object
58
64
  */
59
- export declare function datasetRead(repoPath: string, hash: string): Promise<{
65
+ export declare function datasetRead(storage: StorageBackend, repo: string, hash: string): Promise<{
60
66
  type: EastType;
61
67
  value: unknown;
62
68
  }>;
63
69
  /**
64
70
  * Encode and write a dataset value to the object store.
65
71
  *
66
- * @param repoPath - Path to .e3 repository
72
+ * @param storage - Storage backend
73
+ * @param repo - Repository identifier
67
74
  * @param value - The value to encode
68
75
  * @param type - The East type for encoding (EastType or EastTypeValue)
69
76
  * @returns Hash of the written dataset value
70
77
  */
71
- export declare function datasetWrite(repoPath: string, value: unknown, type: EastType | EastTypeValue): Promise<string>;
72
- /**
73
- * List field names at a tree path within a package's data tree.
74
- *
75
- * @param repoPath - Path to .e3 repository
76
- * @param name - Package name
77
- * @param version - Package version
78
- * @param path - Path to the tree node
79
- * @returns Array of field names at the path
80
- * @throws If package not found, path invalid, or path points to a dataset
81
- */
82
- export declare function packageListTree(repoPath: string, name: string, version: string, path: TreePath): Promise<string[]>;
83
- /**
84
- * Read and decode a dataset value at a path within a package's data tree.
85
- *
86
- * @param repoPath - Path to .e3 repository
87
- * @param name - Package name
88
- * @param version - Package version
89
- * @param path - Path to the dataset
90
- * @returns The decoded dataset value
91
- * @throws If package not found, path invalid, or path points to a tree
92
- */
93
- export declare function packageGetDataset(repoPath: string, name: string, version: string, path: TreePath): Promise<unknown>;
78
+ export declare function datasetWrite(storage: StorageBackend, repo: string, value: unknown, type: EastType | EastTypeValue): Promise<string>;
94
79
  /**
95
80
  * Options for setting a workspace dataset.
96
81
  */
@@ -100,18 +85,16 @@ export interface WorkspaceSetDatasetOptions {
100
85
  * for releasing the lock after the operation. If not provided, workspaceSetDataset
101
86
  * will acquire and release a lock internally.
102
87
  */
103
- lock?: WorkspaceLockHandle;
88
+ lock?: LockHandle;
104
89
  }
105
90
  /**
106
91
  * Update a dataset at a path within a workspace.
107
92
  *
108
- * This creates new tree objects along the path with structural sharing,
109
- * then atomically updates the workspace root.
110
- *
111
- * Acquires an exclusive lock on the workspace for the duration of the write
112
- * to prevent concurrent modifications.
93
+ * Writes the value to the object store and updates the per-dataset ref file.
94
+ * Uses shared structure lock to allow concurrent writes.
113
95
  *
114
- * @param repoPath - Path to .e3 repository
96
+ * @param storage - Storage backend
97
+ * @param repo - Repository identifier
115
98
  * @param ws - Workspace name
116
99
  * @param treePath - Path to the dataset
117
100
  * @param value - The new value to write
@@ -120,59 +103,164 @@ export interface WorkspaceSetDatasetOptions {
120
103
  * @throws {WorkspaceLockError} If workspace is locked by another process
121
104
  * @throws If workspace not deployed, path invalid, or path points to a tree
122
105
  */
123
- export declare function workspaceSetDataset(repoPath: string, ws: string, treePath: TreePath, value: unknown, type: EastType | EastTypeValue, options?: WorkspaceSetDatasetOptions): Promise<void>;
106
+ export declare function workspaceSetDataset(storage: StorageBackend, repo: string, ws: string, treePath: TreePath, value: unknown, type: EastType | EastTypeValue, options?: WorkspaceSetDatasetOptions): Promise<void>;
124
107
  /**
125
108
  * List field names at a tree path within a workspace's data tree.
126
109
  *
127
- * @param repoPath - Path to .e3 repository
110
+ * Uses the structure to determine available fields (no tree traversal needed).
111
+ *
112
+ * @param storage - Storage backend
113
+ * @param repo - Repository identifier
128
114
  * @param ws - Workspace name
129
- * @param path - Path to the tree node
115
+ * @param treePath - Path to the tree node
130
116
  * @returns Array of field names at the path
131
117
  * @throws If workspace not deployed, path invalid, or path points to a dataset
132
118
  */
133
- export declare function workspaceListTree(repoPath: string, ws: string, treePath: TreePath): Promise<string[]>;
119
+ export declare function workspaceListTree(storage: StorageBackend, repo: string, ws: string, treePath: TreePath): Promise<string[]>;
134
120
  /**
135
121
  * Read and decode a dataset value at a path within a workspace's data tree.
136
122
  *
137
- * @param repoPath - Path to .e3 repository
123
+ * Reads the per-dataset ref file to get the value hash, then decodes the value.
124
+ *
125
+ * @param storage - Storage backend
126
+ * @param repo - Repository identifier
138
127
  * @param ws - Workspace name
139
- * @param path - Path to the dataset
128
+ * @param treePath - Path to the dataset
140
129
  * @returns The decoded dataset value
141
130
  * @throws If workspace not deployed, path invalid, or path points to a tree
142
131
  */
143
- export declare function workspaceGetDataset(repoPath: string, ws: string, treePath: TreePath): Promise<unknown>;
132
+ export declare function workspaceGetDataset(storage: StorageBackend, repo: string, ws: string, treePath: TreePath): Promise<unknown>;
144
133
  /**
145
134
  * Get the hash of a dataset at a path within a workspace's data tree.
146
135
  *
147
- * Unlike workspaceGetDataset which decodes the value, this returns the raw
148
- * hash reference. Useful for dataflow execution which operates on hashes.
136
+ * Reads the per-dataset ref file directly. No tree traversal needed.
149
137
  *
150
- * @param repoPath - Path to .e3 repository
138
+ * @param storage - Storage backend
139
+ * @param repo - Repository identifier
151
140
  * @param ws - Workspace name
152
141
  * @param treePath - Path to the dataset
153
142
  * @returns Object with ref type and hash (null for unassigned/null refs)
154
143
  * @throws If workspace not deployed, path invalid, or path points to a tree
155
144
  */
156
- export declare function workspaceGetDatasetHash(repoPath: string, ws: string, treePath: TreePath): Promise<{
145
+ export declare function workspaceGetDatasetHash(storage: StorageBackend, repo: string, ws: string, treePath: TreePath): Promise<{
157
146
  refType: DataRef['type'];
158
147
  hash: string | null;
159
148
  }>;
160
149
  /**
161
150
  * Set a dataset at a path within a workspace using a pre-computed hash.
162
151
  *
163
- * Unlike workspaceSetDataset which encodes a value, this takes a hash
164
- * directly. Useful for dataflow execution which already has the output hash.
152
+ * Writes a DatasetRef file directly. No tree path-copy needed.
165
153
  *
166
154
  * IMPORTANT: This function does NOT acquire a workspace lock. The caller must
167
- * hold an exclusive lock on the workspace (via acquireWorkspaceLock) before
168
- * calling this function. This is typically used by dataflowExecute which
169
- * holds the lock for the entire execution.
155
+ * hold a lock on the workspace before calling this function. This
156
+ * is typically used by dataflowExecute which holds the lock for the entire
157
+ * execution.
170
158
  *
171
- * @param repoPath - Path to .e3 repository
159
+ * @param storage - Storage backend
160
+ * @param repo - Repository identifier
172
161
  * @param ws - Workspace name
173
162
  * @param treePath - Path to the dataset
174
163
  * @param valueHash - Hash of the dataset value already in the object store
175
164
  * @throws If workspace not deployed, path invalid, or path points to a tree
176
165
  */
177
- export declare function workspaceSetDatasetByHash(repoPath: string, ws: string, treePath: TreePath, valueHash: string): Promise<void>;
166
+ export declare function workspaceSetDatasetByHash(storage: StorageBackend, repo: string, ws: string, treePath: TreePath, valueHash: string, versions: VersionVector): Promise<void>;
167
+ /**
168
+ * Result of querying a single dataset's status.
169
+ */
170
+ export interface DatasetStatusResult {
171
+ /** Ref type: 'unassigned' | 'null' | 'value' */
172
+ refType: DataRef['type'];
173
+ /** Object hash (null for unassigned/null refs) */
174
+ hash: string | null;
175
+ /** East type of the dataset */
176
+ datasetType: EastTypeValue;
177
+ /** Size in bytes (null for unassigned) */
178
+ size: number | null;
179
+ }
180
+ /**
181
+ * Get the status of a single dataset at a path within a workspace.
182
+ *
183
+ * Returns the ref type, hash, East type, and size without downloading the value.
184
+ *
185
+ * @param storage - Storage backend
186
+ * @param repo - Repository identifier
187
+ * @param ws - Workspace name
188
+ * @param treePath - Path to the dataset
189
+ * @returns Dataset status including ref type, hash, type, and size
190
+ * @throws If workspace not deployed, path invalid, or path points to a tree
191
+ */
192
+ export declare function workspaceGetDatasetStatus(storage: StorageBackend, repo: string, ws: string, treePath: TreePath): Promise<DatasetStatusResult>;
193
+ /**
194
+ * A tree branch node (contains children).
195
+ */
196
+ export interface TreeBranchNode {
197
+ /** Field name */
198
+ name: string;
199
+ /** Discriminator */
200
+ kind: 'tree';
201
+ /** Child nodes */
202
+ children: TreeNode[];
203
+ }
204
+ /**
205
+ * A dataset leaf node (contains a value).
206
+ */
207
+ export interface TreeLeafNode {
208
+ /** Field name */
209
+ name: string;
210
+ /** Discriminator */
211
+ kind: 'dataset';
212
+ /** East type value (only present if includeTypes option was true) */
213
+ datasetType?: EastTypeValue;
214
+ /** Object hash (only present if includeStatus option was true and ref is 'value') */
215
+ hash?: string;
216
+ /** Ref type: 'unassigned' | 'null' | 'value' (only present if includeStatus option was true) */
217
+ refType?: string;
218
+ /** Size in bytes (only present if includeStatus option was true and ref is 'null' or 'value') */
219
+ size?: number;
220
+ }
221
+ /**
222
+ * A node in the tree structure for display purposes.
223
+ */
224
+ export type TreeNode = TreeBranchNode | TreeLeafNode;
225
+ /**
226
+ * Options for workspaceGetTree.
227
+ */
228
+ export interface WorkspaceGetTreeOptions {
229
+ /** Maximum depth to recurse (undefined = unlimited) */
230
+ maxDepth?: number;
231
+ /** Include East types for dataset nodes */
232
+ includeTypes?: boolean;
233
+ /** Include hash, refType, and size for dataset nodes */
234
+ includeStatus?: boolean;
235
+ }
236
+ /**
237
+ * Get the full tree structure at a path within a workspace.
238
+ *
239
+ * Recursively walks the structure and ref files to build a hierarchical
240
+ * structure suitable for display. Tasks are shown as leaves with their output type.
241
+ *
242
+ * @param storage - Storage backend
243
+ * @param repo - Repository identifier
244
+ * @param ws - Workspace name
245
+ * @param treePath - Path to start from (empty for root)
246
+ * @param options - Optional settings for depth limit and type inclusion
247
+ * @returns Array of tree nodes at the path
248
+ * @throws If workspace not deployed or path invalid
249
+ */
250
+ export declare function workspaceGetTree(storage: StorageBackend, repo: string, ws: string, treePath: TreePath, options?: WorkspaceGetTreeOptions): Promise<TreeNode[]>;
251
+ /**
252
+ * List field names at a tree path within a package's data tree.
253
+ *
254
+ * Note: In the new format, packages store per-dataset refs in data/ dir
255
+ * rather than tree objects. This function uses the structure directly.
256
+ *
257
+ * @param storage - Storage backend
258
+ * @param repo - Repository identifier
259
+ * @param name - Package name
260
+ * @param version - Package version
261
+ * @param path - Path to the tree node
262
+ * @returns Array of field names at the path
263
+ * @throws If package not found, path invalid, or path points to a dataset
264
+ */
265
+ export declare function packageListTree(storage: StorageBackend, repo: string, name: string, version: string, path: TreePath): Promise<string[]>;
178
266
  //# sourceMappingURL=trees.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trees.d.ts","sourceRoot":"","sources":["../../src/trees.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AAEH,OAAO,EAKL,KAAK,QAAQ,EACb,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAsD,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAuB,MAAM,mBAAmB,CAAC;AAQzJ,OAAO,EAAwB,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAIpF;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAyBjD;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,UAAU,CAAC,CAKrB;AAED;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,MAAM,CAAC,CAKjB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC,CAI7C;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,QAAQ,GAAG,aAAa,GAC7B,OAAO,CAAC,MAAM,CAAC,CAOjB;AAyFD;;;;;;;;;GASG;AACH,wB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