@visiq/core-wasm 0.1.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/README.md +34 -0
- package/index.d.ts +95 -0
- package/index.js +84 -0
- package/package.json +19 -0
- package/pkg/visiq_core.d.ts +13 -0
- package/pkg/visiq_core.js +149 -0
- package/pkg/visiq_core_bg.wasm +0 -0
- package/pkg/visiq_core_bg.wasm.d.ts +12 -0
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# @visiq/core-wasm
|
|
2
|
+
|
|
3
|
+
The VisIQ governance **evaluation core** (`experiments/matrix-v2/visiq-core-rs`, the ONE
|
|
4
|
+
compiled Rust engine) exposed to JavaScript/TypeScript via WebAssembly — so the TS SDK
|
|
5
|
+
evaluates through the **same core** the Go / Java / Ruby / Python bindings use, instead
|
|
6
|
+
of a parallel TS implementation that can drift.
|
|
7
|
+
|
|
8
|
+
```js
|
|
9
|
+
const { evaluate } = require('@visiq/core-wasm');
|
|
10
|
+
const decisionJson = evaluate(JSON.stringify(event), JSON.stringify(bundle));
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- **Synchronous, no async init.** `--target nodejs` glue instantiates the wasm from bytes
|
|
14
|
+
at `require` time (`new WebAssembly.Module`/`Instance`) — a drop-in for a sync call.
|
|
15
|
+
(Node/server only; a browser build would need `--target web` + async init.)
|
|
16
|
+
- **`evaluate(eventJson, bundleJson) → decisionJson`** is the language-neutral seam
|
|
17
|
+
(`evaluate_json` in the core). Fail-closed (G001) on malformed input — never throws.
|
|
18
|
+
- **Faithful.** `node conformance.mjs` proves it reproduces the frozen golden corpus
|
|
19
|
+
(`sdk-corpus/GOLDEN-oracle-vectors.json`) — the same vectors every other binding
|
|
20
|
+
reproduces. **85/85, 0 diverge.**
|
|
21
|
+
|
|
22
|
+
## Rebuild
|
|
23
|
+
|
|
24
|
+
`./build.sh` (needs rustup + `wasm32-unknown-unknown` + `wasm-bindgen-cli` **=0.2.100**;
|
|
25
|
+
the crate pins `wasm-bindgen = "=0.2.100"` so CLI/schema versions match).
|
|
26
|
+
|
|
27
|
+
## Scope / what this is NOT
|
|
28
|
+
|
|
29
|
+
This emits the **decision tuple** `{decision, allowed, action:{decision,argRedactionRules},
|
|
30
|
+
retrieval:{action,redactionRules}}`. It does **not** emit rule attribution (`ruleCode`,
|
|
31
|
+
`reason` prose, `decisionId`) — those are out-of-core (#25) and still computed in TS. A
|
|
32
|
+
full `@visiq/harness` cutover to this core therefore needs the core extended to return
|
|
33
|
+
matched-rule attribution; until then this package is the proven, corpus-gated binding.
|
|
34
|
+
See `experiments/matrix-v2/visiq-core-rs/PARITY-GAPS.md`.
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// Typed surface for @visiq/core-wasm — the ONE Rust governance core, bound to JS.
|
|
2
|
+
// Decision/session shapes mirror @visiq/rego-evaluator + @visiq/runtime (kept in
|
|
3
|
+
// lockstep by the whole-object differential corpus; see conformance.mjs).
|
|
4
|
+
|
|
5
|
+
export interface CoreActionSub {
|
|
6
|
+
decision: 'permit' | 'deny' | 'approval_required' | 'mask' | null;
|
|
7
|
+
allowed: boolean;
|
|
8
|
+
argRedactionRules?: unknown[];
|
|
9
|
+
hitlFallback?: 'mask' | 'deny';
|
|
10
|
+
}
|
|
11
|
+
export interface CoreRetrievalSub {
|
|
12
|
+
action: 'allow' | 'deny' | 'redact' | 'escalate' | null;
|
|
13
|
+
redactionRules?: unknown[];
|
|
14
|
+
hitlFallback?: 'mask' | 'deny';
|
|
15
|
+
}
|
|
16
|
+
export interface CoreDecision {
|
|
17
|
+
decision: 'permit' | 'deny' | 'approval_required' | 'redact' | 'escalate' | 'mask';
|
|
18
|
+
allowed: boolean;
|
|
19
|
+
reason: string;
|
|
20
|
+
ruleId: string | null;
|
|
21
|
+
ruleCode: string | null;
|
|
22
|
+
enforced: boolean;
|
|
23
|
+
agentMode: 'enforce' | 'monitor' | 'off';
|
|
24
|
+
action: CoreActionSub;
|
|
25
|
+
retrieval: CoreRetrievalSub;
|
|
26
|
+
/** Per-op TELEMETRY would-be verdict — present ONLY when agent_mode_by_operation is set. */
|
|
27
|
+
wouldBe?: Omit<CoreDecision, 'wouldBe'>;
|
|
28
|
+
}
|
|
29
|
+
export interface CoreRawResult {
|
|
30
|
+
matched: boolean;
|
|
31
|
+
decision: string;
|
|
32
|
+
reason: string;
|
|
33
|
+
reasonCode: string | null;
|
|
34
|
+
ruleId: string | null;
|
|
35
|
+
ruleCode: string | null;
|
|
36
|
+
ruleDescription: string | null;
|
|
37
|
+
redactionRules: unknown[] | null;
|
|
38
|
+
hitlFallback: 'mask' | 'deny' | null;
|
|
39
|
+
}
|
|
40
|
+
export interface CoreHitlResolution {
|
|
41
|
+
decision: string;
|
|
42
|
+
redactionRules?: unknown[] | null;
|
|
43
|
+
maskedFallback: boolean;
|
|
44
|
+
reason?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface CoreNoCoverage {
|
|
47
|
+
decision: 'permit' | 'deny' | 'approval_required';
|
|
48
|
+
rule_code: string;
|
|
49
|
+
reason: string;
|
|
50
|
+
hitlCategory: 'engineer' | 'enduser' | null;
|
|
51
|
+
autopilot: boolean;
|
|
52
|
+
enduserHitlBypassed: boolean;
|
|
53
|
+
}
|
|
54
|
+
export type SessionEvalState = Record<string, unknown>;
|
|
55
|
+
|
|
56
|
+
export function evaluate(event: unknown, bundle: unknown): CoreDecision;
|
|
57
|
+
export function evaluateUnifiedRulesRaw(
|
|
58
|
+
op: 'action' | 'retrieval' | 'delegation',
|
|
59
|
+
event: unknown,
|
|
60
|
+
bundle: unknown,
|
|
61
|
+
): CoreRawResult;
|
|
62
|
+
/**
|
|
63
|
+
* Evaluate a backend-shaped `UnifiedEvaluationInput` (facets/agent/session/
|
|
64
|
+
* operation/surface/query already marshalled) against `{ rules: rawRows[] }` —
|
|
65
|
+
* the Hono backend cutover seam. Returns the SAME `CoreRawResult` shape as
|
|
66
|
+
* `evaluateUnifiedRulesRaw`. Pass `now = Date.now()` for emergency-bypass expiry.
|
|
67
|
+
*/
|
|
68
|
+
export function evaluateUnifiedFromInput(
|
|
69
|
+
input: unknown,
|
|
70
|
+
bundle: unknown,
|
|
71
|
+
now?: number | null,
|
|
72
|
+
): CoreRawResult;
|
|
73
|
+
export function resolveHitlOutcome(
|
|
74
|
+
result: unknown,
|
|
75
|
+
state: 'approved' | 'rejected' | 'timeout' | 'pending',
|
|
76
|
+
): CoreHitlResolution;
|
|
77
|
+
export function resolveNoCoverage(args: {
|
|
78
|
+
action: string;
|
|
79
|
+
targetApp: string;
|
|
80
|
+
mode: 'enforce' | 'monitor' | 'off';
|
|
81
|
+
config: unknown;
|
|
82
|
+
agentNoCoverage?: 'open' | 'closed' | null;
|
|
83
|
+
}): CoreNoCoverage;
|
|
84
|
+
export function emptySessionState(): SessionEvalState;
|
|
85
|
+
export function mergeSessionEvent(state: SessionEvalState, evidence: unknown): SessionEvalState;
|
|
86
|
+
export function toSessionEvalState(raw: unknown): SessionEvalState;
|
|
87
|
+
export function flattenEvent(event: unknown): Record<string, unknown>;
|
|
88
|
+
export function expandFlatToNested(flat: unknown): Record<string, unknown>;
|
|
89
|
+
export function applyMapping(event: unknown, mappings: unknown, derivations?: unknown): Record<string, unknown>;
|
|
90
|
+
export function computeActionSchemaId(event: unknown, opts?: unknown): string;
|
|
91
|
+
export function computeFingerprint(event: unknown): string;
|
|
92
|
+
export function recursiveKeyPaths(event: unknown): string[];
|
|
93
|
+
export function deriveDeclaredCore(samples: unknown[], opts?: unknown): { requiredPaths: string[]; optionalPaths: string[] };
|
|
94
|
+
export function shouldMintNewVersion(prev: string[] | null | undefined, next: string[]): boolean;
|
|
95
|
+
export function sanitizeAgentReason(reason: string | null | undefined): string;
|
package/index.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// Typed wrappers over the ONE narrow WASM seam (`dispatch(op, payload_json)`), so
|
|
3
|
+
// consumers get real signatures instead of hand-marshalling JSON. Everything is
|
|
4
|
+
// synchronous (the wasm is instantiated at require-time in ./pkg/visiq_core.js).
|
|
5
|
+
// Fail-closed: the core never throws; a malformed input yields a G001 deny / error.
|
|
6
|
+
const core = require('./pkg/visiq_core.js');
|
|
7
|
+
|
|
8
|
+
const call = (op, payload) => JSON.parse(core.dispatch(op, JSON.stringify(payload)));
|
|
9
|
+
|
|
10
|
+
/** Evaluate an event against a bundle → the full UnifiedDecision. */
|
|
11
|
+
function evaluate(event, bundle) {
|
|
12
|
+
return JSON.parse(core.evaluate(JSON.stringify(event), JSON.stringify(bundle)));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** Raw single-facet UnifiedEvaluationResult (matched/reason/reasonCode/ruleId/
|
|
16
|
+
* ruleCode/ruleDescription/redactionRules/hitlFallback) — for the backend. */
|
|
17
|
+
function evaluateUnifiedRulesRaw(op, event, bundle) {
|
|
18
|
+
return call('evaluate_unified_rules_raw', { op, event, bundle });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Raw UnifiedEvaluationResult from a backend-shaped UnifiedEvaluationInput (the
|
|
22
|
+
* Hono backend cutover seam — no event remarshalling; the SAME shape as
|
|
23
|
+
* `evaluateUnifiedRulesRaw`). `bundle` = { rules: rawRows[] }. Pass `now =
|
|
24
|
+
* Date.now()` so emergency-bypass expiry resolves against the caller's clock. */
|
|
25
|
+
function evaluateUnifiedFromInput(input, bundle, now) {
|
|
26
|
+
return call('evaluate_unified_from_input', { input, bundle, now: now ?? null });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Resolve a HITL result given the human-review state → terminal outcome. */
|
|
30
|
+
function resolveHitlOutcome(result, state) {
|
|
31
|
+
return call('resolve_hitl_outcome', { result, state });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Full NoCoverageDecision for an uncovered action. */
|
|
35
|
+
function resolveNoCoverage(args) {
|
|
36
|
+
return call('resolve_no_coverage', args);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** The empty session-trajectory state of a fresh session. */
|
|
40
|
+
function emptySessionState() {
|
|
41
|
+
return call('empty_session_state', {});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Fold one event's evidence into the accumulated session state (pure). */
|
|
45
|
+
function mergeSessionEvent(state, evidence) {
|
|
46
|
+
return call('merge_session_event', { state, evidence });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** Defensive hydration of a persisted/untrusted session row. */
|
|
50
|
+
function toSessionEvalState(raw) {
|
|
51
|
+
return call('to_session_eval_state', { raw });
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ── identity / normalization (server-side) ──
|
|
55
|
+
const flattenEvent = (event) => call('flatten_event', { event });
|
|
56
|
+
const expandFlatToNested = (flat) => call('expand_flat_to_nested', { flat });
|
|
57
|
+
const applyMapping = (event, mappings, derivations) =>
|
|
58
|
+
call('apply_mapping', { event, mappings, derivations: derivations ?? null });
|
|
59
|
+
const computeActionSchemaId = (event, opts) => call('compute_action_schema_id', { event, opts: opts ?? {} });
|
|
60
|
+
const computeFingerprint = (event) => call('compute_fingerprint', { event });
|
|
61
|
+
const recursiveKeyPaths = (event) => call('recursive_key_paths', { event });
|
|
62
|
+
const deriveDeclaredCore = (samples, opts) => call('derive_declared_core', { samples, opts: opts ?? {} });
|
|
63
|
+
const shouldMintNewVersion = (prev, next) => call('should_mint_new_version', { prev: prev ?? null, next });
|
|
64
|
+
const sanitizeAgentReason = (reason) => call('sanitize_agent_reason', { reason });
|
|
65
|
+
|
|
66
|
+
module.exports = {
|
|
67
|
+
evaluate,
|
|
68
|
+
evaluateUnifiedRulesRaw,
|
|
69
|
+
evaluateUnifiedFromInput,
|
|
70
|
+
resolveHitlOutcome,
|
|
71
|
+
resolveNoCoverage,
|
|
72
|
+
emptySessionState,
|
|
73
|
+
mergeSessionEvent,
|
|
74
|
+
toSessionEvalState,
|
|
75
|
+
flattenEvent,
|
|
76
|
+
expandFlatToNested,
|
|
77
|
+
applyMapping,
|
|
78
|
+
computeActionSchemaId,
|
|
79
|
+
computeFingerprint,
|
|
80
|
+
recursiveKeyPaths,
|
|
81
|
+
deriveDeclaredCore,
|
|
82
|
+
shouldMintNewVersion,
|
|
83
|
+
sanitizeAgentReason,
|
|
84
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@visiq/core-wasm",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "VisIQ governance core (visiq-core-rs) compiled to WASM — the ONE Rust evaluation core, bound to JS. Same core the Go/Java/Ruby/Python SDKs use. evaluate(eventJson, bundleJson) -> decisionJson.",
|
|
5
|
+
"type": "commonjs",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"types": "index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"index.js",
|
|
10
|
+
"index.d.ts",
|
|
11
|
+
"pkg/visiq_core.js",
|
|
12
|
+
"pkg/visiq_core.d.ts",
|
|
13
|
+
"pkg/visiq_core_bg.wasm",
|
|
14
|
+
"pkg/visiq_core_bg.wasm.d.ts"
|
|
15
|
+
],
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"pkg/visiq_core.js"
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* WASM binding for the granular `dispatch` seam.
|
|
5
|
+
*/
|
|
6
|
+
export function dispatch(op: string, payload_json: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* WASM binding (for `@visiq/core-wasm` → the TS SDK / harness). The SAME
|
|
9
|
+
* `evaluate_json` core, exposed to JS through wasm-bindgen so the TypeScript SDK
|
|
10
|
+
* evaluates through the ONE compiled core exactly like the Go/Java/Ruby bindings.
|
|
11
|
+
* `evaluate_json` is fail-closed (G001) on malformed input, so this never throws.
|
|
12
|
+
*/
|
|
13
|
+
export function evaluate(event_json: string, bundle_json: string): string;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
|
|
2
|
+
let imports = {};
|
|
3
|
+
imports['__wbindgen_placeholder__'] = module.exports;
|
|
4
|
+
let wasm;
|
|
5
|
+
const { TextEncoder, TextDecoder } = require(`util`);
|
|
6
|
+
|
|
7
|
+
let WASM_VECTOR_LEN = 0;
|
|
8
|
+
|
|
9
|
+
let cachedUint8ArrayMemory0 = null;
|
|
10
|
+
|
|
11
|
+
function getUint8ArrayMemory0() {
|
|
12
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
13
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
14
|
+
}
|
|
15
|
+
return cachedUint8ArrayMemory0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
19
|
+
|
|
20
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
21
|
+
? function (arg, view) {
|
|
22
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
23
|
+
}
|
|
24
|
+
: function (arg, view) {
|
|
25
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
26
|
+
view.set(buf);
|
|
27
|
+
return {
|
|
28
|
+
read: arg.length,
|
|
29
|
+
written: buf.length
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
34
|
+
|
|
35
|
+
if (realloc === undefined) {
|
|
36
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
37
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
38
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
39
|
+
WASM_VECTOR_LEN = buf.length;
|
|
40
|
+
return ptr;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
let len = arg.length;
|
|
44
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
45
|
+
|
|
46
|
+
const mem = getUint8ArrayMemory0();
|
|
47
|
+
|
|
48
|
+
let offset = 0;
|
|
49
|
+
|
|
50
|
+
for (; offset < len; offset++) {
|
|
51
|
+
const code = arg.charCodeAt(offset);
|
|
52
|
+
if (code > 0x7F) break;
|
|
53
|
+
mem[ptr + offset] = code;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (offset !== len) {
|
|
57
|
+
if (offset !== 0) {
|
|
58
|
+
arg = arg.slice(offset);
|
|
59
|
+
}
|
|
60
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
61
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
62
|
+
const ret = encodeString(arg, view);
|
|
63
|
+
|
|
64
|
+
offset += ret.written;
|
|
65
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
WASM_VECTOR_LEN = offset;
|
|
69
|
+
return ptr;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
73
|
+
|
|
74
|
+
cachedTextDecoder.decode();
|
|
75
|
+
|
|
76
|
+
function getStringFromWasm0(ptr, len) {
|
|
77
|
+
ptr = ptr >>> 0;
|
|
78
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* WASM binding for the granular `dispatch` seam.
|
|
82
|
+
* @param {string} op
|
|
83
|
+
* @param {string} payload_json
|
|
84
|
+
* @returns {string}
|
|
85
|
+
*/
|
|
86
|
+
module.exports.dispatch = function(op, payload_json) {
|
|
87
|
+
let deferred3_0;
|
|
88
|
+
let deferred3_1;
|
|
89
|
+
try {
|
|
90
|
+
const ptr0 = passStringToWasm0(op, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
91
|
+
const len0 = WASM_VECTOR_LEN;
|
|
92
|
+
const ptr1 = passStringToWasm0(payload_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
93
|
+
const len1 = WASM_VECTOR_LEN;
|
|
94
|
+
const ret = wasm.dispatch(ptr0, len0, ptr1, len1);
|
|
95
|
+
deferred3_0 = ret[0];
|
|
96
|
+
deferred3_1 = ret[1];
|
|
97
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
98
|
+
} finally {
|
|
99
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* WASM binding (for `@visiq/core-wasm` → the TS SDK / harness). The SAME
|
|
105
|
+
* `evaluate_json` core, exposed to JS through wasm-bindgen so the TypeScript SDK
|
|
106
|
+
* evaluates through the ONE compiled core exactly like the Go/Java/Ruby bindings.
|
|
107
|
+
* `evaluate_json` is fail-closed (G001) on malformed input, so this never throws.
|
|
108
|
+
* @param {string} event_json
|
|
109
|
+
* @param {string} bundle_json
|
|
110
|
+
* @returns {string}
|
|
111
|
+
*/
|
|
112
|
+
module.exports.evaluate = function(event_json, bundle_json) {
|
|
113
|
+
let deferred3_0;
|
|
114
|
+
let deferred3_1;
|
|
115
|
+
try {
|
|
116
|
+
const ptr0 = passStringToWasm0(event_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
117
|
+
const len0 = WASM_VECTOR_LEN;
|
|
118
|
+
const ptr1 = passStringToWasm0(bundle_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
119
|
+
const len1 = WASM_VECTOR_LEN;
|
|
120
|
+
const ret = wasm.evaluate(ptr0, len0, ptr1, len1);
|
|
121
|
+
deferred3_0 = ret[0];
|
|
122
|
+
deferred3_1 = ret[1];
|
|
123
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
124
|
+
} finally {
|
|
125
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
module.exports.__wbindgen_init_externref_table = function() {
|
|
130
|
+
const table = wasm.__wbindgen_export_0;
|
|
131
|
+
const offset = table.grow(4);
|
|
132
|
+
table.set(0, undefined);
|
|
133
|
+
table.set(offset + 0, undefined);
|
|
134
|
+
table.set(offset + 1, null);
|
|
135
|
+
table.set(offset + 2, true);
|
|
136
|
+
table.set(offset + 3, false);
|
|
137
|
+
;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const path = require('path').join(__dirname, 'visiq_core_bg.wasm');
|
|
141
|
+
const bytes = require('fs').readFileSync(path);
|
|
142
|
+
|
|
143
|
+
const wasmModule = new WebAssembly.Module(bytes);
|
|
144
|
+
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
145
|
+
wasm = wasmInstance.exports;
|
|
146
|
+
module.exports.__wasm = wasm;
|
|
147
|
+
|
|
148
|
+
wasm.__wbindgen_start();
|
|
149
|
+
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const dispatch: (a: number, b: number, c: number, d: number) => [number, number];
|
|
5
|
+
export const evaluate: (a: number, b: number, c: number, d: number) => [number, number];
|
|
6
|
+
export const visiq_evaluate: (a: number, b: number) => number;
|
|
7
|
+
export const visiq_free: (a: number) => void;
|
|
8
|
+
export const __wbindgen_export_0: 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 __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
12
|
+
export const __wbindgen_start: () => void;
|