chore: merge main into persistent workspace branch

This commit is contained in:
N0zoM1z0
2026-07-13 20:19:07 +08:00
47 changed files with 2741 additions and 1277 deletions
+16 -5
View File
@@ -32,6 +32,8 @@ const IDENTITY: ProviderIdentity = Object.freeze(ARTIFACT_GRAPH_PROVIDER);
/** Read-only inventory and exclusively owned extraction provider. */
export class ArtifactProvider implements AnalysisProvider {
constructor(private readonly nativeMountEnabled = false) {}
readonly #capabilities: readonly CapabilityDescriptor[] = Object.freeze(
ARTIFACT_TOOL_CONTRACTS.map((contract) =>
Object.freeze({
@@ -58,8 +60,8 @@ export class ArtifactProvider implements AnalysisProvider {
timeoutMs: 120_000,
}),
limitations: Object.freeze([
"DMG and PKG child inventory requires a future native read-only adapter.",
"Nested containers are recorded but not recursively expanded implicitly.",
"DMG child inventory is macOS-only and requires per-call approval plus operator policy; PKG remains root-hash-only.",
"ASAR files discovered in filesystem-backed inventories are expanded without bulk extraction; other nested containers remain recorded only.",
]),
}),
),
@@ -74,12 +76,15 @@ export class ArtifactProvider implements AnalysisProvider {
}
createClient(target: BinaryTarget): AnalysisClient {
return new ArtifactClient(target);
return new ArtifactClient(target, this.nativeMountEnabled);
}
}
class ArtifactClient implements AnalysisClient {
constructor(private readonly target: BinaryTarget) {}
constructor(
private readonly target: BinaryTarget,
private readonly nativeMountEnabled: boolean,
) {}
async execute(
operation: AnalysisOperation,
@@ -140,7 +145,13 @@ class ArtifactClient implements AnalysisClient {
edgeOffset: parsed.edge_offset,
edgeLimit: parsed.edge_limit,
},
options?.signal,
{
...(options?.signal === undefined ? {} : { signal: options.signal }),
nativeMount: {
nativeMountApproved: parsed.native_mount_approved === true,
nativeMountEnabled: this.nativeMountEnabled,
},
},
);
return ok(
createAnalysisExecution(result, IDENTITY, {