@aeptus/aexeo-emdash 0.9.0 → 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 +16 -0
- package/INSTALL.md +181 -8
- package/README.md +8 -0
- package/dist/adapter.d.ts +34 -4
- package/dist/adapter.d.ts.map +1 -1
- package/dist/admin/Findings.d.ts.map +1 -1
- package/dist/admin.js +71 -4
- 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 +11 -2
- package/dist/configured.d.ts.map +1 -1
- package/dist/configured.js +944 -210
- package/dist/content-evaluator.d.ts +22 -2
- package/dist/content-evaluator.d.ts.map +1 -1
- package/dist/content.d.ts +51 -4
- package/dist/content.d.ts.map +1 -1
- package/dist/content.js +99 -19
- package/dist/data-route.d.ts +9 -1
- package/dist/data-route.d.ts.map +1 -1
- package/dist/findings-view.d.ts +5 -4
- package/dist/findings-view.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +79 -15
- package/dist/inventory.d.ts +9 -1
- package/dist/inventory.d.ts.map +1 -1
- package/dist/plugin.d.ts +30 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/sandbox-entry.d.ts.map +1 -1
- package/dist/sandbox-entry.js +797 -195
- package/dist/sidecar.d.ts +2 -0
- package/dist/sidecar.d.ts.map +1 -1
- package/dist/types.d.ts +15 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/wasm-init.d.ts +5 -1
- package/dist/wasm-init.d.ts.map +1 -1
- package/package.json +12 -3
- package/wasm/aexeo_emdash_bridge.d.ts +12 -1
- package/wasm/aexeo_emdash_bridge.js +1 -1
- package/wasm/aexeo_emdash_bridge_bg.d.ts +4 -0
- package/wasm/aexeo_emdash_bridge_bg.js +73 -11
- package/wasm/aexeo_emdash_bridge_bg.wasm +0 -0
- package/wasm/aexeo_emdash_bridge_bg.wasm.d.ts +3 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContentReport } from "./content.js";
|
|
1
|
+
import type { ContentReport, ContentEvaluationTelemetry, ExtensionInput, ExternalGateResult, LinkDestinationProjection, BoundLinkObservations } from "./content.js";
|
|
2
2
|
import type { EvaluatorFn } from "./plugin.js";
|
|
3
3
|
import type { EmdashDocument } from "./types.js";
|
|
4
4
|
export interface ContentPresetOptions {
|
|
@@ -9,6 +9,26 @@ export interface ContentPresetOptions {
|
|
|
9
9
|
/** Restrict preset evaluation to these collections; site checks still run for all. */
|
|
10
10
|
collections?: readonly string[];
|
|
11
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
|
+
}
|
|
12
32
|
/** Add portable content findings to an existing evaluator without hiding skipped gates. */
|
|
13
|
-
export declare function withContentPreset(base: EvaluatorFn, preset: ContentPresetOptions | undefined, evaluate: (document: EmdashDocument, name: string, sources?: Record<string, string>, evidenceSources?: Record<string, string
|
|
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;
|
|
14
34
|
//# sourceMappingURL=content-evaluator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-evaluator.d.ts","sourceRoot":"","sources":["../src/content-evaluator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
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,MAAM,CAAC,CAAC;IACtC,sFAAsF;IACtF,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC;AA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,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"}
|
package/dist/content.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export interface ContentGateResult {
|
|
|
4
4
|
status: "passed" | "failed" | "not_checked";
|
|
5
5
|
blocking: boolean;
|
|
6
6
|
scope: "document" | "collection" | "site";
|
|
7
|
-
required_capability: "text" | "source_text" | "metadata" | "headings" | "paragraphs" | "links" | "link_destinations" | "collection_metadata" | "site" | "extension" | "text_and_evidence";
|
|
7
|
+
required_capability: "text" | "source_text" | "metadata" | "headings" | "paragraphs" | "links" | "link_destinations" | "link_reachability" | "collection_metadata" | "site" | "extension" | "text_and_evidence";
|
|
8
8
|
findings: Finding[];
|
|
9
9
|
reason: string | null;
|
|
10
10
|
measurements?: Record<string, number>;
|
|
@@ -32,20 +32,67 @@ export interface ContentReport {
|
|
|
32
32
|
applied_fixes: string[];
|
|
33
33
|
/** Omitted for collection reports; link findings point to the first marked span. */
|
|
34
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
|
+
};
|
|
35
41
|
}
|
|
36
42
|
/** Local, opt-in aggregate metrics; contains no document text or identifiers. */
|
|
37
43
|
export interface ContentEvaluationTelemetry {
|
|
38
44
|
/** End-to-end wrapper duration, including serialization and WASM initialization. */
|
|
39
45
|
evaluation_ms: number;
|
|
40
46
|
source_locations_mapped: number;
|
|
47
|
+
/** Omitted with older WASM bridges. */
|
|
48
|
+
source_locations_eligible?: number;
|
|
49
|
+
source_locations_unmapped?: number;
|
|
41
50
|
/** Aggregate destination occurrences; omitted when the gate did not measure them. */
|
|
42
51
|
link_destinations?: {
|
|
43
52
|
checked: number;
|
|
44
53
|
invalid: number;
|
|
45
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">;
|
|
46
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>;
|
|
47
92
|
/** Evaluate a document locally using the built-in or supplied named TOML presets. */
|
|
48
|
-
export declare function evaluateContent(document: EmdashDocument, preset: string, sources?: Record<string, string>, evidenceSources?: Record<string, string>, onTelemetry?: (event: ContentEvaluationTelemetry) => void): Promise<ContentReport>;
|
|
49
|
-
/**
|
|
50
|
-
export declare function evaluateContentCollection(documents: EmdashDocument[], preset: string, sources?: Record<string, string
|
|
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>;
|
|
51
98
|
//# sourceMappingURL=content.d.ts.map
|
package/dist/content.d.ts.map
CHANGED
|
@@ -1 +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,aAAa,CAAC;IAC5C,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,UAAU,GAAG,YAAY,GAAG,MAAM,CAAC;IAC1C,mBAAmB,EAAE,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,UAAU,GAAG,YAAY,GAAG,OAAO,GAAG,mBAAmB,GAAG,qBAAqB,GAAG,MAAM,GAAG,WAAW,GAAG,mBAAmB,CAAC;
|
|
1
|
+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 -17,12 +17,14 @@ __export(aexeo_emdash_bridge_bg_exports, {
|
|
|
17
17
|
evaluateContentCollection: () => evaluateContentCollection,
|
|
18
18
|
evaluateDocuments: () => evaluateDocuments,
|
|
19
19
|
generateFactsPrompt: () => generateFactsPrompt,
|
|
20
|
+
projectContentInput: () => projectContentInput,
|
|
21
|
+
projectLinkDestinations: () => projectLinkDestinations,
|
|
20
22
|
scoreIntelligence: () => scoreIntelligence,
|
|
21
23
|
validateFactsManifest: () => validateFactsManifest
|
|
22
24
|
});
|
|
23
|
-
function evaluateContent(document_json, preset_name, sources_json, evidence_json) {
|
|
24
|
-
let
|
|
25
|
-
let
|
|
25
|
+
function evaluateContent(document_json, preset_name, sources_json, evidence_json, extensions_json, link_observations_json) {
|
|
26
|
+
let deferred8_0;
|
|
27
|
+
let deferred8_1;
|
|
26
28
|
try {
|
|
27
29
|
const ptr0 = passStringToWasm0(document_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
28
30
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -32,19 +34,23 @@ function evaluateContent(document_json, preset_name, sources_json, evidence_json
|
|
|
32
34
|
var len2 = WASM_VECTOR_LEN;
|
|
33
35
|
var ptr3 = isLikeNone(evidence_json) ? 0 : passStringToWasm0(evidence_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
34
36
|
var len3 = WASM_VECTOR_LEN;
|
|
35
|
-
|
|
36
|
-
var
|
|
37
|
-
var
|
|
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];
|
|
38
44
|
if (ret[3]) {
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
ptr7 = 0;
|
|
46
|
+
len7 = 0;
|
|
41
47
|
throw takeFromExternrefTable0(ret[2]);
|
|
42
48
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return getStringFromWasm0(
|
|
49
|
+
deferred8_0 = ptr7;
|
|
50
|
+
deferred8_1 = len7;
|
|
51
|
+
return getStringFromWasm0(ptr7, len7);
|
|
46
52
|
} finally {
|
|
47
|
-
wasm.__wbindgen_free(
|
|
53
|
+
wasm.__wbindgen_free(deferred8_0, deferred8_1, 1);
|
|
48
54
|
}
|
|
49
55
|
}
|
|
50
56
|
function evaluateContentCollection(documents_json, preset_name, sources_json) {
|
|
@@ -116,6 +122,50 @@ function generateFactsPrompt(documents_json) {
|
|
|
116
122
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
117
123
|
}
|
|
118
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
|
+
}
|
|
119
169
|
function scoreIntelligence(documents_json, manifest_json) {
|
|
120
170
|
let deferred4_0;
|
|
121
171
|
let deferred4_1;
|
|
@@ -325,9 +375,17 @@ async function ensureInitialized() {
|
|
|
325
375
|
instance.exports.__wbindgen_start();
|
|
326
376
|
initialized = true;
|
|
327
377
|
}
|
|
328
|
-
async function evaluateContent2(documentJson, presetName, sourcesJson, evidenceJson) {
|
|
378
|
+
async function evaluateContent2(documentJson, presetName, sourcesJson, evidenceJson, extensionsJson, linkObservationsJson) {
|
|
329
379
|
await ensureInitialized();
|
|
330
|
-
return evaluateContent(documentJson, presetName, sourcesJson, evidenceJson);
|
|
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);
|
|
331
389
|
}
|
|
332
390
|
async function evaluateContentCollection2(documentsJson, presetName, sourcesJson) {
|
|
333
391
|
await ensureInitialized();
|
|
@@ -335,15 +393,34 @@ async function evaluateContentCollection2(documentsJson, presetName, sourcesJson
|
|
|
335
393
|
}
|
|
336
394
|
|
|
337
395
|
// src/content.ts
|
|
338
|
-
async function
|
|
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) {
|
|
339
403
|
const started = onTelemetry ? performance.now() : 0;
|
|
340
404
|
const documentJson = JSON.stringify(document);
|
|
341
405
|
const sourcesJson = JSON.stringify(sources);
|
|
342
|
-
const result = evidenceSources === void 0 ? await evaluateContent2(documentJson, preset, sourcesJson) : await evaluateContent2(documentJson, preset, sourcesJson, JSON.stringify(evidenceSources));
|
|
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));
|
|
343
407
|
const report = JSON.parse(result);
|
|
344
408
|
if (onTelemetry) {
|
|
345
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
|
+
}
|
|
346
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
|
+
}
|
|
347
424
|
const checked = gate.measurements?.checked_destinations;
|
|
348
425
|
const invalid = gate.measurements?.invalid_destinations;
|
|
349
426
|
if (checked !== void 0 && invalid !== void 0) {
|
|
@@ -356,10 +433,13 @@ async function evaluateContent3(document, preset, sources = {}, evidenceSources,
|
|
|
356
433
|
}
|
|
357
434
|
return report;
|
|
358
435
|
}
|
|
359
|
-
async function evaluateContentCollection3(documents, preset, sources = {}) {
|
|
360
|
-
|
|
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)));
|
|
361
439
|
}
|
|
362
440
|
export {
|
|
363
441
|
evaluateContent3 as evaluateContent,
|
|
364
|
-
evaluateContentCollection3 as evaluateContentCollection
|
|
442
|
+
evaluateContentCollection3 as evaluateContentCollection,
|
|
443
|
+
projectContentInput3 as projectContentInput,
|
|
444
|
+
projectLinkDestinations3 as projectLinkDestinations
|
|
365
445
|
};
|
package/dist/data-route.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type CmsBodyCoverage } from "./cms-coverage.js";
|
|
1
2
|
import type { CustomBlockMappings } from "./adapter.js";
|
|
2
|
-
import type { EvaluatorFn, RefreshSummary, SandboxCtx } from "./plugin.js";
|
|
3
|
+
import type { DocumentAssessment, EvaluatorFn, RefreshSummary, SandboxCtx } from "./plugin.js";
|
|
3
4
|
import type { Finding } from "./types.js";
|
|
4
5
|
export interface FindingsPayload {
|
|
5
6
|
routes: RouteSummary[];
|
|
@@ -13,6 +14,7 @@ export interface FindingsPayload {
|
|
|
13
14
|
};
|
|
14
15
|
layerBreakdown: LayerBreakdown[];
|
|
15
16
|
sitewideFindings: Finding[];
|
|
17
|
+
sitewideAssessment?: DocumentAssessment;
|
|
16
18
|
}
|
|
17
19
|
export interface LayerBreakdown {
|
|
18
20
|
layer: import("./types.js").Layer;
|
|
@@ -31,8 +33,13 @@ export interface RouteSummary {
|
|
|
31
33
|
findingCount: number;
|
|
32
34
|
errorCount: number;
|
|
33
35
|
warningCount: number;
|
|
36
|
+
assessment?: DocumentAssessment;
|
|
37
|
+
body_coverage?: CmsBodyCoverage;
|
|
34
38
|
}
|
|
35
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"];
|
|
36
43
|
route: string;
|
|
37
44
|
rule_id: string;
|
|
38
45
|
severity: string;
|
|
@@ -47,6 +54,7 @@ export interface FindingRow {
|
|
|
47
54
|
interface DataRouteOptions {
|
|
48
55
|
blockMappings?: CustomBlockMappings | undefined;
|
|
49
56
|
contentFieldsByCollection?: Record<string, readonly string[]> | undefined;
|
|
57
|
+
descriptionFieldsByCollection?: Record<string, readonly string[]> | undefined;
|
|
50
58
|
collections: readonly string[];
|
|
51
59
|
evaluator: EvaluatorFn;
|
|
52
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":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAUxD,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,UAAU,EAEX,MAAM,aAAa,CAAC;
|
|
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,OAA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E,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,GAAG,SAAS,CAAC;IAC9E,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,SAAS,EAAE,WAAW,CAAC;IAIvB,OAAO,EAAE,OAAO,CAAC;IAIjB,iBAAiB,CAAC,EAAE,OAAO,mBAAmB,EAAE,iBAAiB,CAAC;CACnE;AAED,wBAAsB,eAAe,CACnC,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC;IACT,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;CAChC,CAAC,CAsBD;AAkJD,wBAAsB,4BAA4B,CAChD,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
package/dist/findings-view.d.ts
CHANGED
|
@@ -75,9 +75,8 @@ export interface AdminViewTuning {
|
|
|
75
75
|
*/
|
|
76
76
|
refreshFailureVariant: "alert" | "error";
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* sidecar-backed `scoreSite`.
|
|
78
|
+
* Retained for compatibility; CMS-only widget inputs do not establish the
|
|
79
|
+
* rendered-page coverage required to show a site score.
|
|
81
80
|
*/
|
|
82
81
|
score: (documents: readonly EmdashDocument[], kv: KvNamespace) => Promise<SiteIntelligenceScore | null>;
|
|
83
82
|
/**
|
|
@@ -90,6 +89,8 @@ export interface AdminViewTuning {
|
|
|
90
89
|
export interface RefreshOptions {
|
|
91
90
|
blockMappings?: CustomBlockMappings | undefined;
|
|
92
91
|
contentFieldsByCollection?: Record<string, readonly string[]> | undefined;
|
|
92
|
+
contentFieldsUnavailable?: boolean | undefined;
|
|
93
|
+
descriptionFieldsByCollection?: Record<string, readonly string[]> | undefined;
|
|
93
94
|
/**
|
|
94
95
|
* Host context. `evaluateAndPersistAll` needs kv/http/content/log, and
|
|
95
96
|
* the follow-up `renderFindingsPage` needs kv.
|
|
@@ -131,7 +132,7 @@ export declare function severityFirst(a: Finding, b: Finding): number;
|
|
|
131
132
|
export declare function uniqueRoutes(rows: FindingRow[]): string[];
|
|
132
133
|
export declare function renderFindingsPage(kv: KvNamespace, tuning: AdminViewTuning): Promise<BlockResponse>;
|
|
133
134
|
export declare function findingsTable(rows: FindingRow[]): unknown;
|
|
134
|
-
export declare function renderScoreWidget(
|
|
135
|
+
export declare function renderScoreWidget(_kv: KvNamespace, _tuning: AdminViewTuning, _log?: {
|
|
135
136
|
error(message: string, data?: unknown): void;
|
|
136
137
|
}): Promise<BlockResponse>;
|
|
137
138
|
export declare function topBlockersLine(score: SiteIntelligenceScore): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findings-view.d.ts","sourceRoot":"","sources":["../src/findings-view.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"findings-view.d.ts","sourceRoot":"","sources":["../src/findings-view.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAmBxD,OAAO,KAAK,EACV,cAAc,EACd,OAAO,EACP,qBAAqB,EACtB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAEV,WAAW,EACX,WAAW,EAEX,UAAU,EACX,MAAM,aAAa,CAAC;AAOrB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAK3D,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACnC;IACE,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GACD;IACE,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MA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package/dist/index.d.ts
CHANGED
|
@@ -19,15 +19,17 @@ export interface ConfiguredPluginDescriptor {
|
|
|
19
19
|
}[];
|
|
20
20
|
}
|
|
21
21
|
import type { CustomBlockMappings } from "./adapter.js";
|
|
22
|
-
export type { CustomBlockMappings, CustomBlockField } from "./adapter.js";
|
|
22
|
+
export type { BodyCapability, CustomBlockMapping, CustomBlockMappings, CustomBlockField, InlineComponentField } from "./adapter.js";
|
|
23
23
|
export interface AexeoPluginOptions {
|
|
24
24
|
/** Ordered field mappings for project-specific blocks. */
|
|
25
25
|
blockMappings?: CustomBlockMappings;
|
|
26
26
|
contentFieldsByCollection?: Record<string, readonly string[]>;
|
|
27
|
+
descriptionFieldsByCollection?: Record<string, readonly string[]>;
|
|
27
28
|
/** Add a portable content preset to configured-mode evaluation. */
|
|
28
29
|
contentPreset?: {
|
|
29
30
|
name: string;
|
|
30
31
|
sources?: Record<string, string>;
|
|
32
|
+
evidenceSources?: Record<string, string>;
|
|
31
33
|
byCollection?: Record<string, string>;
|
|
32
34
|
collections?: readonly string[];
|
|
33
35
|
};
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,cAAc,CAAC;AAYtB,MAAM,WAAW,0BAA0B;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IAOnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;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AwB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/version.ts
|
|
2
|
-
var PACKAGE_VERSION = "0.9.
|
|
2
|
+
var PACKAGE_VERSION = "0.9.1";
|
|
3
3
|
|
|
4
4
|
// src/plugin.ts
|
|
5
5
|
var baseCapabilities = ["content:read"];
|
|
@@ -21,6 +21,7 @@ function normalizeHost(evaluatorHost) {
|
|
|
21
21
|
var SETTINGS_TOKEN_KEY = "eval_token";
|
|
22
22
|
var SETTINGS_BLOCK_MAPPINGS_KEY = "block_mappings";
|
|
23
23
|
var SETTINGS_CONTENT_FIELDS_KEY = "content_fields_by_collection";
|
|
24
|
+
var SETTINGS_DESCRIPTION_FIELDS_KEY = "description_fields_by_collection";
|
|
24
25
|
var PLUGIN_SETTINGS_SCHEMA = {
|
|
25
26
|
[SETTINGS_CONTENT_FIELDS_KEY]: {
|
|
26
27
|
type: "string",
|
|
@@ -28,6 +29,12 @@ var PLUGIN_SETTINGS_SCHEMA = {
|
|
|
28
29
|
description: "Ordered rendered body fields per collection.",
|
|
29
30
|
multiline: true
|
|
30
31
|
},
|
|
32
|
+
[SETTINGS_DESCRIPTION_FIELDS_KEY]: {
|
|
33
|
+
type: "string",
|
|
34
|
+
label: "Description fields by collection (JSON)",
|
|
35
|
+
description: "Ordered renderer description fallback fields per collection.",
|
|
36
|
+
multiline: true
|
|
37
|
+
},
|
|
31
38
|
[SETTINGS_BLOCK_MAPPINGS_KEY]: {
|
|
32
39
|
type: "string",
|
|
33
40
|
label: "Custom block mappings (JSON)",
|
|
@@ -71,6 +78,15 @@ function aexeoPluginSandboxed(options = {}) {
|
|
|
71
78
|
}
|
|
72
79
|
|
|
73
80
|
// src/inventory.ts
|
|
81
|
+
var DISPOSITIONS = /* @__PURE__ */ new Set([
|
|
82
|
+
"published",
|
|
83
|
+
"draft",
|
|
84
|
+
"noindex",
|
|
85
|
+
"redirect",
|
|
86
|
+
"canonical_alias",
|
|
87
|
+
"locale_fallback",
|
|
88
|
+
"unknown"
|
|
89
|
+
]);
|
|
74
90
|
async function exportLinkInventory(content, options) {
|
|
75
91
|
const started = options.onTelemetry ? Date.now() : 0;
|
|
76
92
|
const collections = [...new Set(options.collections)];
|
|
@@ -81,10 +97,16 @@ async function exportLinkInventory(content, options) {
|
|
|
81
97
|
if (!Number.isSafeInteger(limit) || limit < 1) {
|
|
82
98
|
throw new Error("maxPagesPerCollection must be a positive integer");
|
|
83
99
|
}
|
|
100
|
+
const concurrency = options.urlResolutionConcurrency ?? 8;
|
|
101
|
+
if (!Number.isSafeInteger(concurrency) || concurrency < 1 || concurrency > 100) {
|
|
102
|
+
throw new Error("urlResolutionConcurrency must be an integer between 1 and 100");
|
|
103
|
+
}
|
|
84
104
|
const pages = [];
|
|
85
105
|
const issues = /* @__PURE__ */ new Set(["transactional_snapshot_unavailable"]);
|
|
86
106
|
let scanned = 0;
|
|
87
107
|
let omitted = 0;
|
|
108
|
+
let classificationFailures = 0;
|
|
109
|
+
let malformedEntries = 0;
|
|
88
110
|
for (const collection of collections) {
|
|
89
111
|
let cursor;
|
|
90
112
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -96,31 +118,71 @@ async function exportLinkInventory(content, options) {
|
|
|
96
118
|
issues.add("collection_read_failed");
|
|
97
119
|
break;
|
|
98
120
|
}
|
|
99
|
-
|
|
121
|
+
if (!batch || !Array.isArray(batch.items) || typeof batch.hasMore !== "boolean") {
|
|
122
|
+
issues.add("invalid_collection_response");
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
const urls = new Array(batch.items.length);
|
|
126
|
+
let next = 0;
|
|
127
|
+
await Promise.all(Array.from({ length: Math.min(concurrency, batch.items.length) }, async () => {
|
|
128
|
+
for (; ; ) {
|
|
129
|
+
const index = next++;
|
|
130
|
+
if (index >= batch.items.length) return;
|
|
131
|
+
try {
|
|
132
|
+
const item = batch.items[index];
|
|
133
|
+
if (!item || typeof item !== "object" || typeof item.id !== "string" || item.id.trim() === "" || item.locale != null && typeof item.locale !== "string") {
|
|
134
|
+
urls[index] = { malformed: true };
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
const url = options.resolveUrl ? await options.resolveUrl(collection, item) : await content.getPublicUrl(collection, item.id);
|
|
138
|
+
if (url !== null && typeof url !== "string") throw new Error("invalid public URL");
|
|
139
|
+
urls[index] = { url };
|
|
140
|
+
} catch {
|
|
141
|
+
urls[index] = { error: true };
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}));
|
|
145
|
+
for (const [index, item] of batch.items.entries()) {
|
|
100
146
|
scanned += 1;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
147
|
+
const resolution = urls[index];
|
|
148
|
+
if ("malformed" in resolution) {
|
|
149
|
+
issues.add("invalid_collection_item");
|
|
150
|
+
malformedEntries += 1;
|
|
151
|
+
omitted += 1;
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
if ("error" in resolution) {
|
|
105
155
|
issues.add("url_resolution_failed");
|
|
106
156
|
omitted += 1;
|
|
107
157
|
continue;
|
|
108
158
|
}
|
|
159
|
+
const url = resolution.url;
|
|
109
160
|
if (!url) {
|
|
110
161
|
issues.add("entry_without_public_url");
|
|
111
162
|
omitted += 1;
|
|
112
163
|
continue;
|
|
113
164
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
165
|
+
let disposition = "unknown";
|
|
166
|
+
let target = null;
|
|
167
|
+
let locale = item.locale ?? null;
|
|
168
|
+
if (options.classify) {
|
|
169
|
+
try {
|
|
170
|
+
const classification = options.classify(item, url, collection);
|
|
171
|
+
if (!classification || !DISPOSITIONS.has(classification.disposition) || classification.target != null && typeof classification.target !== "string" || classification.locale != null && typeof classification.locale !== "string") {
|
|
172
|
+
throw new Error("invalid inventory classification");
|
|
173
|
+
}
|
|
174
|
+
disposition = classification.disposition;
|
|
175
|
+
target = classification.target ?? null;
|
|
176
|
+
if (classification.locale !== void 0) locale = classification.locale;
|
|
177
|
+
} catch {
|
|
178
|
+
classificationFailures += 1;
|
|
179
|
+
issues.add("classification_failed");
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
pages.push({ url, disposition, target, locale });
|
|
121
183
|
}
|
|
122
184
|
if (!batch.hasMore) break;
|
|
123
|
-
if (
|
|
185
|
+
if (typeof batch.cursor !== "string" || batch.cursor.trim() === "" || seen.has(batch.cursor)) {
|
|
124
186
|
issues.add("invalid_or_repeated_cursor");
|
|
125
187
|
break;
|
|
126
188
|
}
|
|
@@ -133,7 +195,7 @@ async function exportLinkInventory(content, options) {
|
|
|
133
195
|
const result = { inventory: { identity: options.identity, complete: false, pages }, issues: [...issues].sort(), scanned, omitted };
|
|
134
196
|
if (options.onTelemetry) {
|
|
135
197
|
try {
|
|
136
|
-
options.onTelemetry({ event: "link_inventory_export", elapsed_ms: Math.max(0, Date.now() - started), scanned, omitted, page_count: pages.length, issue_count: issues.size });
|
|
198
|
+
options.onTelemetry({ event: "link_inventory_export", elapsed_ms: Math.max(0, Date.now() - started), scanned, omitted, page_count: pages.length, issue_count: issues.size, classification_failures: classificationFailures, malformed_entries: malformedEntries });
|
|
137
199
|
} catch {
|
|
138
200
|
}
|
|
139
201
|
}
|
|
@@ -166,11 +228,13 @@ function aexeoPlugin(options = {}) {
|
|
|
166
228
|
options: {
|
|
167
229
|
...options.blockMappings === void 0 ? {} : { blockMappings: options.blockMappings },
|
|
168
230
|
...options.contentFieldsByCollection === void 0 ? {} : { contentFieldsByCollection: options.contentFieldsByCollection },
|
|
231
|
+
...options.descriptionFieldsByCollection === void 0 ? {} : { descriptionFieldsByCollection: options.descriptionFieldsByCollection },
|
|
169
232
|
...options.contentPreset === void 0 ? {} : {
|
|
170
233
|
contentPreset: {
|
|
171
234
|
...options.contentPreset,
|
|
172
235
|
...options.contentPreset.collections === void 0 ? {} : { collections: [...options.contentPreset.collections] },
|
|
173
236
|
...options.contentPreset.sources === void 0 ? {} : { sources: { ...options.contentPreset.sources } },
|
|
237
|
+
...options.contentPreset.evidenceSources === void 0 ? {} : { evidenceSources: { ...options.contentPreset.evidenceSources } },
|
|
174
238
|
...options.contentPreset.byCollection === void 0 ? {} : { byCollection: { ...options.contentPreset.byCollection } }
|
|
175
239
|
}
|
|
176
240
|
},
|
package/dist/inventory.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ export declare function exportLinkInventory(content: Pick<SandboxContentApi, "li
|
|
|
34
34
|
collections: readonly string[];
|
|
35
35
|
identity: LinkInventoryIdentity | null;
|
|
36
36
|
maxPagesPerCollection?: number;
|
|
37
|
+
/** Maximum simultaneous public URL resolutions, from 1 to 100 (default 8). */
|
|
38
|
+
urlResolutionConcurrency?: number;
|
|
37
39
|
/** Optional aggregate-only local telemetry; no URLs or content are included. */
|
|
38
40
|
onTelemetry?: (event: {
|
|
39
41
|
event: "link_inventory_export";
|
|
@@ -42,10 +44,16 @@ export declare function exportLinkInventory(content: Pick<SandboxContentApi, "li
|
|
|
42
44
|
omitted: number;
|
|
43
45
|
page_count: number;
|
|
44
46
|
issue_count: number;
|
|
47
|
+
classification_failures: number;
|
|
48
|
+
malformed_entries: number;
|
|
45
49
|
}) => void;
|
|
46
|
-
|
|
50
|
+
/** Override URL resolution when the host renderer uses a different route mapping. */
|
|
51
|
+
resolveUrl?: (collection: string, item: EmdashContentItem) => Promise<string | null>;
|
|
52
|
+
/** Classify using host-owned publication rules; locale defaults to the CMS value. */
|
|
53
|
+
classify?: (item: EmdashContentItem, url: string, collection: string) => {
|
|
47
54
|
disposition: LinkInventoryDisposition;
|
|
48
55
|
target?: string | null;
|
|
56
|
+
locale?: string | null;
|
|
49
57
|
};
|
|
50
58
|
}): Promise<LinkInventoryExport>;
|
|
51
59
|
//# sourceMappingURL=inventory.d.ts.map
|