@fulmenhq/tsfulmen 0.2.0 → 0.2.2
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 +42 -0
- package/README.md +60 -7
- package/config/crucible-ts/agentic/roles/README.md +3 -3
- package/config/crucible-ts/library/fulencode/fixtures/README.md +18 -0
- package/config/crucible-ts/library/fulencode/fixtures/bom/bom.yaml +14 -0
- package/config/crucible-ts/library/fulencode/fixtures/detection/detection.yaml +12 -0
- package/config/crucible-ts/library/fulencode/fixtures/invalid-encodings/base64.yaml +10 -0
- package/config/crucible-ts/library/fulencode/fixtures/normalization/text-safe.yaml +10 -0
- package/config/crucible-ts/library/fulencode/fixtures/telemetry/telemetry-test-cases.yaml +24 -0
- package/config/crucible-ts/library/fulencode/fixtures/valid-encodings/base64.yaml +11 -0
- package/config/crucible-ts/taxonomy/library/platform-modules/v1.0.0/modules.yaml +2 -2
- package/config/crucible-ts/taxonomy/metrics.yaml +79 -1
- package/dist/appidentity/index.d.ts +1 -1
- package/dist/appidentity/index.js +122 -56
- package/dist/appidentity/index.js.map +1 -1
- package/dist/config/index.js +122 -56
- package/dist/config/index.js.map +1 -1
- package/dist/crucible/index.js +122 -56
- package/dist/crucible/index.js.map +1 -1
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +122 -56
- package/dist/errors/index.js.map +1 -1
- package/dist/foundry/index.js +122 -56
- package/dist/foundry/index.js.map +1 -1
- package/dist/fulencode/index.d.ts +102 -0
- package/dist/fulencode/index.js +806 -0
- package/dist/fulencode/index.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +123 -57
- package/dist/index.js.map +1 -1
- package/dist/pathfinder/index.d.ts +1 -1
- package/dist/pathfinder/index.js +122 -56
- package/dist/pathfinder/index.js.map +1 -1
- package/dist/reports/license-inventory.csv +7 -6
- package/dist/schema/index.d.ts +2 -2
- package/dist/schema/index.js +122 -56
- package/dist/schema/index.js.map +1 -1
- package/dist/signals/index.js +122 -56
- package/dist/signals/index.js.map +1 -1
- package/dist/telemetry/http/index.js +122 -56
- package/dist/telemetry/http/index.js.map +1 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +122 -56
- package/dist/telemetry/index.js.map +1 -1
- package/dist/telemetry/prometheus/index.d.ts +1 -1
- package/dist/telemetry/prometheus/index.js +122 -56
- package/dist/telemetry/prometheus/index.js.map +1 -1
- package/dist/{types-BJswWpQC.d.ts → types-DdoeE7F5.d.ts} +1 -1
- package/package.json +7 -2
- package/schemas/crucible-ts/library/fulencode/v1.0.0/README.md +37 -0
- package/schemas/crucible-ts/library/fulencode/v1.0.0/bom-result.schema.json +48 -0
- package/schemas/crucible-ts/library/fulencode/v1.0.0/decode-options.schema.json +60 -0
- package/schemas/crucible-ts/library/fulencode/v1.0.0/decoding-result.schema.json +70 -0
- package/schemas/crucible-ts/library/fulencode/v1.0.0/detect-options.schema.json +25 -0
- package/schemas/crucible-ts/library/fulencode/v1.0.0/detection-result.schema.json +57 -0
- package/schemas/crucible-ts/library/fulencode/v1.0.0/encode-options.schema.json +71 -0
- package/schemas/crucible-ts/library/fulencode/v1.0.0/encoding-result.schema.json +57 -0
- package/schemas/crucible-ts/library/fulencode/v1.0.0/fulencode-config.schema.json +8 -4
- package/schemas/crucible-ts/library/fulencode/v1.0.0/fulencode-error.schema.json +66 -0
- package/schemas/crucible-ts/library/fulencode/v1.0.0/normalization-result.schema.json +73 -0
- package/schemas/crucible-ts/library/fulencode/v1.0.0/normalize-options.schema.json +44 -0
- package/schemas/crucible-ts/meta/README.md +38 -2
- package/schemas/crucible-ts/meta/draft-04/schema.json +222 -0
- package/schemas/crucible-ts/meta/draft-06/schema.json +218 -0
- package/schemas/crucible-ts/meta/draft-2019-09/meta/applicator.json +93 -0
- package/schemas/crucible-ts/meta/draft-2019-09/meta/content.json +21 -0
- package/schemas/crucible-ts/meta/draft-2019-09/meta/core.json +58 -0
- package/schemas/crucible-ts/meta/draft-2019-09/meta/format.json +15 -0
- package/schemas/crucible-ts/meta/draft-2019-09/meta/meta-data.json +35 -0
- package/schemas/crucible-ts/meta/draft-2019-09/meta/validation.json +119 -0
- package/schemas/crucible-ts/meta/draft-2019-09/offline.schema.json +148 -0
- package/schemas/crucible-ts/meta/draft-2019-09/schema.json +62 -0
- package/schemas/crucible-ts/meta/fixtures/draft-04-sample.json +16 -0
- package/schemas/crucible-ts/meta/fixtures/draft-06-sample.json +16 -0
- package/schemas/crucible-ts/meta/fixtures/draft-07-sample.json +34 -0
- package/schemas/crucible-ts/meta/fixtures/draft-2019-09-sample.json +21 -0
- package/schemas/crucible-ts/meta/fixtures/draft-2020-12-sample.json +21 -0
- package/schemas/crucible-ts/taxonomy/library/fulencode/normalization-profiles/v1.0.0/profiles.yaml +16 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/PROVENANCE.md +64 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/config/classifiers/dimensions/access-tier.dimension.json +103 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/config/classifiers/dimensions/retention-lifecycle.dimension.json +103 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/config/classifiers/dimensions/schema-stability.dimension.json +100 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/config/classifiers/dimensions/sensitivity.dimension.json +130 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/config/classifiers/dimensions/velocity-mode.dimension.json +79 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/config/classifiers/dimensions/volatility.dimension.json +72 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/config/classifiers/dimensions/volume-tier.dimension.json +66 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/docs/catalog/classifiers/README.md +29 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/docs/standards/access-tier-classification.md +163 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/docs/standards/classifiers-framework.md +157 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/docs/standards/data-sensitivity-classification.md +259 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/docs/standards/retention-lifecycle-classification.md +200 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/docs/standards/schema-stability-classification.md +205 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/docs/standards/velocity-mode-classification.md +222 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/docs/standards/volatility-classification.md +209 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/docs/standards/volume-tier-classification.md +200 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/schemas/ailink/v0/README.md +48 -0
- package/schemas/crucible-ts/upstream/3leaps/{ailink → crucible/schemas/ailink}/v0/prompt.schema.json +4 -18
- package/schemas/crucible-ts/upstream/3leaps/{ailink → crucible/schemas/ailink}/v0/search-response.schema.json +7 -37
- package/schemas/crucible-ts/upstream/3leaps/crucible/schemas/classifiers/v0/dimension-definition.schema.json +247 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/schemas/classifiers/v0/sensitivity-level.schema.json +67 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/schemas/foundation/v0/error-response.schema.json +59 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/schemas/foundation/v0/lifecycle-phases.data.json +102 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/schemas/foundation/v0/lifecycle-phases.schema.json +101 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/schemas/foundation/v0/release-phase.schema.json +18 -0
- package/schemas/crucible-ts/upstream/3leaps/crucible/schemas/foundation/v0/types.schema.json +177 -0
- package/schemas/crucible-ts/upstream/3leaps/PROVENANCE.md +0 -43
- /package/schemas/crucible-ts/upstream/3leaps/{agentic → crucible/schemas/agentic}/v0/role-prompt.schema.json +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { M as MetricName, a as MetricUnit, b as MetricsRegistry } from '../registry-_yEKhTTl.js';
|
|
2
2
|
export { C as Counter, F as FlushOptions, G as Gauge, H as Histogram, c as HistogramBucket, d as HistogramOptions, e as HistogramSummary, g as MetricValue, f as MetricsEvent, i as isHistogramSummary, h as isValidMetricName, j as isValidMetricUnit } from '../registry-_yEKhTTl.js';
|
|
3
|
-
import { A as AjvError } from '../types-
|
|
3
|
+
import { A as AjvError } from '../types-DdoeE7F5.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Taxonomy loader for metrics definitions
|
package/dist/telemetry/index.js
CHANGED
|
@@ -5,6 +5,9 @@ import { spawn } from 'child_process';
|
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
6
|
import glob from 'fast-glob';
|
|
7
7
|
import Ajv from 'ajv';
|
|
8
|
+
import Ajv2019 from 'ajv/dist/2019';
|
|
9
|
+
import Ajv2020 from 'ajv/dist/2020';
|
|
10
|
+
import AjvDraft04 from 'ajv-draft-04';
|
|
8
11
|
import addFormats from 'ajv-formats';
|
|
9
12
|
import { Readable } from 'stream';
|
|
10
13
|
import picomatch from 'picomatch';
|
|
@@ -1522,20 +1525,14 @@ async function loadMetaSchema(draft) {
|
|
|
1522
1525
|
const content = await readFile(metaSchemaPath, "utf-8");
|
|
1523
1526
|
return JSON.parse(content);
|
|
1524
1527
|
}
|
|
1525
|
-
async function loadVocabularySchemas() {
|
|
1528
|
+
async function loadVocabularySchemas(draft) {
|
|
1529
|
+
if (draft !== "draft-2019-09" && draft !== "draft-2020-12") {
|
|
1530
|
+
return [];
|
|
1531
|
+
}
|
|
1526
1532
|
const __filename3 = fileURLToPath(import.meta.url);
|
|
1527
1533
|
const __dirname4 = dirname(__filename3);
|
|
1528
|
-
const vocabDir = join(
|
|
1529
|
-
|
|
1530
|
-
"..",
|
|
1531
|
-
"..",
|
|
1532
|
-
"schemas",
|
|
1533
|
-
"crucible-ts",
|
|
1534
|
-
"meta",
|
|
1535
|
-
"draft-2020-12",
|
|
1536
|
-
"meta"
|
|
1537
|
-
);
|
|
1538
|
-
const vocabFiles = [
|
|
1534
|
+
const vocabDir = join(__dirname4, "..", "..", "schemas", "crucible-ts", "meta", draft, "meta");
|
|
1535
|
+
const vocabFiles = draft === "draft-2020-12" ? [
|
|
1539
1536
|
"core.json",
|
|
1540
1537
|
"applicator.json",
|
|
1541
1538
|
"unevaluated.json",
|
|
@@ -1543,6 +1540,13 @@ async function loadVocabularySchemas() {
|
|
|
1543
1540
|
"meta-data.json",
|
|
1544
1541
|
"format-annotation.json",
|
|
1545
1542
|
"content.json"
|
|
1543
|
+
] : [
|
|
1544
|
+
"core.json",
|
|
1545
|
+
"applicator.json",
|
|
1546
|
+
"validation.json",
|
|
1547
|
+
"meta-data.json",
|
|
1548
|
+
"format.json",
|
|
1549
|
+
"content.json"
|
|
1546
1550
|
];
|
|
1547
1551
|
const schemas = [];
|
|
1548
1552
|
for (const file of vocabFiles) {
|
|
@@ -1597,47 +1601,68 @@ async function loadReferencedSchema(uri) {
|
|
|
1597
1601
|
}
|
|
1598
1602
|
return JSON.parse(content);
|
|
1599
1603
|
}
|
|
1600
|
-
function
|
|
1601
|
-
if (!
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
}
|
|
1611
|
-
addFormats(ajvInstance, {
|
|
1612
|
-
mode: "fast",
|
|
1613
|
-
formats: ["date-time", "email", "hostname", "ipv4", "ipv6", "uri", "uri-reference"]
|
|
1614
|
-
});
|
|
1615
|
-
metaschemaReady = Promise.all([loadVocabularySchemas(), loadMetaSchema("draft-2020-12")]).then(([vocabSchemas, metaSchema]) => {
|
|
1616
|
-
if (ajvInstance) {
|
|
1617
|
-
for (const vocabSchema of vocabSchemas) {
|
|
1618
|
-
try {
|
|
1619
|
-
ajvInstance.addMetaSchema(vocabSchema);
|
|
1620
|
-
} catch {
|
|
1621
|
-
}
|
|
1622
|
-
}
|
|
1623
|
-
ajvInstance.addMetaSchema(metaSchema);
|
|
1624
|
-
}
|
|
1625
|
-
}).catch((error) => {
|
|
1626
|
-
throw new Error(`Failed to load metaschemas: ${error}`);
|
|
1627
|
-
});
|
|
1604
|
+
function detectDialect(schema) {
|
|
1605
|
+
if (schema && typeof schema === "object" && !Array.isArray(schema)) {
|
|
1606
|
+
const maybeSchema = schema;
|
|
1607
|
+
const declared = maybeSchema.$schema;
|
|
1608
|
+
if (typeof declared === "string") {
|
|
1609
|
+
if (declared.includes("draft-04")) return "draft-04";
|
|
1610
|
+
if (declared.includes("draft-06")) return "draft-06";
|
|
1611
|
+
if (declared.includes("draft-07")) return "draft-07";
|
|
1612
|
+
if (declared.includes("draft/2019-09")) return "draft-2019-09";
|
|
1613
|
+
if (declared.includes("draft/2020-12")) return "draft-2020-12";
|
|
1614
|
+
}
|
|
1628
1615
|
}
|
|
1629
|
-
return
|
|
1616
|
+
return "draft-2020-12";
|
|
1617
|
+
}
|
|
1618
|
+
function createAjv(dialect) {
|
|
1619
|
+
const AjvCtor = dialect === "draft-2020-12" ? Ajv2020 : dialect === "draft-2019-09" ? Ajv2019 : dialect === "draft-04" ? AjvDraft04 : Ajv;
|
|
1620
|
+
const ajv = new AjvCtor({
|
|
1621
|
+
strict: false,
|
|
1622
|
+
allErrors: true,
|
|
1623
|
+
verbose: true,
|
|
1624
|
+
// Allow schemas with $id to be added without replacing existing ones
|
|
1625
|
+
addUsedSchema: false,
|
|
1626
|
+
// draft-04 uses "id"; later drafts use "$id"
|
|
1627
|
+
schemaId: dialect === "draft-04" ? "id" : "$id",
|
|
1628
|
+
// Enable async schema loading for YAML references
|
|
1629
|
+
loadSchema: loadReferencedSchema
|
|
1630
|
+
});
|
|
1631
|
+
addFormats(ajv, {
|
|
1632
|
+
mode: "fast",
|
|
1633
|
+
formats: ["date-time", "email", "hostname", "ipv4", "ipv6", "uri", "uri-reference"]
|
|
1634
|
+
});
|
|
1635
|
+
return ajv;
|
|
1636
|
+
}
|
|
1637
|
+
async function getAjv(dialect) {
|
|
1638
|
+
const existing = ajvInstances.get(dialect);
|
|
1639
|
+
if (existing) {
|
|
1640
|
+
const ready = metaschemaReady.get(dialect);
|
|
1641
|
+
if (ready) await ready;
|
|
1642
|
+
return existing;
|
|
1643
|
+
}
|
|
1644
|
+
const ajv = createAjv(dialect);
|
|
1645
|
+
ajvInstances.set(dialect, ajv);
|
|
1646
|
+
const readyPromise = Promise.all([loadVocabularySchemas(dialect), loadMetaSchema(dialect)]).then(([vocabSchemas, metaSchema]) => {
|
|
1647
|
+
for (const vocabSchema of vocabSchemas) {
|
|
1648
|
+
try {
|
|
1649
|
+
ajv.addMetaSchema(vocabSchema);
|
|
1650
|
+
} catch {
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
try {
|
|
1654
|
+
ajv.addMetaSchema(metaSchema);
|
|
1655
|
+
} catch {
|
|
1656
|
+
}
|
|
1657
|
+
}).catch((error) => {
|
|
1658
|
+
throw new Error(`Failed to load metaschemas (${dialect}): ${error}`);
|
|
1659
|
+
});
|
|
1660
|
+
metaschemaReady.set(dialect, readyPromise);
|
|
1661
|
+
await readyPromise;
|
|
1662
|
+
return ajv;
|
|
1630
1663
|
}
|
|
1631
1664
|
async function compileSchema(schema, options = {}) {
|
|
1632
|
-
const
|
|
1633
|
-
if (metaschemaReady) {
|
|
1634
|
-
await metaschemaReady;
|
|
1635
|
-
}
|
|
1636
|
-
const cacheKey = typeof schema === "string" ? schema : JSON.stringify(schema);
|
|
1637
|
-
const cached = schemaCache.get(cacheKey);
|
|
1638
|
-
if (cached !== void 0) {
|
|
1639
|
-
return cached;
|
|
1640
|
-
}
|
|
1665
|
+
const baseKey = typeof schema === "string" ? schema : JSON.stringify(schema);
|
|
1641
1666
|
let parsedSchema;
|
|
1642
1667
|
if (typeof schema === "string") {
|
|
1643
1668
|
try {
|
|
@@ -1655,18 +1680,27 @@ async function compileSchema(schema, options = {}) {
|
|
|
1655
1680
|
} else {
|
|
1656
1681
|
parsedSchema = schema;
|
|
1657
1682
|
}
|
|
1683
|
+
const dialect = detectDialect(parsedSchema);
|
|
1684
|
+
const ajv = await getAjv(dialect);
|
|
1685
|
+
const cacheKey = `${dialect}:${baseKey}`;
|
|
1686
|
+
const cached = schemaCache.get(cacheKey);
|
|
1687
|
+
if (cached !== void 0) {
|
|
1688
|
+
return cached;
|
|
1689
|
+
}
|
|
1658
1690
|
try {
|
|
1659
1691
|
if (options.aliases && options.aliases.length > 0) {
|
|
1660
1692
|
for (const alias of options.aliases) {
|
|
1661
1693
|
if (alias && ajv.getSchema(alias) === void 0) {
|
|
1662
1694
|
try {
|
|
1663
|
-
|
|
1695
|
+
if (typeof parsedSchema === "object" && parsedSchema !== null) {
|
|
1696
|
+
ajv.addSchema(parsedSchema, alias);
|
|
1697
|
+
}
|
|
1664
1698
|
} catch {
|
|
1665
1699
|
}
|
|
1666
1700
|
}
|
|
1667
1701
|
}
|
|
1668
1702
|
}
|
|
1669
|
-
const validator = await ajv.compileAsync(parsedSchema);
|
|
1703
|
+
const validator = typeof parsedSchema === "boolean" ? ajv.compile(parsedSchema) : await ajv.compileAsync(parsedSchema);
|
|
1670
1704
|
schemaCache.set(cacheKey, validator);
|
|
1671
1705
|
return validator;
|
|
1672
1706
|
} catch (error) {
|
|
@@ -1736,8 +1770,39 @@ async function validateFile(filePath, validator) {
|
|
|
1736
1770
|
}
|
|
1737
1771
|
async function validateSchema(schema) {
|
|
1738
1772
|
try {
|
|
1739
|
-
|
|
1740
|
-
|
|
1773
|
+
let parsedSchema;
|
|
1774
|
+
if (typeof schema === "string") {
|
|
1775
|
+
try {
|
|
1776
|
+
parsedSchema = JSON.parse(schema);
|
|
1777
|
+
} catch {
|
|
1778
|
+
parsedSchema = parse(schema);
|
|
1779
|
+
}
|
|
1780
|
+
} else if (Buffer.isBuffer(schema)) {
|
|
1781
|
+
const content = schema.toString("utf-8");
|
|
1782
|
+
try {
|
|
1783
|
+
parsedSchema = JSON.parse(content);
|
|
1784
|
+
} catch {
|
|
1785
|
+
parsedSchema = parse(content);
|
|
1786
|
+
}
|
|
1787
|
+
} else {
|
|
1788
|
+
parsedSchema = schema;
|
|
1789
|
+
}
|
|
1790
|
+
const dialect = detectDialect(parsedSchema);
|
|
1791
|
+
const ajv = await getAjv(dialect);
|
|
1792
|
+
const metaValid = ajv.validateSchema(parsedSchema);
|
|
1793
|
+
if (!metaValid && ajv.errors) {
|
|
1794
|
+
const diagnostics = ajv.errors.map(
|
|
1795
|
+
(error) => createDiagnostic(
|
|
1796
|
+
error.instancePath || "",
|
|
1797
|
+
error.message || "Schema meta-validation failed",
|
|
1798
|
+
error.keyword || "unknown",
|
|
1799
|
+
"ERROR",
|
|
1800
|
+
"ajv"
|
|
1801
|
+
)
|
|
1802
|
+
);
|
|
1803
|
+
return { valid: false, diagnostics, source: "ajv" };
|
|
1804
|
+
}
|
|
1805
|
+
await compileSchema(parsedSchema);
|
|
1741
1806
|
return {
|
|
1742
1807
|
valid: true,
|
|
1743
1808
|
diagnostics: [],
|
|
@@ -1808,14 +1873,15 @@ async function validateFileBySchemaId(filePath, schemaId, registryOptions) {
|
|
|
1808
1873
|
throw error;
|
|
1809
1874
|
}
|
|
1810
1875
|
}
|
|
1811
|
-
var
|
|
1876
|
+
var ajvInstances, metaschemaReady, schemaCache;
|
|
1812
1877
|
var init_validator = __esm({
|
|
1813
1878
|
"src/schema/validator.ts"() {
|
|
1814
1879
|
init_telemetry();
|
|
1815
1880
|
init_errors();
|
|
1816
1881
|
init_registry2();
|
|
1817
1882
|
init_utils();
|
|
1818
|
-
|
|
1883
|
+
ajvInstances = /* @__PURE__ */ new Map();
|
|
1884
|
+
metaschemaReady = /* @__PURE__ */ new Map();
|
|
1819
1885
|
schemaCache = /* @__PURE__ */ new Map();
|
|
1820
1886
|
}
|
|
1821
1887
|
});
|