@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
package/dist/src/gc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gc.js","sourceRoot":"","sources":["../../src/gc.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"gc.js","sourceRoot":"","sources":["../../src/gc.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAkDxD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,OAAuB,EACvB,IAAY,EACZ,UAAqB,EAAE;IAEvB,qEAAqE;IACrE,IAAI,CAAC,CAAC,OAAO,YAAY,YA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AC,IAAI,CAAC,EAAE,CAAC;4BACxB,MAAM,CAAC,eAAe,EAAE,CAAC;wBAC3B,CAAC;6BAAM,CAAC;4BACN,IAAI,CAAC,MAAM,EAAE,CAAC;gCACZ,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;4BAC5B,CAAC;4BACD,MAAM,CAAC,cAAc,EAAE,CAAC;4BACxB,MAAM,CAAC,UAAU,IAAI,QAAQ,CAAC,IAAI,CAAC;wBACrC,CAAC;oBACH,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC;oBACP,qCAAqC;gBACvC,CAAC;YACH,CAAC;YAED,mCAAmC;YACnC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,IAAI,CAAC;oBACH,MAAM,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;gBAC7B,CAAC;gBAAC,MAAM,CAAC;oBACP,mCAAmC;gBACrC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,mDAAmD;IACrD,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -9,17 +9,19 @@
|
|
|
9
9
|
* similar to libgit2 for git. It has no UI dependencies and can be
|
|
10
10
|
* used programmatically.
|
|
11
11
|
*/
|
|
12
|
+
export * from './storage/index.js';
|
|
13
|
+
export * from './execution/index.js';
|
|
12
14
|
export { repoInit, repoFind, repoGet, type InitRepositoryResult, } from './repository.js';
|
|
13
15
|
export { repoGc, type GcOptions, type GcResult } from './gc.js';
|
|
14
|
-
export { computeHash, objectWrite, objectWriteStream, objectRead, objectExists,
|
|
16
|
+
export { computeHash, objectWrite, objectWriteStream, objectRead, objectExists, objectAbbrev, } from './objects.js';
|
|
15
17
|
export { packageImport, packageExport, packageRemove, packageList, packageGetLatestVersion, packageResolve, packageRead, type PackageImportResult, type PackageExportResult, } from './packages.js';
|
|
16
|
-
export { workspaceCreate, workspaceRemove,
|
|
18
|
+
export { workspaceList, workspaceCreate, workspaceRemove, workspaceGetState, workspaceGetPackage, workspaceGetRoot, workspaceSetRoot, workspaceDeploy, workspaceExport, type WorkspaceExportResult, type WorkspaceRemoveOptions, type WorkspaceDeployOptions, } from './workspaces.js';
|
|
17
19
|
export { treeRead, treeWrite, datasetRead, datasetWrite, type TreeObject, } from './trees.js';
|
|
18
20
|
export { packageListTree, packageGetDataset, workspaceListTree, workspaceGetDataset, workspaceGetDatasetHash, workspaceSetDataset, workspaceSetDatasetByHash, workspaceGetTree, type WorkspaceSetDatasetOptions, type WorkspaceGetTreeOptions, type TreeNode, type TreeBranchNode, type TreeLeafNode, } from './trees.js';
|
|
19
21
|
export { packageListTasks, packageGetTask, workspaceListTasks, workspaceGetTask, workspaceGetTaskHash, } from './tasks.js';
|
|
20
|
-
export { inputsHash,
|
|
21
|
-
export { dataflowExecute, dataflowStart, dataflowGetGraph, type DataflowOptions, type DataflowResult, type TaskExecutionResult, } from './dataflow.js';
|
|
22
|
-
export { acquireWorkspaceLock, getWorkspaceLockHolder, workspaceLockPath, type WorkspaceLockHandle, type AcquireLockOptions, } from './workspaceLock.js';
|
|
22
|
+
export { inputsHash, executionGet, executionGetOutput, executionListForTask, executionList, executionFindCurrent, type CurrentExecutionRef, executionReadLog, type LogReadOptions, evaluateCommandIr, getBootId, getPidStartTime, isProcessAlive, taskExecute, type ExecuteOptions, type ExecutionResult, } from './executions.js';
|
|
23
|
+
export { dataflowExecute, dataflowStart, dataflowGetGraph, dataflowGetReadyTasks, dataflowCheckCache, dataflowGetDependentsToSkip, dataflowResolveInputHashes, type DataflowGraph, type DataflowOptions, type DataflowResult, type TaskExecutionResult, } from './dataflow.js';
|
|
24
|
+
export { acquireWorkspaceLock, getWorkspaceLockState, getWorkspaceLockHolder, lockStateToHolderInfo, isLockHolderAlive, workspaceLockPath, type WorkspaceLockHandle, type AcquireLockOptions, } from './workspaceLock.js';
|
|
23
25
|
export { workspaceStatus, type DatasetStatus, type TaskStatus, type DatasetStatusInfo, type TaskStatusInfo, type WorkspaceStatusResult, } from './workspaceStatus.js';
|
|
24
|
-
export { E3Error, RepositoryNotFoundError, WorkspaceNotFoundError, WorkspaceNotDeployedError, WorkspaceExistsError, WorkspaceLockError, type
|
|
26
|
+
export { E3Error, RepositoryNotFoundError, WorkspaceNotFoundError, WorkspaceNotDeployedError, WorkspaceExistsError, WorkspaceLockError, type LockHolderInfo, PackageNotFoundError, PackageInvalidError, PackageExistsError, DatasetNotFoundError, TaskNotFoundError, ObjectNotFoundError, ObjectCorruptError, ExecutionCorruptError, DataflowError, DataflowAbortedError, PermissionDeniedError, isNotFoundError, isPermissionError, isExistsError, wrapError, } from './errors.js';
|
|
25
27
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAUH,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AASrC,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,KAAK,oBAAoB,GAC1B,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGhE,OAAO,EACL,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,YAAY,GACb,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,aAAa,EACb,aAAa,EACb,aAAa,EACb,WAAW,EACX,uBAAuB,EACvB,cAAc,EACd,WAAW,EACX,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,MAAM,eAAe,CAAC;AAGvB,OAAO,E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KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAEL,OAAO,EAEP,uBAAuB,EAEvB,sBAAsB,EACtB,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB,EAClB,KAAK,cAAc,EAEnB,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAElB,oBAAoB,EAEpB,iBAAiB,EAEjB,mBAAmB,EACnB,kBAAkB,EAElB,qBAAqB,EAErB,aAAa,EACb,oBAAoB,EAEpB,qBAAqB,EAErB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,SAAS,GACV,MAAM,aAAa,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -9,16 +9,30 @@
|
|
|
9
9
|
* similar to libgit2 for git. It has no UI dependencies and can be
|
|
10
10
|
* used programmatically.
|
|
11
11
|
*/
|
|
12
|
+
// =============================================================================
|
|
13
|
+
// Storage and Execution Abstractions
|
|
14
|
+
// =============================================================================
|
|
15
|
+
// These interfaces enable e3-core to work against different backends:
|
|
16
|
+
// - Local filesystem (default, CLI and local dev)
|
|
17
|
+
// - AWS EFS (Lambda/Fargate cloud deployment)
|
|
18
|
+
// - S3 + DynamoDB (future optimization)
|
|
19
|
+
export * from './storage/index.js';
|
|
20
|
+
export * from './execution/index.js';
|
|
21
|
+
// =============================================================================
|
|
22
|
+
// Repository Operations (filesystem-based)
|
|
23
|
+
// =============================================================================
|
|
24
|
+
// These functions use repoPath directly. Future versions will also accept
|
|
25
|
+
// a StorageBackend for backend-agnostic operation.
|
|
12
26
|
// Repository management
|
|
13
27
|
export { repoInit, repoFind, repoGet, } from './repository.js';
|
|
14
28
|
// Garbage collection
|
|
15
29
|
export { repoGc } from './gc.js';
|
|
16
30
|
// Object storage
|
|
17
|
-
export { computeHash, objectWrite, objectWriteStream, objectRead, objectExists,
|
|
31
|
+
export { computeHash, objectWrite, objectWriteStream, objectRead, objectExists, objectAbbrev, } from './objects.js';
|
|
18
32
|
// Package operations
|
|
19
33
|
export { packageImport, packageExport, packageRemove, packageList, packageGetLatestVersion, packageResolve, packageRead, } from './packages.js';
|
|
20
34
|
// Workspace operations
|
|
21
|
-
export { workspaceCreate, workspaceRemove,
|
|
35
|
+
export { workspaceList, workspaceCreate, workspaceRemove, workspaceGetState, workspaceGetPackage, workspaceGetRoot, workspaceSetRoot, workspaceDeploy, workspaceExport, } from './workspaces.js';
|
|
22
36
|
// Tree and dataset operations (low-level, by hash)
|
|
23
37
|
export { treeRead, treeWrite, datasetRead, datasetWrite, } from './trees.js';
|
|
24
38
|
// Tree and dataset operations (high-level, by path)
|
|
@@ -28,11 +42,14 @@ export { packageListTasks, packageGetTask, workspaceListTasks, workspaceGetTask,
|
|
|
28
42
|
// Execution operations
|
|
29
43
|
export {
|
|
30
44
|
// Identity
|
|
31
|
-
inputsHash,
|
|
45
|
+
inputsHash,
|
|
32
46
|
// Status
|
|
33
47
|
executionGet, executionGetOutput, executionListForTask, executionList,
|
|
48
|
+
// Find current execution for a task in workspace
|
|
49
|
+
executionFindCurrent,
|
|
34
50
|
// Logs
|
|
35
51
|
executionReadLog,
|
|
52
|
+
// Note: LogChunk is exported from './storage/index.js' (aligned interface)
|
|
36
53
|
// Command IR evaluation
|
|
37
54
|
evaluateCommandIr,
|
|
38
55
|
// Process detection
|
|
@@ -40,9 +57,9 @@ getBootId, getPidStartTime, isProcessAlive,
|
|
|
40
57
|
// Execution
|
|
41
58
|
taskExecute, } from './executions.js';
|
|
42
59
|
// Dataflow execution
|
|
43
|
-
export { dataflowExecute, dataflowStart, dataflowGetGraph, } from './dataflow.js';
|
|
60
|
+
export { dataflowExecute, dataflowStart, dataflowGetGraph, dataflowGetReadyTasks, dataflowCheckCache, dataflowGetDependentsToSkip, dataflowResolveInputHashes, } from './dataflow.js';
|
|
44
61
|
// Workspace locking
|
|
45
|
-
export { acquireWorkspaceLock, getWorkspaceLockHolder, workspaceLockPath, } from './workspaceLock.js';
|
|
62
|
+
export { acquireWorkspaceLock, getWorkspaceLockState, getWorkspaceLockHolder, lockStateToHolderInfo, isLockHolderAlive, workspaceLockPath, } from './workspaceLock.js';
|
|
46
63
|
// Workspace status
|
|
47
64
|
export { workspaceStatus, } from './workspaceStatus.js';
|
|
48
65
|
// Errors
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,wBAAwB;AACxB,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,OAAO,GAER,MAAM,iBAAiB,CAAC;AAEzB,qBAAqB;AACrB,OAAO,EAAE,MAAM,EAAiC,MAAM,SAAS,CAAC;AAEhE,iBAAiB;AACjB,OAAO,EACL,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AAEH,gFAAgF;AAChF,qCAAqC;AACrC,gFAAgF;AAChF,sEAAsE;AACtE,kDAAkD;AAClD,8CAA8C;AAC9C,wCAAwC;AAExC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AAErC,gFAAgF;AAChF,2CAA2C;AAC3C,gFAAgF;AAChF,0EAA0E;AAC1E,mDAAmD;AAEnD,wBAAwB;AACxB,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,OAAO,GAER,MAAM,iBAAiB,CAAC;AAEzB,qBAAqB;AACrB,OAAO,EAAE,MAAM,EAAiC,MAAM,SAAS,CAAC;AAEhE,iBAAiB;AACjB,OAAO,EACL,WAAW,EACX,WAAW,E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,EACL,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,GAGlB,MAAM,oBAAoB,CAAC;AAE5B,mBAAmB;AACnB,OAAO,EACL,eAAe,GAMhB,MAAM,sBAAsB,CAAC;AAE9B,SAAS;AACT,OAAO;AACL,OAAO;AACP,OAAO;AACP,aAAa;AACb,uBAAuB;AACvB,YAAY;AACZ,sBAAsB,EACtB,yBAAyB,EACzB,oBAAoB,EACpB,kBAAkB;AAElB,UAAU;AACV,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB;AAClB,UAAU;AACV,oBAAoB;AACpB,OAAO;AACP,iBAAiB;AACjB,SAAS;AACT,mBAAmB,EACnB,kBAAkB;AAClB,YAAY;AACZ,qBAAqB;AACrB,WAAW;AACX,aAAa,EACb,oBAAoB;AACpB,UAAU;AACV,qBAAqB;AACrB,UAAU;AACV,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,SAAS,GACV,MAAM,aAAa,CAAC"}
|
package/dist/src/objects.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare function computeHash(data: Uint8Array): string;
|
|
|
9
9
|
/**
|
|
10
10
|
* Atomically write an object to the repository
|
|
11
11
|
*
|
|
12
|
-
* @param repoPath - Path to
|
|
12
|
+
* @param repoPath - Path to e3 repository
|
|
13
13
|
* @param data - Data to store
|
|
14
14
|
* @returns SHA256 hash of the data
|
|
15
15
|
*/
|
|
@@ -17,7 +17,7 @@ export declare function objectWrite(repoPath: string, data: Uint8Array): Promise
|
|
|
17
17
|
/**
|
|
18
18
|
* Atomically write a stream to the repository
|
|
19
19
|
*
|
|
20
|
-
* @param repoPath - Path to
|
|
20
|
+
* @param repoPath - Path to e3 repository
|
|
21
21
|
* @param stream - Stream to store
|
|
22
22
|
* @returns SHA256 hash of the data
|
|
23
23
|
*/
|
|
@@ -25,7 +25,7 @@ export declare function objectWriteStream(repoPath: string, stream: ReadableStre
|
|
|
25
25
|
/**
|
|
26
26
|
* Read an object from the repository
|
|
27
27
|
*
|
|
28
|
-
* @param repoPath - Path to
|
|
28
|
+
* @param repoPath - Path to e3 repository
|
|
29
29
|
* @param hash - SHA256 hash of the object
|
|
30
30
|
* @returns Object data
|
|
31
31
|
* @throws {ObjectNotFoundError} If object not found
|
|
@@ -34,7 +34,7 @@ export declare function objectRead(repoPath: string, hash: string): Promise<Uint
|
|
|
34
34
|
/**
|
|
35
35
|
* Check if an object exists in the repository
|
|
36
36
|
*
|
|
37
|
-
* @param repoPath - Path to
|
|
37
|
+
* @param repoPath - Path to e3 repository
|
|
38
38
|
* @param hash - SHA256 hash of the object
|
|
39
39
|
* @returns true if object exists
|
|
40
40
|
*/
|
|
@@ -42,7 +42,7 @@ export declare function objectExists(repoPath: string, hash: string): Promise<bo
|
|
|
42
42
|
/**
|
|
43
43
|
* Get the filesystem path for an object
|
|
44
44
|
*
|
|
45
|
-
* @param repoPath - Path to
|
|
45
|
+
* @param repoPath - Path to e3 repository
|
|
46
46
|
* @param hash - SHA256 hash of the object
|
|
47
47
|
* @returns Filesystem path: objects/<hash[0..2]>/<hash[2..]>.beast2
|
|
48
48
|
*/
|
|
@@ -53,7 +53,7 @@ export declare function objectPath(repoPath: string, hash: string): string;
|
|
|
53
53
|
* Scans the object store to find the shortest prefix of the given hash
|
|
54
54
|
* that uniquely identifies it among all stored objects.
|
|
55
55
|
*
|
|
56
|
-
* @param repoPath - Path to
|
|
56
|
+
* @param repoPath - Path to e3 repository
|
|
57
57
|
* @param hash - Full SHA256 hash of the object
|
|
58
58
|
* @param minLength - Minimum prefix length to return (default: 4)
|
|
59
59
|
* @returns Minimum unambiguous prefix length
|
package/dist/src/objects.js
CHANGED
|
@@ -38,7 +38,7 @@ async function computeHashFromStream(stream) {
|
|
|
38
38
|
/**
|
|
39
39
|
* Atomically write an object to the repository
|
|
40
40
|
*
|
|
41
|
-
* @param repoPath - Path to
|
|
41
|
+
* @param repoPath - Path to e3 repository
|
|
42
42
|
* @param data - Data to store
|
|
43
43
|
* @returns SHA256 hash of the data
|
|
44
44
|
*/
|
|
@@ -92,7 +92,7 @@ export async function objectWrite(repoPath, data) {
|
|
|
92
92
|
/**
|
|
93
93
|
* Atomically write a stream to the repository
|
|
94
94
|
*
|
|
95
|
-
* @param repoPath - Path to
|
|
95
|
+
* @param repoPath - Path to e3 repository
|
|
96
96
|
* @param stream - Stream to store
|
|
97
97
|
* @returns SHA256 hash of the data
|
|
98
98
|
*/
|
|
@@ -150,7 +150,7 @@ export async function objectWriteStream(repoPath, stream) {
|
|
|
150
150
|
/**
|
|
151
151
|
* Read an object from the repository
|
|
152
152
|
*
|
|
153
|
-
* @param repoPath - Path to
|
|
153
|
+
* @param repoPath - Path to e3 repository
|
|
154
154
|
* @param hash - SHA256 hash of the object
|
|
155
155
|
* @returns Object data
|
|
156
156
|
* @throws {ObjectNotFoundError} If object not found
|
|
@@ -173,7 +173,7 @@ export async function objectRead(repoPath, hash) {
|
|
|
173
173
|
/**
|
|
174
174
|
* Check if an object exists in the repository
|
|
175
175
|
*
|
|
176
|
-
* @param repoPath - Path to
|
|
176
|
+
* @param repoPath - Path to e3 repository
|
|
177
177
|
* @param hash - SHA256 hash of the object
|
|
178
178
|
* @returns true if object exists
|
|
179
179
|
*/
|
|
@@ -190,7 +190,7 @@ export async function objectExists(repoPath, hash) {
|
|
|
190
190
|
/**
|
|
191
191
|
* Get the filesystem path for an object
|
|
192
192
|
*
|
|
193
|
-
* @param repoPath - Path to
|
|
193
|
+
* @param repoPath - Path to e3 repository
|
|
194
194
|
* @param hash - SHA256 hash of the object
|
|
195
195
|
* @returns Filesystem path: objects/<hash[0..2]>/<hash[2..]>.beast2
|
|
196
196
|
*/
|
|
@@ -205,7 +205,7 @@ export function objectPath(repoPath, hash) {
|
|
|
205
205
|
* Scans the object store to find the shortest prefix of the given hash
|
|
206
206
|
* that uniquely identifies it among all stored objects.
|
|
207
207
|
*
|
|
208
|
-
* @param repoPath - Path to
|
|
208
|
+
* @param repoPath - Path to e3 repository
|
|
209
209
|
* @param hash - Full SHA256 hash of the object
|
|
210
210
|
* @param minLength - Minimum prefix length to return (default: 4)
|
|
211
211
|
* @returns Minimum unambiguous prefix length
|
package/dist/src/packages.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under BSL 1.1. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
5
|
import type { PackageObject } from '@elaraai/e3-types';
|
|
6
|
+
import type { StorageBackend } from './storage/interfaces.js';
|
|
6
7
|
/**
|
|
7
8
|
* Result of importing a package
|
|
8
9
|
*/
|
|
@@ -17,60 +18,66 @@ export interface PackageImportResult {
|
|
|
17
18
|
*
|
|
18
19
|
* Extracts objects to `objects/`, creates ref at `packages/<name>/<version>`.
|
|
19
20
|
*
|
|
20
|
-
* @param
|
|
21
|
+
* @param storage - Storage backend
|
|
22
|
+
* @param repo - Repository identifier
|
|
21
23
|
* @param zipPath - Path to the .zip package file
|
|
22
24
|
* @returns Import result with package name, version, and stats
|
|
23
25
|
*/
|
|
24
|
-
export declare function packageImport(
|
|
26
|
+
export declare function packageImport(storage: StorageBackend, repo: string, zipPath: string): Promise<PackageImportResult>;
|
|
25
27
|
/**
|
|
26
28
|
* Remove a package ref from the repository.
|
|
27
29
|
*
|
|
28
30
|
* Objects remain until gc is run.
|
|
29
31
|
*
|
|
30
|
-
* @param
|
|
32
|
+
* @param storage - Storage backend
|
|
33
|
+
* @param repo - Repository identifier
|
|
31
34
|
* @param name - Package name
|
|
32
35
|
* @param version - Package version
|
|
33
36
|
* @throws {PackageNotFoundError} If package doesn't exist
|
|
34
37
|
*/
|
|
35
|
-
export declare function packageRemove(
|
|
38
|
+
export declare function packageRemove(storage: StorageBackend, repo: string, name: string, version: string): Promise<void>;
|
|
36
39
|
/**
|
|
37
40
|
* List all installed packages.
|
|
38
41
|
*
|
|
39
|
-
* @param
|
|
42
|
+
* @param storage - Storage backend
|
|
43
|
+
* @param repo - Repository identifier
|
|
40
44
|
* @returns Array of (name, version) pairs
|
|
41
45
|
*/
|
|
42
|
-
export declare function packageList(
|
|
46
|
+
export declare function packageList(storage: StorageBackend, repo: string): Promise<Array<{
|
|
43
47
|
name: string;
|
|
44
48
|
version: string;
|
|
45
49
|
}>>;
|
|
46
50
|
/**
|
|
47
51
|
* Get the latest version of a package.
|
|
48
52
|
*
|
|
49
|
-
* @param
|
|
53
|
+
* @param storage - Storage backend
|
|
54
|
+
* @param repo - Repository identifier
|
|
50
55
|
* @param name - Package name
|
|
51
56
|
* @returns Latest version string, or undefined if package not found
|
|
52
57
|
*/
|
|
53
|
-
export declare function packageGetLatestVersion(
|
|
58
|
+
export declare function packageGetLatestVersion(storage: StorageBackend, repo: string, name: string): Promise<string | undefined>;
|
|
54
59
|
/**
|
|
55
60
|
* Resolve a package to its PackageObject hash.
|
|
56
61
|
*
|
|
57
|
-
* @param
|
|
62
|
+
* @param storage - Storage backend
|
|
63
|
+
* @param repo - Repository identifier
|
|
58
64
|
* @param name - Package name
|
|
59
65
|
* @param version - Package version
|
|
60
66
|
* @returns PackageObject hash
|
|
61
67
|
* @throws {PackageNotFoundError} If package doesn't exist
|
|
62
68
|
*/
|
|
63
|
-
export declare function packageResolve(
|
|
69
|
+
export declare function packageResolve(storage: StorageBackend, repo: string, name: string, version: string): Promise<string>;
|
|
64
70
|
/**
|
|
65
71
|
* Read and parse a PackageObject.
|
|
66
72
|
*
|
|
67
|
-
* @param
|
|
73
|
+
* @param storage - Storage backend
|
|
74
|
+
* @param repo - Repository identifier
|
|
68
75
|
* @param name - Package name
|
|
69
76
|
* @param version - Package version
|
|
70
77
|
* @returns Parsed PackageObject
|
|
71
78
|
* @throws {PackageNotFoundError} If package doesn't exist
|
|
72
79
|
*/
|
|
73
|
-
export declare function packageRead(
|
|
80
|
+
export declare function packageRead(storage: StorageBackend, repo: string, name: string, version: string): Promise<PackageObject>;
|
|
74
81
|
/**
|
|
75
82
|
* Result of exporting a package
|
|
76
83
|
*/
|
|
@@ -83,11 +90,12 @@ export interface PackageExportResult {
|
|
|
83
90
|
*
|
|
84
91
|
* Collects the package object and all transitively referenced objects.
|
|
85
92
|
*
|
|
86
|
-
* @param
|
|
93
|
+
* @param storage - Storage backend
|
|
94
|
+
* @param repo - Repository identifier
|
|
87
95
|
* @param name - Package name
|
|
88
96
|
* @param version - Package version
|
|
89
97
|
* @param zipPath - Path to write the .zip file
|
|
90
98
|
* @returns Export result with package hash and object count
|
|
91
99
|
*/
|
|
92
|
-
export declare function packageExport(
|
|
100
|
+
export declare function packageExport(storage: StorageBackend, repo: string, name: string, version: string, zipPath: string): Promise<PackageExportResult>;
|
|
93
101
|
//# sourceMappingURL=packages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packages.d.ts","sourceRoot":"","sources":["../../src/packages.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"packages.d.ts","sourceRoot":"","sources":["../../src/packages.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,mBAAmB,CAAC,CA+D9B;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAQf;AAED;;;;;;GAMG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAEnD;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAO7B;AAED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,aAAa,CAAC,CAKxB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAOD;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,mBAAmB,CAAC,CAoG9B"}
|
package/dist/src/packages.js
CHANGED
|
@@ -10,23 +10,22 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import * as fs from 'fs/promises';
|
|
12
12
|
import { createWriteStream } from 'fs';
|
|
13
|
-
import * as path from 'path';
|
|
14
13
|
import yauzl from 'yauzl';
|
|
15
14
|
import yazl from 'yazl';
|
|
16
15
|
import { decodeBeast2For } from '@elaraai/east';
|
|
17
16
|
import { PackageObjectType } from '@elaraai/e3-types';
|
|
18
|
-
import {
|
|
19
|
-
import { PackageNotFoundError, PackageInvalidError, isNotFoundError, } from './errors.js';
|
|
17
|
+
import { PackageNotFoundError, PackageInvalidError, } from './errors.js';
|
|
20
18
|
/**
|
|
21
19
|
* Import a package from a .zip file into the repository.
|
|
22
20
|
*
|
|
23
21
|
* Extracts objects to `objects/`, creates ref at `packages/<name>/<version>`.
|
|
24
22
|
*
|
|
25
|
-
* @param
|
|
23
|
+
* @param storage - Storage backend
|
|
24
|
+
* @param repo - Repository identifier
|
|
26
25
|
* @param zipPath - Path to the .zip package file
|
|
27
26
|
* @returns Import result with package name, version, and stats
|
|
28
27
|
*/
|
|
29
|
-
export async function packageImport(
|
|
28
|
+
export async function packageImport(storage, repo, zipPath) {
|
|
30
29
|
// Open the zip file
|
|
31
30
|
const zipfile = await openZip(zipPath);
|
|
32
31
|
let packageName;
|
|
@@ -51,18 +50,15 @@ export async function packageImport(repoPath, zipPath) {
|
|
|
51
50
|
const data = await getData();
|
|
52
51
|
packageHash = data.toString('utf-8').trim();
|
|
53
52
|
// Write the ref to the repository
|
|
54
|
-
|
|
55
|
-
await fs.mkdir(refDir, { recursive: true });
|
|
56
|
-
const refPath = path.join(refDir, packageVersion);
|
|
57
|
-
await fs.writeFile(refPath, packageHash + '\n');
|
|
53
|
+
await storage.refs.packageWrite(repo, packageName, packageVersion, packageHash);
|
|
58
54
|
}
|
|
59
55
|
continue;
|
|
60
56
|
}
|
|
61
57
|
// Handle object: objects/<ab>/<cdef...>.beast2
|
|
62
58
|
if (fileName.startsWith('objects/')) {
|
|
63
59
|
const data = await getData();
|
|
64
|
-
// Store the object (
|
|
65
|
-
await
|
|
60
|
+
// Store the object (storage.objects.write will verify the hash matches)
|
|
61
|
+
await storage.objects.write(repo, data);
|
|
66
62
|
objectCount++;
|
|
67
63
|
continue;
|
|
68
64
|
}
|
|
@@ -88,67 +84,40 @@ export async function packageImport(repoPath, zipPath) {
|
|
|
88
84
|
*
|
|
89
85
|
* Objects remain until gc is run.
|
|
90
86
|
*
|
|
91
|
-
* @param
|
|
87
|
+
* @param storage - Storage backend
|
|
88
|
+
* @param repo - Repository identifier
|
|
92
89
|
* @param name - Package name
|
|
93
90
|
* @param version - Package version
|
|
94
91
|
* @throws {PackageNotFoundError} If package doesn't exist
|
|
95
92
|
*/
|
|
96
|
-
export async function packageRemove(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
catch (err) {
|
|
102
|
-
if (isNotFoundError(err)) {
|
|
103
|
-
throw new PackageNotFoundError(name, version);
|
|
104
|
-
}
|
|
105
|
-
throw err;
|
|
106
|
-
}
|
|
107
|
-
// Try to remove the package name directory if empty
|
|
108
|
-
const packageDir = path.join(repoPath, 'packages', name);
|
|
109
|
-
try {
|
|
110
|
-
await fs.rmdir(packageDir);
|
|
111
|
-
}
|
|
112
|
-
catch {
|
|
113
|
-
// Directory not empty, that's fine
|
|
93
|
+
export async function packageRemove(storage, repo, name, version) {
|
|
94
|
+
// Check if package exists first (storage.refs.packageRemove is idempotent)
|
|
95
|
+
const hash = await storage.refs.packageResolve(repo, name, version);
|
|
96
|
+
if (hash === null) {
|
|
97
|
+
throw new PackageNotFoundError(name, version);
|
|
114
98
|
}
|
|
99
|
+
await storage.refs.packageRemove(repo, name, version);
|
|
115
100
|
}
|
|
116
101
|
/**
|
|
117
102
|
* List all installed packages.
|
|
118
103
|
*
|
|
119
|
-
* @param
|
|
104
|
+
* @param storage - Storage backend
|
|
105
|
+
* @param repo - Repository identifier
|
|
120
106
|
* @returns Array of (name, version) pairs
|
|
121
107
|
*/
|
|
122
|
-
export async function packageList(
|
|
123
|
-
|
|
124
|
-
const packages = [];
|
|
125
|
-
try {
|
|
126
|
-
const names = await fs.readdir(packagesDir);
|
|
127
|
-
for (const name of names) {
|
|
128
|
-
const nameDir = path.join(packagesDir, name);
|
|
129
|
-
const stat = await fs.stat(nameDir);
|
|
130
|
-
if (stat.isDirectory()) {
|
|
131
|
-
const versions = await fs.readdir(nameDir);
|
|
132
|
-
for (const version of versions) {
|
|
133
|
-
packages.push({ name, version });
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
catch {
|
|
139
|
-
// packages directory doesn't exist or is empty
|
|
140
|
-
}
|
|
141
|
-
return packages;
|
|
108
|
+
export async function packageList(storage, repo) {
|
|
109
|
+
return storage.refs.packageList(repo);
|
|
142
110
|
}
|
|
143
111
|
/**
|
|
144
112
|
* Get the latest version of a package.
|
|
145
113
|
*
|
|
146
|
-
* @param
|
|
114
|
+
* @param storage - Storage backend
|
|
115
|
+
* @param repo - Repository identifier
|
|
147
116
|
* @param name - Package name
|
|
148
117
|
* @returns Latest version string, or undefined if package not found
|
|
149
118
|
*/
|
|
150
|
-
export async function packageGetLatestVersion(
|
|
151
|
-
const packages = await packageList(
|
|
119
|
+
export async function packageGetLatestVersion(storage, repo, name) {
|
|
120
|
+
const packages = await packageList(storage, repo);
|
|
152
121
|
const versions = packages
|
|
153
122
|
.filter(p => p.name === name)
|
|
154
123
|
.map(p => p.version)
|
|
@@ -158,37 +127,33 @@ export async function packageGetLatestVersion(repoPath, name) {
|
|
|
158
127
|
/**
|
|
159
128
|
* Resolve a package to its PackageObject hash.
|
|
160
129
|
*
|
|
161
|
-
* @param
|
|
130
|
+
* @param storage - Storage backend
|
|
131
|
+
* @param repo - Repository identifier
|
|
162
132
|
* @param name - Package name
|
|
163
133
|
* @param version - Package version
|
|
164
134
|
* @returns PackageObject hash
|
|
165
135
|
* @throws {PackageNotFoundError} If package doesn't exist
|
|
166
136
|
*/
|
|
167
|
-
export async function packageResolve(
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
return content.trim();
|
|
172
|
-
}
|
|
173
|
-
catch (err) {
|
|
174
|
-
if (isNotFoundError(err)) {
|
|
175
|
-
throw new PackageNotFoundError(name, version);
|
|
176
|
-
}
|
|
177
|
-
throw err;
|
|
137
|
+
export async function packageResolve(storage, repo, name, version) {
|
|
138
|
+
const hash = await storage.refs.packageResolve(repo, name, version);
|
|
139
|
+
if (hash === null) {
|
|
140
|
+
throw new PackageNotFoundError(name, version);
|
|
178
141
|
}
|
|
142
|
+
return hash;
|
|
179
143
|
}
|
|
180
144
|
/**
|
|
181
145
|
* Read and parse a PackageObject.
|
|
182
146
|
*
|
|
183
|
-
* @param
|
|
147
|
+
* @param storage - Storage backend
|
|
148
|
+
* @param repo - Repository identifier
|
|
184
149
|
* @param name - Package name
|
|
185
150
|
* @param version - Package version
|
|
186
151
|
* @returns Parsed PackageObject
|
|
187
152
|
* @throws {PackageNotFoundError} If package doesn't exist
|
|
188
153
|
*/
|
|
189
|
-
export async function packageRead(
|
|
190
|
-
const hash = await packageResolve(
|
|
191
|
-
const data = await
|
|
154
|
+
export async function packageRead(storage, repo, name, version) {
|
|
155
|
+
const hash = await packageResolve(storage, repo, name, version);
|
|
156
|
+
const data = await storage.objects.read(repo, hash);
|
|
192
157
|
const decoder = decodeBeast2For(PackageObjectType);
|
|
193
158
|
return decoder(Buffer.from(data));
|
|
194
159
|
}
|
|
@@ -201,16 +166,17 @@ const DETERMINISTIC_MTIME = new Date(0);
|
|
|
201
166
|
*
|
|
202
167
|
* Collects the package object and all transitively referenced objects.
|
|
203
168
|
*
|
|
204
|
-
* @param
|
|
169
|
+
* @param storage - Storage backend
|
|
170
|
+
* @param repo - Repository identifier
|
|
205
171
|
* @param name - Package name
|
|
206
172
|
* @param version - Package version
|
|
207
173
|
* @param zipPath - Path to write the .zip file
|
|
208
174
|
* @returns Export result with package hash and object count
|
|
209
175
|
*/
|
|
210
|
-
export async function packageExport(
|
|
176
|
+
export async function packageExport(storage, repo, name, version, zipPath) {
|
|
211
177
|
const partialPath = `${zipPath}.partial`;
|
|
212
178
|
// Resolve package to hash
|
|
213
|
-
const packageHash = await packageResolve(
|
|
179
|
+
const packageHash = await packageResolve(storage, repo, name, version);
|
|
214
180
|
// Create zip file
|
|
215
181
|
const zipfile = new yazl.ZipFile();
|
|
216
182
|
// Track which objects we've added to avoid duplicates
|
|
@@ -220,9 +186,9 @@ export async function packageExport(repoPath, name, version, zipPath) {
|
|
|
220
186
|
if (addedObjects.has(hash))
|
|
221
187
|
return;
|
|
222
188
|
addedObjects.add(hash);
|
|
223
|
-
const data = await
|
|
224
|
-
const
|
|
225
|
-
zipfile.addBuffer(Buffer.from(data),
|
|
189
|
+
const data = await storage.objects.read(repo, hash);
|
|
190
|
+
const objPath = `objects/${hash.slice(0, 2)}/${hash.slice(2)}.beast2`;
|
|
191
|
+
zipfile.addBuffer(Buffer.from(data), objPath, { mtime: DETERMINISTIC_MTIME });
|
|
226
192
|
};
|
|
227
193
|
// Helper to collect children from a tree object
|
|
228
194
|
// Tree objects are encoded as structs with DataRef fields
|
|
@@ -246,7 +212,7 @@ export async function packageExport(repoPath, name, version, zipPath) {
|
|
|
246
212
|
try {
|
|
247
213
|
await addObject(potentialHash);
|
|
248
214
|
// Recursively collect children from this object
|
|
249
|
-
const childData = await
|
|
215
|
+
const childData = await storage.objects.read(repo, potentialHash);
|
|
250
216
|
await collectTreeChildren(childData);
|
|
251
217
|
}
|
|
252
218
|
catch {
|
|
@@ -258,7 +224,7 @@ export async function packageExport(repoPath, name, version, zipPath) {
|
|
|
258
224
|
// Add the package object first
|
|
259
225
|
await addObject(packageHash);
|
|
260
226
|
// Load and parse the package object
|
|
261
|
-
const packageData = await
|
|
227
|
+
const packageData = await storage.objects.read(repo, packageHash);
|
|
262
228
|
const decoder = decodeBeast2For(PackageObjectType);
|
|
263
229
|
const packageObject = decoder(Buffer.from(packageData));
|
|
264
230
|
// Collect all task objects
|
|
@@ -270,7 +236,7 @@ export async function packageExport(repoPath, name, version, zipPath) {
|
|
|
270
236
|
// Collect the root tree and all its children
|
|
271
237
|
const rootTreeHash = packageObject.data.value;
|
|
272
238
|
await addObject(rootTreeHash);
|
|
273
|
-
const rootTreeData = await
|
|
239
|
+
const rootTreeData = await storage.objects.read(repo, rootTreeHash);
|
|
274
240
|
await collectTreeChildren(rootTreeData);
|
|
275
241
|
// Write the package ref
|
|
276
242
|
const refPath = `packages/${name}/${version}`;
|