@visiq/core-wasm 0.1.0 → 0.1.2
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/LICENSE +21 -0
- package/package.json +24 -2
- package/pkg/visiq_core.d.ts +4 -4
- package/pkg/visiq_core.js +17 -17
- package/pkg/visiq_core_bg.wasm +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 VisIQ Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,13 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visiq/core-wasm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
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
5
|
"type": "commonjs",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"types": "index.d.ts",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/VISIQ-LABS/xy.git",
|
|
12
|
+
"directory": "packages/core-wasm"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://docs.visiqlabs.com",
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=20"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"visiq",
|
|
20
|
+
"ai-agent",
|
|
21
|
+
"governance",
|
|
22
|
+
"authorization",
|
|
23
|
+
"wasm",
|
|
24
|
+
"policy"
|
|
25
|
+
],
|
|
8
26
|
"files": [
|
|
9
27
|
"index.js",
|
|
10
28
|
"index.d.ts",
|
|
29
|
+
"LICENSE",
|
|
11
30
|
"pkg/visiq_core.js",
|
|
12
31
|
"pkg/visiq_core.d.ts",
|
|
13
32
|
"pkg/visiq_core_bg.wasm",
|
|
@@ -15,5 +34,8 @@
|
|
|
15
34
|
],
|
|
16
35
|
"sideEffects": [
|
|
17
36
|
"pkg/visiq_core.js"
|
|
18
|
-
]
|
|
37
|
+
],
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
}
|
|
19
41
|
}
|
package/pkg/visiq_core.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
* WASM binding for the granular `dispatch` seam.
|
|
5
|
-
*/
|
|
6
|
-
export function dispatch(op: string, payload_json: string): string;
|
|
7
3
|
/**
|
|
8
4
|
* WASM binding (for `@visiq/core-wasm` → the TS SDK / harness). The SAME
|
|
9
5
|
* `evaluate_json` core, exposed to JS through wasm-bindgen so the TypeScript SDK
|
|
@@ -11,3 +7,7 @@ export function dispatch(op: string, payload_json: string): string;
|
|
|
11
7
|
* `evaluate_json` is fail-closed (G001) on malformed input, so this never throws.
|
|
12
8
|
*/
|
|
13
9
|
export function evaluate(event_json: string, bundle_json: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* WASM binding for the granular `dispatch` seam.
|
|
12
|
+
*/
|
|
13
|
+
export function dispatch(op: string, payload_json: string): string;
|
package/pkg/visiq_core.js
CHANGED
|
@@ -78,20 +78,23 @@ function getStringFromWasm0(ptr, len) {
|
|
|
78
78
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
|
-
* WASM binding for the
|
|
82
|
-
*
|
|
83
|
-
*
|
|
81
|
+
* WASM binding (for `@visiq/core-wasm` → the TS SDK / harness). The SAME
|
|
82
|
+
* `evaluate_json` core, exposed to JS through wasm-bindgen so the TypeScript SDK
|
|
83
|
+
* evaluates through the ONE compiled core exactly like the Go/Java/Ruby bindings.
|
|
84
|
+
* `evaluate_json` is fail-closed (G001) on malformed input, so this never throws.
|
|
85
|
+
* @param {string} event_json
|
|
86
|
+
* @param {string} bundle_json
|
|
84
87
|
* @returns {string}
|
|
85
88
|
*/
|
|
86
|
-
module.exports.
|
|
89
|
+
module.exports.evaluate = function(event_json, bundle_json) {
|
|
87
90
|
let deferred3_0;
|
|
88
91
|
let deferred3_1;
|
|
89
92
|
try {
|
|
90
|
-
const ptr0 = passStringToWasm0(
|
|
93
|
+
const ptr0 = passStringToWasm0(event_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
91
94
|
const len0 = WASM_VECTOR_LEN;
|
|
92
|
-
const ptr1 = passStringToWasm0(
|
|
95
|
+
const ptr1 = passStringToWasm0(bundle_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
93
96
|
const len1 = WASM_VECTOR_LEN;
|
|
94
|
-
const ret = wasm.
|
|
97
|
+
const ret = wasm.evaluate(ptr0, len0, ptr1, len1);
|
|
95
98
|
deferred3_0 = ret[0];
|
|
96
99
|
deferred3_1 = ret[1];
|
|
97
100
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -101,23 +104,20 @@ module.exports.dispatch = function(op, payload_json) {
|
|
|
101
104
|
};
|
|
102
105
|
|
|
103
106
|
/**
|
|
104
|
-
* WASM binding
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* `evaluate_json` is fail-closed (G001) on malformed input, so this never throws.
|
|
108
|
-
* @param {string} event_json
|
|
109
|
-
* @param {string} bundle_json
|
|
107
|
+
* WASM binding for the granular `dispatch` seam.
|
|
108
|
+
* @param {string} op
|
|
109
|
+
* @param {string} payload_json
|
|
110
110
|
* @returns {string}
|
|
111
111
|
*/
|
|
112
|
-
module.exports.
|
|
112
|
+
module.exports.dispatch = function(op, payload_json) {
|
|
113
113
|
let deferred3_0;
|
|
114
114
|
let deferred3_1;
|
|
115
115
|
try {
|
|
116
|
-
const ptr0 = passStringToWasm0(
|
|
116
|
+
const ptr0 = passStringToWasm0(op, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
117
117
|
const len0 = WASM_VECTOR_LEN;
|
|
118
|
-
const ptr1 = passStringToWasm0(
|
|
118
|
+
const ptr1 = passStringToWasm0(payload_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
119
119
|
const len1 = WASM_VECTOR_LEN;
|
|
120
|
-
const ret = wasm.
|
|
120
|
+
const ret = wasm.dispatch(ptr0, len0, ptr1, len1);
|
|
121
121
|
deferred3_0 = ret[0];
|
|
122
122
|
deferred3_1 = ret[1];
|
|
123
123
|
return getStringFromWasm0(ret[0], ret[1]);
|
package/pkg/visiq_core_bg.wasm
CHANGED
|
Binary file
|