portable-agent-layer 0.89.0 → 0.89.1
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/package.json
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Archive metadata naming the machine that produced it. */
|
|
2
|
+
export const MANIFEST_NAME = "export-manifest.json";
|
|
3
|
+
|
|
4
|
+
export interface ExportManifest {
|
|
5
|
+
machineId: string;
|
|
6
|
+
label: string;
|
|
7
|
+
os: string;
|
|
8
|
+
exportedAt: string;
|
|
9
|
+
fileCount: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function buildManifest(
|
|
13
|
+
identity: { id: string; label: string; os: string },
|
|
14
|
+
fileCount: number
|
|
15
|
+
): ExportManifest {
|
|
16
|
+
return {
|
|
17
|
+
machineId: identity.id,
|
|
18
|
+
label: identity.label,
|
|
19
|
+
os: identity.os,
|
|
20
|
+
exportedAt: new Date().toISOString(),
|
|
21
|
+
fileCount,
|
|
22
|
+
};
|
|
23
|
+
}
|
package/src/hooks/lib/export.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { existsSync, readdirSync } from "node:fs";
|
|
|
7
7
|
import { relative, resolve } from "node:path";
|
|
8
8
|
import AdmZip from "adm-zip";
|
|
9
9
|
import { ensureActorRegistered } from "./actor";
|
|
10
|
+
import { buildManifest, MANIFEST_NAME } from "./export-manifest";
|
|
10
11
|
import { ensureRegistered } from "./machine";
|
|
11
12
|
import { palHome } from "./paths";
|
|
12
13
|
|
|
@@ -61,30 +62,6 @@ export function collectExportFiles(): string[] {
|
|
|
61
62
|
return files;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
/** Archive metadata naming the machine that produced it. */
|
|
65
|
-
export const MANIFEST_NAME = "export-manifest.json";
|
|
66
|
-
|
|
67
|
-
export interface ExportManifest {
|
|
68
|
-
machineId: string;
|
|
69
|
-
label: string;
|
|
70
|
-
os: string;
|
|
71
|
-
exportedAt: string;
|
|
72
|
-
fileCount: number;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export function buildManifest(
|
|
76
|
-
identity: { id: string; label: string; os: string },
|
|
77
|
-
fileCount: number
|
|
78
|
-
): ExportManifest {
|
|
79
|
-
return {
|
|
80
|
-
machineId: identity.id,
|
|
81
|
-
label: identity.label,
|
|
82
|
-
os: identity.os,
|
|
83
|
-
exportedAt: new Date().toISOString(),
|
|
84
|
-
fileCount,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
|
|
88
65
|
/**
|
|
89
66
|
* Zip the given files and write to outputPath. Returns file count.
|
|
90
67
|
*
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
20
20
|
import { dirname, resolve } from "node:path";
|
|
21
|
-
import { type ExportManifest, MANIFEST_NAME } from "./export";
|
|
21
|
+
import { type ExportManifest, MANIFEST_NAME } from "./export-manifest";
|
|
22
22
|
|
|
23
23
|
/** One file inside an export archive, decoupled from the zip library. */
|
|
24
24
|
export interface ArchiveEntry {
|