@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
package/dist/findings-view.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CustomBlockMappings } from "./adapter.js";
|
|
1
2
|
import type { EmdashDocument, Finding, SiteIntelligenceScore } from "./types.js";
|
|
2
3
|
import type { EvaluatorFn, KvNamespace, SandboxCtx } from "./plugin.js";
|
|
3
4
|
import type { SuppressionFilter } from "./suppressions.js";
|
|
@@ -74,11 +75,10 @@ export interface AdminViewTuning {
|
|
|
74
75
|
*/
|
|
75
76
|
refreshFailureVariant: "alert" | "error";
|
|
76
77
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* 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.
|
|
80
80
|
*/
|
|
81
|
-
score: (documents: readonly EmdashDocument[], kv: KvNamespace) => Promise<SiteIntelligenceScore>;
|
|
81
|
+
score: (documents: readonly EmdashDocument[], kv: KvNamespace) => Promise<SiteIntelligenceScore | null>;
|
|
82
82
|
/**
|
|
83
83
|
* Label for the widget's truth-consistency stat. Configured mode badges
|
|
84
84
|
* it with the real signal source so a schema-only 60 doesn't read the
|
|
@@ -87,6 +87,10 @@ export interface AdminViewTuning {
|
|
|
87
87
|
truthLabel: (score: SiteIntelligenceScore) => string;
|
|
88
88
|
}
|
|
89
89
|
export interface RefreshOptions {
|
|
90
|
+
blockMappings?: CustomBlockMappings | undefined;
|
|
91
|
+
contentFieldsByCollection?: Record<string, readonly string[]> | undefined;
|
|
92
|
+
contentFieldsUnavailable?: boolean | undefined;
|
|
93
|
+
descriptionFieldsByCollection?: Record<string, readonly string[]> | undefined;
|
|
90
94
|
/**
|
|
91
95
|
* Host context. `evaluateAndPersistAll` needs kv/http/content/log, and
|
|
92
96
|
* the follow-up `renderFindingsPage` needs kv.
|
|
@@ -128,7 +132,9 @@ export declare function severityFirst(a: Finding, b: Finding): number;
|
|
|
128
132
|
export declare function uniqueRoutes(rows: FindingRow[]): string[];
|
|
129
133
|
export declare function renderFindingsPage(kv: KvNamespace, tuning: AdminViewTuning): Promise<BlockResponse>;
|
|
130
134
|
export declare function findingsTable(rows: FindingRow[]): unknown;
|
|
131
|
-
export declare function renderScoreWidget(
|
|
135
|
+
export declare function renderScoreWidget(_kv: KvNamespace, _tuning: AdminViewTuning, _log?: {
|
|
136
|
+
error(message: string, data?: unknown): void;
|
|
137
|
+
}): Promise<BlockResponse>;
|
|
132
138
|
export declare function topBlockersLine(score: SiteIntelligenceScore): string;
|
|
133
139
|
export declare function renderDocumentPanel(kv: KvNamespace, route?: string): Promise<BlockResponse>;
|
|
134
140
|
export declare function documentFindingsTable(findings: Finding[]): unknown;
|
|
@@ -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,OA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,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;CAAE,GACtD,OAAO,CAAC,aAAa,CAAC,CASxB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAMpE;AAED,wBAAsB,mBAAmB,CACvC,EAAE,EAAE,WAAW,EACf,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,aAAa,CAAC,CA+CxB;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,CAoBlE;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAOpD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -18,7 +18,21 @@ export interface ConfiguredPluginDescriptor {
|
|
|
18
18
|
title?: string;
|
|
19
19
|
}[];
|
|
20
20
|
}
|
|
21
|
+
import type { CustomBlockMappings } from "./adapter.js";
|
|
22
|
+
export type { BodyCapability, CustomBlockMapping, CustomBlockMappings, CustomBlockField, InlineComponentField } from "./adapter.js";
|
|
21
23
|
export interface AexeoPluginOptions {
|
|
24
|
+
/** Ordered field mappings for project-specific blocks. */
|
|
25
|
+
blockMappings?: CustomBlockMappings;
|
|
26
|
+
contentFieldsByCollection?: Record<string, readonly string[]>;
|
|
27
|
+
descriptionFieldsByCollection?: Record<string, readonly string[]>;
|
|
28
|
+
/** Add a portable content preset to configured-mode evaluation. */
|
|
29
|
+
contentPreset?: {
|
|
30
|
+
name: string;
|
|
31
|
+
sources?: Record<string, string>;
|
|
32
|
+
evidenceSources?: Record<string, string>;
|
|
33
|
+
byCollection?: Record<string, string>;
|
|
34
|
+
collections?: readonly string[];
|
|
35
|
+
};
|
|
22
36
|
/**
|
|
23
37
|
* emdash collections the plugin sweeps when an admin clicks
|
|
24
38
|
* Refresh on the findings page. Order doesn't matter; the sweep
|
|
@@ -96,7 +110,7 @@ export interface AexeoPluginOptions {
|
|
|
96
110
|
*
|
|
97
111
|
* Suppressions are plugin-only by design. The CLI's `check` is the
|
|
98
112
|
* canonical strict audit; if you want to silence findings at the
|
|
99
|
-
* CLI layer, use `
|
|
113
|
+
* CLI layer, use `ignore_paths` under `[policy]` in `aexeo.toml` instead. The two
|
|
100
114
|
* surfaces serve different audiences: the plugin is editorial
|
|
101
115
|
* workflow, the CLI is build-gating.
|
|
102
116
|
*/
|
|
@@ -105,4 +119,6 @@ export interface AexeoPluginOptions {
|
|
|
105
119
|
export type { Suppression } from "./suppressions.js";
|
|
106
120
|
import type { Suppression } from "./suppressions.js";
|
|
107
121
|
export declare function aexeoPlugin(options?: AexeoPluginOptions): ConfiguredPluginDescriptor;
|
|
122
|
+
export { exportLinkInventory } from "./inventory.js";
|
|
123
|
+
export type { LinkInventoryDisposition, LinkInventoryExport, LinkInventoryIdentity, LinkInventoryPage } from "./inventory.js";
|
|
108
124
|
//# sourceMappingURL=index.d.ts.map
|
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;IACjC,UAAU,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvD,YAA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YAAY,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;CACvC;AAED,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,wBAAgB,WAAW,CACzB,OAAO,GAAE,kBAAuB,GAC/B,0BAA0B,CAqF5B;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,YAAY,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// src/version.ts
|
|
2
|
+
var PACKAGE_VERSION = "0.9.1";
|
|
3
|
+
|
|
1
4
|
// src/plugin.ts
|
|
2
5
|
var baseCapabilities = ["content:read"];
|
|
3
6
|
function buildCapabilities(evaluatorHost) {
|
|
@@ -16,7 +19,28 @@ function normalizeHost(evaluatorHost) {
|
|
|
16
19
|
return host.length === 0 ? null : host;
|
|
17
20
|
}
|
|
18
21
|
var SETTINGS_TOKEN_KEY = "eval_token";
|
|
22
|
+
var SETTINGS_BLOCK_MAPPINGS_KEY = "block_mappings";
|
|
23
|
+
var SETTINGS_CONTENT_FIELDS_KEY = "content_fields_by_collection";
|
|
24
|
+
var SETTINGS_DESCRIPTION_FIELDS_KEY = "description_fields_by_collection";
|
|
19
25
|
var PLUGIN_SETTINGS_SCHEMA = {
|
|
26
|
+
[SETTINGS_CONTENT_FIELDS_KEY]: {
|
|
27
|
+
type: "string",
|
|
28
|
+
label: "Content fields by collection (JSON)",
|
|
29
|
+
description: "Ordered rendered body fields per collection.",
|
|
30
|
+
multiline: true
|
|
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
|
+
},
|
|
38
|
+
[SETTINGS_BLOCK_MAPPINGS_KEY]: {
|
|
39
|
+
type: "string",
|
|
40
|
+
label: "Custom block mappings (JSON)",
|
|
41
|
+
description: "Ordered mappings for the rendered fields of each custom block type.",
|
|
42
|
+
multiline: true
|
|
43
|
+
},
|
|
20
44
|
[SETTINGS_TOKEN_KEY]: {
|
|
21
45
|
type: "secret",
|
|
22
46
|
label: "EVAL_TOKEN",
|
|
@@ -24,9 +48,6 @@ var PLUGIN_SETTINGS_SCHEMA = {
|
|
|
24
48
|
}
|
|
25
49
|
};
|
|
26
50
|
|
|
27
|
-
// src/version.ts
|
|
28
|
-
var PACKAGE_VERSION = "0.8.19";
|
|
29
|
-
|
|
30
51
|
// src/sandbox.ts
|
|
31
52
|
function aexeoPluginSandboxed(options = {}) {
|
|
32
53
|
const evaluatorHost = options.evaluatorHost ?? process.env.AEXEO_EVALUATOR_HOST ?? null;
|
|
@@ -56,6 +77,131 @@ function aexeoPluginSandboxed(options = {}) {
|
|
|
56
77
|
};
|
|
57
78
|
}
|
|
58
79
|
|
|
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
|
+
]);
|
|
90
|
+
async function exportLinkInventory(content, options) {
|
|
91
|
+
const started = options.onTelemetry ? Date.now() : 0;
|
|
92
|
+
const collections = [...new Set(options.collections)];
|
|
93
|
+
if (collections.length === 0 || collections.some((name) => name.trim() === "")) {
|
|
94
|
+
throw new Error("at least one explicit collection is required");
|
|
95
|
+
}
|
|
96
|
+
const limit = options.maxPagesPerCollection ?? 100;
|
|
97
|
+
if (!Number.isSafeInteger(limit) || limit < 1) {
|
|
98
|
+
throw new Error("maxPagesPerCollection must be a positive integer");
|
|
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
|
+
}
|
|
104
|
+
const pages = [];
|
|
105
|
+
const issues = /* @__PURE__ */ new Set(["transactional_snapshot_unavailable"]);
|
|
106
|
+
let scanned = 0;
|
|
107
|
+
let omitted = 0;
|
|
108
|
+
let classificationFailures = 0;
|
|
109
|
+
let malformedEntries = 0;
|
|
110
|
+
for (const collection of collections) {
|
|
111
|
+
let cursor;
|
|
112
|
+
const seen = /* @__PURE__ */ new Set();
|
|
113
|
+
for (let count = 0; count < limit; count += 1) {
|
|
114
|
+
let batch;
|
|
115
|
+
try {
|
|
116
|
+
batch = await content.list(collection, { limit: 100, ...cursor === void 0 ? {} : { cursor } });
|
|
117
|
+
} catch {
|
|
118
|
+
issues.add("collection_read_failed");
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
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()) {
|
|
146
|
+
scanned += 1;
|
|
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) {
|
|
155
|
+
issues.add("url_resolution_failed");
|
|
156
|
+
omitted += 1;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
const url = resolution.url;
|
|
160
|
+
if (!url) {
|
|
161
|
+
issues.add("entry_without_public_url");
|
|
162
|
+
omitted += 1;
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
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 });
|
|
183
|
+
}
|
|
184
|
+
if (!batch.hasMore) break;
|
|
185
|
+
if (typeof batch.cursor !== "string" || batch.cursor.trim() === "" || seen.has(batch.cursor)) {
|
|
186
|
+
issues.add("invalid_or_repeated_cursor");
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
seen.add(batch.cursor);
|
|
190
|
+
cursor = batch.cursor;
|
|
191
|
+
if (count + 1 === limit) issues.add("collection_page_limit_reached");
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
pages.sort((left, right) => left.url < right.url ? -1 : left.url > right.url ? 1 : 0);
|
|
195
|
+
const result = { inventory: { identity: options.identity, complete: false, pages }, issues: [...issues].sort(), scanned, omitted };
|
|
196
|
+
if (options.onTelemetry) {
|
|
197
|
+
try {
|
|
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 });
|
|
199
|
+
} catch {
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return result;
|
|
203
|
+
}
|
|
204
|
+
|
|
59
205
|
// src/index.ts
|
|
60
206
|
function aexeoPlugin(options = {}) {
|
|
61
207
|
return {
|
|
@@ -80,6 +226,18 @@ function aexeoPlugin(options = {}) {
|
|
|
80
226
|
// receives. Spread to a plain object so readonly arrays survive
|
|
81
227
|
// the structured-clone semantics of that codegen.
|
|
82
228
|
options: {
|
|
229
|
+
...options.blockMappings === void 0 ? {} : { blockMappings: options.blockMappings },
|
|
230
|
+
...options.contentFieldsByCollection === void 0 ? {} : { contentFieldsByCollection: options.contentFieldsByCollection },
|
|
231
|
+
...options.descriptionFieldsByCollection === void 0 ? {} : { descriptionFieldsByCollection: options.descriptionFieldsByCollection },
|
|
232
|
+
...options.contentPreset === void 0 ? {} : {
|
|
233
|
+
contentPreset: {
|
|
234
|
+
...options.contentPreset,
|
|
235
|
+
...options.contentPreset.collections === void 0 ? {} : { collections: [...options.contentPreset.collections] },
|
|
236
|
+
...options.contentPreset.sources === void 0 ? {} : { sources: { ...options.contentPreset.sources } },
|
|
237
|
+
...options.contentPreset.evidenceSources === void 0 ? {} : { evidenceSources: { ...options.contentPreset.evidenceSources } },
|
|
238
|
+
...options.contentPreset.byCollection === void 0 ? {} : { byCollection: { ...options.contentPreset.byCollection } }
|
|
239
|
+
}
|
|
240
|
+
},
|
|
83
241
|
...options.collections === void 0 ? {} : { collections: [...options.collections] },
|
|
84
242
|
...options.includeCollections === void 0 ? {} : { includeCollections: [...options.includeCollections] },
|
|
85
243
|
...options.excludeCollections === void 0 ? {} : { excludeCollections: [...options.excludeCollections] },
|
|
@@ -111,5 +269,6 @@ function aexeoPlugin(options = {}) {
|
|
|
111
269
|
}
|
|
112
270
|
export {
|
|
113
271
|
aexeoPlugin,
|
|
114
|
-
aexeoPluginSandboxed
|
|
272
|
+
aexeoPluginSandboxed,
|
|
273
|
+
exportLinkInventory
|
|
115
274
|
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { EmdashContentItem } from "./adapter.js";
|
|
2
|
+
import type { SandboxContentApi } from "./plugin.js";
|
|
3
|
+
/** Explicit surface identity supplied by the inventory producer. */
|
|
4
|
+
export interface LinkInventoryIdentity {
|
|
5
|
+
origin: string;
|
|
6
|
+
release: string;
|
|
7
|
+
surface: string;
|
|
8
|
+
snapshot: string;
|
|
9
|
+
}
|
|
10
|
+
export type LinkInventoryDisposition = "published" | "draft" | "noindex" | "redirect" | "canonical_alias" | "locale_fallback" | "unknown";
|
|
11
|
+
export interface LinkInventoryPage {
|
|
12
|
+
url: string;
|
|
13
|
+
disposition: LinkInventoryDisposition;
|
|
14
|
+
target: string | null;
|
|
15
|
+
locale: string | null;
|
|
16
|
+
}
|
|
17
|
+
export interface LinkInventoryExport {
|
|
18
|
+
inventory: {
|
|
19
|
+
identity: LinkInventoryIdentity | null;
|
|
20
|
+
/** EmDash pagination does not establish a transactional site snapshot. */
|
|
21
|
+
complete: false;
|
|
22
|
+
pages: LinkInventoryPage[];
|
|
23
|
+
};
|
|
24
|
+
issues: string[];
|
|
25
|
+
scanned: number;
|
|
26
|
+
omitted: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Enumerate explicitly selected collections using EmDash's actual URL resolver.
|
|
30
|
+
* An application may supply its own indexability and alias classification.
|
|
31
|
+
* Missing metadata is unknown; no route or snapshot guarantees are inferred.
|
|
32
|
+
*/
|
|
33
|
+
export declare function exportLinkInventory(content: Pick<SandboxContentApi, "list" | "getPublicUrl">, options: {
|
|
34
|
+
collections: readonly string[];
|
|
35
|
+
identity: LinkInventoryIdentity | null;
|
|
36
|
+
maxPagesPerCollection?: number;
|
|
37
|
+
/** Maximum simultaneous public URL resolutions, from 1 to 100 (default 8). */
|
|
38
|
+
urlResolutionConcurrency?: number;
|
|
39
|
+
/** Optional aggregate-only local telemetry; no URLs or content are included. */
|
|
40
|
+
onTelemetry?: (event: {
|
|
41
|
+
event: "link_inventory_export";
|
|
42
|
+
elapsed_ms: number;
|
|
43
|
+
scanned: number;
|
|
44
|
+
omitted: number;
|
|
45
|
+
page_count: number;
|
|
46
|
+
issue_count: number;
|
|
47
|
+
classification_failures: number;
|
|
48
|
+
malformed_entries: number;
|
|
49
|
+
}) => void;
|
|
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) => {
|
|
54
|
+
disposition: LinkInventoryDisposition;
|
|
55
|
+
target?: string | null;
|
|
56
|
+
locale?: string | null;
|
|
57
|
+
};
|
|
58
|
+
}): Promise<LinkInventoryExport>;
|
|
59
|
+
//# sourceMappingURL=inventory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inventory.d.ts","sourceRoot":"","sources":["../src/inventory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,C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MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,uBAAuB,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7N,qFAAqF;IACrF,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACrF,qFAAqF;IACrF,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK;QACvE,WAAW,EAAE,wBAAwB,CAAC;QACtC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACxB,CAAC;CACH,GACA,OAAO,CAAC,mBAAmB,CAAC,CA6H9B"}
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CustomBlockMappings } from "./adapter.js";
|
|
1
2
|
import type { SuppressionFilter } from "./suppressions.js";
|
|
2
3
|
import type { EmdashDocument, Finding } from "./types.js";
|
|
3
4
|
import { type EmdashContentItem, type EmdashContentMeta } from "./adapter.js";
|
|
@@ -22,12 +23,21 @@ export interface KvNamespace {
|
|
|
22
23
|
export declare const CONFIG_URL_KEY = "config:evaluator_url";
|
|
23
24
|
export declare const CONFIG_TOKEN_KEY = "config:eval_token";
|
|
24
25
|
export declare const SETTINGS_TOKEN_KEY = "eval_token";
|
|
26
|
+
export declare const SETTINGS_BLOCK_MAPPINGS_KEY = "block_mappings";
|
|
27
|
+
export declare const SETTINGS_CONTENT_FIELDS_KEY = "content_fields_by_collection";
|
|
28
|
+
export declare const SETTINGS_DESCRIPTION_FIELDS_KEY = "description_fields_by_collection";
|
|
25
29
|
export interface SecretSettingField {
|
|
26
30
|
type: "secret";
|
|
27
31
|
label: string;
|
|
28
32
|
description?: string;
|
|
29
33
|
}
|
|
30
|
-
export
|
|
34
|
+
export type PluginSettingField = SecretSettingField | {
|
|
35
|
+
type: "string";
|
|
36
|
+
label: string;
|
|
37
|
+
description?: string;
|
|
38
|
+
multiline?: boolean;
|
|
39
|
+
};
|
|
40
|
+
export declare const PLUGIN_SETTINGS_SCHEMA: Record<string, PluginSettingField>;
|
|
31
41
|
export interface PluginSettingsAccess {
|
|
32
42
|
get<T = unknown>(key: string): Promise<T | null>;
|
|
33
43
|
set(key: string, value: unknown): Promise<void>;
|
|
@@ -46,6 +56,9 @@ export interface SidecarRuntimeConfig {
|
|
|
46
56
|
}
|
|
47
57
|
export declare function readSidecarConfig(store: SidecarConfigStore): Promise<SidecarRuntimeConfig | null>;
|
|
48
58
|
export declare function writeSidecarConfig(store: SidecarConfigStore, config: SidecarRuntimeConfig): Promise<void>;
|
|
59
|
+
export declare function isTokenStoredInPlaintext(store: SidecarConfigStore): Promise<boolean>;
|
|
60
|
+
export declare class TokenStorageError extends Error {
|
|
61
|
+
}
|
|
49
62
|
export interface ContentList {
|
|
50
63
|
items: EmdashContentItem[];
|
|
51
64
|
cursor?: string;
|
|
@@ -80,8 +93,27 @@ export interface ContentAfterSaveEvent {
|
|
|
80
93
|
collection: string;
|
|
81
94
|
isNew: boolean;
|
|
82
95
|
}
|
|
96
|
+
export interface ContentAfterDeleteEvent {
|
|
97
|
+
id: string;
|
|
98
|
+
collection: string;
|
|
99
|
+
permanent: boolean;
|
|
100
|
+
}
|
|
101
|
+
export declare function handleAfterDelete(event: ContentAfterDeleteEvent, ctx: SandboxCtx): Promise<void>;
|
|
102
|
+
/** Read optional sandbox mappings without logging their potentially sensitive contents. */
|
|
103
|
+
export declare function readSandboxBlockMappings(ctx: SandboxCtx): Promise<CustomBlockMappings | undefined>;
|
|
104
|
+
/** Read an optional JSON mapping from collection names to ordered field names. */
|
|
105
|
+
type SandboxFieldsState = {
|
|
106
|
+
fields: Record<string, readonly string[]> | undefined;
|
|
107
|
+
unavailable: boolean;
|
|
108
|
+
};
|
|
109
|
+
export declare function readSandboxContentFieldState(ctx: SandboxCtx): Promise<SandboxFieldsState>;
|
|
110
|
+
export declare function readSandboxContentFields(ctx: SandboxCtx): Promise<Record<string, readonly string[]> | undefined>;
|
|
111
|
+
export declare function readSandboxDescriptionFields(ctx: SandboxCtx): Promise<Record<string, readonly string[]> | undefined>;
|
|
83
112
|
export declare function handleAfterSave(event: ContentAfterSaveEvent, ctx: SandboxCtx): Promise<void>;
|
|
84
|
-
export declare
|
|
113
|
+
export declare const SITE_GRAPH_RULE_IDS: ReadonlySet<string>;
|
|
114
|
+
/** A content preset may deliberately reuse a legacy site rule identifier. */
|
|
115
|
+
export declare function isSiteGraphFinding(finding: Finding): boolean;
|
|
116
|
+
export declare function handleAfterSaveConfigured(event: ContentAfterSaveEvent, ctx: SandboxCtx, evaluator: EvaluatorFn, suppressionFilter?: SuppressionFilter, blockMappings?: CustomBlockMappings, contentFields?: readonly string[], descriptionFields?: readonly string[], contentFieldsUnavailable?: boolean): Promise<void>;
|
|
85
117
|
export declare const DEFAULT_COLLECTIONS: readonly ["posts", "pages"];
|
|
86
118
|
export interface RefreshSummary {
|
|
87
119
|
documentsScanned: number;
|
|
@@ -89,19 +121,40 @@ export interface RefreshSummary {
|
|
|
89
121
|
totalFindings: number;
|
|
90
122
|
errors: string[];
|
|
91
123
|
}
|
|
124
|
+
export type DocumentAssessment = {
|
|
125
|
+
status: "evaluated";
|
|
126
|
+
preset: string;
|
|
127
|
+
gates: Pick<import("./content.js").ContentGateResult, "gate_id" | "status" | "blocking" | "scope" | "required_capability" | "reason" | "measurements">[];
|
|
128
|
+
source_mapping?: {
|
|
129
|
+
eligible: number;
|
|
130
|
+
mapped: number;
|
|
131
|
+
unmapped: number;
|
|
132
|
+
};
|
|
133
|
+
} | {
|
|
134
|
+
status: "error";
|
|
135
|
+
reason: string;
|
|
136
|
+
detail: string;
|
|
137
|
+
};
|
|
92
138
|
export type EvaluationOutcome = {
|
|
93
139
|
ok: true;
|
|
94
140
|
findings: Finding[];
|
|
141
|
+
assessments?: Record<string, DocumentAssessment>;
|
|
95
142
|
} | {
|
|
96
143
|
ok: false;
|
|
97
144
|
reason: string;
|
|
98
145
|
detail: string;
|
|
99
146
|
};
|
|
100
|
-
export type EvaluatorFn = (documents: readonly EmdashDocument[]
|
|
147
|
+
export type EvaluatorFn = (documents: readonly EmdashDocument[], context?: {
|
|
148
|
+
collections: readonly string[];
|
|
149
|
+
}) => Promise<EvaluationOutcome>;
|
|
101
150
|
export declare function evaluateAndPersistAll(ctx: SandboxCtx, options: {
|
|
102
151
|
collections?: readonly string[];
|
|
103
152
|
evaluator: EvaluatorFn;
|
|
104
153
|
suppressionFilter?: SuppressionFilter;
|
|
154
|
+
blockMappings?: CustomBlockMappings | undefined;
|
|
155
|
+
contentFieldsByCollection?: Record<string, readonly string[]> | undefined;
|
|
156
|
+
contentFieldsUnavailable?: boolean | undefined;
|
|
157
|
+
descriptionFieldsByCollection?: Record<string, readonly string[]> | undefined;
|
|
105
158
|
}): Promise<RefreshSummary>;
|
|
106
159
|
export declare function findingsKey(route: string): string;
|
|
107
160
|
export declare function documentKey(route: string): string;
|
|
@@ -110,4 +163,7 @@ export declare function readStoredFacts(kv: KvNamespace): Promise<unknown | null
|
|
|
110
163
|
export declare function readAllDocuments(kv: KvNamespace): Promise<EmdashDocument[]>;
|
|
111
164
|
export declare function readAllStoredDocuments(kv: KvNamespace): Promise<StoredDocument[]>;
|
|
112
165
|
export declare function readFindings(kv: KvNamespace, route: string): Promise<Finding[]>;
|
|
166
|
+
/** Assessment is stored atomically with the findings for the same revision. */
|
|
167
|
+
export declare function readAssessment(kv: KvNamespace, route: string): Promise<DocumentAssessment | undefined>;
|
|
168
|
+
export {};
|
|
113
169
|
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pl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AAG,MAAM,CAGjD;AAOD,eAAO,MAAM,SAAS,kBAAkB,CAAC;AAMzC,wBAAsB,eAAe,CACnC,EAAE,EAAE,WAAW,GACd,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAGzB;AAED,wBAAsB,gBAAgB,CACpC,EAAE,EAAE,WAAW,GACd,OAAO,CAAC,cAAc,EAAE,CAAC,CAE3B;AAED,wBAAsB,sBAAsB,CAC1C,EAAE,EAAE,WAAW,GACd,OAAO,CAAC,cAAc,EAAE,CAAC,CAW3B;AAED,wBAAsB,YAAY,CAChC,EAAE,EAAE,WAAW,EACf,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,OAAO,EAAE,CAAC,CAMpB;AAED,+EAA+E;AAC/E,wBAAsB,cAAc,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAG5G"}
|
package/dist/presence-check.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TruthManifest } from "./types.js";
|
|
2
|
+
export declare const PRESENCE_HOSTS: readonly ["en.wikipedia.org", "www.wikidata.org", "api.github.com", "rdap.org", "index.commoncrawl.org"];
|
|
2
3
|
export type SourceStatus = "found" | "not_found" | "unreachable" | "skipped";
|
|
3
4
|
export interface SourceResult {
|
|
4
5
|
source: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presence-check.d.ts","sourceRoot":"","sources":["../src/presence-check.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"presence-check.d.ts","sourceRoot":"","sources":["../src/presence-check.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAQhD,eAAO,MAAM,cAAc,YACzB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,uBAAuB,CACf,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,CAAC;AAE7E,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,YAAY,CAAC;IAGrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B;AAED,QAAA,MAAM,YAAY,YAChB,WAAW,EACX,UAAU,EACV,QAAQ,EACR,MAAM,EACN,cAAc,CACN,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAKvD,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,aAAa,GAAG,IAAI,GAC7B,WAAW,GAAG,IAAI,CAUpB;AAED,wBAAsB,eAAe,CACnC,KAAK,EAAE,WAAW,EAClB,OAAO,GAAE,OAAO,KAAa,GAC5B,OAAO,CAAC,YAAY,EAAE,CAAC,CAoBzB"}
|
package/dist/sandbox-entry.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { KvNamespace, SandboxCtx } from "./plugin.js";
|
|
2
|
-
import { handleAfterSave } from "./plugin.js";
|
|
2
|
+
import { handleAfterDelete, handleAfterSave } from "./plugin.js";
|
|
3
3
|
import type { BlockInteraction, BlockResponse } from "./findings-view.js";
|
|
4
4
|
export type { BlockInteraction, BlockResponse } from "./findings-view.js";
|
|
5
5
|
export interface RouteInput {
|
|
@@ -16,6 +16,7 @@ declare function handleAdminRoute(input: RouteInput, ctx: SandboxCtx): Promise<B
|
|
|
16
16
|
declare const _default: {
|
|
17
17
|
hooks: {
|
|
18
18
|
"content:afterSave": typeof handleAfterSave;
|
|
19
|
+
"content:afterDelete": typeof handleAfterDelete;
|
|
19
20
|
};
|
|
20
21
|
routes: {
|
|
21
22
|
admin: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-entry.d.ts","sourceRoot":"","sources":["../src/sandbox-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EACX,UAAU,EAEX,MAAM,aAAa,CAAC;AACrB,OAAO,
|
|
1
|
+
{"version":3,"file":"sandbox-entry.d.ts","sourceRoot":"","sources":["../src/sandbox-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,WAAW,EACX,UAAU,EAEX,MAAM,aAAa,CAAC;AACrB,OAAO,EAIL,iBAAiB,EACjB,eAAe,EAOhB,MAAM,aAAa,CAAC;AAIrB,OAAO,KAAK,EAEV,gBAAgB,EAChB,aAAa,EACd,MAAM,oBAAoB,CAAC;AAuB5B,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAa1E,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAID,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,gBAAgB,CAAC;IACvB,EAAE,EAAE,WAAW,CAAC;IAChB,GAAG,EAAE,UAAU,CAAC;CACjB;AA6BD,iBAAe,gBAAgB,CAC7B,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,aAAa,CAAC,CAwBxB;;;QAwQG,mBAAmB;QACnB,qBAAqB;;;QAGrB,KAAK;YAAI,OAAO"}
|