deepbom 2.2.0 → 2.4.0
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/README.md +20 -7
- package/bin/deepbom.mjs +143 -89
- package/package.json +1 -1
- package/pkg/release-manifest.json +4 -4
- package/pkg/tflite_wasm_audit_bg.wasm +0 -0
- package/sdk/index.d.mts +15 -0
- package/sdk/index.mjs +19 -1
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "deepbom.npm_release.v1",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"source": {
|
|
5
|
-
"git_commit": "
|
|
5
|
+
"git_commit": "91e3c39cbe024964058df8dab5277a6cadf354a3",
|
|
6
6
|
"git_state": "clean",
|
|
7
7
|
"distribution": "public_channel"
|
|
8
8
|
},
|
|
9
9
|
"runtime": {
|
|
10
10
|
"node": ">=20",
|
|
11
|
-
"tflite_wasm_sha256": "
|
|
11
|
+
"tflite_wasm_sha256": "d99d5d4f377bc324ff71b7e3ca8b2a090bf075528e75579fd9a783b3cca82edd",
|
|
12
12
|
"self_test": {
|
|
13
13
|
"file": "bin/deepbom-self-test.onnx",
|
|
14
14
|
"sha256": "82a2feef00eb6ab03d82f2b30cd17f4d826e2d8307cb059eccd6a0f3120059b2"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"spdx": "Apache-2.0",
|
|
19
19
|
"file": "LICENSE"
|
|
20
20
|
},
|
|
21
|
-
"public_bundle_input_count":
|
|
21
|
+
"public_bundle_input_count": 236,
|
|
22
22
|
"supported_inputs": [
|
|
23
23
|
"tflite",
|
|
24
24
|
"onnx",
|
|
Binary file
|
package/sdk/index.d.mts
CHANGED
|
@@ -84,3 +84,18 @@ export function diff(baseline: string, candidate: string, options?: Limits & { t
|
|
|
84
84
|
export function captureContract(artifact: string, options?: Limits): Promise<JsonDocument>;
|
|
85
85
|
export function verifyContract(artifact: string, contract: string, options?: Limits): Promise<JsonDocument>;
|
|
86
86
|
export function verifyBom(artifact: string, bom: string, options?: Limits & { componentRef?: string }): Promise<JsonDocument>;
|
|
87
|
+
|
|
88
|
+
export interface EvidenceWorkflowRequest extends JsonDocument {
|
|
89
|
+
schema: "deepbom.evidence_workflow_request.v1";
|
|
90
|
+
operation: "snapshot" | "omop" | "protocol" | "evaluation" | "provenance" | "review" | "deployment" | "verify";
|
|
91
|
+
input: JsonDocument;
|
|
92
|
+
documents: JsonDocument[];
|
|
93
|
+
}
|
|
94
|
+
export interface EvidenceWorkflowResult extends JsonDocument {
|
|
95
|
+
schema: "deepbom.evidence_workflow_result.v1";
|
|
96
|
+
result_sha256: string;
|
|
97
|
+
document: JsonDocument;
|
|
98
|
+
request: EvidenceWorkflowRequest;
|
|
99
|
+
execution_status: "completed";
|
|
100
|
+
}
|
|
101
|
+
export function evidenceWorkflow(request: EvidenceWorkflowRequest | EvidenceWorkflowResult, options?: Limits & {files?: {sha256:string;path:string}[]}): Promise<EvidenceWorkflowResult>;
|
package/sdk/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Public Node SDK. All analysis and policy evaluation run in the packaged CLI. */
|
|
2
2
|
import { spawn } from "node:child_process";
|
|
3
|
-
import { mkdtemp, readFile, rm, stat } from "node:fs/promises";
|
|
3
|
+
import { mkdtemp, readFile, rm, stat, writeFile } from "node:fs/promises";
|
|
4
4
|
import { tmpdir } from "node:os";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
@@ -195,3 +195,21 @@ async function invoke(argv, options) {
|
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
+
|
|
199
|
+
/** The request and result contracts are shared with browser workers and MCP. */
|
|
200
|
+
export async function evidenceWorkflow(request, options = {}) {
|
|
201
|
+
checkOptions(options, [...limitKeys, "files"]);
|
|
202
|
+
if (!request || typeof request !== "object" || Array.isArray(request)) throw new TypeError("request must be a document");
|
|
203
|
+
const directory=await mkdtemp(path.join(tmpdir(),"deepbom-evidence-"));
|
|
204
|
+
try {
|
|
205
|
+
const filename=path.join(directory,"request.json");
|
|
206
|
+
const text=JSON.stringify(request);if(Buffer.byteLength(text)>16*1024*1024)throw new TypeError("Request exceeds 16 MiB");
|
|
207
|
+
await writeFile(filename,text,{mode:0o600});
|
|
208
|
+
const argv=["evidence-workflow",filename];
|
|
209
|
+
if(options.files!==undefined){
|
|
210
|
+
if(!Array.isArray(options.files)||options.files.length>256)throw new TypeError("files must be a bounded list");
|
|
211
|
+
for(const f of options.files){if(!f||Object.keys(f).some(k=>!["sha256","path"].includes(k))||!/^[a-f0-9]{64}$/.test(f.sha256))throw new TypeError("File needs sha256 and local path");argv.push("--file",f.sha256+":"+localPath(f.path));}
|
|
212
|
+
}
|
|
213
|
+
return await invoke(argv,options);
|
|
214
|
+
} finally { await rm(directory,{recursive:true,force:true}); }
|
|
215
|
+
}
|