@tangle-network/agent-provider-tangle 4.4.5 → 4.4.6
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.
|
@@ -18,6 +18,8 @@ export interface PreparedNativeEvidence {
|
|
|
18
18
|
native: RetainedNativeEvidence | undefined;
|
|
19
19
|
payloads: WeakMap<object, NativePayloadFile>;
|
|
20
20
|
directory?: string;
|
|
21
|
+
/** Wall time of the bounded export that copied the session's native store out of the sandbox. */
|
|
22
|
+
copyMs?: number;
|
|
21
23
|
remove(): Promise<void>;
|
|
22
24
|
}
|
|
23
25
|
export declare const MAX_METADATA_BYTES: number;
|
|
@@ -102,9 +102,11 @@ export async function prepareNativeDirectoryEvidence(session, maxBytes, signal)
|
|
|
102
102
|
const destination = join(temporary, "export");
|
|
103
103
|
const remove = () => rm(temporary, { recursive: true, force: true });
|
|
104
104
|
try {
|
|
105
|
+
const copyStarted = performance.now();
|
|
105
106
|
const response = record(await session.exportRawEvidence(destination, { maxBytes, maxFiles: MAX_ENTRIES, omitContent: NATIVE_OMIT_CONTENT_DIRECTORIES, signal }));
|
|
107
|
+
const copyMs = Math.round(performance.now() - copyStarted);
|
|
106
108
|
if (response.status === "unavailable") {
|
|
107
|
-
return { native: response, payloads: new WeakMap(), remove };
|
|
109
|
+
return { native: response, payloads: new WeakMap(), copyMs, remove };
|
|
108
110
|
}
|
|
109
111
|
if ((response.status !== "captured" && response.status !== "partial") || response.directory !== destination ||
|
|
110
112
|
typeof response.manifestPath !== "string" || !response.manifestPath.startsWith(destination + "/") ||
|
|
@@ -171,7 +173,7 @@ export async function prepareNativeDirectoryEvidence(session, maxBytes, signal)
|
|
|
171
173
|
const { schema: _schema, ...legacyMetadata } = manifest;
|
|
172
174
|
// The existing evidence validator checks all identity, attribution and completeness fields.
|
|
173
175
|
const native = { ...legacyMetadata, files, processIo, processTerminals, processSources, events };
|
|
174
|
-
return { native, payloads, directory: destination, remove };
|
|
176
|
+
return { native, payloads, directory: destination, copyMs, remove };
|
|
175
177
|
}
|
|
176
178
|
catch (error) {
|
|
177
179
|
await remove();
|
|
@@ -121,6 +121,11 @@ export interface TangleEnvironmentEvidence {
|
|
|
121
121
|
skippedEntries: number;
|
|
122
122
|
} | null;
|
|
123
123
|
complete: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Wall time, in ms, of the bounded export that copied this session's
|
|
126
|
+
* native store out of the sandbox. Directory capture only.
|
|
127
|
+
*/
|
|
128
|
+
copyMs?: number;
|
|
124
129
|
entries: Array<{
|
|
125
130
|
sourceId?: string;
|
|
126
131
|
rootScope: "session-home" | "workspace-session";
|
package/dist/tangle-evidence.js
CHANGED
|
@@ -502,6 +502,7 @@ async function captureSandboxEvidence(box, options, writer) {
|
|
|
502
502
|
};
|
|
503
503
|
const nativeStore = {
|
|
504
504
|
scope: "session", roots: [], inventory: null, complete: false, entries: [], excludedPaths: [],
|
|
505
|
+
...(prepared?.copyMs === undefined ? {} : { copyMs: prepared.copyMs }),
|
|
505
506
|
};
|
|
506
507
|
const processStreams = {
|
|
507
508
|
complete: false, streamCount: 0, processCount: 0, terminalCount: 0,
|