INNER CODE UNIT · TypeScript
createEngine
center-for-threat-informed-defense/attack-flow · src/attack_flow_builder/packages/tie-inference-web/src/index.ts:19
export async function createEngine(
npzUrl: string,
enrichmentUrl?: string,
cache: boolean = true
): Promise<TieEngine> {
const modelSource = new RemoteModelSource(npzUrl, cache);
let enrichmentSource: DataSource<EnrichmentFile>;
if (enrichmentUrl) {
const { RemoteEnrichmentSource } = await import(
"./tie/TechniqueInferenceEngine/DataSource/EnrichmentFile/RemoteEnrichmentSource"
);
enrichmentSource = new (RemoteEnrichmentSource as any)(enrichmentUrl, cache);
} else {
// Stub enrichment to keep the package logic-only and client-side
enrichmentSource = {
cachingEnabled: false,
async preload() { },