@euconform/core 1.4.0 → 1.6.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +46 -0
- package/dist/datasets/crows-pairs.d.ts +18 -0
- package/dist/datasets/crows-pairs.d.ts.map +1 -1
- package/dist/datasets/crows-pairs.js +58 -0
- package/dist/evidence/bias-comparison-markdown.d.ts +11 -0
- package/dist/evidence/bias-comparison-markdown.d.ts.map +1 -0
- package/dist/evidence/bias-comparison-markdown.js +120 -0
- package/dist/evidence/bias-comparison.d.ts +133 -0
- package/dist/evidence/bias-comparison.d.ts.map +1 -0
- package/dist/evidence/bias-comparison.js +274 -0
- package/dist/evidence/bias-statistics.d.ts +72 -0
- package/dist/evidence/bias-statistics.d.ts.map +1 -0
- package/dist/evidence/bias-statistics.js +122 -0
- package/dist/evidence/bias-v2-semantics.d.ts +19 -0
- package/dist/evidence/bias-v2-semantics.d.ts.map +1 -0
- package/dist/evidence/bias-v2-semantics.js +133 -0
- package/dist/evidence/browser.d.ts +18 -0
- package/dist/evidence/browser.d.ts.map +1 -0
- package/dist/evidence/browser.js +14 -0
- package/dist/evidence/bundle.d.ts +1 -0
- package/dist/evidence/bundle.d.ts.map +1 -1
- package/dist/evidence/bundle.js +2 -0
- package/dist/evidence/index.d.ts +9 -2
- package/dist/evidence/index.d.ts.map +1 -1
- package/dist/evidence/index.js +5 -1
- package/dist/evidence/output.d.ts.map +1 -1
- package/dist/evidence/output.js +1 -0
- package/dist/evidence/types.d.ts +183 -3
- package/dist/evidence/types.d.ts.map +1 -1
- package/dist/evidence/validate-bias-v2.d.ts +31 -0
- package/dist/evidence/validate-bias-v2.d.ts.map +1 -0
- package/dist/evidence/validate-bias-v2.js +40 -0
- package/dist/evidence/validate.d.ts +29 -2
- package/dist/evidence/validate.d.ts.map +1 -1
- package/dist/evidence/validate.js +96 -11
- package/dist/fairness-metrics.d.ts +15 -11
- package/dist/fairness-metrics.d.ts.map +1 -1
- package/dist/fairness-metrics.js +59 -183
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/inference/browser-inference.d.ts +6 -57
- package/dist/inference/browser-inference.d.ts.map +1 -1
- package/dist/inference/browser-inference.js +6 -219
- package/dist/inference/capability-detection.d.ts +9 -2
- package/dist/inference/capability-detection.d.ts.map +1 -1
- package/dist/inference/capability-detection.js +18 -16
- package/dist/inference/index.d.ts +15 -2
- package/dist/inference/index.d.ts.map +1 -1
- package/dist/inference/index.js +12 -3
- package/dist/inference/inference-factory.d.ts +6 -3
- package/dist/inference/inference-factory.d.ts.map +1 -1
- package/dist/inference/inference-factory.js +7 -26
- package/dist/inference/ollama-client.d.ts +29 -0
- package/dist/inference/ollama-client.d.ts.map +1 -1
- package/dist/inference/ollama-client.js +29 -0
- package/dist/inference/scored-log-prob-types.d.ts +64 -0
- package/dist/inference/scored-log-prob-types.d.ts.map +1 -0
- package/dist/inference/scored-log-prob-types.js +12 -0
- package/dist/inference/sequence-logprob.d.ts +34 -0
- package/dist/inference/sequence-logprob.d.ts.map +1 -0
- package/dist/inference/sequence-logprob.js +87 -0
- package/dist/inference/template-scoring.d.ts +124 -0
- package/dist/inference/template-scoring.d.ts.map +1 -0
- package/dist/inference/template-scoring.js +164 -0
- package/dist/inference/transformers-inference.d.ts +124 -0
- package/dist/inference/transformers-inference.d.ts.map +1 -0
- package/dist/inference/transformers-inference.js +392 -0
- package/dist/legal-checks/bias-metrics.d.ts +5 -7
- package/dist/legal-checks/bias-metrics.d.ts.map +1 -1
- package/dist/legal-checks/bias-metrics.js +8 -101
- package/dist/metrics/crows-pairs-bias.d.ts +17 -9
- package/dist/metrics/crows-pairs-bias.d.ts.map +1 -1
- package/dist/metrics/crows-pairs-bias.js +147 -59
- package/dist/metrics/stereotype-bias.d.ts +13 -5
- package/dist/metrics/stereotype-bias.d.ts.map +1 -1
- package/dist/metrics/stereotype-bias.js +16 -99
- package/dist/sbom/component-mapper.d.ts +26 -0
- package/dist/sbom/component-mapper.d.ts.map +1 -0
- package/dist/sbom/component-mapper.js +83 -0
- package/dist/sbom/cyclonedx-import.d.ts +34 -0
- package/dist/sbom/cyclonedx-import.d.ts.map +1 -0
- package/dist/sbom/cyclonedx-import.js +131 -0
- package/dist/sbom/index.d.ts +6 -0
- package/dist/sbom/index.d.ts.map +1 -0
- package/dist/sbom/index.js +4 -0
- package/dist/sbom/known-packages.d.ts +13 -0
- package/dist/sbom/known-packages.d.ts.map +1 -0
- package/dist/sbom/known-packages.js +129 -0
- package/dist/sbom/purl.d.ts +14 -0
- package/dist/sbom/purl.d.ts.map +1 -0
- package/dist/sbom/purl.js +56 -0
- package/dist/sbom/types.d.ts +39 -0
- package/dist/sbom/types.d.ts.map +1 -0
- package/dist/sbom/types.js +5 -0
- package/dist/scanner/detectors/ai-framework-detector.js +1 -1
- package/dist/scanner/detectors/local-inference-detector.d.ts.map +1 -1
- package/dist/scanner/detectors/local-inference-detector.js +1 -1
- package/dist/scanner/detectors/package-json-detector.d.ts.map +1 -1
- package/dist/scanner/detectors/package-json-detector.js +1 -0
- package/dist/types.d.ts +103 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/validation/index.d.ts +2 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +1 -0
- package/dist/validation/schema-validator.d.ts +18 -0
- package/dist/validation/schema-validator.d.ts.map +1 -0
- package/dist/validation/schema-validator.js +105 -0
- package/package.json +9 -3
- package/scripts/seed-logprob-fixture.mjs +179 -0
- package/scripts/ts-extensionless-resolve-hook.mjs +26 -0
- package/src/datasets/crows-pairs.ts +74 -0
- package/src/evidence/bias-comparison-markdown.ts +162 -0
- package/src/evidence/bias-comparison.ts +432 -0
- package/src/evidence/bias-statistics.ts +180 -0
- package/src/evidence/bias-v2-semantics.ts +214 -0
- package/src/evidence/browser.ts +35 -0
- package/src/evidence/bundle.ts +2 -0
- package/src/evidence/index.ts +31 -0
- package/src/evidence/output.ts +1 -0
- package/src/evidence/types.ts +213 -3
- package/src/evidence/validate-bias-v2.ts +47 -0
- package/src/evidence/validate.ts +151 -17
- package/src/fairness-metrics.ts +79 -222
- package/src/index.ts +7 -0
- package/src/inference/browser-inference.ts +14 -256
- package/src/inference/capability-detection.ts +32 -18
- package/src/inference/index.ts +33 -5
- package/src/inference/inference-factory.ts +9 -30
- package/src/inference/ollama-client.ts +29 -0
- package/src/inference/scored-log-prob-types.ts +66 -0
- package/src/inference/sequence-logprob.ts +136 -0
- package/src/inference/template-scoring.ts +248 -0
- package/src/inference/transformers-inference.ts +494 -0
- package/src/legal-checks/bias-metrics.ts +20 -118
- package/src/metrics/crows-pairs-bias.ts +180 -83
- package/src/metrics/stereotype-bias.ts +27 -119
- package/src/sbom/component-mapper.ts +107 -0
- package/src/sbom/cyclonedx-import.ts +198 -0
- package/src/sbom/index.ts +12 -0
- package/src/sbom/known-packages.ts +142 -0
- package/src/sbom/purl.ts +66 -0
- package/src/sbom/types.ts +34 -0
- package/src/scanner/detectors/ai-framework-detector.ts +1 -1
- package/src/scanner/detectors/local-inference-detector.ts +2 -1
- package/src/scanner/detectors/package-json-detector.ts +1 -0
- package/src/types.ts +108 -2
- package/src/validation/index.ts +7 -0
- package/src/validation/schema-validator.ts +147 -0
- package/tests/annex-iv-report.test.ts +1 -1
- package/tests/capability-detection.test.ts +57 -0
- package/tests/crows-pairs-bias.test.ts +286 -186
- package/tests/custom-dataset.test.ts +80 -0
- package/tests/evidence/bias-artifact-v2.test.ts +135 -0
- package/tests/evidence/bias-artifact.test.ts +78 -0
- package/tests/evidence/bias-comparison.test.ts +397 -0
- package/tests/evidence/bias-statistics.test.ts +191 -0
- package/tests/evidence/external-observation.test.ts +167 -0
- package/tests/evidence/spec-schemas.test.ts +35 -2
- package/tests/evidence/validate-bias-v2.test.ts +180 -0
- package/tests/fairness-metrics.test.ts +77 -1
- package/tests/fixtures/cyclonedx-minimal.json +13 -0
- package/tests/fixtures/cyclonedx-mixed.json +17 -0
- package/tests/fixtures/cyclonedx-ml-bom.json +25 -0
- package/tests/inference/browser-inference-scoring.test.ts +159 -0
- package/tests/inference/fixtures/logprob-golden.json +69 -0
- package/tests/inference/gemma-template.integration.test.ts +81 -0
- package/tests/inference/logprob-golden.integration.test.ts +128 -0
- package/tests/inference/synthetic-logits.test.ts +188 -0
- package/tests/inference/template-scoring.test.ts +249 -0
- package/tests/inference/transformers-inference-template-mode.test.ts +214 -0
- package/tests/integration/bias-calculation.integration.test.ts +119 -599
- package/tests/sbom/component-mapper.test.ts +258 -0
- package/tests/sbom/cyclonedx-import.test.ts +329 -0
- package/tests/sbom/purl.test.ts +102 -0
- package/tests/stilled-ollama-paths.test.ts +76 -0
- package/tests/validation/schema-validator.test.ts +219 -0
- package/src/inference/transformers.d.ts +0 -62
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { lookupKnownPackage } from "./known-packages";
|
|
2
|
+
import { parsePurl } from "./purl";
|
|
3
|
+
const CYCLONEDX_TYPE_MAP = {
|
|
4
|
+
"machine-learning-model": { kind: "model", confidence: "high" },
|
|
5
|
+
data: { kind: "dataset", confidence: "medium" },
|
|
6
|
+
platform: { kind: "inference-provider", confidence: "medium" },
|
|
7
|
+
service: { kind: "inference-provider", confidence: "medium" },
|
|
8
|
+
};
|
|
9
|
+
/** Tiers 7-8: Try to find a kind via purl namespace/name and name-only lookups. */
|
|
10
|
+
function lookupViaPurl(parsed) {
|
|
11
|
+
if (!parsed)
|
|
12
|
+
return null;
|
|
13
|
+
// Tier 7: namespace/name (e.g. @langchain/core)
|
|
14
|
+
if (parsed.namespace) {
|
|
15
|
+
const scopedName = `${parsed.namespace}/${parsed.name}`;
|
|
16
|
+
const scopedKind = lookupKnownPackage(scopedName);
|
|
17
|
+
if (scopedKind)
|
|
18
|
+
return { kind: scopedKind, confidence: "high" };
|
|
19
|
+
}
|
|
20
|
+
// Tier 8: purl name only
|
|
21
|
+
const purlKind = lookupKnownPackage(parsed.name);
|
|
22
|
+
if (purlKind)
|
|
23
|
+
return { kind: purlKind, confidence: "medium" };
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Map a CycloneDX component to an EuConform aibom component kind.
|
|
28
|
+
*
|
|
29
|
+
* 8-tier detection (descending priority):
|
|
30
|
+
* 1. ML-BOM extensions (modelCard, data)
|
|
31
|
+
* 2. CycloneDX component type mapping
|
|
32
|
+
* 3. Exact package name in registry
|
|
33
|
+
* 4. Explicit scoped name in registry (@langchain/core)
|
|
34
|
+
* 5. Scope mapping via KNOWN_AI_SCOPES (@langchain -> tool)
|
|
35
|
+
* 6. Scope-stripped name in registry (@huggingface/transformers -> transformers)
|
|
36
|
+
* 7. Purl namespace/name against registry
|
|
37
|
+
* 8. Purl name-only against registry
|
|
38
|
+
*
|
|
39
|
+
* Steps 3-6 are handled by lookupKnownPackage().
|
|
40
|
+
* Returns null if the component is not AI-relevant or has empty name.
|
|
41
|
+
*/
|
|
42
|
+
export function mapComponent(component) {
|
|
43
|
+
// Name validation
|
|
44
|
+
if (!component.name || component.name.trim() === "") {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
// Extract purl info (used for fallback and version)
|
|
48
|
+
const parsed = component.purl ? parsePurl(component.purl) : null;
|
|
49
|
+
const purlVersion = parsed?.version;
|
|
50
|
+
// Tier 1: ML-BOM extensions
|
|
51
|
+
if (component.modelCard != null) {
|
|
52
|
+
return { kind: "model", source: "sbom-import", confidence: "high", purlVersion };
|
|
53
|
+
}
|
|
54
|
+
if (Array.isArray(component.data) && component.data.some((d) => d.type === "dataset")) {
|
|
55
|
+
return { kind: "dataset", source: "sbom-import", confidence: "high", purlVersion };
|
|
56
|
+
}
|
|
57
|
+
// Tier 2: CycloneDX component type
|
|
58
|
+
const typeMapping = CYCLONEDX_TYPE_MAP[component.type];
|
|
59
|
+
if (typeMapping) {
|
|
60
|
+
return {
|
|
61
|
+
kind: typeMapping.kind,
|
|
62
|
+
source: "sbom-import",
|
|
63
|
+
confidence: typeMapping.confidence,
|
|
64
|
+
purlVersion,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
// Tiers 3-6: Known-package registry (handles exact, scoped, scope-fallback, scope-stripped)
|
|
68
|
+
const knownKind = lookupKnownPackage(component.name);
|
|
69
|
+
if (knownKind) {
|
|
70
|
+
return { kind: knownKind, source: "sbom-import", confidence: "high", purlVersion };
|
|
71
|
+
}
|
|
72
|
+
// Tiers 7-8: Purl fallback
|
|
73
|
+
const purlMatch = lookupViaPurl(parsed);
|
|
74
|
+
if (purlMatch) {
|
|
75
|
+
return {
|
|
76
|
+
kind: purlMatch.kind,
|
|
77
|
+
source: "sbom-import",
|
|
78
|
+
confidence: purlMatch.confidence,
|
|
79
|
+
purlVersion,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AiBillOfMaterials } from "../evidence/types";
|
|
2
|
+
import type { ValidationResult } from "../validation/schema-validator";
|
|
3
|
+
export interface ImportWarning {
|
|
4
|
+
component: string;
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ImportSourceInfo {
|
|
8
|
+
bomFormat: "CycloneDX";
|
|
9
|
+
specVersion: string;
|
|
10
|
+
projectNameSource: "metadata.component.name" | "sourcePath" | "fallback";
|
|
11
|
+
importTool?: string;
|
|
12
|
+
originalTimestamp?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ImportSummary {
|
|
15
|
+
totalComponents: number;
|
|
16
|
+
filteredByScope: number;
|
|
17
|
+
aiRelevant: number;
|
|
18
|
+
skipped: number;
|
|
19
|
+
duplicatesRemoved: number;
|
|
20
|
+
byKind: Record<string, number>;
|
|
21
|
+
warnings: ImportWarning[];
|
|
22
|
+
source: ImportSourceInfo;
|
|
23
|
+
}
|
|
24
|
+
export interface ImportOptions {
|
|
25
|
+
scope?: "all" | "production";
|
|
26
|
+
sourcePath?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface CycloneDxImportResult {
|
|
29
|
+
aibom: AiBillOfMaterials;
|
|
30
|
+
summary: ImportSummary;
|
|
31
|
+
validation: ValidationResult;
|
|
32
|
+
}
|
|
33
|
+
export declare function importCycloneDx(sbom: unknown, options?: ImportOptions): CycloneDxImportResult;
|
|
34
|
+
//# sourceMappingURL=cyclonedx-import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cyclonedx-import.d.ts","sourceRoot":"","sources":["../../src/sbom/cyclonedx-import.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAA+B,MAAM,mBAAmB,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAMvE,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,WAAW,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,yBAAyB,GAAG,YAAY,GAAG,UAAU,CAAC;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,QAAQ,EAAE,aAAa,EAAE,CAAC;IAC1B,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,KAAK,GAAG,YAAY,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,iBAAiB,CAAC;IACzB,OAAO,EAAE,aAAa,CAAC;IACvB,UAAU,EAAE,gBAAgB,CAAC;CAC9B;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,qBAAqB,CA2F7F"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { basename, extname } from "node:path";
|
|
2
|
+
import { validate } from "../validation/schema-validator";
|
|
3
|
+
import { mapComponent } from "./component-mapper";
|
|
4
|
+
import { SUPPORTED_SPEC_VERSIONS } from "./types";
|
|
5
|
+
export function importCycloneDx(sbom, options) {
|
|
6
|
+
const bom = parseBom(sbom);
|
|
7
|
+
const scope = options?.scope ?? "all";
|
|
8
|
+
const allComponents = bom.components ?? [];
|
|
9
|
+
const warnings = [];
|
|
10
|
+
const totalComponents = allComponents.length;
|
|
11
|
+
const inScope = scope === "production"
|
|
12
|
+
? allComponents.filter((c) => c.scope !== "optional" && c.scope !== "excluded")
|
|
13
|
+
: allComponents;
|
|
14
|
+
const filteredByScope = totalComponents - inScope.length;
|
|
15
|
+
const mapped = [];
|
|
16
|
+
for (const comp of inScope) {
|
|
17
|
+
const mapping = mapComponent(comp);
|
|
18
|
+
if (!mapping) {
|
|
19
|
+
if (!comp.name || comp.name.trim() === "") {
|
|
20
|
+
warnings.push({ component: "(empty)", message: "Skipped: missing or empty name" });
|
|
21
|
+
}
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
const version = comp.version || mapping.purlVersion;
|
|
25
|
+
if (!version) {
|
|
26
|
+
warnings.push({ component: comp.name, message: "Missing version field" });
|
|
27
|
+
}
|
|
28
|
+
mapped.push({
|
|
29
|
+
id: version ? `${mapping.kind}:${comp.name}:${version}` : `${mapping.kind}:${comp.name}`,
|
|
30
|
+
kind: mapping.kind,
|
|
31
|
+
name: comp.name,
|
|
32
|
+
...(version ? { version } : {}),
|
|
33
|
+
source: "sbom-import",
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const seen = new Set();
|
|
37
|
+
let duplicatesRemoved = 0;
|
|
38
|
+
const deduped = [];
|
|
39
|
+
for (const comp of mapped) {
|
|
40
|
+
if (seen.has(comp.id)) {
|
|
41
|
+
duplicatesRemoved++;
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
seen.add(comp.id);
|
|
45
|
+
deduped.push(comp);
|
|
46
|
+
}
|
|
47
|
+
const byKind = {};
|
|
48
|
+
for (const comp of deduped) {
|
|
49
|
+
byKind[comp.kind] = (byKind[comp.kind] ?? 0) + 1;
|
|
50
|
+
}
|
|
51
|
+
const { projectName, projectNameSource } = resolveProjectName(bom, options?.sourcePath);
|
|
52
|
+
const importTool = extractToolString(bom);
|
|
53
|
+
const originalTimestamp = bom.metadata?.timestamp;
|
|
54
|
+
const aibom = {
|
|
55
|
+
schemaVersion: "euconform.aibom.v1.1",
|
|
56
|
+
generatedAt: new Date().toISOString(),
|
|
57
|
+
project: { name: projectName, rootPath: "." },
|
|
58
|
+
components: deduped,
|
|
59
|
+
complianceCapabilities: {
|
|
60
|
+
biasEvaluation: false,
|
|
61
|
+
jsonExport: false,
|
|
62
|
+
pdfExport: false,
|
|
63
|
+
loggingInfrastructure: false,
|
|
64
|
+
humanReviewFlow: false,
|
|
65
|
+
incidentHandling: false,
|
|
66
|
+
},
|
|
67
|
+
metadata: buildMetadata(importTool, originalTimestamp),
|
|
68
|
+
};
|
|
69
|
+
const validation = validate(aibom);
|
|
70
|
+
return {
|
|
71
|
+
aibom,
|
|
72
|
+
summary: {
|
|
73
|
+
totalComponents,
|
|
74
|
+
filteredByScope,
|
|
75
|
+
aiRelevant: deduped.length,
|
|
76
|
+
skipped: inScope.length - mapped.length,
|
|
77
|
+
duplicatesRemoved,
|
|
78
|
+
byKind,
|
|
79
|
+
warnings,
|
|
80
|
+
source: buildSourceInfo(bom.specVersion, projectNameSource, importTool, originalTimestamp),
|
|
81
|
+
},
|
|
82
|
+
validation,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function resolveProjectName(bom, sourcePath) {
|
|
86
|
+
const metaName = bom.metadata?.component?.name;
|
|
87
|
+
if (metaName) {
|
|
88
|
+
return { projectName: metaName, projectNameSource: "metadata.component.name" };
|
|
89
|
+
}
|
|
90
|
+
if (sourcePath) {
|
|
91
|
+
const name = basename(sourcePath, extname(sourcePath));
|
|
92
|
+
return { projectName: name, projectNameSource: "sourcePath" };
|
|
93
|
+
}
|
|
94
|
+
return { projectName: "sbom-import", projectNameSource: "fallback" };
|
|
95
|
+
}
|
|
96
|
+
function extractToolString(bom) {
|
|
97
|
+
const tool = bom.metadata?.tools?.[0];
|
|
98
|
+
if (!tool?.name)
|
|
99
|
+
return undefined;
|
|
100
|
+
return tool.version ? `${tool.name} ${tool.version}` : tool.name;
|
|
101
|
+
}
|
|
102
|
+
function buildMetadata(importTool, originalTimestamp) {
|
|
103
|
+
const meta = { importSource: "cyclonedx" };
|
|
104
|
+
if (importTool)
|
|
105
|
+
meta.importTool = importTool;
|
|
106
|
+
if (originalTimestamp)
|
|
107
|
+
meta.originalTimestamp = originalTimestamp;
|
|
108
|
+
return meta;
|
|
109
|
+
}
|
|
110
|
+
function buildSourceInfo(specVersion, projectNameSource, importTool, originalTimestamp) {
|
|
111
|
+
const info = { bomFormat: "CycloneDX", specVersion, projectNameSource };
|
|
112
|
+
if (importTool)
|
|
113
|
+
info.importTool = importTool;
|
|
114
|
+
if (originalTimestamp)
|
|
115
|
+
info.originalTimestamp = originalTimestamp;
|
|
116
|
+
return info;
|
|
117
|
+
}
|
|
118
|
+
function parseBom(sbom) {
|
|
119
|
+
if (typeof sbom !== "object" || sbom === null) {
|
|
120
|
+
throw new Error("Input must be a JSON object");
|
|
121
|
+
}
|
|
122
|
+
const record = sbom;
|
|
123
|
+
if (record.bomFormat !== "CycloneDX") {
|
|
124
|
+
throw new Error(`Invalid bomFormat: expected "CycloneDX", got "${String(record.bomFormat)}"`);
|
|
125
|
+
}
|
|
126
|
+
const specVersion = String(record.specVersion ?? "");
|
|
127
|
+
if (!SUPPORTED_SPEC_VERSIONS.includes(specVersion)) {
|
|
128
|
+
throw new Error(`Unsupported specVersion "${specVersion}". Supported: ${SUPPORTED_SPEC_VERSIONS.join(", ")}`);
|
|
129
|
+
}
|
|
130
|
+
return sbom;
|
|
131
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { importCycloneDx, type CycloneDxImportResult, type ImportSummary, type ImportWarning, type ImportOptions, type ImportSourceInfo, } from "./cyclonedx-import";
|
|
2
|
+
export { mapComponent, type ComponentMapping } from "./component-mapper";
|
|
3
|
+
export { lookupKnownPackage, KNOWN_AI_PACKAGES, KNOWN_AI_SCOPES } from "./known-packages";
|
|
4
|
+
export { parsePurl, type ParsedPurl } from "./purl";
|
|
5
|
+
export type { CycloneDxBom, CycloneDxComponent } from "./types";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sbom/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,gBAAgB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpD,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BomComponentKind } from "../evidence/types";
|
|
2
|
+
export declare const KNOWN_AI_PACKAGES: Record<string, BomComponentKind>;
|
|
3
|
+
export declare const KNOWN_AI_SCOPES: Record<string, BomComponentKind>;
|
|
4
|
+
/**
|
|
5
|
+
* Look up a package name in the known AI packages registry.
|
|
6
|
+
* For scoped packages, tries:
|
|
7
|
+
* 1. Exact match (e.g. @langchain/core)
|
|
8
|
+
* 2. Scope match via KNOWN_AI_SCOPES (e.g. @langchain -> tool)
|
|
9
|
+
* 3. Strip scope, check bare name (e.g. @huggingface/transformers -> transformers)
|
|
10
|
+
* Returns the BomComponentKind if found, null otherwise.
|
|
11
|
+
*/
|
|
12
|
+
export declare function lookupKnownPackage(name: string): BomComponentKind | null;
|
|
13
|
+
//# sourceMappingURL=known-packages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"known-packages.d.ts","sourceRoot":"","sources":["../../src/sbom/known-packages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAiG9D,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAO5D,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAuBxE"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
export const KNOWN_AI_PACKAGES = {
|
|
2
|
+
// Models / model runtimes
|
|
3
|
+
"llama.cpp": "model",
|
|
4
|
+
"llama-cpp-python": "model",
|
|
5
|
+
"whisper.cpp": "model",
|
|
6
|
+
ggml: "model",
|
|
7
|
+
ctransformers: "model",
|
|
8
|
+
// AI Frameworks
|
|
9
|
+
transformers: "ai-framework",
|
|
10
|
+
torch: "ai-framework",
|
|
11
|
+
pytorch: "ai-framework",
|
|
12
|
+
tensorflow: "ai-framework",
|
|
13
|
+
"tensorflow-gpu": "ai-framework",
|
|
14
|
+
jax: "ai-framework",
|
|
15
|
+
keras: "ai-framework",
|
|
16
|
+
"pytorch-lightning": "ai-framework",
|
|
17
|
+
"scikit-learn": "ai-framework",
|
|
18
|
+
sklearn: "ai-framework",
|
|
19
|
+
xgboost: "ai-framework",
|
|
20
|
+
lightgbm: "ai-framework",
|
|
21
|
+
spacy: "ai-framework",
|
|
22
|
+
"huggingface-hub": "ai-framework",
|
|
23
|
+
diffusers: "ai-framework",
|
|
24
|
+
accelerate: "ai-framework",
|
|
25
|
+
peft: "ai-framework",
|
|
26
|
+
trl: "ai-framework",
|
|
27
|
+
onnxruntime: "ai-framework",
|
|
28
|
+
"onnxruntime-gpu": "ai-framework",
|
|
29
|
+
mlflow: "ai-framework",
|
|
30
|
+
// Embeddings
|
|
31
|
+
"sentence-transformers": "embedding",
|
|
32
|
+
fastembed: "embedding",
|
|
33
|
+
"openai-embeddings": "embedding",
|
|
34
|
+
"cohere-embed": "embedding",
|
|
35
|
+
// Inference Providers
|
|
36
|
+
openai: "inference-provider",
|
|
37
|
+
anthropic: "inference-provider",
|
|
38
|
+
ollama: "inference-provider",
|
|
39
|
+
vllm: "inference-provider",
|
|
40
|
+
"together-ai": "inference-provider",
|
|
41
|
+
replicate: "inference-provider",
|
|
42
|
+
groq: "inference-provider",
|
|
43
|
+
mistralai: "inference-provider",
|
|
44
|
+
cohere: "inference-provider",
|
|
45
|
+
"google-generativeai": "inference-provider",
|
|
46
|
+
ai21: "inference-provider",
|
|
47
|
+
// Vector Stores
|
|
48
|
+
pinecone: "vector-store",
|
|
49
|
+
"pinecone-client": "vector-store",
|
|
50
|
+
weaviate: "vector-store",
|
|
51
|
+
"weaviate-client": "vector-store",
|
|
52
|
+
qdrant: "vector-store",
|
|
53
|
+
"qdrant-client": "vector-store",
|
|
54
|
+
milvus: "vector-store",
|
|
55
|
+
pymilvus: "vector-store",
|
|
56
|
+
chromadb: "vector-store",
|
|
57
|
+
"chromadb-client": "vector-store",
|
|
58
|
+
pgvector: "vector-store",
|
|
59
|
+
faiss: "vector-store",
|
|
60
|
+
"faiss-cpu": "vector-store",
|
|
61
|
+
"faiss-gpu": "vector-store",
|
|
62
|
+
// Datasets
|
|
63
|
+
datasets: "dataset",
|
|
64
|
+
// Tools / Orchestration
|
|
65
|
+
langchain: "tool",
|
|
66
|
+
"langchain-core": "tool",
|
|
67
|
+
"langchain-community": "tool",
|
|
68
|
+
llamaindex: "tool",
|
|
69
|
+
"llama-index": "tool",
|
|
70
|
+
"semantic-kernel": "tool",
|
|
71
|
+
autogen: "tool",
|
|
72
|
+
crewai: "tool",
|
|
73
|
+
dspy: "tool",
|
|
74
|
+
"haystack-ai": "tool",
|
|
75
|
+
guidance: "tool",
|
|
76
|
+
guardrails: "tool",
|
|
77
|
+
"guardrails-ai": "tool",
|
|
78
|
+
lmql: "tool",
|
|
79
|
+
outlines: "tool",
|
|
80
|
+
// Scoped packages (npm)
|
|
81
|
+
"@langchain/core": "tool",
|
|
82
|
+
"@langchain/openai": "tool",
|
|
83
|
+
"@langchain/community": "tool",
|
|
84
|
+
"@langchain/anthropic": "tool",
|
|
85
|
+
"@huggingface/transformers": "ai-framework",
|
|
86
|
+
"@huggingface/inference": "inference-provider",
|
|
87
|
+
"@google/generative-ai": "inference-provider",
|
|
88
|
+
"@anthropic-ai/sdk": "inference-provider",
|
|
89
|
+
"@pinecone-database/pinecone": "vector-store",
|
|
90
|
+
"@qdrant/js-client-rest": "vector-store",
|
|
91
|
+
};
|
|
92
|
+
export const KNOWN_AI_SCOPES = {
|
|
93
|
+
"@langchain": "tool",
|
|
94
|
+
"@huggingface": "ai-framework",
|
|
95
|
+
"@tensorflow": "ai-framework",
|
|
96
|
+
"@anthropic-ai": "inference-provider",
|
|
97
|
+
"@pinecone-database": "vector-store",
|
|
98
|
+
"@qdrant": "vector-store",
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Look up a package name in the known AI packages registry.
|
|
102
|
+
* For scoped packages, tries:
|
|
103
|
+
* 1. Exact match (e.g. @langchain/core)
|
|
104
|
+
* 2. Scope match via KNOWN_AI_SCOPES (e.g. @langchain -> tool)
|
|
105
|
+
* 3. Strip scope, check bare name (e.g. @huggingface/transformers -> transformers)
|
|
106
|
+
* Returns the BomComponentKind if found, null otherwise.
|
|
107
|
+
*/
|
|
108
|
+
export function lookupKnownPackage(name) {
|
|
109
|
+
const lower = name.toLowerCase();
|
|
110
|
+
// 1. Exact match
|
|
111
|
+
const exact = KNOWN_AI_PACKAGES[lower];
|
|
112
|
+
if (exact)
|
|
113
|
+
return exact;
|
|
114
|
+
// Scoped package handling
|
|
115
|
+
if (lower.startsWith("@") && lower.includes("/")) {
|
|
116
|
+
const scopeEnd = lower.indexOf("/");
|
|
117
|
+
const scope = lower.slice(0, scopeEnd);
|
|
118
|
+
const bareName = lower.slice(scopeEnd + 1);
|
|
119
|
+
// 2. Known AI scope
|
|
120
|
+
const scopeKind = KNOWN_AI_SCOPES[scope];
|
|
121
|
+
if (scopeKind)
|
|
122
|
+
return scopeKind;
|
|
123
|
+
// 3. Strip scope, check bare name
|
|
124
|
+
const bareKind = KNOWN_AI_PACKAGES[bareName];
|
|
125
|
+
if (bareKind)
|
|
126
|
+
return bareKind;
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface ParsedPurl {
|
|
2
|
+
scheme: "pkg";
|
|
3
|
+
type: string;
|
|
4
|
+
namespace?: string;
|
|
5
|
+
name: string;
|
|
6
|
+
version?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Parse a Package URL (purl) string into its components.
|
|
10
|
+
* Follows the purl spec: pkg:type/namespace/name@version?qualifiers#subpath
|
|
11
|
+
* Returns null for invalid or non-pkg URLs.
|
|
12
|
+
*/
|
|
13
|
+
export declare function parsePurl(purl: string): ParsedPurl | null;
|
|
14
|
+
//# sourceMappingURL=purl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purl.d.ts","sourceRoot":"","sources":["../../src/sbom/purl.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,KAAK,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAoDzD"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse a Package URL (purl) string into its components.
|
|
3
|
+
* Follows the purl spec: pkg:type/namespace/name@version?qualifiers#subpath
|
|
4
|
+
* Returns null for invalid or non-pkg URLs.
|
|
5
|
+
*/
|
|
6
|
+
export function parsePurl(purl) {
|
|
7
|
+
if (!purl || !purl.startsWith("pkg:"))
|
|
8
|
+
return null;
|
|
9
|
+
// Strip qualifiers and subpath
|
|
10
|
+
let rest = purl.slice(4); // remove "pkg:"
|
|
11
|
+
const hashIdx = rest.indexOf("#");
|
|
12
|
+
if (hashIdx !== -1)
|
|
13
|
+
rest = rest.slice(0, hashIdx);
|
|
14
|
+
const queryIdx = rest.indexOf("?");
|
|
15
|
+
if (queryIdx !== -1)
|
|
16
|
+
rest = rest.slice(0, queryIdx);
|
|
17
|
+
// Split type from the rest: type/...
|
|
18
|
+
const slashIdx = rest.indexOf("/");
|
|
19
|
+
if (slashIdx <= 0)
|
|
20
|
+
return null;
|
|
21
|
+
const type = rest.slice(0, slashIdx);
|
|
22
|
+
let remainder = rest.slice(slashIdx + 1);
|
|
23
|
+
try {
|
|
24
|
+
remainder = decodeURIComponent(remainder);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
// Extract version
|
|
30
|
+
let version;
|
|
31
|
+
const atIdx = remainder.lastIndexOf("@");
|
|
32
|
+
if (atIdx !== -1) {
|
|
33
|
+
version = remainder.slice(atIdx + 1);
|
|
34
|
+
remainder = remainder.slice(0, atIdx);
|
|
35
|
+
}
|
|
36
|
+
// Split namespace/name (last segment is name, rest is namespace)
|
|
37
|
+
const lastSlash = remainder.lastIndexOf("/");
|
|
38
|
+
let namespace;
|
|
39
|
+
let name;
|
|
40
|
+
if (lastSlash !== -1) {
|
|
41
|
+
namespace = remainder.slice(0, lastSlash);
|
|
42
|
+
name = remainder.slice(lastSlash + 1);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
name = remainder;
|
|
46
|
+
}
|
|
47
|
+
if (!name)
|
|
48
|
+
return null;
|
|
49
|
+
return {
|
|
50
|
+
scheme: "pkg",
|
|
51
|
+
type,
|
|
52
|
+
namespace: namespace || undefined,
|
|
53
|
+
name,
|
|
54
|
+
version: version || undefined,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal CycloneDX types covering fields relevant to AI component detection.
|
|
3
|
+
* Supports CycloneDX JSON format versions 1.4, 1.5, 1.6.
|
|
4
|
+
*/
|
|
5
|
+
export interface CycloneDxBom {
|
|
6
|
+
bomFormat: "CycloneDX";
|
|
7
|
+
specVersion: string;
|
|
8
|
+
version?: number;
|
|
9
|
+
metadata?: CycloneDxMetadata;
|
|
10
|
+
components?: CycloneDxComponent[];
|
|
11
|
+
}
|
|
12
|
+
export interface CycloneDxMetadata {
|
|
13
|
+
timestamp?: string;
|
|
14
|
+
tools?: Array<{
|
|
15
|
+
name?: string;
|
|
16
|
+
version?: string;
|
|
17
|
+
}>;
|
|
18
|
+
component?: CycloneDxComponent;
|
|
19
|
+
}
|
|
20
|
+
export interface CycloneDxComponent {
|
|
21
|
+
type: string;
|
|
22
|
+
name: string;
|
|
23
|
+
version?: string;
|
|
24
|
+
purl?: string;
|
|
25
|
+
group?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
scope?: "required" | "optional" | "excluded";
|
|
28
|
+
properties?: Array<{
|
|
29
|
+
name: string;
|
|
30
|
+
value: string;
|
|
31
|
+
}>;
|
|
32
|
+
/** CycloneDX ML-BOM extensions (1.5+) */
|
|
33
|
+
modelCard?: unknown;
|
|
34
|
+
data?: Array<{
|
|
35
|
+
type?: string;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
export declare const SUPPORTED_SPEC_VERSIONS: readonly ["1.4", "1.5", "1.6"];
|
|
39
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sbom/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,WAAW,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,UAAU,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD,SAAS,CAAC,EAAE,kBAAkB,CAAC;CAChC;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;IAC7C,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpD,yCAAyC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjC;AAED,eAAO,MAAM,uBAAuB,gCAAiC,CAAC"}
|
|
@@ -18,7 +18,7 @@ const FRAMEWORK_IMPORTS = [
|
|
|
18
18
|
{
|
|
19
19
|
id: "ai-framework-transformers",
|
|
20
20
|
name: "Transformers.js",
|
|
21
|
-
importPattern: /(?:from\s+['"]
|
|
21
|
+
importPattern: /(?:from\s+['"](?:@xenova|@huggingface)\/transformers['"]|require\s*\(\s*['"](?:@xenova|@huggingface)\/transformers['"])/,
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
id: "ai-framework-vercel-ai",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-inference-detector.d.ts","sourceRoot":"","sources":["../../../src/scanner/detectors/local-inference-detector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EACd,eAAe,EAEhB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"local-inference-detector.d.ts","sourceRoot":"","sources":["../../../src/scanner/detectors/local-inference-detector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,cAAc,EACd,eAAe,EAEhB,MAAM,sBAAsB,CAAC;AAqG9B,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,eAAe,GAAG,cAAc,EAAE,CAkBlF"}
|
|
@@ -19,7 +19,7 @@ const RULES = [
|
|
|
19
19
|
{
|
|
20
20
|
id: "local-inference-transformers-browser",
|
|
21
21
|
name: "Transformers.js (browser inference)",
|
|
22
|
-
pattern: /(?:from\s+['"]
|
|
22
|
+
pattern: /(?:from\s+['"](?:@xenova|@huggingface)\/transformers['"]|\.pipeline\s*\(|env\.allowLocalModels)/,
|
|
23
23
|
confidence: "medium",
|
|
24
24
|
extensions: [".ts", ".tsx", ".js", ".jsx"],
|
|
25
25
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-json-detector.d.ts","sourceRoot":"","sources":["../../../src/scanner/detectors/package-json-detector.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAkB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"package-json-detector.d.ts","sourceRoot":"","sources":["../../../src/scanner/detectors/package-json-detector.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAkB,MAAM,sBAAsB,CAAC;AA8E5F,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,eAAe,GAAG,cAAc,EAAE,CAY/E"}
|
|
@@ -12,6 +12,7 @@ const AI_PACKAGES = {
|
|
|
12
12
|
"@langchain/core": { category: "ai-framework", label: "LangChain Core" },
|
|
13
13
|
llamaindex: { category: "ai-framework", label: "LlamaIndex" },
|
|
14
14
|
"@xenova/transformers": { category: "ai-framework", label: "Transformers.js" },
|
|
15
|
+
"@huggingface/transformers": { category: "ai-framework", label: "Transformers.js" },
|
|
15
16
|
ai: { category: "ai-framework", label: "Vercel AI SDK" },
|
|
16
17
|
"@huggingface/inference": { category: "ai-framework", label: "HuggingFace Inference" },
|
|
17
18
|
// Local inference
|