@aeptus/aexeo-emdash 0.8.19 → 0.9.1
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 +112 -2
- package/INSTALL.md +286 -4
- package/README.md +20 -5
- package/dist/adapter.d.ts +62 -4
- package/dist/adapter.d.ts.map +1 -1
- package/dist/admin/Findings.d.ts.map +1 -1
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +73 -6
- package/dist/assessment-display.d.ts +10 -0
- package/dist/assessment-display.d.ts.map +1 -0
- package/dist/cms-coverage.d.ts +10 -0
- package/dist/cms-coverage.d.ts.map +1 -0
- package/dist/configured.d.ts +16 -1
- package/dist/configured.d.ts.map +1 -1
- package/dist/configured.js +1341 -172
- package/dist/content-evaluator.d.ts +34 -0
- package/dist/content-evaluator.d.ts.map +1 -0
- package/dist/content.d.ts +98 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/content.js +445 -0
- package/dist/data-route.d.ts +12 -1
- package/dist/data-route.d.ts.map +1 -1
- package/dist/evaluator-sandbox.d.ts +1 -1
- package/dist/evaluator-sandbox.d.ts.map +1 -1
- package/dist/evaluator.d.ts +1 -1
- package/dist/evaluator.d.ts.map +1 -1
- package/dist/findings-view.d.ts +11 -5
- package/dist/findings-view.d.ts.map +1 -1
- package/dist/index.d.ts +17 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +163 -4
- package/dist/inventory.d.ts +59 -0
- package/dist/inventory.d.ts.map +1 -0
- package/dist/plugin.d.ts +59 -3
- package/dist/plugin.d.ts.map +1 -1
- package/dist/presence-check.d.ts +1 -0
- package/dist/presence-check.d.ts.map +1 -1
- package/dist/sandbox-entry.d.ts +2 -1
- package/dist/sandbox-entry.d.ts.map +1 -1
- package/dist/sandbox-entry.js +1077 -190
- package/dist/sandbox.d.ts +2 -2
- package/dist/sidecar-url.d.ts.map +1 -1
- package/dist/sidecar.d.ts +9 -1
- package/dist/sidecar.d.ts.map +1 -1
- package/dist/types.d.ts +26 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/wasm-init.d.ts +8 -0
- package/dist/wasm-init.d.ts.map +1 -1
- package/package.json +28 -8
- package/wasm/aexeo_emdash_bridge.d.ts +22 -0
- package/wasm/aexeo_emdash_bridge.js +1 -1
- package/wasm/aexeo_emdash_bridge_bg.d.ts +15 -0
- package/wasm/aexeo_emdash_bridge_bg.js +130 -0
- package/wasm/aexeo_emdash_bridge_bg.wasm +0 -0
- package/wasm/aexeo_emdash_bridge_bg.wasm.d.ts +4 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ContentReport, ContentEvaluationTelemetry, ExtensionInput, ExternalGateResult, LinkDestinationProjection, BoundLinkObservations } from "./content.js";
|
|
2
|
+
import type { EvaluatorFn } from "./plugin.js";
|
|
3
|
+
import type { EmdashDocument } from "./types.js";
|
|
4
|
+
export interface ContentPresetOptions {
|
|
5
|
+
name: string;
|
|
6
|
+
sources?: Record<string, string>;
|
|
7
|
+
evidenceSources?: Record<string, string>;
|
|
8
|
+
byCollection?: Record<string, string>;
|
|
9
|
+
/** Restrict preset evaluation to these collections; site checks still run for all. */
|
|
10
|
+
collections?: readonly string[];
|
|
11
|
+
}
|
|
12
|
+
/** Trusted host code, installed explicitly at runtime; presets never load providers. */
|
|
13
|
+
export type ExternalGateProvider = (request: {
|
|
14
|
+
input: ExtensionInput;
|
|
15
|
+
preset: string;
|
|
16
|
+
collection: string | undefined;
|
|
17
|
+
}) => Promise<ExternalGateResult[]>;
|
|
18
|
+
/** Trusted host observer; it controls its own network policy and timeouts. */
|
|
19
|
+
export type LinkObservationProvider = (request: {
|
|
20
|
+
destinations: readonly string[];
|
|
21
|
+
preset: string;
|
|
22
|
+
collection: string | undefined;
|
|
23
|
+
}) => Promise<BoundLinkObservations["observations"]>;
|
|
24
|
+
export interface LinkProviderTelemetry {
|
|
25
|
+
duration_ms: number;
|
|
26
|
+
status: "success" | "error" | "unavailable";
|
|
27
|
+
}
|
|
28
|
+
export interface ExternalGateTelemetry {
|
|
29
|
+
duration_ms: number;
|
|
30
|
+
status: "success" | "error";
|
|
31
|
+
}
|
|
32
|
+
/** Add portable content findings to an existing evaluator without hiding skipped gates. */
|
|
33
|
+
export declare function withContentPreset(base: EvaluatorFn, preset: ContentPresetOptions | undefined, evaluate: (document: EmdashDocument, name: string, sources?: Record<string, string>, evidenceSources?: Record<string, string>, onTelemetry?: (event: ContentEvaluationTelemetry) => void, externalResults?: ExternalGateResult[], linkObservations?: BoundLinkObservations) => Promise<ContentReport>, provider?: ExternalGateProvider, project?: (document: EmdashDocument, evidenceSources?: Record<string, string>) => Promise<ExtensionInput>, onProviderTelemetry?: (event: ExternalGateTelemetry) => void, linkProvider?: LinkObservationProvider, projectLinks?: (document: EmdashDocument) => Promise<LinkDestinationProjection | null>, onLinkProviderTelemetry?: (event: LinkProviderTelemetry) => void): EvaluatorFn;
|
|
34
|
+
//# sourceMappingURL=content-evaluator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-evaluator.d.ts","sourceRoot":"","sources":["../src/content-evaluator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,0BAA0B,EAAE,cAAc,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACpK,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MA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AQ,CAAC,EAAE,oBAAoB,EAC/B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,OAAO,CAAC,cAAc,CAAC,EACzG,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,EAC5D,YAAY,CAAC,EAAE,uBAAuB,EACtC,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,EACtF,uBAAuB,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,GAC/D,WAAW,CA8Fb"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { EmdashDocument, Finding } from "./types.js";
|
|
2
|
+
export interface ContentGateResult {
|
|
3
|
+
gate_id: string;
|
|
4
|
+
status: "passed" | "failed" | "not_checked";
|
|
5
|
+
blocking: boolean;
|
|
6
|
+
scope: "document" | "collection" | "site";
|
|
7
|
+
required_capability: "text" | "source_text" | "metadata" | "headings" | "paragraphs" | "links" | "link_destinations" | "link_reachability" | "collection_metadata" | "site" | "extension" | "text_and_evidence";
|
|
8
|
+
findings: Finding[];
|
|
9
|
+
reason: string | null;
|
|
10
|
+
measurements?: Record<string, number>;
|
|
11
|
+
}
|
|
12
|
+
/** Coordinates inside the exact Portable Text snapshot sent for evaluation. */
|
|
13
|
+
export interface EmdashSourceLocation {
|
|
14
|
+
gate_id: string;
|
|
15
|
+
finding_index: number;
|
|
16
|
+
block_index: number;
|
|
17
|
+
span_index: number;
|
|
18
|
+
/** Zero-based UTF-16 code unit offset in the span text. */
|
|
19
|
+
utf16_offset: number;
|
|
20
|
+
}
|
|
21
|
+
export interface ContentReport {
|
|
22
|
+
preset: string;
|
|
23
|
+
input_id: string;
|
|
24
|
+
gates: ContentGateResult[];
|
|
25
|
+
summary?: {
|
|
26
|
+
passed: number;
|
|
27
|
+
failed: number;
|
|
28
|
+
not_checked: number;
|
|
29
|
+
blocking_failed: number;
|
|
30
|
+
blocking_not_checked: number;
|
|
31
|
+
};
|
|
32
|
+
applied_fixes: string[];
|
|
33
|
+
/** Omitted for collection reports; link findings point to the first marked span. */
|
|
34
|
+
source_locations?: EmdashSourceLocation[];
|
|
35
|
+
/** Emitted positional findings; report limits can omit additional findings. */
|
|
36
|
+
source_mapping?: {
|
|
37
|
+
eligible: number;
|
|
38
|
+
mapped: number;
|
|
39
|
+
unmapped: number;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** Local, opt-in aggregate metrics; contains no document text or identifiers. */
|
|
43
|
+
export interface ContentEvaluationTelemetry {
|
|
44
|
+
/** End-to-end wrapper duration, including serialization and WASM initialization. */
|
|
45
|
+
evaluation_ms: number;
|
|
46
|
+
source_locations_mapped: number;
|
|
47
|
+
/** Omitted with older WASM bridges. */
|
|
48
|
+
source_locations_eligible?: number;
|
|
49
|
+
source_locations_unmapped?: number;
|
|
50
|
+
/** Aggregate destination occurrences; omitted when the gate did not measure them. */
|
|
51
|
+
link_destinations?: {
|
|
52
|
+
checked: number;
|
|
53
|
+
invalid: number;
|
|
54
|
+
};
|
|
55
|
+
link_reachability?: {
|
|
56
|
+
checked: number;
|
|
57
|
+
not_found: number;
|
|
58
|
+
unchecked: number;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** Exact projected input bound to external extension results; may contain private content. */
|
|
62
|
+
export interface ExtensionInput {
|
|
63
|
+
id: string;
|
|
64
|
+
text: string | null;
|
|
65
|
+
source_text: string | null;
|
|
66
|
+
headings: string[] | null;
|
|
67
|
+
metadata: Record<string, string> | null;
|
|
68
|
+
evidence_sources: Record<string, string> | null;
|
|
69
|
+
}
|
|
70
|
+
export interface ExternalGateResult {
|
|
71
|
+
extension: string;
|
|
72
|
+
parameters: Record<string, string>;
|
|
73
|
+
input: ExtensionInput;
|
|
74
|
+
diagnostics: Array<{
|
|
75
|
+
message: string;
|
|
76
|
+
line: number;
|
|
77
|
+
column: number;
|
|
78
|
+
}>;
|
|
79
|
+
}
|
|
80
|
+
/** Project the same input the evaluator will give a trusted extension. */
|
|
81
|
+
export declare function projectContentInput(document: EmdashDocument, evidenceSources?: Record<string, string>): Promise<ExtensionInput>;
|
|
82
|
+
/** Snapshot and link occurrences in adapter order. This may contain private content and URLs. */
|
|
83
|
+
export interface LinkDestinationProjection {
|
|
84
|
+
document: EmdashDocument;
|
|
85
|
+
destinations: string[];
|
|
86
|
+
}
|
|
87
|
+
export interface BoundLinkObservations extends LinkDestinationProjection {
|
|
88
|
+
observations: Array<"reachable" | "not_found" | "not_checked" | "not_applicable">;
|
|
89
|
+
}
|
|
90
|
+
/** Return null when link coverage is unavailable. The returned snapshot must not be modified. */
|
|
91
|
+
export declare function projectLinkDestinations(document: EmdashDocument): Promise<LinkDestinationProjection | null>;
|
|
92
|
+
/** Evaluate a document locally using the built-in or supplied named TOML presets. */
|
|
93
|
+
export declare function evaluateContent(document: EmdashDocument, preset: string, sources?: Record<string, string>, evidenceSources?: Record<string, string>, onTelemetry?: (event: ContentEvaluationTelemetry) => void, externalResults?: ExternalGateResult[], linkObservations?: BoundLinkObservations): Promise<ContentReport>;
|
|
94
|
+
/** Mark known incomplete collections explicitly; omitted options assume completeness. */
|
|
95
|
+
export declare function evaluateContentCollection(documents: EmdashDocument[], preset: string, sources?: Record<string, string>, options?: {
|
|
96
|
+
complete?: boolean;
|
|
97
|
+
}): Promise<ContentReport>;
|
|
98
|
+
//# sourceMappingURL=content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../src/content.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1D,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,aAA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ED,iGAAiG;AACjG,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,cAAc,CAAC;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,qBAAsB,SAAQ,yBAAyB;IACtE,YAAY,EAAE,KAAK,CAAC,WAAW,GAAG,WAAW,GAAG,aAAa,GAAG,gBAAgB,CAAC,CAAC;CACnF;AAED,iGAAiG;AACjG,wBAAsB,uBAAuB,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAEjH;AAED,qFAAqF;AACrF,wBAAsB,eAAe,CACnC,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EACpC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACxC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,EACzD,eAAe,CAAC,EAAE,kBAAkB,EAAE,EACtC,gBAAgB,CAAC,EAAE,qBAAqB,GACvC,OAAO,CAAC,aAAa,CAAC,CAuCxB;AAED,yFAAyF;AACzF,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,cAAc,EAAE,EAC3B,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EACpC,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,GACnC,OAAO,CAAC,aAAa,CAAC,CAGxB"}
|
package/dist/content.js
ADDED
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// wasm/aexeo_emdash_bridge_bg.js
|
|
8
|
+
var aexeo_emdash_bridge_bg_exports = {};
|
|
9
|
+
__export(aexeo_emdash_bridge_bg_exports, {
|
|
10
|
+
__wbg_Error_960c155d3d49e4c2: () => __wbg_Error_960c155d3d49e4c2,
|
|
11
|
+
__wbg_error_a6fa202b58aa1cd3: () => __wbg_error_a6fa202b58aa1cd3,
|
|
12
|
+
__wbg_new_227d7c05414eb861: () => __wbg_new_227d7c05414eb861,
|
|
13
|
+
__wbg_set_wasm: () => __wbg_set_wasm,
|
|
14
|
+
__wbg_stack_3b0d974bbf31e44f: () => __wbg_stack_3b0d974bbf31e44f,
|
|
15
|
+
__wbindgen_init_externref_table: () => __wbindgen_init_externref_table,
|
|
16
|
+
evaluateContent: () => evaluateContent,
|
|
17
|
+
evaluateContentCollection: () => evaluateContentCollection,
|
|
18
|
+
evaluateDocuments: () => evaluateDocuments,
|
|
19
|
+
generateFactsPrompt: () => generateFactsPrompt,
|
|
20
|
+
projectContentInput: () => projectContentInput,
|
|
21
|
+
projectLinkDestinations: () => projectLinkDestinations,
|
|
22
|
+
scoreIntelligence: () => scoreIntelligence,
|
|
23
|
+
validateFactsManifest: () => validateFactsManifest
|
|
24
|
+
});
|
|
25
|
+
function evaluateContent(document_json, preset_name, sources_json, evidence_json, extensions_json, link_observations_json) {
|
|
26
|
+
let deferred8_0;
|
|
27
|
+
let deferred8_1;
|
|
28
|
+
try {
|
|
29
|
+
const ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
30
|
+
const len0 = WASM_VECTOR_LEN;
|
|
31
|
+
const ptr1 = passStringToWasm0(preset_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
32
|
+
const len1 = WASM_VECTOR_LEN;
|
|
33
|
+
var ptr2 = isLikeNone(sources_json) ? 0 : passStringToWasm0(sources_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
34
|
+
var len2 = WASM_VECTOR_LEN;
|
|
35
|
+
var ptr3 = isLikeNone(evidence_json) ? 0 : passStringToWasm0(evidence_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
36
|
+
var len3 = WASM_VECTOR_LEN;
|
|
37
|
+
var ptr4 = isLikeNone(extensions_json) ? 0 : passStringToWasm0(extensions_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
38
|
+
var len4 = WASM_VECTOR_LEN;
|
|
39
|
+
var ptr5 = isLikeNone(link_observations_json) ? 0 : passStringToWasm0(link_observations_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
40
|
+
var len5 = WASM_VECTOR_LEN;
|
|
41
|
+
const ret = wasm.evaluateContent(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
42
|
+
var ptr7 = ret[0];
|
|
43
|
+
var len7 = ret[1];
|
|
44
|
+
if (ret[3]) {
|
|
45
|
+
ptr7 = 0;
|
|
46
|
+
len7 = 0;
|
|
47
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
48
|
+
}
|
|
49
|
+
deferred8_0 = ptr7;
|
|
50
|
+
deferred8_1 = len7;
|
|
51
|
+
return getStringFromWasm0(ptr7, len7);
|
|
52
|
+
} finally {
|
|
53
|
+
wasm.__wbindgen_free(deferred8_0, deferred8_1, 1);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function evaluateContentCollection(documents_json, preset_name, sources_json) {
|
|
57
|
+
let deferred5_0;
|
|
58
|
+
let deferred5_1;
|
|
59
|
+
try {
|
|
60
|
+
const ptr0 = passStringToWasm0(documents_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
61
|
+
const len0 = WASM_VECTOR_LEN;
|
|
62
|
+
const ptr1 = passStringToWasm0(preset_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
63
|
+
const len1 = WASM_VECTOR_LEN;
|
|
64
|
+
var ptr2 = isLikeNone(sources_json) ? 0 : passStringToWasm0(sources_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
65
|
+
var len2 = WASM_VECTOR_LEN;
|
|
66
|
+
const ret = wasm.evaluateContentCollection(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
67
|
+
var ptr4 = ret[0];
|
|
68
|
+
var len4 = ret[1];
|
|
69
|
+
if (ret[3]) {
|
|
70
|
+
ptr4 = 0;
|
|
71
|
+
len4 = 0;
|
|
72
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
73
|
+
}
|
|
74
|
+
deferred5_0 = ptr4;
|
|
75
|
+
deferred5_1 = len4;
|
|
76
|
+
return getStringFromWasm0(ptr4, len4);
|
|
77
|
+
} finally {
|
|
78
|
+
wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function evaluateDocuments(documents_json, config_json) {
|
|
82
|
+
let deferred4_0;
|
|
83
|
+
let deferred4_1;
|
|
84
|
+
try {
|
|
85
|
+
const ptr0 = passStringToWasm0(documents_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
86
|
+
const len0 = WASM_VECTOR_LEN;
|
|
87
|
+
var ptr1 = isLikeNone(config_json) ? 0 : passStringToWasm0(config_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
88
|
+
var len1 = WASM_VECTOR_LEN;
|
|
89
|
+
const ret = wasm.evaluateDocuments(ptr0, len0, ptr1, len1);
|
|
90
|
+
var ptr3 = ret[0];
|
|
91
|
+
var len3 = ret[1];
|
|
92
|
+
if (ret[3]) {
|
|
93
|
+
ptr3 = 0;
|
|
94
|
+
len3 = 0;
|
|
95
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
96
|
+
}
|
|
97
|
+
deferred4_0 = ptr3;
|
|
98
|
+
deferred4_1 = len3;
|
|
99
|
+
return getStringFromWasm0(ptr3, len3);
|
|
100
|
+
} finally {
|
|
101
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function generateFactsPrompt(documents_json) {
|
|
105
|
+
let deferred3_0;
|
|
106
|
+
let deferred3_1;
|
|
107
|
+
try {
|
|
108
|
+
const ptr0 = passStringToWasm0(documents_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
109
|
+
const len0 = WASM_VECTOR_LEN;
|
|
110
|
+
const ret = wasm.generateFactsPrompt(ptr0, len0);
|
|
111
|
+
var ptr2 = ret[0];
|
|
112
|
+
var len2 = ret[1];
|
|
113
|
+
if (ret[3]) {
|
|
114
|
+
ptr2 = 0;
|
|
115
|
+
len2 = 0;
|
|
116
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
117
|
+
}
|
|
118
|
+
deferred3_0 = ptr2;
|
|
119
|
+
deferred3_1 = len2;
|
|
120
|
+
return getStringFromWasm0(ptr2, len2);
|
|
121
|
+
} finally {
|
|
122
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function projectContentInput(document_json, evidence_json) {
|
|
126
|
+
let deferred4_0;
|
|
127
|
+
let deferred4_1;
|
|
128
|
+
try {
|
|
129
|
+
const ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
130
|
+
const len0 = WASM_VECTOR_LEN;
|
|
131
|
+
var ptr1 = isLikeNone(evidence_json) ? 0 : passStringToWasm0(evidence_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
132
|
+
var len1 = WASM_VECTOR_LEN;
|
|
133
|
+
const ret = wasm.projectContentInput(ptr0, len0, ptr1, len1);
|
|
134
|
+
var ptr3 = ret[0];
|
|
135
|
+
var len3 = ret[1];
|
|
136
|
+
if (ret[3]) {
|
|
137
|
+
ptr3 = 0;
|
|
138
|
+
len3 = 0;
|
|
139
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
140
|
+
}
|
|
141
|
+
deferred4_0 = ptr3;
|
|
142
|
+
deferred4_1 = len3;
|
|
143
|
+
return getStringFromWasm0(ptr3, len3);
|
|
144
|
+
} finally {
|
|
145
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function projectLinkDestinations(document_json) {
|
|
149
|
+
let deferred3_0;
|
|
150
|
+
let deferred3_1;
|
|
151
|
+
try {
|
|
152
|
+
const ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
153
|
+
const len0 = WASM_VECTOR_LEN;
|
|
154
|
+
const ret = wasm.projectLinkDestinations(ptr0, len0);
|
|
155
|
+
var ptr2 = ret[0];
|
|
156
|
+
var len2 = ret[1];
|
|
157
|
+
if (ret[3]) {
|
|
158
|
+
ptr2 = 0;
|
|
159
|
+
len2 = 0;
|
|
160
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
161
|
+
}
|
|
162
|
+
deferred3_0 = ptr2;
|
|
163
|
+
deferred3_1 = len2;
|
|
164
|
+
return getStringFromWasm0(ptr2, len2);
|
|
165
|
+
} finally {
|
|
166
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function scoreIntelligence(documents_json, manifest_json) {
|
|
170
|
+
let deferred4_0;
|
|
171
|
+
let deferred4_1;
|
|
172
|
+
try {
|
|
173
|
+
const ptr0 = passStringToWasm0(documents_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
174
|
+
const len0 = WASM_VECTOR_LEN;
|
|
175
|
+
var ptr1 = isLikeNone(manifest_json) ? 0 : passStringToWasm0(manifest_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
176
|
+
var len1 = WASM_VECTOR_LEN;
|
|
177
|
+
const ret = wasm.scoreIntelligence(ptr0, len0, ptr1, len1);
|
|
178
|
+
var ptr3 = ret[0];
|
|
179
|
+
var len3 = ret[1];
|
|
180
|
+
if (ret[3]) {
|
|
181
|
+
ptr3 = 0;
|
|
182
|
+
len3 = 0;
|
|
183
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
184
|
+
}
|
|
185
|
+
deferred4_0 = ptr3;
|
|
186
|
+
deferred4_1 = len3;
|
|
187
|
+
return getStringFromWasm0(ptr3, len3);
|
|
188
|
+
} finally {
|
|
189
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
function validateFactsManifest(manifest_json, documents_json) {
|
|
193
|
+
let deferred4_0;
|
|
194
|
+
let deferred4_1;
|
|
195
|
+
try {
|
|
196
|
+
const ptr0 = passStringToWasm0(manifest_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
197
|
+
const len0 = WASM_VECTOR_LEN;
|
|
198
|
+
const ptr1 = passStringToWasm0(documents_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
199
|
+
const len1 = WASM_VECTOR_LEN;
|
|
200
|
+
const ret = wasm.validateFactsManifest(ptr0, len0, ptr1, len1);
|
|
201
|
+
var ptr3 = ret[0];
|
|
202
|
+
var len3 = ret[1];
|
|
203
|
+
if (ret[3]) {
|
|
204
|
+
ptr3 = 0;
|
|
205
|
+
len3 = 0;
|
|
206
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
207
|
+
}
|
|
208
|
+
deferred4_0 = ptr3;
|
|
209
|
+
deferred4_1 = len3;
|
|
210
|
+
return getStringFromWasm0(ptr3, len3);
|
|
211
|
+
} finally {
|
|
212
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function __wbg_Error_960c155d3d49e4c2(arg0, arg1) {
|
|
216
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
217
|
+
return ret;
|
|
218
|
+
}
|
|
219
|
+
function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
|
|
220
|
+
let deferred0_0;
|
|
221
|
+
let deferred0_1;
|
|
222
|
+
try {
|
|
223
|
+
deferred0_0 = arg0;
|
|
224
|
+
deferred0_1 = arg1;
|
|
225
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
226
|
+
} finally {
|
|
227
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function __wbg_new_227d7c05414eb861() {
|
|
231
|
+
const ret = new Error();
|
|
232
|
+
return ret;
|
|
233
|
+
}
|
|
234
|
+
function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
|
|
235
|
+
const ret = arg1.stack;
|
|
236
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
237
|
+
const len1 = WASM_VECTOR_LEN;
|
|
238
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
239
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
240
|
+
}
|
|
241
|
+
function __wbindgen_init_externref_table() {
|
|
242
|
+
const table = wasm.__wbindgen_externrefs;
|
|
243
|
+
const offset = table.grow(4);
|
|
244
|
+
table.set(0, void 0);
|
|
245
|
+
table.set(offset + 0, void 0);
|
|
246
|
+
table.set(offset + 1, null);
|
|
247
|
+
table.set(offset + 2, true);
|
|
248
|
+
table.set(offset + 3, false);
|
|
249
|
+
}
|
|
250
|
+
var cachedDataViewMemory0 = null;
|
|
251
|
+
function getDataViewMemory0() {
|
|
252
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
|
253
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
254
|
+
}
|
|
255
|
+
return cachedDataViewMemory0;
|
|
256
|
+
}
|
|
257
|
+
function getStringFromWasm0(ptr, len) {
|
|
258
|
+
ptr = ptr >>> 0;
|
|
259
|
+
return decodeText(ptr, len);
|
|
260
|
+
}
|
|
261
|
+
var cachedUint8ArrayMemory0 = null;
|
|
262
|
+
function getUint8ArrayMemory0() {
|
|
263
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
264
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
265
|
+
}
|
|
266
|
+
return cachedUint8ArrayMemory0;
|
|
267
|
+
}
|
|
268
|
+
function isLikeNone(x) {
|
|
269
|
+
return x === void 0 || x === null;
|
|
270
|
+
}
|
|
271
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
272
|
+
if (realloc === void 0) {
|
|
273
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
274
|
+
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
275
|
+
getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
276
|
+
WASM_VECTOR_LEN = buf.length;
|
|
277
|
+
return ptr2;
|
|
278
|
+
}
|
|
279
|
+
let len = arg.length;
|
|
280
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
281
|
+
const mem = getUint8ArrayMemory0();
|
|
282
|
+
let offset = 0;
|
|
283
|
+
for (; offset < len; offset++) {
|
|
284
|
+
const code = arg.charCodeAt(offset);
|
|
285
|
+
if (code > 127) break;
|
|
286
|
+
mem[ptr + offset] = code;
|
|
287
|
+
}
|
|
288
|
+
if (offset !== len) {
|
|
289
|
+
if (offset !== 0) {
|
|
290
|
+
arg = arg.slice(offset);
|
|
291
|
+
}
|
|
292
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
293
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
294
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
295
|
+
offset += ret.written;
|
|
296
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
297
|
+
}
|
|
298
|
+
WASM_VECTOR_LEN = offset;
|
|
299
|
+
return ptr;
|
|
300
|
+
}
|
|
301
|
+
function takeFromExternrefTable0(idx) {
|
|
302
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
303
|
+
wasm.__externref_table_dealloc(idx);
|
|
304
|
+
return value;
|
|
305
|
+
}
|
|
306
|
+
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
307
|
+
cachedTextDecoder.decode();
|
|
308
|
+
var MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
309
|
+
var numBytesDecoded = 0;
|
|
310
|
+
function decodeText(ptr, len) {
|
|
311
|
+
numBytesDecoded += len;
|
|
312
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
313
|
+
cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
314
|
+
cachedTextDecoder.decode();
|
|
315
|
+
numBytesDecoded = len;
|
|
316
|
+
}
|
|
317
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
318
|
+
}
|
|
319
|
+
var cachedTextEncoder = new TextEncoder();
|
|
320
|
+
if (!("encodeInto" in cachedTextEncoder)) {
|
|
321
|
+
cachedTextEncoder.encodeInto = function(arg, view) {
|
|
322
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
323
|
+
view.set(buf);
|
|
324
|
+
return {
|
|
325
|
+
read: arg.length,
|
|
326
|
+
written: buf.length
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
var WASM_VECTOR_LEN = 0;
|
|
331
|
+
var wasm;
|
|
332
|
+
function __wbg_set_wasm(val) {
|
|
333
|
+
wasm = val;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// src/wasm-init.ts
|
|
337
|
+
var WASM_SPECIFIER = "../wasm/aexeo_emdash_bridge_bg.wasm";
|
|
338
|
+
var initialized = false;
|
|
339
|
+
var cachedModule = null;
|
|
340
|
+
async function loadBridgeModule() {
|
|
341
|
+
if (cachedModule !== null) {
|
|
342
|
+
return cachedModule;
|
|
343
|
+
}
|
|
344
|
+
try {
|
|
345
|
+
const mod = await import(WASM_SPECIFIER);
|
|
346
|
+
if (mod.default instanceof WebAssembly.Module) {
|
|
347
|
+
cachedModule = mod.default;
|
|
348
|
+
return cachedModule;
|
|
349
|
+
}
|
|
350
|
+
} catch {
|
|
351
|
+
}
|
|
352
|
+
const wasmUrl = new URL(WASM_SPECIFIER, import.meta.url);
|
|
353
|
+
if (wasmUrl.protocol === "file:") {
|
|
354
|
+
const [{ readFile }, { fileURLToPath }] = await Promise.all([
|
|
355
|
+
import("node:fs/promises"),
|
|
356
|
+
import("node:url")
|
|
357
|
+
]);
|
|
358
|
+
const bytes = await readFile(fileURLToPath(wasmUrl));
|
|
359
|
+
cachedModule = await WebAssembly.compile(bytes);
|
|
360
|
+
return cachedModule;
|
|
361
|
+
}
|
|
362
|
+
const response = await fetch(wasmUrl);
|
|
363
|
+
cachedModule = await WebAssembly.compileStreaming(response);
|
|
364
|
+
return cachedModule;
|
|
365
|
+
}
|
|
366
|
+
async function ensureInitialized() {
|
|
367
|
+
if (initialized) {
|
|
368
|
+
return;
|
|
369
|
+
}
|
|
370
|
+
const bridgeModule = await loadBridgeModule();
|
|
371
|
+
const instance = new WebAssembly.Instance(bridgeModule, {
|
|
372
|
+
"./aexeo_emdash_bridge_bg.js": aexeo_emdash_bridge_bg_exports
|
|
373
|
+
});
|
|
374
|
+
__wbg_set_wasm(instance.exports);
|
|
375
|
+
instance.exports.__wbindgen_start();
|
|
376
|
+
initialized = true;
|
|
377
|
+
}
|
|
378
|
+
async function evaluateContent2(documentJson, presetName, sourcesJson, evidenceJson, extensionsJson, linkObservationsJson) {
|
|
379
|
+
await ensureInitialized();
|
|
380
|
+
return evaluateContent(documentJson, presetName, sourcesJson, evidenceJson, extensionsJson, linkObservationsJson);
|
|
381
|
+
}
|
|
382
|
+
async function projectLinkDestinations2(documentJson) {
|
|
383
|
+
await ensureInitialized();
|
|
384
|
+
return projectLinkDestinations(documentJson);
|
|
385
|
+
}
|
|
386
|
+
async function projectContentInput2(documentJson, evidenceJson) {
|
|
387
|
+
await ensureInitialized();
|
|
388
|
+
return projectContentInput(documentJson, evidenceJson);
|
|
389
|
+
}
|
|
390
|
+
async function evaluateContentCollection2(documentsJson, presetName, sourcesJson) {
|
|
391
|
+
await ensureInitialized();
|
|
392
|
+
return evaluateContentCollection(documentsJson, presetName, sourcesJson);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
// src/content.ts
|
|
396
|
+
async function projectContentInput3(document, evidenceSources) {
|
|
397
|
+
return JSON.parse(await projectContentInput2(JSON.stringify(document), evidenceSources === void 0 ? void 0 : JSON.stringify(evidenceSources)));
|
|
398
|
+
}
|
|
399
|
+
async function projectLinkDestinations3(document) {
|
|
400
|
+
return JSON.parse(await projectLinkDestinations2(JSON.stringify(document)));
|
|
401
|
+
}
|
|
402
|
+
async function evaluateContent3(document, preset, sources = {}, evidenceSources, onTelemetry, externalResults, linkObservations) {
|
|
403
|
+
const started = onTelemetry ? performance.now() : 0;
|
|
404
|
+
const documentJson = JSON.stringify(document);
|
|
405
|
+
const sourcesJson = JSON.stringify(sources);
|
|
406
|
+
const result = linkObservations !== void 0 ? await evaluateContent2(documentJson, preset, sourcesJson, evidenceSources === void 0 ? void 0 : JSON.stringify(evidenceSources), externalResults === void 0 ? void 0 : JSON.stringify(externalResults), JSON.stringify(linkObservations)) : externalResults !== void 0 ? await evaluateContent2(documentJson, preset, sourcesJson, evidenceSources === void 0 ? void 0 : JSON.stringify(evidenceSources), JSON.stringify(externalResults)) : evidenceSources === void 0 ? await evaluateContent2(documentJson, preset, sourcesJson) : await evaluateContent2(documentJson, preset, sourcesJson, JSON.stringify(evidenceSources));
|
|
407
|
+
const report = JSON.parse(result);
|
|
408
|
+
if (onTelemetry) {
|
|
409
|
+
const event = { evaluation_ms: performance.now() - started, source_locations_mapped: report.source_locations?.length ?? 0 };
|
|
410
|
+
if (report.source_mapping) {
|
|
411
|
+
event.source_locations_eligible = report.source_mapping.eligible;
|
|
412
|
+
event.source_locations_unmapped = report.source_mapping.unmapped;
|
|
413
|
+
}
|
|
414
|
+
for (const gate of report.gates) {
|
|
415
|
+
if (gate.required_capability === "link_reachability" && gate.measurements) {
|
|
416
|
+
const { checked_destinations, not_found_destinations, unchecked_destinations } = gate.measurements;
|
|
417
|
+
if (checked_destinations !== void 0 && not_found_destinations !== void 0 && unchecked_destinations !== void 0) {
|
|
418
|
+
event.link_reachability ??= { checked: 0, not_found: 0, unchecked: 0 };
|
|
419
|
+
event.link_reachability.checked += checked_destinations;
|
|
420
|
+
event.link_reachability.not_found += not_found_destinations;
|
|
421
|
+
event.link_reachability.unchecked += unchecked_destinations;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
const checked = gate.measurements?.checked_destinations;
|
|
425
|
+
const invalid = gate.measurements?.invalid_destinations;
|
|
426
|
+
if (checked !== void 0 && invalid !== void 0) {
|
|
427
|
+
event.link_destinations ??= { checked: 0, invalid: 0 };
|
|
428
|
+
event.link_destinations.checked += checked;
|
|
429
|
+
event.link_destinations.invalid += invalid;
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
onTelemetry(event);
|
|
433
|
+
}
|
|
434
|
+
return report;
|
|
435
|
+
}
|
|
436
|
+
async function evaluateContentCollection3(documents, preset, sources = {}, options = {}) {
|
|
437
|
+
const input = options.complete === false ? { documents, complete: false } : documents;
|
|
438
|
+
return JSON.parse(await evaluateContentCollection2(JSON.stringify(input), preset, JSON.stringify(sources)));
|
|
439
|
+
}
|
|
440
|
+
export {
|
|
441
|
+
evaluateContent3 as evaluateContent,
|
|
442
|
+
evaluateContentCollection3 as evaluateContentCollection,
|
|
443
|
+
projectContentInput3 as projectContentInput,
|
|
444
|
+
projectLinkDestinations3 as projectLinkDestinations
|
|
445
|
+
};
|
package/dist/data-route.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type CmsBodyCoverage } from "./cms-coverage.js";
|
|
2
|
+
import type { CustomBlockMappings } from "./adapter.js";
|
|
3
|
+
import type { DocumentAssessment, EvaluatorFn, RefreshSummary, SandboxCtx } from "./plugin.js";
|
|
2
4
|
import type { Finding } from "./types.js";
|
|
3
5
|
export interface FindingsPayload {
|
|
4
6
|
routes: RouteSummary[];
|
|
@@ -12,6 +14,7 @@ export interface FindingsPayload {
|
|
|
12
14
|
};
|
|
13
15
|
layerBreakdown: LayerBreakdown[];
|
|
14
16
|
sitewideFindings: Finding[];
|
|
17
|
+
sitewideAssessment?: DocumentAssessment;
|
|
15
18
|
}
|
|
16
19
|
export interface LayerBreakdown {
|
|
17
20
|
layer: import("./types.js").Layer;
|
|
@@ -30,8 +33,13 @@ export interface RouteSummary {
|
|
|
30
33
|
findingCount: number;
|
|
31
34
|
errorCount: number;
|
|
32
35
|
warningCount: number;
|
|
36
|
+
assessment?: DocumentAssessment;
|
|
37
|
+
body_coverage?: CmsBodyCoverage;
|
|
33
38
|
}
|
|
34
39
|
export interface FindingRow {
|
|
40
|
+
aexeo_origin?: "content_preset";
|
|
41
|
+
aexeo_source_location?: Finding["aexeo_source_location"];
|
|
42
|
+
aexeo_cms_location?: Finding["aexeo_cms_location"];
|
|
35
43
|
route: string;
|
|
36
44
|
rule_id: string;
|
|
37
45
|
severity: string;
|
|
@@ -44,6 +52,9 @@ export interface FindingRow {
|
|
|
44
52
|
layers?: import("./types.js").RuleLayers;
|
|
45
53
|
}
|
|
46
54
|
interface DataRouteOptions {
|
|
55
|
+
blockMappings?: CustomBlockMappings | undefined;
|
|
56
|
+
contentFieldsByCollection?: Record<string, readonly string[]> | undefined;
|
|
57
|
+
descriptionFieldsByCollection?: Record<string, readonly string[]> | undefined;
|
|
47
58
|
collections: readonly string[];
|
|
48
59
|
evaluator: EvaluatorFn;
|
|
49
60
|
refresh: boolean;
|
package/dist/data-route.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-route.d.ts","sourceRoot":"","sources":["../src/data-route.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data-route.d.ts","sourceRoot":"","sources":["../src/data-route.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAUxD,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,UAAU,EAEX,MAAM,aAAa,CAAC;AASrB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAM1C,MAAM,WAAW,eAAe;IAG9B,MAAM,EAAE,YAAY,EAAE,CAAC;IAIvB,QAAQ,EAAE,UAAU,EAAE,CAAC;IAIvB,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;IAIF,cAAc,EAAE,cAAc,EAAE,CAAC;IAIjC,gBAAgB,EAAE,OAAO,EAAE,CAAC;IAC5B,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,OAAO,YAAY,EAAE,KAAK,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IAGd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IAIX,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,M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ChC,CAAC,CAsBD;AAkJD,wBAAsB,4BAA4B,CAChD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EmdashDocument, Finding, SiteIntelligenceScore } from "./types.js";
|
|
2
2
|
export declare function evaluate(_documents: readonly EmdashDocument[]): Promise<Finding[]>;
|
|
3
|
-
export declare function scoreSite(_documents: readonly EmdashDocument[]): Promise<SiteIntelligenceScore>;
|
|
3
|
+
export declare function scoreSite(_documents: readonly EmdashDocument[]): Promise<SiteIntelligenceScore | null>;
|
|
4
4
|
export declare function errorFindings(findings: readonly Finding[]): Finding[];
|
|
5
5
|
export declare function findingsByRoute(findings: readonly Finding[]): Map<string, Finding[]>;
|
|
6
6
|
//# sourceMappingURL=evaluator-sandbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluator-sandbox.d.ts","sourceRoot":"","sources":["../src/evaluator-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,OAAO,EACP,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAkBpB,wBAAsB,QAAQ,CAC5B,UAAU,EAAE,SAAS,cAAc,EAAE,GACpC,OAAO,CAAC,OAAO,EAAE,CAAC,CAEpB;AAED,wBAAsB,SAAS,CAC7B,UAAU,EAAE,SAAS,cAAc,EAAE,GACpC,OAAO,CAAC,qBAAqB,CAAC,
|
|
1
|
+
{"version":3,"file":"evaluator-sandbox.d.ts","sourceRoot":"","sources":["../src/evaluator-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,OAAO,EACP,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAkBpB,wBAAsB,QAAQ,CAC5B,UAAU,EAAE,SAAS,cAAc,EAAE,GACpC,OAAO,CAAC,OAAO,EAAE,CAAC,CAEpB;AAED,wBAAsB,SAAS,CAC7B,UAAU,EAAE,SAAS,cAAc,EAAE,GACpC,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAEvC;AAQD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE,CAErE;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,SAAS,OAAO,EAAE,GAC3B,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAWxB"}
|
package/dist/evaluator.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export interface EvaluateOptions {
|
|
|
5
5
|
export declare function evaluate(documents: readonly EmdashDocument[], options?: EvaluateOptions): Promise<Finding[]>;
|
|
6
6
|
export declare function errorFindings(findings: readonly Finding[]): Finding[];
|
|
7
7
|
export declare function findingsByRoute(findings: readonly Finding[]): Map<string, Finding[]>;
|
|
8
|
-
export declare function scoreSite(documents: readonly EmdashDocument[]): Promise<SiteIntelligenceScore>;
|
|
8
|
+
export declare function scoreSite(documents: readonly EmdashDocument[]): Promise<SiteIntelligenceScore | null>;
|
|
9
9
|
//# sourceMappingURL=evaluator.d.ts.map
|
package/dist/evaluator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../src/evaluator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,OAAO,EACP,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAapB,MAAM,WAAW,eAAe;IAG9B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,QAAQ,CAC5B,SAAS,EAAE,SAAS,cAAc,EAAE,EACpC,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,OAAO,EAAE,CAAC,CAIpB;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE,CAErE;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,SAAS,OAAO,EAAE,GAC3B,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAWxB;
|
|
1
|
+
{"version":3,"file":"evaluator.d.ts","sourceRoot":"","sources":["../src/evaluator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,OAAO,EACP,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAapB,MAAM,WAAW,eAAe;IAG9B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,QAAQ,CAC5B,SAAS,EAAE,SAAS,cAAc,EAAE,EACpC,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,OAAO,EAAE,CAAC,CAIpB;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,EAAE,CAErE;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,SAAS,OAAO,EAAE,GAC3B,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAWxB;AAMD,wBAAsB,SAAS,CAC7B,SAAS,EAAE,SAAS,cAAc,EAAE,GACnC,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAGvC"}
|