@cleocode/cant 2026.4.0 → 2026.4.4
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/native-loader.d.ts +11 -1
- package/dist/wasm-loader.d.ts +1 -5
- package/dist/wasm-loader.js +1 -1
- package/package.json +11 -3
package/dist/native-loader.d.ts
CHANGED
|
@@ -10,10 +10,20 @@
|
|
|
10
10
|
* Check if the native addon is available
|
|
11
11
|
*/
|
|
12
12
|
export declare function isNativeAvailable(): boolean;
|
|
13
|
+
/** Shape returned by the native Rust WASM cantParse function. */
|
|
14
|
+
export interface NativeParseResult {
|
|
15
|
+
directive?: string;
|
|
16
|
+
directiveType?: string;
|
|
17
|
+
addresses?: string[];
|
|
18
|
+
taskRefs?: string[];
|
|
19
|
+
tags?: string[];
|
|
20
|
+
headerRaw?: string;
|
|
21
|
+
body?: string;
|
|
22
|
+
}
|
|
13
23
|
/**
|
|
14
24
|
* Parse a CANT message using the native addon
|
|
15
25
|
*/
|
|
16
|
-
export declare function cantParseNative(content: string):
|
|
26
|
+
export declare function cantParseNative(content: string): NativeParseResult;
|
|
17
27
|
/**
|
|
18
28
|
* Classify a directive using the native addon
|
|
19
29
|
*/
|
package/dist/wasm-loader.d.ts
CHANGED
|
@@ -4,11 +4,7 @@
|
|
|
4
4
|
* Loads the WASM module and provides access to CANT parsing functions
|
|
5
5
|
*/
|
|
6
6
|
/** Shape of the CANT WASM module exports. */
|
|
7
|
-
|
|
8
|
-
default(): Promise<void>;
|
|
9
|
-
cant_parse(content: string): unknown;
|
|
10
|
-
cant_classify_directive(verb: string): string;
|
|
11
|
-
}
|
|
7
|
+
type CantWasmModule = typeof import('../wasm/cant_core');
|
|
12
8
|
declare let wasmModule: CantWasmModule | null;
|
|
13
9
|
/**
|
|
14
10
|
* Initialize the WASM module
|
package/dist/wasm-loader.js
CHANGED
|
@@ -62,7 +62,7 @@ async function initWasm() {
|
|
|
62
62
|
initPromise = (async () => {
|
|
63
63
|
try {
|
|
64
64
|
// Try to load the WASM module
|
|
65
|
-
const wasm =
|
|
65
|
+
const wasm = await Promise.resolve().then(() => __importStar(require('../wasm/cant_core.js')));
|
|
66
66
|
await wasm.default();
|
|
67
67
|
exports.wasmModule = wasmModule = wasm;
|
|
68
68
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleocode/cant",
|
|
3
|
-
"version": "2026.4.
|
|
3
|
+
"version": "2026.4.4",
|
|
4
4
|
"description": "CANT protocol parser and interpreter for CLEO - wraps cant-core WASM",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"wasm/"
|
|
10
10
|
],
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@cleocode/
|
|
13
|
-
"@cleocode/
|
|
12
|
+
"@cleocode/lafs": "2026.4.4",
|
|
13
|
+
"@cleocode/contracts": "2026.4.4"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"typescript": "^5.0.0",
|
|
@@ -24,6 +24,14 @@
|
|
|
24
24
|
"wasm"
|
|
25
25
|
],
|
|
26
26
|
"license": "MIT",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/kryptobaseddev/cleo.git",
|
|
30
|
+
"directory": "packages/cant"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
27
35
|
"scripts": {
|
|
28
36
|
"build": "tsc",
|
|
29
37
|
"build:wasm": "cd ../../crates/cant-core && wasm-pack build --target web --features wasm --out-dir ../../packages/cant/wasm",
|