@aeptus/aexeo-emdash 0.1.2 → 0.3.0
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 +121 -1
- package/dist/adapter.d.ts +12 -0
- package/dist/adapter.d.ts.map +1 -1
- package/dist/admin/Facts.d.ts +3 -0
- package/dist/admin/Facts.d.ts.map +1 -0
- package/dist/admin/Findings.d.ts +3 -0
- package/dist/admin/Findings.d.ts.map +1 -0
- package/dist/admin.d.ts +7 -0
- package/dist/admin.d.ts.map +1 -0
- package/dist/admin.js +492 -0
- package/dist/configured.d.ts.map +1 -1
- package/dist/configured.js +456 -21
- package/dist/data-route.d.ts +49 -0
- package/dist/data-route.d.ts.map +1 -0
- package/dist/facts-route.d.ts +7 -0
- package/dist/facts-route.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -2
- package/dist/plugin.d.ts +13 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/sandbox-entry.js +47 -8
- package/dist/sandbox.d.ts.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/wasm-init.d.ts +3 -1
- package/dist/wasm-init.d.ts.map +1 -1
- package/package.json +16 -4
- package/wasm/aexeo_emdash_bridge.d.ts +16 -1
- package/wasm/aexeo_emdash_bridge.js +1 -1
- package/wasm/aexeo_emdash_bridge_bg.d.ts +12 -3
- package/wasm/aexeo_emdash_bridge_bg.js +65 -2
- package/wasm/aexeo_emdash_bridge_bg.wasm +0 -0
- package/wasm/aexeo_emdash_bridge_bg.wasm.d.ts +13 -11
package/dist/index.js
CHANGED
|
@@ -22,12 +22,15 @@ function buildAllowedHosts(evaluatorHost) {
|
|
|
22
22
|
return hosts;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
// src/version.ts
|
|
26
|
+
var PACKAGE_VERSION = "0.3.0";
|
|
27
|
+
|
|
25
28
|
// src/sandbox.ts
|
|
26
29
|
function seogeoPluginSandboxed(options = {}) {
|
|
27
30
|
const evaluatorHost = options.evaluatorHost ?? process.env.SEOGEO_EVALUATOR_HOST ?? null;
|
|
28
31
|
return {
|
|
29
32
|
id: "aexeo-seogeo",
|
|
30
|
-
version:
|
|
33
|
+
version: PACKAGE_VERSION,
|
|
31
34
|
// Subpath export of this same package; must match package.json
|
|
32
35
|
// `exports["./sandbox"]`.
|
|
33
36
|
entrypoint: "@aeptus/aexeo-emdash/sandbox",
|
|
@@ -52,11 +55,20 @@ function seogeoPluginSandboxed(options = {}) {
|
|
|
52
55
|
function seogeoPlugin(options = {}) {
|
|
53
56
|
return {
|
|
54
57
|
id: "aexeo-seogeo",
|
|
55
|
-
version:
|
|
58
|
+
version: PACKAGE_VERSION,
|
|
56
59
|
// Subpath import resolved by the consumer's bundler at build
|
|
57
60
|
// time — must match the package.json `exports["./configured"]`
|
|
58
61
|
// entry.
|
|
59
62
|
entrypoint: "@aeptus/aexeo-emdash/configured",
|
|
63
|
+
// React admin module — registers a custom <Findings/> component
|
|
64
|
+
// for /findings so the route column can render proper <a href>
|
|
65
|
+
// links. Block Kit can't express clickable links in any element
|
|
66
|
+
// type as of emdash 0.8.0. The React module's `pages` object is
|
|
67
|
+
// imported by emdash's admin registry codegen at build time; if
|
|
68
|
+
// the consumer's bundler doesn't pick up tsx (rare — every
|
|
69
|
+
// emdash adapter does), the rest of the plugin still works
|
|
70
|
+
// because /document and the dashboard widget stay on Block Kit.
|
|
71
|
+
adminEntry: "@aeptus/aexeo-emdash/admin",
|
|
60
72
|
// emdash's astro integration JSON-serializes `options` and emits
|
|
61
73
|
// an importer that does `createPlugin(<options>)` at boot.
|
|
62
74
|
// Anything we put here is what the runtime entry's createPlugin
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { EmdashDocument, Finding } from "./types.js";
|
|
2
|
-
import { type EmdashContentItem } from "./adapter.js";
|
|
2
|
+
import { type EmdashContentItem, type EmdashContentMeta } from "./adapter.js";
|
|
3
3
|
import type { SidecarHttp } from "./sidecar.js";
|
|
4
|
+
export interface StoredDocument {
|
|
5
|
+
document: EmdashDocument;
|
|
6
|
+
meta: EmdashContentMeta;
|
|
7
|
+
}
|
|
4
8
|
export declare function buildCapabilities(evaluatorHost: string | null): readonly string[];
|
|
5
9
|
export declare function buildAllowedHosts(evaluatorHost: string | null): readonly string[];
|
|
6
10
|
export declare const capabilities: readonly string[];
|
|
@@ -37,6 +41,11 @@ export interface SandboxCtx {
|
|
|
37
41
|
kv: KvNamespace;
|
|
38
42
|
http: SidecarHttp;
|
|
39
43
|
content: SandboxContentApi;
|
|
44
|
+
site?: {
|
|
45
|
+
url: string;
|
|
46
|
+
name?: string;
|
|
47
|
+
locale?: string;
|
|
48
|
+
};
|
|
40
49
|
log?: {
|
|
41
50
|
info(msg: string, data?: unknown): void;
|
|
42
51
|
warn(msg: string, data?: unknown): void;
|
|
@@ -72,6 +81,9 @@ export declare function evaluateAndPersistAll(ctx: SandboxCtx, options: {
|
|
|
72
81
|
}): Promise<RefreshSummary>;
|
|
73
82
|
export declare function findingsKey(route: string): string;
|
|
74
83
|
export declare function documentKey(route: string): string;
|
|
84
|
+
export declare const FACTS_KEY = "facts:current";
|
|
85
|
+
export declare function readStoredFacts(kv: KvNamespace): Promise<unknown | null>;
|
|
75
86
|
export declare function readAllDocuments(kv: KvNamespace): Promise<EmdashDocument[]>;
|
|
87
|
+
export declare function readAllStoredDocuments(kv: KvNamespace): Promise<StoredDocument[]>;
|
|
76
88
|
export declare function readFindings(kv: KvNamespace, route: string): Promise<Finding[]>;
|
|
77
89
|
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO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,MAAM,GAAG,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,CA+B3B;AAED,wBAAsB,YAAY,CAChC,EAAE,EAAE,WAAW,EACf,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,OAAO,EAAE,CAAC,CAMpB"}
|
package/dist/sandbox-entry.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/adapter.ts
|
|
2
|
-
function
|
|
2
|
+
function adaptContentItem(content) {
|
|
3
3
|
const route = deriveRoute(content);
|
|
4
4
|
const title = stringOrEmpty(
|
|
5
5
|
content.seo?.title ?? content.data["title"] ?? content.slug ?? content.id
|
|
@@ -23,7 +23,16 @@ function contentItemToEmdashDocument(content) {
|
|
|
23
23
|
if (body !== null) {
|
|
24
24
|
document.body = body;
|
|
25
25
|
}
|
|
26
|
-
return
|
|
26
|
+
return {
|
|
27
|
+
document,
|
|
28
|
+
meta: {
|
|
29
|
+
id: content.id,
|
|
30
|
+
collection: content.type,
|
|
31
|
+
slug: content.slug,
|
|
32
|
+
status: content.status,
|
|
33
|
+
title
|
|
34
|
+
}
|
|
35
|
+
};
|
|
27
36
|
}
|
|
28
37
|
function deriveRoute(content) {
|
|
29
38
|
if (typeof content.slug === "string" && content.slug.length > 0) {
|
|
@@ -88,6 +97,7 @@ async function evaluateAndPersistAll(ctx, options) {
|
|
|
88
97
|
errors: []
|
|
89
98
|
};
|
|
90
99
|
const documents = [];
|
|
100
|
+
const adaptedByRoute = /* @__PURE__ */ new Map();
|
|
91
101
|
const documentRoutes = /* @__PURE__ */ new Set();
|
|
92
102
|
for (const collection of collections) {
|
|
93
103
|
let cursor;
|
|
@@ -98,9 +108,13 @@ async function evaluateAndPersistAll(ctx, options) {
|
|
|
98
108
|
...cursor === void 0 ? {} : { cursor }
|
|
99
109
|
});
|
|
100
110
|
for (const item of page.items) {
|
|
101
|
-
const
|
|
102
|
-
documents.push(document);
|
|
103
|
-
documentRoutes.add(document.route);
|
|
111
|
+
const adapted = adaptContentItem(item);
|
|
112
|
+
documents.push(adapted.document);
|
|
113
|
+
documentRoutes.add(adapted.document.route);
|
|
114
|
+
adaptedByRoute.set(adapted.document.route, {
|
|
115
|
+
document: adapted.document,
|
|
116
|
+
meta: adapted.meta
|
|
117
|
+
});
|
|
104
118
|
}
|
|
105
119
|
cursor = page.hasMore ? page.cursor : void 0;
|
|
106
120
|
} catch (err) {
|
|
@@ -111,8 +125,8 @@ async function evaluateAndPersistAll(ctx, options) {
|
|
|
111
125
|
} while (cursor !== void 0);
|
|
112
126
|
}
|
|
113
127
|
summary.documentsScanned = documents.length;
|
|
114
|
-
for (const
|
|
115
|
-
await kv.set(documentKey(document.route),
|
|
128
|
+
for (const stored of adaptedByRoute.values()) {
|
|
129
|
+
await kv.set(documentKey(stored.document.route), stored);
|
|
116
130
|
}
|
|
117
131
|
const result = await options.evaluator(documents);
|
|
118
132
|
if (!result.ok) {
|
|
@@ -148,8 +162,33 @@ function documentKey(route) {
|
|
|
148
162
|
return `document:${normalized}`;
|
|
149
163
|
}
|
|
150
164
|
async function readAllDocuments(kv) {
|
|
165
|
+
return (await readAllStoredDocuments(kv)).map((s) => s.document);
|
|
166
|
+
}
|
|
167
|
+
async function readAllStoredDocuments(kv) {
|
|
151
168
|
const entries = await kv.list("document:");
|
|
152
|
-
|
|
169
|
+
const out = [];
|
|
170
|
+
for (const entry of entries) {
|
|
171
|
+
const value = entry.value;
|
|
172
|
+
if (value === null || typeof value !== "object") continue;
|
|
173
|
+
if ("document" in value && "meta" in value) {
|
|
174
|
+
out.push(value);
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
if ("route" in value) {
|
|
178
|
+
const document = value;
|
|
179
|
+
out.push({
|
|
180
|
+
document,
|
|
181
|
+
meta: {
|
|
182
|
+
id: document.route,
|
|
183
|
+
collection: "",
|
|
184
|
+
slug: null,
|
|
185
|
+
status: "",
|
|
186
|
+
title: document.title ?? ""
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return out;
|
|
153
192
|
}
|
|
154
193
|
async function readFindings(kv, route) {
|
|
155
194
|
const stored = await kv.get(findingsKey(route));
|
package/dist/sandbox.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../src/sandbox.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../src/sandbox.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IAGnB,MAAM,EAAE,UAAU,CAAC;IACnB,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,UAAU,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IAGxC,YAAY,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC5C,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAeD,MAAM,WAAW,sBAAsB;IAgBrC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,qBAAqB,CACnC,OAAO,GAAE,sBAA2B,GACnC,yBAAyB,CAwB3B"}
|
package/dist/types.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export interface Finding {
|
|
|
48
48
|
suggestion: string | null;
|
|
49
49
|
scope: FindingScope;
|
|
50
50
|
}
|
|
51
|
+
export type StructuredTruthSource = "manifest" | "schema" | "schema_and_manifest" | "none";
|
|
51
52
|
export interface SiteIntelligenceScore {
|
|
52
53
|
citation_readiness_score: number;
|
|
53
54
|
truth_consistency_score: number;
|
|
@@ -56,6 +57,7 @@ export interface SiteIntelligenceScore {
|
|
|
56
57
|
overall_score: number;
|
|
57
58
|
route_scores: unknown[];
|
|
58
59
|
blockers: IntelligenceBlocker[];
|
|
60
|
+
structured_truth_source?: StructuredTruthSource;
|
|
59
61
|
}
|
|
60
62
|
export interface IntelligenceBlocker {
|
|
61
63
|
rule_id?: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,UAAU,GAClB,QAAQ,GACR,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,YAAY,CAAC;AAEjB,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,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AAO,MAAM,eAAe,UAAU,CAAC"}
|
package/dist/wasm-init.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export declare function evaluateDocuments(documentsJson: string, configJson?: string | null): Promise<string>;
|
|
2
|
-
export declare function scoreIntelligence(documentsJson: string): Promise<string>;
|
|
2
|
+
export declare function scoreIntelligence(documentsJson: string, manifestJson?: string | null): Promise<string>;
|
|
3
|
+
export declare function generateFactsPrompt(documentsJson: string): Promise<string>;
|
|
4
|
+
export declare function validateFactsManifest(manifestJson: string, documentsJson: string): Promise<string>;
|
|
3
5
|
//# sourceMappingURL=wasm-init.d.ts.map
|
package/dist/wasm-init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wasm-init.d.ts","sourceRoot":"","sources":["../src/wasm-init.ts"],"names":[],"mappings":"AAmDA,wBAAsB,iBAAiB,CACrC,aAAa,EAAE,MAAM,EACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GACzB,OAAO,CAAC,MAAM,CAAC,CAGjB;AAED,wBAAsB,iBAAiB,CACrC,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC,CAGjB"}
|
|
1
|
+
{"version":3,"file":"wasm-init.d.ts","sourceRoot":"","sources":["../src/wasm-init.ts"],"names":[],"mappings":"AAmDA,wBAAsB,iBAAiB,CACrC,aAAa,EAAE,MAAM,EACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GACzB,OAAO,CAAC,MAAM,CAAC,CAGjB;AAED,wBAAsB,iBAAiB,CACrC,aAAa,EAAE,MAAM,EACrB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAC3B,OAAO,CAAC,MAAM,CAAC,CAGjB;AAID,wBAAsB,mBAAmB,CACvC,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC,CAGjB;AAKD,wBAAsB,qBAAqB,CACzC,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC,CAGjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aeptus/aexeo-emdash",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Aexeo seogeo SEO/GEO content evaluator as an emdash plugin",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Aexeo",
|
|
@@ -36,6 +36,11 @@
|
|
|
36
36
|
"import": "./dist/configured.js",
|
|
37
37
|
"default": "./dist/configured.js"
|
|
38
38
|
},
|
|
39
|
+
"./admin": {
|
|
40
|
+
"types": "./dist/admin.d.ts",
|
|
41
|
+
"import": "./dist/admin.js",
|
|
42
|
+
"default": "./dist/admin.js"
|
|
43
|
+
},
|
|
39
44
|
"./sandbox": {
|
|
40
45
|
"types": "./dist/sandbox-entry.d.ts",
|
|
41
46
|
"import": "./dist/sandbox-entry.js",
|
|
@@ -50,16 +55,18 @@
|
|
|
50
55
|
"LICENSE"
|
|
51
56
|
],
|
|
52
57
|
"scripts": {
|
|
58
|
+
"sync-version": "node scripts/sync-version.mjs",
|
|
53
59
|
"build:wasm": "bash scripts/build-wasm.sh",
|
|
54
60
|
"build:ts": "tsc -p tsconfig.build.json",
|
|
55
61
|
"build:bundle": "node scripts/build-bundle.mjs",
|
|
56
|
-
"build": "npm run build:wasm && npm run build:ts && npm run build:bundle",
|
|
57
|
-
"typecheck": "tsc --noEmit",
|
|
62
|
+
"build": "npm run sync-version && npm run build:wasm && npm run build:ts && npm run build:bundle",
|
|
63
|
+
"typecheck": "npm run sync-version && tsc --noEmit",
|
|
58
64
|
"prepublishOnly": "npm run build"
|
|
59
65
|
},
|
|
60
66
|
"peerDependencies": {
|
|
61
67
|
"@emdash-cms/core": "*",
|
|
62
|
-
"emdash": ">=0.7.0"
|
|
68
|
+
"emdash": ">=0.7.0",
|
|
69
|
+
"react": "^18.0.0 || ^19.0.0"
|
|
63
70
|
},
|
|
64
71
|
"peerDependenciesMeta": {
|
|
65
72
|
"@emdash-cms/core": {
|
|
@@ -67,12 +74,17 @@
|
|
|
67
74
|
},
|
|
68
75
|
"emdash": {
|
|
69
76
|
"optional": true
|
|
77
|
+
},
|
|
78
|
+
"react": {
|
|
79
|
+
"optional": true
|
|
70
80
|
}
|
|
71
81
|
},
|
|
72
82
|
"devDependencies": {
|
|
73
83
|
"@types/node": "^22.0.0",
|
|
84
|
+
"@types/react": "^19.2.14",
|
|
74
85
|
"emdash": "^0.7.0",
|
|
75
86
|
"esbuild": "^0.28.0",
|
|
87
|
+
"react": "^19.2.5",
|
|
76
88
|
"typescript": "^5.6.0"
|
|
77
89
|
}
|
|
78
90
|
}
|
|
@@ -3,4 +3,19 @@
|
|
|
3
3
|
|
|
4
4
|
export function evaluateDocuments(documents_json: string, config_json?: string | null): string;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Generate the LLM authoring prompt for a truth manifest. The plugin calls
|
|
8
|
+
* this when the editor opens "Generate authoring prompt" — the returned
|
|
9
|
+
* string is what the editor pastes into Claude/GPT/etc.
|
|
10
|
+
*/
|
|
11
|
+
export function generateFactsPrompt(documents_json: string): string;
|
|
12
|
+
|
|
13
|
+
export function scoreIntelligence(documents_json: string, manifest_json?: string | null): string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Validate a candidate `facts.json`. Returns a JSON object with two top-level
|
|
17
|
+
* fields: `validation` (shape / schema check) and `assessment` (truth-layer
|
|
18
|
+
* audit including mismatches against the site). The plugin renders this in
|
|
19
|
+
* the validate-paste UI.
|
|
20
|
+
*/
|
|
21
|
+
export function validateFactsManifest(manifest_json: string, documents_json: string): string;
|
|
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./aexeo_emdash_bridge_bg.js";
|
|
|
5
5
|
__wbg_set_wasm(wasm);
|
|
6
6
|
wasm.__wbindgen_start();
|
|
7
7
|
export {
|
|
8
|
-
evaluateDocuments, scoreIntelligence
|
|
8
|
+
evaluateDocuments, generateFactsPrompt, scoreIntelligence, validateFactsManifest
|
|
9
9
|
} from "./aexeo_emdash_bridge_bg.js";
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
// Minimal ambient declarations for the wasm-bindgen "bg" glue
|
|
2
2
|
// module. We import this for two purposes:
|
|
3
3
|
// 1. The named functions we actually call from JS:
|
|
4
|
-
// __wbg_set_wasm, evaluateDocuments, scoreIntelligence
|
|
4
|
+
// __wbg_set_wasm, evaluateDocuments, scoreIntelligence,
|
|
5
|
+
// generateFactsPrompt, validateFactsManifest.
|
|
5
6
|
// 2. The full namespace, which we hand to WebAssembly.instantiate
|
|
6
7
|
// as the import map — every __wbg_* / __wbindgen_* import the
|
|
7
8
|
// WASM declares needs to resolve at instantiation time.
|
|
8
9
|
// We don't enumerate the second set here; they cross the boundary
|
|
9
10
|
// only via `import * as glue` and never appear in TypeScript call
|
|
10
11
|
// sites by name. See scripts/build-wasm.sh for why this file is
|
|
11
|
-
//
|
|
12
|
+
// hand-maintained: wasm-bindgen does not generate it for our target.
|
|
12
13
|
export const __wbg_set_wasm: (wasm: WebAssembly.Exports) => void;
|
|
13
14
|
export const evaluateDocuments: (
|
|
14
15
|
documents_json: string,
|
|
15
16
|
config_json?: string | null,
|
|
16
17
|
) => string;
|
|
17
|
-
export const scoreIntelligence: (
|
|
18
|
+
export const scoreIntelligence: (
|
|
19
|
+
documents_json: string,
|
|
20
|
+
manifest_json?: string | null,
|
|
21
|
+
) => string;
|
|
22
|
+
export const generateFactsPrompt: (documents_json: string) => string;
|
|
23
|
+
export const validateFactsManifest: (
|
|
24
|
+
manifest_json: string,
|
|
25
|
+
documents_json: string,
|
|
26
|
+
) => string;
|
|
@@ -27,16 +27,19 @@ export function evaluateDocuments(documents_json, config_json) {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
+
* Generate the LLM authoring prompt for a truth manifest. The plugin calls
|
|
31
|
+
* this when the editor opens "Generate authoring prompt" — the returned
|
|
32
|
+
* string is what the editor pastes into Claude/GPT/etc.
|
|
30
33
|
* @param {string} documents_json
|
|
31
34
|
* @returns {string}
|
|
32
35
|
*/
|
|
33
|
-
export function
|
|
36
|
+
export function generateFactsPrompt(documents_json) {
|
|
34
37
|
let deferred3_0;
|
|
35
38
|
let deferred3_1;
|
|
36
39
|
try {
|
|
37
40
|
const ptr0 = passStringToWasm0(documents_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
38
41
|
const len0 = WASM_VECTOR_LEN;
|
|
39
|
-
const ret = wasm.
|
|
42
|
+
const ret = wasm.generateFactsPrompt(ptr0, len0);
|
|
40
43
|
var ptr2 = ret[0];
|
|
41
44
|
var len2 = ret[1];
|
|
42
45
|
if (ret[3]) {
|
|
@@ -50,6 +53,66 @@ export function scoreIntelligence(documents_json) {
|
|
|
50
53
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
51
54
|
}
|
|
52
55
|
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @param {string} documents_json
|
|
59
|
+
* @param {string | null} [manifest_json]
|
|
60
|
+
* @returns {string}
|
|
61
|
+
*/
|
|
62
|
+
export function scoreIntelligence(documents_json, manifest_json) {
|
|
63
|
+
let deferred4_0;
|
|
64
|
+
let deferred4_1;
|
|
65
|
+
try {
|
|
66
|
+
const ptr0 = passStringToWasm0(documents_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
67
|
+
const len0 = WASM_VECTOR_LEN;
|
|
68
|
+
var ptr1 = isLikeNone(manifest_json) ? 0 : passStringToWasm0(manifest_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
69
|
+
var len1 = WASM_VECTOR_LEN;
|
|
70
|
+
const ret = wasm.scoreIntelligence(ptr0, len0, ptr1, len1);
|
|
71
|
+
var ptr3 = ret[0];
|
|
72
|
+
var len3 = ret[1];
|
|
73
|
+
if (ret[3]) {
|
|
74
|
+
ptr3 = 0; len3 = 0;
|
|
75
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
76
|
+
}
|
|
77
|
+
deferred4_0 = ptr3;
|
|
78
|
+
deferred4_1 = len3;
|
|
79
|
+
return getStringFromWasm0(ptr3, len3);
|
|
80
|
+
} finally {
|
|
81
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Validate a candidate `facts.json`. Returns a JSON object with two top-level
|
|
87
|
+
* fields: `validation` (shape / schema check) and `assessment` (truth-layer
|
|
88
|
+
* audit including mismatches against the site). The plugin renders this in
|
|
89
|
+
* the validate-paste UI.
|
|
90
|
+
* @param {string} manifest_json
|
|
91
|
+
* @param {string} documents_json
|
|
92
|
+
* @returns {string}
|
|
93
|
+
*/
|
|
94
|
+
export function validateFactsManifest(manifest_json, documents_json) {
|
|
95
|
+
let deferred4_0;
|
|
96
|
+
let deferred4_1;
|
|
97
|
+
try {
|
|
98
|
+
const ptr0 = passStringToWasm0(manifest_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
99
|
+
const len0 = WASM_VECTOR_LEN;
|
|
100
|
+
const ptr1 = passStringToWasm0(documents_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
101
|
+
const len1 = WASM_VECTOR_LEN;
|
|
102
|
+
const ret = wasm.validateFactsManifest(ptr0, len0, ptr1, len1);
|
|
103
|
+
var ptr3 = ret[0];
|
|
104
|
+
var len3 = ret[1];
|
|
105
|
+
if (ret[3]) {
|
|
106
|
+
ptr3 = 0; len3 = 0;
|
|
107
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
108
|
+
}
|
|
109
|
+
deferred4_0 = ptr3;
|
|
110
|
+
deferred4_1 = len3;
|
|
111
|
+
return getStringFromWasm0(ptr3, len3);
|
|
112
|
+
} finally {
|
|
113
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
53
116
|
export function __wbg_Error_960c155d3d49e4c2(arg0, arg1) {
|
|
54
117
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
55
118
|
return ret;
|
|
Binary file
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const evaluateDocuments: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
5
|
+
export const generateFactsPrompt: (a: number, b: number) => [number, number, number, number];
|
|
6
|
+
export const scoreIntelligence: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
7
|
+
export const validateFactsManifest: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
8
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
9
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
10
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
11
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
12
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
13
|
+
export const __wbindgen_start: () => void;
|