@elaraai/e3-core 0.0.2-beta.12 → 0.0.2-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/dataflow.d.ts +118 -9
- package/dist/src/dataflow.d.ts.map +1 -1
- package/dist/src/dataflow.js +283 -54
- package/dist/src/dataflow.js.map +1 -1
- package/dist/src/errors.d.ts +11 -6
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/errors.js +10 -3
- package/dist/src/errors.js.map +1 -1
- package/dist/src/execution/index.d.ts +14 -0
- package/dist/src/execution/index.d.ts.map +1 -0
- package/dist/src/execution/index.js +6 -0
- package/dist/src/execution/index.js.map +1 -0
- package/dist/src/execution/interfaces.d.ts +244 -0
- package/dist/src/execution/interfaces.d.ts.map +1 -0
- package/dist/src/execution/interfaces.js +6 -0
- package/dist/src/execution/interfaces.js.map +1 -0
- package/dist/src/executions.d.ts +48 -38
- package/dist/src/executions.d.ts.map +1 -1
- package/dist/src/executions.js +117 -162
- package/dist/src/executions.js.map +1 -1
- package/dist/src/gc.d.ts +9 -2
- package/dist/src/gc.d.ts.map +1 -1
- package/dist/src/gc.js +19 -9
- package/dist/src/gc.js.map +1 -1
- package/dist/src/index.d.ts +8 -6
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +22 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/objects.d.ts +6 -6
- package/dist/src/objects.js +6 -6
- package/dist/src/packages.d.ts +22 -14
- package/dist/src/packages.d.ts.map +1 -1
- package/dist/src/packages.js +45 -79
- package/dist/src/packages.js.map +1 -1
- package/dist/src/repository.d.ts +8 -4
- package/dist/src/repository.d.ts.map +1 -1
- package/dist/src/repository.js +25 -29
- package/dist/src/repository.js.map +1 -1
- package/dist/src/storage/index.d.ts +17 -0
- package/dist/src/storage/index.d.ts.map +1 -0
- package/dist/src/storage/index.js +8 -0
- package/dist/src/storage/index.js.map +1 -0
- package/dist/src/storage/interfaces.d.ts +299 -0
- package/dist/src/storage/interfaces.d.ts.map +1 -0
- package/dist/src/storage/interfaces.js +6 -0
- package/dist/src/storage/interfaces.js.map +1 -0
- package/dist/src/storage/local/LocalBackend.d.ts +51 -0
- package/dist/src/storage/local/LocalBackend.d.ts.map +1 -0
- package/dist/src/storage/local/LocalBackend.js +73 -0
- package/dist/src/storage/local/LocalBackend.js.map +1 -0
- package/dist/src/storage/local/LocalLockService.d.ts +22 -0
- package/dist/src/storage/local/LocalLockService.d.ts.map +1 -0
- package/dist/src/storage/local/LocalLockService.js +38 -0
- package/dist/src/storage/local/LocalLockService.js.map +1 -0
- package/dist/src/storage/local/LocalLogStore.d.ts +23 -0
- package/dist/src/storage/local/LocalLogStore.d.ts.map +1 -0
- package/dist/src/storage/local/LocalLogStore.js +66 -0
- package/dist/src/storage/local/LocalLogStore.js.map +1 -0
- package/dist/src/storage/local/LocalObjectStore.d.ts +19 -0
- package/dist/src/storage/local/LocalObjectStore.d.ts.map +1 -0
- package/dist/src/storage/local/LocalObjectStore.js +68 -0
- package/dist/src/storage/local/LocalObjectStore.js.map +1 -0
- package/dist/src/storage/local/LocalRefStore.d.ts +35 -0
- package/dist/src/storage/local/LocalRefStore.d.ts.map +1 -0
- package/dist/src/storage/local/LocalRefStore.js +233 -0
- package/dist/src/storage/local/LocalRefStore.js.map +1 -0
- package/dist/src/storage/local/index.d.ts +16 -0
- package/dist/src/storage/local/index.d.ts.map +1 -0
- package/dist/src/storage/local/index.js +16 -0
- package/dist/src/storage/local/index.js.map +1 -0
- package/dist/src/tasks.d.ts +16 -10
- package/dist/src/tasks.d.ts.map +1 -1
- package/dist/src/tasks.js +35 -41
- package/dist/src/tasks.js.map +1 -1
- package/dist/src/test-helpers.d.ts +4 -4
- package/dist/src/test-helpers.d.ts.map +1 -1
- package/dist/src/test-helpers.js +6 -20
- package/dist/src/test-helpers.js.map +1 -1
- package/dist/src/trees.d.ts +41 -29
- package/dist/src/trees.d.ts.map +1 -1
- package/dist/src/trees.js +112 -109
- package/dist/src/trees.js.map +1 -1
- package/dist/src/workspaceLock.d.ts +29 -7
- package/dist/src/workspaceLock.d.ts.map +1 -1
- package/dist/src/workspaceLock.js +130 -40
- package/dist/src/workspaceLock.js.map +1 -1
- package/dist/src/workspaceStatus.d.ts +6 -4
- package/dist/src/workspaceStatus.d.ts.map +1 -1
- package/dist/src/workspaceStatus.js +42 -58
- package/dist/src/workspaceStatus.js.map +1 -1
- package/dist/src/workspaces.d.ts +35 -26
- package/dist/src/workspaces.d.ts.map +1 -1
- package/dist/src/workspaces.js +93 -116
- package/dist/src/workspaces.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/storage/local/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Local filesystem implementation of StorageBackend.
|
|
7
|
+
*
|
|
8
|
+
* This wraps the existing e3-core filesystem functions to provide a
|
|
9
|
+
* StorageBackend that works with local repositories.
|
|
10
|
+
*/
|
|
11
|
+
export { LocalStorage, LocalBackend } from './LocalBackend.js';
|
|
12
|
+
export { LocalObjectStore } from './LocalObjectStore.js';
|
|
13
|
+
export { LocalRefStore } from './LocalRefStore.js';
|
|
14
|
+
export { LocalLockService } from './LocalLockService.js';
|
|
15
|
+
export { LocalLogStore } from './LocalLogStore.js';
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/storage/local/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/src/tasks.d.ts
CHANGED
|
@@ -3,20 +3,23 @@
|
|
|
3
3
|
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
5
|
import { type TaskObject } from '@elaraai/e3-types';
|
|
6
|
+
import type { StorageBackend } from './storage/interfaces.js';
|
|
6
7
|
/**
|
|
7
8
|
* List task names in a package.
|
|
8
9
|
*
|
|
9
|
-
* @param
|
|
10
|
+
* @param storage - Storage backend
|
|
11
|
+
* @param repo - Repository identifier
|
|
10
12
|
* @param name - Package name
|
|
11
13
|
* @param version - Package version
|
|
12
14
|
* @returns Array of task names
|
|
13
15
|
* @throws If package not found
|
|
14
16
|
*/
|
|
15
|
-
export declare function packageListTasks(
|
|
17
|
+
export declare function packageListTasks(storage: StorageBackend, repo: string, name: string, version: string): Promise<string[]>;
|
|
16
18
|
/**
|
|
17
19
|
* Get task details from a package.
|
|
18
20
|
*
|
|
19
|
-
* @param
|
|
21
|
+
* @param storage - Storage backend
|
|
22
|
+
* @param repo - Repository identifier
|
|
20
23
|
* @param name - Package name
|
|
21
24
|
* @param version - Package version
|
|
22
25
|
* @param taskName - Name of the task
|
|
@@ -24,22 +27,24 @@ export declare function packageListTasks(repoPath: string, name: string, version
|
|
|
24
27
|
* @throws {PackageNotFoundError} If package not found
|
|
25
28
|
* @throws {TaskNotFoundError} If task not found in package
|
|
26
29
|
*/
|
|
27
|
-
export declare function packageGetTask(
|
|
30
|
+
export declare function packageGetTask(storage: StorageBackend, repo: string, name: string, version: string, taskName: string): Promise<TaskObject>;
|
|
28
31
|
/**
|
|
29
32
|
* List task names in a workspace.
|
|
30
33
|
*
|
|
31
34
|
* Tasks are defined by the deployed package.
|
|
32
35
|
*
|
|
33
|
-
* @param
|
|
36
|
+
* @param storage - Storage backend
|
|
37
|
+
* @param repo - Repository identifier
|
|
34
38
|
* @param ws - Workspace name
|
|
35
39
|
* @returns Array of task names
|
|
36
40
|
* @throws If workspace not found or not deployed
|
|
37
41
|
*/
|
|
38
|
-
export declare function workspaceListTasks(
|
|
42
|
+
export declare function workspaceListTasks(storage: StorageBackend, repo: string, ws: string): Promise<string[]>;
|
|
39
43
|
/**
|
|
40
44
|
* Get task hash from a workspace.
|
|
41
45
|
*
|
|
42
|
-
* @param
|
|
46
|
+
* @param storage - Storage backend
|
|
47
|
+
* @param repo - Repository identifier
|
|
43
48
|
* @param ws - Workspace name
|
|
44
49
|
* @param taskName - Name of the task
|
|
45
50
|
* @returns The hash of the TaskObject
|
|
@@ -47,17 +52,18 @@ export declare function workspaceListTasks(repoPath: string, ws: string): Promis
|
|
|
47
52
|
* @throws {WorkspaceNotDeployedError} If workspace not deployed
|
|
48
53
|
* @throws {TaskNotFoundError} If task not found
|
|
49
54
|
*/
|
|
50
|
-
export declare function workspaceGetTaskHash(
|
|
55
|
+
export declare function workspaceGetTaskHash(storage: StorageBackend, repo: string, ws: string, taskName: string): Promise<string>;
|
|
51
56
|
/**
|
|
52
57
|
* Get task details from a workspace.
|
|
53
58
|
*
|
|
54
59
|
* Tasks are defined by the deployed package.
|
|
55
60
|
*
|
|
56
|
-
* @param
|
|
61
|
+
* @param storage - Storage backend
|
|
62
|
+
* @param repo - Repository identifier
|
|
57
63
|
* @param ws - Workspace name
|
|
58
64
|
* @param taskName - Name of the task
|
|
59
65
|
* @returns The TaskObject containing runner, inputs, and output
|
|
60
66
|
* @throws If workspace not deployed or task not found
|
|
61
67
|
*/
|
|
62
|
-
export declare function workspaceGetTask(
|
|
68
|
+
export declare function workspaceGetTask(storage: StorageBackend, repo: string, ws: string, taskName: string): Promise<TaskObject>;
|
|
63
69
|
//# sourceMappingURL=tasks.d.ts.map
|
package/dist/src/tasks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/tasks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../../src/tasks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,mBAAmB,CAAC;AAO3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAM9D;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,EAAE,CAAC,CAGnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,UAAU,CAAC,CAWrB;AAoCD;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,MAAM,EAAE,CAAC,CAGnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC,CASjB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,UAAU,CAAC,CAKrB"}
|
package/dist/src/tasks.js
CHANGED
|
@@ -14,31 +14,30 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { decodeBeast2For } from '@elaraai/east';
|
|
16
16
|
import { PackageObjectType, TaskObjectType, WorkspaceStateType, } from '@elaraai/e3-types';
|
|
17
|
-
import { objectRead } from './objects.js';
|
|
18
17
|
import { packageRead } from './packages.js';
|
|
19
|
-
import { TaskNotFoundError, WorkspaceNotFoundError, WorkspaceNotDeployedError,
|
|
20
|
-
import * as fs from 'fs/promises';
|
|
21
|
-
import * as path from 'path';
|
|
18
|
+
import { TaskNotFoundError, WorkspaceNotFoundError, WorkspaceNotDeployedError, } from './errors.js';
|
|
22
19
|
// =============================================================================
|
|
23
20
|
// Package Task Operations
|
|
24
21
|
// =============================================================================
|
|
25
22
|
/**
|
|
26
23
|
* List task names in a package.
|
|
27
24
|
*
|
|
28
|
-
* @param
|
|
25
|
+
* @param storage - Storage backend
|
|
26
|
+
* @param repo - Repository identifier
|
|
29
27
|
* @param name - Package name
|
|
30
28
|
* @param version - Package version
|
|
31
29
|
* @returns Array of task names
|
|
32
30
|
* @throws If package not found
|
|
33
31
|
*/
|
|
34
|
-
export async function packageListTasks(
|
|
35
|
-
const pkg = await packageRead(
|
|
32
|
+
export async function packageListTasks(storage, repo, name, version) {
|
|
33
|
+
const pkg = await packageRead(storage, repo, name, version);
|
|
36
34
|
return Array.from(pkg.tasks.keys());
|
|
37
35
|
}
|
|
38
36
|
/**
|
|
39
37
|
* Get task details from a package.
|
|
40
38
|
*
|
|
41
|
-
* @param
|
|
39
|
+
* @param storage - Storage backend
|
|
40
|
+
* @param repo - Repository identifier
|
|
42
41
|
* @param name - Package name
|
|
43
42
|
* @param version - Package version
|
|
44
43
|
* @param taskName - Name of the task
|
|
@@ -46,13 +45,13 @@ export async function packageListTasks(repoPath, name, version) {
|
|
|
46
45
|
* @throws {PackageNotFoundError} If package not found
|
|
47
46
|
* @throws {TaskNotFoundError} If task not found in package
|
|
48
47
|
*/
|
|
49
|
-
export async function packageGetTask(
|
|
50
|
-
const pkg = await packageRead(
|
|
48
|
+
export async function packageGetTask(storage, repo, name, version, taskName) {
|
|
49
|
+
const pkg = await packageRead(storage, repo, name, version);
|
|
51
50
|
const taskHash = pkg.tasks.get(taskName);
|
|
52
51
|
if (!taskHash) {
|
|
53
52
|
throw new TaskNotFoundError(taskName);
|
|
54
53
|
}
|
|
55
|
-
const taskData = await
|
|
54
|
+
const taskData = await storage.objects.read(repo, taskHash);
|
|
56
55
|
const decoder = decodeBeast2For(TaskObjectType);
|
|
57
56
|
return decoder(Buffer.from(taskData));
|
|
58
57
|
}
|
|
@@ -60,35 +59,27 @@ export async function packageGetTask(repoPath, name, version, taskName) {
|
|
|
60
59
|
// Workspace Task Operations
|
|
61
60
|
// =============================================================================
|
|
62
61
|
/**
|
|
63
|
-
* Read workspace state from
|
|
62
|
+
* Read workspace state from storage.
|
|
64
63
|
* @throws {WorkspaceNotFoundError} If workspace doesn't exist
|
|
65
64
|
* @throws {WorkspaceNotDeployedError} If workspace exists but not deployed
|
|
66
65
|
*/
|
|
67
|
-
async function readWorkspaceState(
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (data.length === 0) {
|
|
72
|
-
throw new WorkspaceNotDeployedError(ws);
|
|
73
|
-
}
|
|
74
|
-
const decoder = decodeBeast2For(WorkspaceStateType);
|
|
75
|
-
return decoder(data);
|
|
66
|
+
async function readWorkspaceState(storage, repo, ws) {
|
|
67
|
+
const data = await storage.refs.workspaceRead(repo, ws);
|
|
68
|
+
if (data === null) {
|
|
69
|
+
throw new WorkspaceNotFoundError(ws);
|
|
76
70
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
throw err;
|
|
80
|
-
if (isNotFoundError(err)) {
|
|
81
|
-
throw new WorkspaceNotFoundError(ws);
|
|
82
|
-
}
|
|
83
|
-
throw err;
|
|
71
|
+
if (data.length === 0) {
|
|
72
|
+
throw new WorkspaceNotDeployedError(ws);
|
|
84
73
|
}
|
|
74
|
+
const decoder = decodeBeast2For(WorkspaceStateType);
|
|
75
|
+
return decoder(Buffer.from(data));
|
|
85
76
|
}
|
|
86
77
|
/**
|
|
87
78
|
* Get the deployed package object for a workspace.
|
|
88
79
|
*/
|
|
89
|
-
async function getWorkspacePackageObject(
|
|
90
|
-
const state = await readWorkspaceState(
|
|
91
|
-
const pkgData = await
|
|
80
|
+
async function getWorkspacePackageObject(storage, repo, ws) {
|
|
81
|
+
const state = await readWorkspaceState(storage, repo, ws);
|
|
82
|
+
const pkgData = await storage.objects.read(repo, state.packageHash);
|
|
92
83
|
const decoder = decodeBeast2For(PackageObjectType);
|
|
93
84
|
return decoder(Buffer.from(pkgData));
|
|
94
85
|
}
|
|
@@ -97,19 +88,21 @@ async function getWorkspacePackageObject(repoPath, ws) {
|
|
|
97
88
|
*
|
|
98
89
|
* Tasks are defined by the deployed package.
|
|
99
90
|
*
|
|
100
|
-
* @param
|
|
91
|
+
* @param storage - Storage backend
|
|
92
|
+
* @param repo - Repository identifier
|
|
101
93
|
* @param ws - Workspace name
|
|
102
94
|
* @returns Array of task names
|
|
103
95
|
* @throws If workspace not found or not deployed
|
|
104
96
|
*/
|
|
105
|
-
export async function workspaceListTasks(
|
|
106
|
-
const pkg = await getWorkspacePackageObject(
|
|
97
|
+
export async function workspaceListTasks(storage, repo, ws) {
|
|
98
|
+
const pkg = await getWorkspacePackageObject(storage, repo, ws);
|
|
107
99
|
return Array.from(pkg.tasks.keys());
|
|
108
100
|
}
|
|
109
101
|
/**
|
|
110
102
|
* Get task hash from a workspace.
|
|
111
103
|
*
|
|
112
|
-
* @param
|
|
104
|
+
* @param storage - Storage backend
|
|
105
|
+
* @param repo - Repository identifier
|
|
113
106
|
* @param ws - Workspace name
|
|
114
107
|
* @param taskName - Name of the task
|
|
115
108
|
* @returns The hash of the TaskObject
|
|
@@ -117,8 +110,8 @@ export async function workspaceListTasks(repoPath, ws) {
|
|
|
117
110
|
* @throws {WorkspaceNotDeployedError} If workspace not deployed
|
|
118
111
|
* @throws {TaskNotFoundError} If task not found
|
|
119
112
|
*/
|
|
120
|
-
export async function workspaceGetTaskHash(
|
|
121
|
-
const pkg = await getWorkspacePackageObject(
|
|
113
|
+
export async function workspaceGetTaskHash(storage, repo, ws, taskName) {
|
|
114
|
+
const pkg = await getWorkspacePackageObject(storage, repo, ws);
|
|
122
115
|
const taskHash = pkg.tasks.get(taskName);
|
|
123
116
|
if (!taskHash) {
|
|
124
117
|
throw new TaskNotFoundError(taskName);
|
|
@@ -130,15 +123,16 @@ export async function workspaceGetTaskHash(repoPath, ws, taskName) {
|
|
|
130
123
|
*
|
|
131
124
|
* Tasks are defined by the deployed package.
|
|
132
125
|
*
|
|
133
|
-
* @param
|
|
126
|
+
* @param storage - Storage backend
|
|
127
|
+
* @param repo - Repository identifier
|
|
134
128
|
* @param ws - Workspace name
|
|
135
129
|
* @param taskName - Name of the task
|
|
136
130
|
* @returns The TaskObject containing runner, inputs, and output
|
|
137
131
|
* @throws If workspace not deployed or task not found
|
|
138
132
|
*/
|
|
139
|
-
export async function workspaceGetTask(
|
|
140
|
-
const taskHash = await workspaceGetTaskHash(
|
|
141
|
-
const taskData = await
|
|
133
|
+
export async function workspaceGetTask(storage, repo, ws, taskName) {
|
|
134
|
+
const taskHash = await workspaceGetTaskHash(storage, repo, ws, taskName);
|
|
135
|
+
const taskData = await storage.objects.read(repo, taskHash);
|
|
142
136
|
const decoder = decodeBeast2For(TaskObjectType);
|
|
143
137
|
return decoder(Buffer.from(taskData));
|
|
144
138
|
}
|
package/dist/src/tasks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/tasks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,kBAAkB,GAEnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../../src/tasks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,kBAAkB,GAEnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AAGrB,gFAAgF;AAChF,0BAA0B;AAC1B,gFAAgF;AAEhF;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAAuB,EACvB,IAAY,EACZ,IAAY,EACZ,OAAe;IAEf,MAAM,GAAG,GAAG,MAAM,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC5D,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;AACtC,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,OAAuB,EACvB,IAAY,EACZ,IAAY,EACZ,OAAe,EACf,QAAgB;IAEhB,MA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IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAG,eAAe,CAAC,cAAc,CAAC,CAAC;IAChD,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -14,14 +14,14 @@ export declare function createTempDir(): string;
|
|
|
14
14
|
export declare function removeTempDir(dir: string): void;
|
|
15
15
|
/**
|
|
16
16
|
* Creates a temporary e3 repository for testing
|
|
17
|
-
* @returns Path to
|
|
17
|
+
* @returns Path to the repository directory
|
|
18
18
|
*/
|
|
19
19
|
export declare function createTestRepo(): string;
|
|
20
20
|
/**
|
|
21
|
-
* Remove a test repository
|
|
22
|
-
* @param
|
|
21
|
+
* Remove a test repository
|
|
22
|
+
* @param repoPath Path to repository directory
|
|
23
23
|
*/
|
|
24
|
-
export declare function removeTestRepo(
|
|
24
|
+
export declare function removeTestRepo(repoPath: string): void;
|
|
25
25
|
/**
|
|
26
26
|
* Read all entries from a zip file
|
|
27
27
|
* @param zipPath Path to zip file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-helpers.d.ts","sourceRoot":"","sources":["../../src/test-helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;;GAGG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE/C;
|
|
1
|
+
{"version":3,"file":"test-helpers.d.ts","sourceRoot":"","sources":["../../src/test-helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAaH;;;GAGG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE/C;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAOvC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAErD;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAgClF;AAED;;;;;;;;GAQG;AACH,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAoC5C"}
|
package/dist/src/test-helpers.js
CHANGED
|
@@ -25,13 +25,9 @@ export function createTempDir() {
|
|
|
25
25
|
export function removeTempDir(dir) {
|
|
26
26
|
rmSync(dir, { recursive: true, force: true });
|
|
27
27
|
}
|
|
28
|
-
/**
|
|
29
|
-
* Track parent directories for cleanup
|
|
30
|
-
*/
|
|
31
|
-
const parentDirs = new Map();
|
|
32
28
|
/**
|
|
33
29
|
* Creates a temporary e3 repository for testing
|
|
34
|
-
* @returns Path to
|
|
30
|
+
* @returns Path to the repository directory
|
|
35
31
|
*/
|
|
36
32
|
export function createTestRepo() {
|
|
37
33
|
const dir = createTempDir();
|
|
@@ -39,24 +35,14 @@ export function createTestRepo() {
|
|
|
39
35
|
if (!result.success) {
|
|
40
36
|
throw new Error(`Failed to create test repository: ${result.error?.message}`);
|
|
41
37
|
}
|
|
42
|
-
|
|
43
|
-
parentDirs.set(result.e3Dir, dir);
|
|
44
|
-
return result.e3Dir;
|
|
38
|
+
return result.repoPath;
|
|
45
39
|
}
|
|
46
40
|
/**
|
|
47
|
-
* Remove a test repository
|
|
48
|
-
* @param
|
|
41
|
+
* Remove a test repository
|
|
42
|
+
* @param repoPath Path to repository directory
|
|
49
43
|
*/
|
|
50
|
-
export function removeTestRepo(
|
|
51
|
-
|
|
52
|
-
if (parentDir) {
|
|
53
|
-
removeTempDir(parentDir);
|
|
54
|
-
parentDirs.delete(e3Dir);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
// Fallback: remove the .e3 directory itself
|
|
58
|
-
removeTempDir(e3Dir);
|
|
59
|
-
}
|
|
44
|
+
export function removeTestRepo(repoPath) {
|
|
45
|
+
removeTempDir(repoPath);
|
|
60
46
|
}
|
|
61
47
|
/**
|
|
62
48
|
* Read all entries from a zip file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-helpers.js","sourceRoot":"","sources":["../../src/test-helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;GAGG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC;AACjD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAChD,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"test-helpers.js","sourceRoot":"","sources":["../../src/test-helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,iB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AAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC"}
|
package/dist/src/trees.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { type EastType, type EastTypeValue } from '@elaraai/east';
|
|
19
19
|
import { type DataRef, type Structure, type TreePath } from '@elaraai/e3-types';
|
|
20
|
-
import {
|
|
20
|
+
import type { StorageBackend, LockHandle } from './storage/interfaces.js';
|
|
21
21
|
/**
|
|
22
22
|
* A tree object: mapping of field names to data references.
|
|
23
23
|
*
|
|
@@ -28,69 +28,75 @@ export type TreeObject = Record<string, DataRef>;
|
|
|
28
28
|
/**
|
|
29
29
|
* Read and decode a tree object from the object store.
|
|
30
30
|
*
|
|
31
|
-
* @param
|
|
31
|
+
* @param storage - Storage backend
|
|
32
|
+
* @param repo - Repository identifier
|
|
32
33
|
* @param hash - Hash of the tree object
|
|
33
34
|
* @param structure - The structure describing this tree node's shape
|
|
34
35
|
* @returns The decoded tree object (field name -> DataRef)
|
|
35
36
|
* @throws If object not found, structure is not a tree, or decoding fails
|
|
36
37
|
*/
|
|
37
|
-
export declare function treeRead(
|
|
38
|
+
export declare function treeRead(storage: StorageBackend, repo: string, hash: string, structure: Structure): Promise<TreeObject>;
|
|
38
39
|
/**
|
|
39
40
|
* Encode and write a tree object to the object store.
|
|
40
41
|
*
|
|
41
|
-
* @param
|
|
42
|
+
* @param storage - Storage backend
|
|
43
|
+
* @param repo - Repository identifier
|
|
42
44
|
* @param fields - Object mapping field names to DataRefs
|
|
43
45
|
* @param structure - The structure describing this tree node's shape
|
|
44
46
|
* @returns Hash of the written tree object
|
|
45
47
|
* @throws If structure is not a tree or encoding fails
|
|
46
48
|
*/
|
|
47
|
-
export declare function treeWrite(
|
|
49
|
+
export declare function treeWrite(storage: StorageBackend, repo: string, fields: TreeObject, structure: Structure): Promise<string>;
|
|
48
50
|
/**
|
|
49
51
|
* Read and decode a dataset value from the object store.
|
|
50
52
|
*
|
|
51
53
|
* The .beast2 format includes type information in the header, so values
|
|
52
54
|
* can be decoded without knowing the schema in advance.
|
|
53
55
|
*
|
|
54
|
-
* @param
|
|
56
|
+
* @param storage - Storage backend
|
|
57
|
+
* @param repo - Repository identifier
|
|
55
58
|
* @param hash - Hash of the dataset value
|
|
56
59
|
* @returns The decoded value and its type
|
|
57
60
|
* @throws If object not found or not a valid beast2 object
|
|
58
61
|
*/
|
|
59
|
-
export declare function datasetRead(
|
|
62
|
+
export declare function datasetRead(storage: StorageBackend, repo: string, hash: string): Promise<{
|
|
60
63
|
type: EastType;
|
|
61
64
|
value: unknown;
|
|
62
65
|
}>;
|
|
63
66
|
/**
|
|
64
67
|
* Encode and write a dataset value to the object store.
|
|
65
68
|
*
|
|
66
|
-
* @param
|
|
69
|
+
* @param storage - Storage backend
|
|
70
|
+
* @param repo - Repository identifier
|
|
67
71
|
* @param value - The value to encode
|
|
68
72
|
* @param type - The East type for encoding (EastType or EastTypeValue)
|
|
69
73
|
* @returns Hash of the written dataset value
|
|
70
74
|
*/
|
|
71
|
-
export declare function datasetWrite(
|
|
75
|
+
export declare function datasetWrite(storage: StorageBackend, repo: string, value: unknown, type: EastType | EastTypeValue): Promise<string>;
|
|
72
76
|
/**
|
|
73
77
|
* List field names at a tree path within a package's data tree.
|
|
74
78
|
*
|
|
75
|
-
* @param
|
|
79
|
+
* @param storage - Storage backend
|
|
80
|
+
* @param repo - Repository identifier
|
|
76
81
|
* @param name - Package name
|
|
77
82
|
* @param version - Package version
|
|
78
83
|
* @param path - Path to the tree node
|
|
79
84
|
* @returns Array of field names at the path
|
|
80
85
|
* @throws If package not found, path invalid, or path points to a dataset
|
|
81
86
|
*/
|
|
82
|
-
export declare function packageListTree(
|
|
87
|
+
export declare function packageListTree(storage: StorageBackend, repo: string, name: string, version: string, path: TreePath): Promise<string[]>;
|
|
83
88
|
/**
|
|
84
89
|
* Read and decode a dataset value at a path within a package's data tree.
|
|
85
90
|
*
|
|
86
|
-
* @param
|
|
91
|
+
* @param storage - Storage backend
|
|
92
|
+
* @param repo - Repository identifier
|
|
87
93
|
* @param name - Package name
|
|
88
94
|
* @param version - Package version
|
|
89
95
|
* @param path - Path to the dataset
|
|
90
96
|
* @returns The decoded dataset value
|
|
91
97
|
* @throws If package not found, path invalid, or path points to a tree
|
|
92
98
|
*/
|
|
93
|
-
export declare function packageGetDataset(
|
|
99
|
+
export declare function packageGetDataset(storage: StorageBackend, repo: string, name: string, version: string, path: TreePath): Promise<unknown>;
|
|
94
100
|
/**
|
|
95
101
|
* Options for setting a workspace dataset.
|
|
96
102
|
*/
|
|
@@ -100,7 +106,7 @@ export interface WorkspaceSetDatasetOptions {
|
|
|
100
106
|
* for releasing the lock after the operation. If not provided, workspaceSetDataset
|
|
101
107
|
* will acquire and release a lock internally.
|
|
102
108
|
*/
|
|
103
|
-
lock?:
|
|
109
|
+
lock?: LockHandle;
|
|
104
110
|
}
|
|
105
111
|
/**
|
|
106
112
|
* Update a dataset at a path within a workspace.
|
|
@@ -111,7 +117,8 @@ export interface WorkspaceSetDatasetOptions {
|
|
|
111
117
|
* Acquires an exclusive lock on the workspace for the duration of the write
|
|
112
118
|
* to prevent concurrent modifications.
|
|
113
119
|
*
|
|
114
|
-
* @param
|
|
120
|
+
* @param storage - Storage backend
|
|
121
|
+
* @param repo - Repository identifier
|
|
115
122
|
* @param ws - Workspace name
|
|
116
123
|
* @param treePath - Path to the dataset
|
|
117
124
|
* @param value - The new value to write
|
|
@@ -120,40 +127,43 @@ export interface WorkspaceSetDatasetOptions {
|
|
|
120
127
|
* @throws {WorkspaceLockError} If workspace is locked by another process
|
|
121
128
|
* @throws If workspace not deployed, path invalid, or path points to a tree
|
|
122
129
|
*/
|
|
123
|
-
export declare function workspaceSetDataset(
|
|
130
|
+
export declare function workspaceSetDataset(storage: StorageBackend, repo: string, ws: string, treePath: TreePath, value: unknown, type: EastType | EastTypeValue, options?: WorkspaceSetDatasetOptions): Promise<void>;
|
|
124
131
|
/**
|
|
125
132
|
* List field names at a tree path within a workspace's data tree.
|
|
126
133
|
*
|
|
127
|
-
* @param
|
|
134
|
+
* @param storage - Storage backend
|
|
135
|
+
* @param repo - Repository identifier
|
|
128
136
|
* @param ws - Workspace name
|
|
129
137
|
* @param path - Path to the tree node
|
|
130
138
|
* @returns Array of field names at the path
|
|
131
139
|
* @throws If workspace not deployed, path invalid, or path points to a dataset
|
|
132
140
|
*/
|
|
133
|
-
export declare function workspaceListTree(
|
|
141
|
+
export declare function workspaceListTree(storage: StorageBackend, repo: string, ws: string, treePath: TreePath): Promise<string[]>;
|
|
134
142
|
/**
|
|
135
143
|
* Read and decode a dataset value at a path within a workspace's data tree.
|
|
136
144
|
*
|
|
137
|
-
* @param
|
|
145
|
+
* @param storage - Storage backend
|
|
146
|
+
* @param repo - Repository identifier
|
|
138
147
|
* @param ws - Workspace name
|
|
139
148
|
* @param path - Path to the dataset
|
|
140
149
|
* @returns The decoded dataset value
|
|
141
150
|
* @throws If workspace not deployed, path invalid, or path points to a tree
|
|
142
151
|
*/
|
|
143
|
-
export declare function workspaceGetDataset(
|
|
152
|
+
export declare function workspaceGetDataset(storage: StorageBackend, repo: string, ws: string, treePath: TreePath): Promise<unknown>;
|
|
144
153
|
/**
|
|
145
154
|
* Get the hash of a dataset at a path within a workspace's data tree.
|
|
146
155
|
*
|
|
147
156
|
* Unlike workspaceGetDataset which decodes the value, this returns the raw
|
|
148
157
|
* hash reference. Useful for dataflow execution which operates on hashes.
|
|
149
158
|
*
|
|
150
|
-
* @param
|
|
159
|
+
* @param storage - Storage backend
|
|
160
|
+
* @param repo - Repository identifier
|
|
151
161
|
* @param ws - Workspace name
|
|
152
162
|
* @param treePath - Path to the dataset
|
|
153
163
|
* @returns Object with ref type and hash (null for unassigned/null refs)
|
|
154
164
|
* @throws If workspace not deployed, path invalid, or path points to a tree
|
|
155
165
|
*/
|
|
156
|
-
export declare function workspaceGetDatasetHash(
|
|
166
|
+
export declare function workspaceGetDatasetHash(storage: StorageBackend, repo: string, ws: string, treePath: TreePath): Promise<{
|
|
157
167
|
refType: DataRef['type'];
|
|
158
168
|
hash: string | null;
|
|
159
169
|
}>;
|
|
@@ -164,17 +174,18 @@ export declare function workspaceGetDatasetHash(repoPath: string, ws: string, tr
|
|
|
164
174
|
* directly. Useful for dataflow execution which already has the output hash.
|
|
165
175
|
*
|
|
166
176
|
* IMPORTANT: This function does NOT acquire a workspace lock. The caller must
|
|
167
|
-
* hold an exclusive lock on the workspace
|
|
168
|
-
*
|
|
169
|
-
*
|
|
177
|
+
* hold an exclusive lock on the workspace before calling this function. This
|
|
178
|
+
* is typically used by dataflowExecute which holds the lock for the entire
|
|
179
|
+
* execution.
|
|
170
180
|
*
|
|
171
|
-
* @param
|
|
181
|
+
* @param storage - Storage backend
|
|
182
|
+
* @param repo - Repository identifier
|
|
172
183
|
* @param ws - Workspace name
|
|
173
184
|
* @param treePath - Path to the dataset
|
|
174
185
|
* @param valueHash - Hash of the dataset value already in the object store
|
|
175
186
|
* @throws If workspace not deployed, path invalid, or path points to a tree
|
|
176
187
|
*/
|
|
177
|
-
export declare function workspaceSetDatasetByHash(
|
|
188
|
+
export declare function workspaceSetDatasetByHash(storage: StorageBackend, repo: string, ws: string, treePath: TreePath, valueHash: string): Promise<void>;
|
|
178
189
|
/**
|
|
179
190
|
* A tree branch node (contains children).
|
|
180
191
|
*/
|
|
@@ -216,12 +227,13 @@ export interface WorkspaceGetTreeOptions {
|
|
|
216
227
|
* Recursively walks the tree and returns a hierarchical structure
|
|
217
228
|
* suitable for display. Tasks are shown as leaves with their output type.
|
|
218
229
|
*
|
|
219
|
-
* @param
|
|
230
|
+
* @param storage - Storage backend
|
|
231
|
+
* @param repo - Repository identifier
|
|
220
232
|
* @param ws - Workspace name
|
|
221
233
|
* @param treePath - Path to start from (empty for root)
|
|
222
234
|
* @param options - Optional settings for depth limit and type inclusion
|
|
223
235
|
* @returns Array of tree nodes at the path
|
|
224
236
|
* @throws If workspace not deployed or path invalid
|
|
225
237
|
*/
|
|
226
|
-
export declare function workspaceGetTree(
|
|
238
|
+
export declare function workspaceGetTree(storage: StorageBackend, repo: string, ws: string, treePath: TreePath, options?: WorkspaceGetTreeOptions): Promise<TreeNode[]>;
|
|
227
239
|
//# sourceMappingURL=trees.d.ts.map
|
package/dist/src/trees.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trees.d.ts","sourceRoot":"","sources":["../../src/trees.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"trees.d.ts","sourceRoot":"","sources":["../../src/trees.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AAEH,OAAO,EAML,KAAK,QAAQ,EACb,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAsD,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAuB,MAAM,mBAAmB,CAAC;AAOzJ,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAyBjD;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,UAAU,CAAC,CAKrB;AAED;;;;;;;;;GASG;AACH,wBAAsB,SAAS,CAC7B,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,MAAM,CAAC,CAKjB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM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