circle-ir-ai 4.30.0 → 4.32.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/CHANGELOG.md +153 -13
- package/README.md +3 -3
- package/dist/agents/mastra/swarm.d.ts.map +1 -1
- package/dist/agents/mastra/swarm.js +9 -3
- package/dist/agents/mastra/swarm.js.map +1 -1
- package/dist/agents/mastra/workflow.d.ts +3 -1
- package/dist/agents/mastra/workflow.d.ts.map +1 -1
- package/dist/agents/mastra/workflow.js +13 -5
- package/dist/agents/mastra/workflow.js.map +1 -1
- package/dist/blast-radius/index.d.ts +51 -0
- package/dist/blast-radius/index.d.ts.map +1 -0
- package/dist/blast-radius/index.js +462 -0
- package/dist/blast-radius/index.js.map +1 -0
- package/dist/blast-radius/manifest.d.ts +13 -0
- package/dist/blast-radius/manifest.d.ts.map +1 -0
- package/dist/blast-radius/manifest.js +54 -0
- package/dist/blast-radius/manifest.js.map +1 -0
- package/dist/blast-radius/radius.d.ts +138 -0
- package/dist/blast-radius/radius.d.ts.map +1 -0
- package/dist/blast-radius/radius.js +278 -0
- package/dist/blast-radius/radius.js.map +1 -0
- package/dist/blast-radius/types.d.ts +99 -0
- package/dist/blast-radius/types.d.ts.map +1 -0
- package/dist/blast-radius/types.js +15 -0
- package/dist/blast-radius/types.js.map +1 -0
- package/dist/bom/assemble.d.ts +4 -0
- package/dist/bom/assemble.d.ts.map +1 -1
- package/dist/bom/assemble.js +12 -1
- package/dist/bom/assemble.js.map +1 -1
- package/dist/bom/classify.d.ts +6 -2
- package/dist/bom/classify.d.ts.map +1 -1
- package/dist/bom/classify.js +2 -1
- package/dist/bom/classify.js.map +1 -1
- package/dist/bom/index.d.ts +69 -8
- package/dist/bom/index.d.ts.map +1 -1
- package/dist/bom/index.js +222 -62
- package/dist/bom/index.js.map +1 -1
- package/dist/bom/lockfiles.d.ts +73 -0
- package/dist/bom/lockfiles.d.ts.map +1 -0
- package/dist/bom/lockfiles.js +408 -0
- package/dist/bom/lockfiles.js.map +1 -0
- package/dist/bom/osgi-libraries.d.ts +93 -0
- package/dist/bom/osgi-libraries.d.ts.map +1 -0
- package/dist/bom/osgi-libraries.js +333 -0
- package/dist/bom/osgi-libraries.js.map +1 -0
- package/dist/bom/osgi.d.ts +72 -0
- package/dist/bom/osgi.d.ts.map +1 -0
- package/dist/bom/osgi.js +295 -0
- package/dist/bom/osgi.js.map +1 -0
- package/dist/bom/types.d.ts +22 -0
- package/dist/bom/types.d.ts.map +1 -1
- package/dist/bom/unread.d.ts +56 -0
- package/dist/bom/unread.d.ts.map +1 -0
- package/dist/bom/unread.js +187 -0
- package/dist/bom/unread.js.map +1 -0
- package/dist/bom/usage.d.ts +44 -1
- package/dist/bom/usage.d.ts.map +1 -1
- package/dist/bom/usage.js +110 -33
- package/dist/bom/usage.js.map +1 -1
- package/dist/grid/index.d.ts +169 -0
- package/dist/grid/index.d.ts.map +1 -0
- package/dist/grid/index.js +250 -0
- package/dist/grid/index.js.map +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/llm/ax-client.d.ts +12 -0
- package/dist/llm/ax-client.d.ts.map +1 -1
- package/dist/llm/ax-client.js +69 -8
- package/dist/llm/ax-client.js.map +1 -1
- package/dist/llm/config.d.ts +15 -2
- package/dist/llm/config.d.ts.map +1 -1
- package/dist/llm/config.js +106 -47
- package/dist/llm/config.js.map +1 -1
- package/dist/llm/discovery.d.ts.map +1 -1
- package/dist/llm/discovery.js +6 -1
- package/dist/llm/discovery.js.map +1 -1
- package/dist/llm/index.d.ts +1 -0
- package/dist/llm/index.d.ts.map +1 -1
- package/dist/llm/index.js +2 -0
- package/dist/llm/index.js.map +1 -1
- package/dist/llm/model-route.d.ts +139 -0
- package/dist/llm/model-route.d.ts.map +1 -0
- package/dist/llm/model-route.js +256 -0
- package/dist/llm/model-route.js.map +1 -0
- package/dist/llm/verification.d.ts.map +1 -1
- package/dist/llm/verification.js +5 -1
- package/dist/llm/verification.js.map +1 -1
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +11 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/tools/blast-radius.d.ts +14 -0
- package/dist/mcp/tools/blast-radius.d.ts.map +1 -0
- package/dist/mcp/tools/blast-radius.js +105 -0
- package/dist/mcp/tools/blast-radius.js.map +1 -0
- package/dist/mcp/tools/detect-selectors.d.ts +14 -0
- package/dist/mcp/tools/detect-selectors.d.ts.map +1 -0
- package/dist/mcp/tools/detect-selectors.js +86 -0
- package/dist/mcp/tools/detect-selectors.js.map +1 -0
- package/dist/mcp/tools/find-credential-exposure.d.ts.map +1 -1
- package/dist/mcp/tools/find-credential-exposure.js +2 -1
- package/dist/mcp/tools/find-credential-exposure.js.map +1 -1
- package/dist/mcp/tools/layer-bom.d.ts.map +1 -1
- package/dist/mcp/tools/layer-bom.js +6 -0
- package/dist/mcp/tools/layer-bom.js.map +1 -1
- package/dist/mcp/tools/layer-grid.d.ts +12 -0
- package/dist/mcp/tools/layer-grid.d.ts.map +1 -0
- package/dist/mcp/tools/layer-grid.js +56 -0
- package/dist/mcp/tools/layer-grid.js.map +1 -0
- package/dist/project/analyzer.d.ts +3 -1
- package/dist/project/analyzer.d.ts.map +1 -1
- package/dist/project/analyzer.js +12 -3
- package/dist/project/analyzer.js.map +1 -1
- package/dist/secret-scan/history-patterns.d.ts +6 -0
- package/dist/secret-scan/history-patterns.d.ts.map +1 -1
- package/dist/secret-scan/history-patterns.js +2 -1
- package/dist/secret-scan/history-patterns.js.map +1 -1
- package/dist/secret-scan/index.d.ts +1 -1
- package/dist/secret-scan/index.d.ts.map +1 -1
- package/dist/secret-scan/index.js +1 -1
- package/dist/secret-scan/index.js.map +1 -1
- package/dist/secret-scan/scanner.d.ts +59 -0
- package/dist/secret-scan/scanner.d.ts.map +1 -1
- package/dist/secret-scan/scanner.js +413 -16
- package/dist/secret-scan/scanner.js.map +1 -1
- package/dist/security-scan/scanner.d.ts +6 -0
- package/dist/security-scan/scanner.d.ts.map +1 -1
- package/dist/security-scan/scanner.js +90 -11
- package/dist/security-scan/scanner.js.map +1 -1
- package/dist/selectors/canonical.d.ts +46 -0
- package/dist/selectors/canonical.d.ts.map +1 -0
- package/dist/selectors/canonical.js +106 -0
- package/dist/selectors/canonical.js.map +1 -0
- package/dist/selectors/detect.d.ts +50 -0
- package/dist/selectors/detect.d.ts.map +1 -0
- package/dist/selectors/detect.js +459 -0
- package/dist/selectors/detect.js.map +1 -0
- package/dist/selectors/exclude.d.ts +29 -0
- package/dist/selectors/exclude.d.ts.map +1 -0
- package/dist/selectors/exclude.js +63 -0
- package/dist/selectors/exclude.js.map +1 -0
- package/dist/selectors/facts.d.ts +92 -0
- package/dist/selectors/facts.d.ts.map +1 -0
- package/dist/selectors/facts.js +312 -0
- package/dist/selectors/facts.js.map +1 -0
- package/dist/selectors/index.d.ts +42 -0
- package/dist/selectors/index.d.ts.map +1 -0
- package/dist/selectors/index.js +54 -0
- package/dist/selectors/index.js.map +1 -0
- package/dist/selectors/rules.d.ts +126 -0
- package/dist/selectors/rules.d.ts.map +1 -0
- package/dist/selectors/rules.js +340 -0
- package/dist/selectors/rules.js.map +1 -0
- package/dist/selectors/taxonomy.d.ts +35 -0
- package/dist/selectors/taxonomy.d.ts.map +1 -0
- package/dist/selectors/taxonomy.js +317 -0
- package/dist/selectors/taxonomy.js.map +1 -0
- package/dist/selectors/types.d.ts +104 -0
- package/dist/selectors/types.d.ts.map +1 -0
- package/dist/selectors/types.js +16 -0
- package/dist/selectors/types.js.map +1 -0
- package/dist/skills/capability-mismatch.d.ts +30 -0
- package/dist/skills/capability-mismatch.d.ts.map +1 -1
- package/dist/skills/capability-mismatch.js +24 -0
- package/dist/skills/capability-mismatch.js.map +1 -1
- package/dist/skills/code-threat-patterns.d.ts +10 -0
- package/dist/skills/code-threat-patterns.d.ts.map +1 -1
- package/dist/skills/code-threat-patterns.js +166 -21
- package/dist/skills/code-threat-patterns.js.map +1 -1
- package/dist/skills/precision.d.ts.map +1 -1
- package/dist/skills/precision.js +11 -10
- package/dist/skills/precision.js.map +1 -1
- package/dist/specifica/evidence-aggregator.d.ts.map +1 -1
- package/dist/specifica/evidence-aggregator.js +4 -0
- package/dist/specifica/evidence-aggregator.js.map +1 -1
- package/dist/specifica/evidence-extractor.d.ts.map +1 -1
- package/dist/specifica/evidence-extractor.js +8 -2
- package/dist/specifica/evidence-extractor.js.map +1 -1
- package/dist/specifica/generator.d.ts.map +1 -1
- package/dist/specifica/generator.js +45 -5
- package/dist/specifica/generator.js.map +1 -1
- package/dist/specifica/provenance.d.ts +30 -3
- package/dist/specifica/provenance.d.ts.map +1 -1
- package/dist/specifica/provenance.js +34 -0
- package/dist/specifica/provenance.js.map +1 -1
- package/dist/specifica/spec-generator.d.ts.map +1 -1
- package/dist/specifica/spec-generator.js +24 -3
- package/dist/specifica/spec-generator.js.map +1 -1
- package/dist/specifica/ts-rule-sources.d.ts +32 -5
- package/dist/specifica/ts-rule-sources.d.ts.map +1 -1
- package/dist/specifica/ts-rule-sources.js +190 -8
- package/dist/specifica/ts-rule-sources.js.map +1 -1
- package/dist/specifica/types.d.ts +17 -2
- package/dist/specifica/types.d.ts.map +1 -1
- package/dist/trust/passes/code-complexity.d.ts +1 -1
- package/dist/trust/passes/code-complexity.d.ts.map +1 -1
- package/dist/trust/passes/code-complexity.js +18 -13
- package/dist/trust/passes/code-complexity.js.map +1 -1
- package/dist/trust/passes/hardcoded-secrets.d.ts.map +1 -1
- package/dist/trust/passes/hardcoded-secrets.js +9 -2
- package/dist/trust/passes/hardcoded-secrets.js.map +1 -1
- package/dist/trust/passes/input-validation.d.ts.map +1 -1
- package/dist/trust/passes/input-validation.js +4 -0
- package/dist/trust/passes/input-validation.js.map +1 -1
- package/dist/trust/passes/missing-guard-dom.d.ts.map +1 -1
- package/dist/trust/passes/missing-guard-dom.js +48 -1
- package/dist/trust/passes/missing-guard-dom.js.map +1 -1
- package/dist/utils/nearest-java-manifests.d.ts +9 -0
- package/dist/utils/nearest-java-manifests.d.ts.map +1 -0
- package/dist/utils/nearest-java-manifests.js +51 -0
- package/dist/utils/nearest-java-manifests.js.map +1 -0
- package/dist/utils/nearest-npm-manifests.d.ts +10 -0
- package/dist/utils/nearest-npm-manifests.d.ts.map +1 -0
- package/dist/utils/nearest-npm-manifests.js +42 -0
- package/dist/utils/nearest-npm-manifests.js.map +1 -0
- package/dist/utils/nearest-python-manifests.d.ts +9 -0
- package/dist/utils/nearest-python-manifests.d.ts.map +1 -0
- package/dist/utils/nearest-python-manifests.js +41 -0
- package/dist/utils/nearest-python-manifests.js.map +1 -0
- package/dist/utils/nearest-scan-dependency-context.d.ts +12 -0
- package/dist/utils/nearest-scan-dependency-context.d.ts.map +1 -0
- package/dist/utils/nearest-scan-dependency-context.js +21 -0
- package/dist/utils/nearest-scan-dependency-context.js.map +1 -0
- package/package.json +6 -6
- package/dist/coverage/index.d.ts +0 -50
- package/dist/coverage/index.d.ts.map +0 -1
- package/dist/coverage/index.js +0 -73
- package/dist/coverage/index.js.map +0 -1
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OSGi inventory rows → libraries.
|
|
3
|
+
*
|
|
4
|
+
* A bundle manifest's versioned `Import-Package` names one Java package per
|
|
5
|
+
* clause, so an Eclipse / Tycho repository read row by row lists hundreds of
|
|
6
|
+
* packages (`org.apache.xerces.impl.dv`, `org.apache.xerces.impl.xs`, …)
|
|
7
|
+
* where it uses a few libraries, and the same library twice: as an OSGi
|
|
8
|
+
* bundle (`org.postgresql.jdbc`) and as the Maven coordinate the target
|
|
9
|
+
* platform pulls it from (`org.postgresql:postgresql`). The inventory counts
|
|
10
|
+
* libraries, so after the walk:
|
|
11
|
+
*
|
|
12
|
+
* 1. an imported package collapses to the library that provides it:
|
|
13
|
+
* a. the repository's own bundles: a package one of its manifests exports,
|
|
14
|
+
* or under one of its `Bundle-SymbolicName`s, is its own code (dropped);
|
|
15
|
+
* b. a required or target-platform bundle whose symbolic name is the
|
|
16
|
+
* package or a prefix of it (the longest such name), or
|
|
17
|
+
* c. a Maven coordinate of a `.target` whose groupId is the package or a
|
|
18
|
+
* prefix of it (the longest groupId; among the group's artifacts, the
|
|
19
|
+
* one the package names, else none). When both b and c match, the
|
|
20
|
+
* longer prefix wins, a tie going to the bundle (`org.junit.jupiter.api`
|
|
21
|
+
* is `org.junit.jupiter:junit-jupiter-api`, not the `org.junit` bundle);
|
|
22
|
+
* else a `.target` artifactId whose dashed parts spell the end of a
|
|
23
|
+
* package prefix (`commons-codec` for `org.apache.commons.codec.binary`);
|
|
24
|
+
* d. otherwise one row per package root: the target groupId it falls under,
|
|
25
|
+
* else the first three segments under a reverse-domain name
|
|
26
|
+
* (`org.apache.xerces`), else the first two (`javax.servlet`); or, when
|
|
27
|
+
* shorter, the root of another such package that is a prefix of it
|
|
28
|
+
* (`org.slf4j.spi` under an imported `org.slf4j`).
|
|
29
|
+
* The library's row keeps how many imported packages it stands for
|
|
30
|
+
* (`packages`).
|
|
31
|
+
* 2. an OSGi row and a Maven row for the same library become the Maven row
|
|
32
|
+
* (with its version, else the bundle's), the bundle name kept in `aliases`
|
|
33
|
+
* (see `mavenFor`): Tycho's wrapper name `wrapped.<groupId>.<artifactId>`,
|
|
34
|
+
* the `Bundle-SymbolicName` a `.target` location's `<instructions>` give
|
|
35
|
+
* the jar, a bundle spelled from the coordinate, or the groupId of a group
|
|
36
|
+
* whose artifact is named like it (`com.google.guava` → `guava`).
|
|
37
|
+
*
|
|
38
|
+
* Only OSGi rows trigger any of this: an inventory without them is returned
|
|
39
|
+
* as it is. The repository's own Maven modules (`org.idempiere:*`) are kept;
|
|
40
|
+
* selector detection reads them for the domain.
|
|
41
|
+
*
|
|
42
|
+
* Pure and deterministic: the same rows and facts give the same output, in
|
|
43
|
+
* the same order (rows that stay keep their order; package roots follow,
|
|
44
|
+
* sorted by name).
|
|
45
|
+
*/
|
|
46
|
+
import { parseOsgiManifest, parseTargetBundleNames, parseTychoTarget } from './osgi.js';
|
|
47
|
+
export function newOsgiFacts() {
|
|
48
|
+
return { ownBundles: new Set(), ownPackages: new Set(), importedPackages: new Set(), bundles: new Set(), targetMaven: new Set(), bundleAliases: new Map() };
|
|
49
|
+
}
|
|
50
|
+
/** Record what one `META-INF/MANIFEST.MF` or `.target` file says (any other file: nothing). */
|
|
51
|
+
export function observeOsgiFile(facts, base, text) {
|
|
52
|
+
if (base === 'MANIFEST.MF') {
|
|
53
|
+
const b = parseOsgiManifest(text);
|
|
54
|
+
if (b.symbolicName)
|
|
55
|
+
facts.ownBundles.add(b.symbolicName);
|
|
56
|
+
for (const p of b.exports)
|
|
57
|
+
facts.ownPackages.add(p);
|
|
58
|
+
for (const n of b.requiredBundles)
|
|
59
|
+
facts.bundles.add(n);
|
|
60
|
+
for (const n of b.importedPackages)
|
|
61
|
+
facts.importedPackages.add(n);
|
|
62
|
+
}
|
|
63
|
+
else if (base.endsWith('.target')) {
|
|
64
|
+
for (const d of parseTychoTarget(text)) {
|
|
65
|
+
if (d.ecosystem === 'maven')
|
|
66
|
+
facts.targetMaven.add(d.name);
|
|
67
|
+
else
|
|
68
|
+
facts.bundles.add(d.name);
|
|
69
|
+
}
|
|
70
|
+
for (const [bsn, coord] of parseTargetBundleNames(text))
|
|
71
|
+
if (!facts.bundleAliases.has(bsn))
|
|
72
|
+
facts.bundleAliases.set(bsn, coord);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const REVERSE_DOMAIN = new Set(['com', 'org', 'net', 'io', 'de', 'dev', 'edu', 'gov', 'fr', 'uk', 'ch', 'nl', 'be', 'it', 'es', 'at', 'se', 'jp', 'cn', 'ru', 'biz', 'info', 'us', 'eu', 'me', 'co']);
|
|
76
|
+
/** `org.apache.xerces.impl.dv` → `org.apache.xerces`; `javax.servlet.jsp` → `javax.servlet`. */
|
|
77
|
+
export function packageRoot(pkg) {
|
|
78
|
+
const segs = pkg.split('.');
|
|
79
|
+
return segs.slice(0, REVERSE_DOMAIN.has(segs[0]) ? 3 : 2).join('.');
|
|
80
|
+
}
|
|
81
|
+
const under = (pkg, prefix) => pkg === prefix || pkg.startsWith(`${prefix}.`);
|
|
82
|
+
const cmp = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
83
|
+
/** The longest name of `names` that is `pkg` or a package prefix of it. */
|
|
84
|
+
function longestPrefix(pkg, names) {
|
|
85
|
+
let best;
|
|
86
|
+
for (const n of names)
|
|
87
|
+
if (under(pkg, n) && (!best || n.length > best.length || (n.length === best.length && n < best)))
|
|
88
|
+
best = n;
|
|
89
|
+
return best;
|
|
90
|
+
}
|
|
91
|
+
/** The Maven coordinates of `coords`, grouped by groupId, artifactIds sorted. */
|
|
92
|
+
function byGroup(coords) {
|
|
93
|
+
const groups = new Map();
|
|
94
|
+
for (const c of coords) {
|
|
95
|
+
const i = c.indexOf(':');
|
|
96
|
+
if (i <= 0)
|
|
97
|
+
continue;
|
|
98
|
+
const g = c.slice(0, i);
|
|
99
|
+
groups.set(g, [...(groups.get(g) ?? []), c.slice(i + 1)]);
|
|
100
|
+
}
|
|
101
|
+
for (const a of groups.values())
|
|
102
|
+
a.sort(cmp);
|
|
103
|
+
return groups;
|
|
104
|
+
}
|
|
105
|
+
/** The last dot-segment of a name. */
|
|
106
|
+
const last = (s) => s.slice(s.lastIndexOf('.') + 1);
|
|
107
|
+
/**
|
|
108
|
+
* The artifact of group `g` that package `pkg` (under `g`) names: a dotted
|
|
109
|
+
* artifactId that is a prefix of the package; else the segment after the
|
|
110
|
+
* group, as the artifactId, its last `-` part (`commons-text` for
|
|
111
|
+
* `org.apache.commons.text`) or after the group's last segment (`jfreechart`
|
|
112
|
+
* for `org.jfree.chart`); else the one named like the group's last
|
|
113
|
+
* segment (`poi` of `org.apache.poi`). None when the group's artifacts leave
|
|
114
|
+
* it open (a group's only artifact is not assumed: `org.apache.pdfbox:fontbox`
|
|
115
|
+
* does not provide `org.apache.pdfbox`).
|
|
116
|
+
*/
|
|
117
|
+
function artifactFor(pkg, g, artifacts) {
|
|
118
|
+
const dotted = longestPrefix(pkg, artifacts.filter((a) => a.includes('.')));
|
|
119
|
+
if (dotted)
|
|
120
|
+
return dotted;
|
|
121
|
+
const seg = pkg.slice(g.length + 1).split('.')[0];
|
|
122
|
+
if (seg) {
|
|
123
|
+
// `jfreechart` of `org.jfree` for `org.jfree.chart`.
|
|
124
|
+
const hit = artifacts.find((a) => a === seg || a.endsWith(`-${seg}`) || a === `${last(g)}${seg}`);
|
|
125
|
+
if (hit)
|
|
126
|
+
return hit;
|
|
127
|
+
}
|
|
128
|
+
return artifacts.find((a) => a === last(g));
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* A coordinate whose dashed artifactId spells the end of a package prefix:
|
|
132
|
+
* `commons-codec:commons-codec` for `org.apache.commons.codec.binary`. Only
|
|
133
|
+
* artifactIds of two or more `-` parts, so a one-word artifact (`core`) never
|
|
134
|
+
* matches by name alone. The longest such spelling wins; ties by coordinate.
|
|
135
|
+
*/
|
|
136
|
+
function dashedArtifactFor(pkg, coords) {
|
|
137
|
+
let best;
|
|
138
|
+
for (const c of coords) {
|
|
139
|
+
const a = c.slice(c.indexOf(':') + 1);
|
|
140
|
+
if (!a.includes('-') || a.includes('.'))
|
|
141
|
+
continue;
|
|
142
|
+
const dotted = `.${a.replace(/-/g, '.')}`;
|
|
143
|
+
const at = `${pkg}.`.indexOf(`${dotted}.`);
|
|
144
|
+
if (at <= 0)
|
|
145
|
+
continue;
|
|
146
|
+
if (!best || dotted.length > best.len || (dotted.length === best.len && c < best.coord))
|
|
147
|
+
best = { coord: c, len: dotted.length };
|
|
148
|
+
}
|
|
149
|
+
return best?.coord;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* The Maven coordinate an OSGi bundle name stands for, among the inventory's
|
|
153
|
+
* Maven rows (grouped by groupId): the `<instructions>` name; Tycho's
|
|
154
|
+
* `wrapped.<groupId>.<artifactId>`; `<groupId>.<artifactId>`, also with the
|
|
155
|
+
* artifactId's group-name prefix dropped and dashes as dots
|
|
156
|
+
* (`org.apache.logging.log4j.to.slf4j` for `log4j-to-slf4j`); a dotted
|
|
157
|
+
* artifactId equal to the name; a dashed artifactId the name ends with
|
|
158
|
+
* (`org.apache.commons.commons-io` for `commons-io:commons-io`, the name's
|
|
159
|
+
* segment before it being the artifactId's first part); or the groupId itself
|
|
160
|
+
* when the group has an artifact named like its last segment. Failing those,
|
|
161
|
+
* a bundle under such a group is that artifact (`org.postgresql.jdbc` for
|
|
162
|
+
* `org.postgresql:postgresql`).
|
|
163
|
+
*/
|
|
164
|
+
function mavenFor(name, groups, aliases, maven) {
|
|
165
|
+
const aliased = aliases.get(name);
|
|
166
|
+
if (aliased && maven.has(aliased))
|
|
167
|
+
return aliased;
|
|
168
|
+
const bare = name.startsWith('wrapped.') ? name.slice('wrapped.'.length) : name;
|
|
169
|
+
const hits = [];
|
|
170
|
+
const underGroup = [];
|
|
171
|
+
for (const [g, artifacts] of groups) {
|
|
172
|
+
for (const a of artifacts) {
|
|
173
|
+
const stripped = a.startsWith(`${last(g)}-`) ? a.slice(last(g).length + 1) : a;
|
|
174
|
+
const spelled = [`${g}.${a}`, `${g}.${stripped}`, `${g}.${stripped.replace(/-/g, '.')}`];
|
|
175
|
+
const dashedTail = a.includes('-') && name.endsWith(`.${a}`) && last(name.slice(0, -a.length - 1)) === a.split('-')[0];
|
|
176
|
+
if (spelled.includes(bare) || a === name || dashedTail || (bare === g && a === last(g)))
|
|
177
|
+
hits.push(`${g}:${a}`);
|
|
178
|
+
else if (a === last(g) && under(bare, g))
|
|
179
|
+
underGroup.push(`${g}:${a}`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// Last: a bundle under a group whose main artifact is named like the group (`org.postgresql.jdbc`).
|
|
183
|
+
return hits.sort(cmp)[0] ?? underGroup.sort((x, y) => y.length - x.length || cmp(x, y))[0];
|
|
184
|
+
}
|
|
185
|
+
/** Lower-precedence scope merges into higher: required > optional > dev. */
|
|
186
|
+
function mergeScope(a, b) {
|
|
187
|
+
const rank = { required: 2, optional: 1, dev: 0 };
|
|
188
|
+
const ra = rank[a ?? 'required'];
|
|
189
|
+
const rb = rank[b ?? 'required'];
|
|
190
|
+
return ra >= rb ? (a ?? 'required') : (b ?? 'required');
|
|
191
|
+
}
|
|
192
|
+
const known = (v) => !!v && v !== 'unknown';
|
|
193
|
+
/**
|
|
194
|
+
* Collapse imported packages into libraries and fold OSGi aliases of Maven
|
|
195
|
+
* coordinates (see the module comment). `rows` are deduped by
|
|
196
|
+
* `<ecosystem>:<name>` already; they are not mutated.
|
|
197
|
+
*/
|
|
198
|
+
export function collapseOsgiLibraries(rows, facts) {
|
|
199
|
+
const renamed = new Map();
|
|
200
|
+
const keyOf = (r) => `${r.ecosystem}:${r.name}`;
|
|
201
|
+
if (!rows.some((r) => r.ecosystem === 'osgi'))
|
|
202
|
+
return { rows, renamed };
|
|
203
|
+
const out = new Map();
|
|
204
|
+
for (const r of rows)
|
|
205
|
+
out.set(keyOf(r), { ...r });
|
|
206
|
+
const maven = new Set(rows.filter((r) => r.ecosystem === 'maven').map((r) => r.name));
|
|
207
|
+
const targetGroups = byGroup([...facts.targetMaven].filter((c) => maven.has(c)));
|
|
208
|
+
const allGroups = byGroup(maven);
|
|
209
|
+
const fold = (fromKey, toKey, addPackages) => {
|
|
210
|
+
const from = out.get(fromKey);
|
|
211
|
+
const to = out.get(toKey);
|
|
212
|
+
to.packages = (to.packages ?? 0) + addPackages + (from.packages ?? 0) || undefined;
|
|
213
|
+
if (!known(to.version) && known(from.version))
|
|
214
|
+
to.version = from.version;
|
|
215
|
+
to.scope = mergeScope(to.scope, from.scope);
|
|
216
|
+
if (from.direct)
|
|
217
|
+
to.direct = true;
|
|
218
|
+
out.delete(fromKey);
|
|
219
|
+
renamed.set(fromKey, toKey);
|
|
220
|
+
for (const [k, v] of renamed)
|
|
221
|
+
if (v === fromKey)
|
|
222
|
+
renamed.set(k, toKey);
|
|
223
|
+
};
|
|
224
|
+
const drop = (key) => {
|
|
225
|
+
out.delete(key);
|
|
226
|
+
renamed.set(key, null);
|
|
227
|
+
for (const [k, v] of renamed)
|
|
228
|
+
if (v === key)
|
|
229
|
+
renamed.set(k, null);
|
|
230
|
+
};
|
|
231
|
+
// 1. Imported packages → their provider, in name order.
|
|
232
|
+
// A name read both as a bundle and as an imported package is a bundle.
|
|
233
|
+
const isPackage = (r) => facts.importedPackages.has(r.name) && !facts.bundles.has(r.name);
|
|
234
|
+
const bundleRows = rows.filter((r) => r.ecosystem === 'osgi' && !isPackage(r)).map((r) => r.name);
|
|
235
|
+
const packageRows = rows.filter((r) => r.ecosystem === 'osgi' && isPackage(r)).sort((a, b) => cmp(a.name, b.name));
|
|
236
|
+
const targetCoords = [...facts.targetMaven].filter((c) => maven.has(c)).sort(cmp);
|
|
237
|
+
const unprovided = [];
|
|
238
|
+
for (const r of packageRows) {
|
|
239
|
+
const key = keyOf(r);
|
|
240
|
+
if (facts.ownPackages.has(r.name) || longestPrefix(r.name, facts.ownBundles)) {
|
|
241
|
+
drop(key);
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
const bundle = longestPrefix(r.name, bundleRows.filter((b) => b !== r.name && out.has(`osgi:${b}`)));
|
|
245
|
+
const g = longestPrefix(r.name, targetGroups.keys());
|
|
246
|
+
const a = g ? artifactFor(r.name, g, targetGroups.get(g)) : undefined;
|
|
247
|
+
const mavenKey = g && a && out.has(`maven:${g}:${a}`) ? `maven:${g}:${a}` : undefined;
|
|
248
|
+
// The longer prefix names the provider more closely: `org.junit.jupiter.api` is JUnit 5's
|
|
249
|
+
// `org.junit.jupiter:junit-jupiter-api`, not the JUnit 4 bundle `org.junit`. A tie goes to the bundle.
|
|
250
|
+
if (bundle && (!mavenKey || bundle.length >= g.length)) {
|
|
251
|
+
fold(key, `osgi:${bundle}`, 1);
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
if (mavenKey) {
|
|
255
|
+
fold(key, mavenKey, 1);
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
const dashed = dashedArtifactFor(r.name, targetCoords);
|
|
259
|
+
if (dashed && out.has(`maven:${dashed}`)) {
|
|
260
|
+
fold(key, `maven:${dashed}`, 1);
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
unprovided.push({ row: out.get(key), group: g });
|
|
264
|
+
}
|
|
265
|
+
// A package with no provider goes under the target groupId it falls under, else its package
|
|
266
|
+
// root; or, when shorter, the root of another unprovided package that is a prefix of it
|
|
267
|
+
// (`org.slf4j.spi` under an imported `org.slf4j`). Shortest first, so a prefix's root is known.
|
|
268
|
+
const rootOf = new Map();
|
|
269
|
+
const roots = new Map();
|
|
270
|
+
unprovided.sort((x, y) => x.row.name.length - y.row.name.length || cmp(x.row.name, y.row.name));
|
|
271
|
+
for (const { row, group } of unprovided) {
|
|
272
|
+
let root = group ?? packageRoot(row.name);
|
|
273
|
+
for (const [n, r] of rootOf)
|
|
274
|
+
if (n !== row.name && under(row.name, n) && (r.length < root.length || (r.length === root.length && r < root)))
|
|
275
|
+
root = r;
|
|
276
|
+
rootOf.set(row.name, root);
|
|
277
|
+
roots.set(root, [...(roots.get(root) ?? []), row]);
|
|
278
|
+
}
|
|
279
|
+
// 1d. One row per package root, in name order: the row already named so (an imported root
|
|
280
|
+
// package, or a bundle), else a new one carrying the version of the first package by name (a
|
|
281
|
+
// known one, when any member has it).
|
|
282
|
+
const rootRows = [];
|
|
283
|
+
for (const root of [...roots.keys()].sort(cmp)) {
|
|
284
|
+
const members = roots.get(root);
|
|
285
|
+
const rootKey = `osgi:${root}`;
|
|
286
|
+
let target = out.get(rootKey);
|
|
287
|
+
if (!target) {
|
|
288
|
+
const first = members.reduce((a, m) => (cmp(m.name, a.name) < 0 ? m : a));
|
|
289
|
+
target = { ...first, name: root, packages: 0 };
|
|
290
|
+
out.set(rootKey, target);
|
|
291
|
+
rootRows.push(target);
|
|
292
|
+
}
|
|
293
|
+
for (const m of members) {
|
|
294
|
+
if (m === target)
|
|
295
|
+
target.packages = (target.packages ?? 0) + 1;
|
|
296
|
+
else
|
|
297
|
+
fold(keyOf(m), rootKey, 1);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
// 2. OSGi bundles that are a Maven coordinate of the inventory → that coordinate.
|
|
301
|
+
for (const [key, r] of [...out]) {
|
|
302
|
+
if (r.ecosystem !== 'osgi')
|
|
303
|
+
continue;
|
|
304
|
+
const coord = mavenFor(r.name, allGroups, facts.bundleAliases, maven);
|
|
305
|
+
const to = coord ? `maven:${coord}` : undefined;
|
|
306
|
+
if (!to || !out.has(to))
|
|
307
|
+
continue;
|
|
308
|
+
const target = out.get(to);
|
|
309
|
+
target.aliases = [...new Set([...(target.aliases ?? []), r.name, ...(r.aliases ?? [])])].sort(cmp);
|
|
310
|
+
fold(key, to, 0);
|
|
311
|
+
}
|
|
312
|
+
// Rows that stay keep their order; new package-root rows follow, sorted.
|
|
313
|
+
const kept = [];
|
|
314
|
+
const seen = new Set();
|
|
315
|
+
for (const r of rows) {
|
|
316
|
+
const k = keyOf(r);
|
|
317
|
+
const row = out.get(k);
|
|
318
|
+
if (row && !seen.has(k)) {
|
|
319
|
+
kept.push(row);
|
|
320
|
+
seen.add(k);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
for (const r of rootRows)
|
|
324
|
+
if (out.get(keyOf(r)) === r && !seen.has(keyOf(r))) {
|
|
325
|
+
kept.push(r);
|
|
326
|
+
seen.add(keyOf(r));
|
|
327
|
+
}
|
|
328
|
+
for (const r of kept)
|
|
329
|
+
if (r.packages === undefined)
|
|
330
|
+
delete r.packages;
|
|
331
|
+
return { rows: kept, renamed };
|
|
332
|
+
}
|
|
333
|
+
//# sourceMappingURL=osgi-libraries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"osgi-libraries.js","sourceRoot":"","sources":["../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AC;IACtE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Eclipse / OSGi inventory readers: Tycho target platforms (`*.target`) and
|
|
3
|
+
* bundle manifests (`META-INF/MANIFEST.MF`).
|
|
4
|
+
*
|
|
5
|
+
* On a Tycho build the third-party versions live in the target platform, not
|
|
6
|
+
* in pom `<dependency>` rows: Maven locations name Maven coordinates
|
|
7
|
+
* (ecosystem `maven`), InstallableUnit locations name p2 units (bundles and
|
|
8
|
+
* features, ecosystem `osgi`). Each bundle's MANIFEST.MF then declares what it
|
|
9
|
+
* wires to: `Require-Bundle` (bundles) and `Import-Package` (packages, kept
|
|
10
|
+
* only when the import names a version). Scanned with `indexOf`, not an XML
|
|
11
|
+
* tree or backtracking regexes: no new dependency, and time linear in size.
|
|
12
|
+
*/
|
|
13
|
+
export interface OsgiDependency {
|
|
14
|
+
name: string;
|
|
15
|
+
version: string;
|
|
16
|
+
ecosystem: 'maven' | 'osgi';
|
|
17
|
+
scope: 'required' | 'optional';
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The largest `.target` or MANIFEST.MF the inventory reads (bytes). Real ones
|
|
21
|
+
* are well under 1 MB; a larger one is skipped with a note (see bom/index.ts).
|
|
22
|
+
*/
|
|
23
|
+
export declare const MAX_OSGI_FILE_BYTES: number;
|
|
24
|
+
/**
|
|
25
|
+
* A Tycho / PDE target platform: Maven locations (`<groupId>`/`<artifactId>`/
|
|
26
|
+
* `<version>`, flat or in `<dependencies>`) and InstallableUnit locations
|
|
27
|
+
* (`<unit id="…" version="…"/>`). Target locations (`type="Target"`, a
|
|
28
|
+
* reference to another file) add nothing here; the file they name is read on
|
|
29
|
+
* its own. Comments are ignored. Malformed input gives `[]`. One linear pass
|
|
30
|
+
* per tag kind, no backtracking regexes, so input size bounds the time.
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseTychoTarget(text: string): OsgiDependency[];
|
|
33
|
+
/**
|
|
34
|
+
* The `Bundle-SymbolicName` a target platform gives each Maven location's jar
|
|
35
|
+
* in its `<instructions>` (Tycho's bnd wrapping of a plain jar), resolved
|
|
36
|
+
* against the location's coordinates: symbolic name → `groupId:artifactId`.
|
|
37
|
+
* `${mvnGroupId}` and `${mvnArtifactId}` are substituted; a name with any
|
|
38
|
+
* other `${…}` left in it is skipped. Locations without instructions give
|
|
39
|
+
* nothing here (Tycho's default, `wrapped.<groupId>.<artifactId>`, is
|
|
40
|
+
* recognised by name; see osgi-libraries.ts).
|
|
41
|
+
*/
|
|
42
|
+
export declare function parseTargetBundleNames(text: string): Map<string, string>;
|
|
43
|
+
/** The main section of a MANIFEST.MF as header → value, continuation lines joined. */
|
|
44
|
+
export declare function manifestHeaders(text: string): Map<string, string>;
|
|
45
|
+
/** Split an OSGi header value on top-level commas (not inside quoted attributes). */
|
|
46
|
+
export declare function splitClauses(value: string | undefined): string[];
|
|
47
|
+
/**
|
|
48
|
+
* An OSGi version range as declared (`[1.2,2.0)`) or a floor (`1.2.0`): the
|
|
49
|
+
* floor is the version the bundle was built against. A build-timestamp
|
|
50
|
+
* qualifier is dropped (`3.18.500.v20230801-1600` → `3.18.500`); any other
|
|
51
|
+
* qualifier is part of the version and kept (`10.3.0.1`, `2.0.22.bcfips`).
|
|
52
|
+
*/
|
|
53
|
+
export declare function osgiVersion(v: string | undefined): string;
|
|
54
|
+
export interface OsgiBundle {
|
|
55
|
+
/** `Bundle-SymbolicName`, without directives; null for a plain jar manifest. */
|
|
56
|
+
symbolicName: string | null;
|
|
57
|
+
/** `Export-Package` package names (every name of a multi-package clause). */
|
|
58
|
+
exports: string[];
|
|
59
|
+
dependencies: OsgiDependency[];
|
|
60
|
+
/** The `Require-Bundle` names among `dependencies` (bundles). */
|
|
61
|
+
requiredBundles: string[];
|
|
62
|
+
/** The versioned `Import-Package` names among `dependencies` (Java packages, not bundles). */
|
|
63
|
+
importedPackages: string[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* One bundle manifest: `Require-Bundle` (bundle, `bundle-version`) and
|
|
67
|
+
* `Import-Package` (package, `version`; only versioned imports, and never
|
|
68
|
+
* `java.*`, which the JRE provides). `resolution:=optional` → `optional`. A
|
|
69
|
+
* manifest without `Bundle-SymbolicName` is a plain jar manifest: `[]`.
|
|
70
|
+
*/
|
|
71
|
+
export declare function parseOsgiManifest(text: string): OsgiBundle;
|
|
72
|
+
//# sourceMappingURL=osgi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"osgi.d.ts","sourceRoot":"","sources":["../../src/bom/osgi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,KAAK,EAAE,UAAU,GAAG,UAAU,CAAC;CAChC;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAkB,CAAC;AAiEnD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,EAAE,CAwB/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAoBxE;AAED,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAmBjE;AAED,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,CAYhE;AA+BD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAOzD;AAED,MAAM,WAAW,UAAU;IACzB,gFAAgF;I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