@aeptus/aexeo-emdash 0.2.0 → 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/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;
@@ -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,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,E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CAAC;CACjD;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,2 @@
1
+ export declare const PACKAGE_VERSION = "0.3.0";
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,UAAU,CAAC"}
@@ -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
@@ -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.2.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",
@@ -55,11 +55,12 @@
55
55
  "LICENSE"
56
56
  ],
57
57
  "scripts": {
58
+ "sync-version": "node scripts/sync-version.mjs",
58
59
  "build:wasm": "bash scripts/build-wasm.sh",
59
60
  "build:ts": "tsc -p tsconfig.build.json",
60
61
  "build:bundle": "node scripts/build-bundle.mjs",
61
- "build": "npm run build:wasm && npm run build:ts && npm run build:bundle",
62
- "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",
63
64
  "prepublishOnly": "npm run build"
64
65
  },
65
66
  "peerDependencies": {
@@ -3,4 +3,19 @@
3
3
 
4
4
  export function evaluateDocuments(documents_json: string, config_json?: string | null): string;
5
5
 
6
- export function scoreIntelligence(documents_json: string): string;
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
- // (re)written after every wasm-bindgen run.
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: (documents_json: string) => string;
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 scoreIntelligence(documents_json) {
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.scoreIntelligence(ptr0, len0);
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
- // Overrides the wasm-bindgen-generated default to match what
2
- // emdash hosts consuming this package actually receive at the
3
- // import site: a precompiled WebAssembly.Module. Cloudflare
4
- // Workers / workerd disallow runtime WebAssembly.instantiate
5
- // from raw bytes ("Wasm code generation disallowed by embedder"),
6
- // so we depend on the consumer's bundler resolving the import
7
- // to a Module at build time. esbuild's "wasm" loader does this;
8
- // Wrangler does this natively. See scripts/build-wasm.sh for why
9
- // this file is rewritten after every wasm-bindgen run.
10
- declare const wasmModule: WebAssembly.Module;
11
- export default wasmModule;
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;