@dot-agent/kernel-dsl 0.1.0 → 0.1.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dot-agent/kernel-dsl",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "WASM kernel for parsing and executing the agent behavior DSL",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -56,10 +56,9 @@
56
56
  },
57
57
  "scripts": {
58
58
  "build": "./scripts/build-wasm.sh && node scripts/patch-wasm-bindgen.js",
59
- "build:release": "RELEASE=true ./scripts/build-wasm.sh && node scripts/patch-wasm-bindgen.js",
60
- "patch": "node -e \"const fs=require('fs'),p=require('./pkg/package.json');p.name='@dot-agent/kernel-dsl';p.publishConfig={access:'public'};fs.writeFileSync('./pkg/package.json',JSON.stringify(p,null,2)+'\\n')\"",
59
+ "build:release": "RELEASE=true ./scripts/build-wasm.sh && node scripts/patch-wasm-bindgen.js && node scripts/create-pkg-manifest.js",
61
60
  "test:node": "node --test tests/node-compat.test.js",
62
- "prepublishOnly": "npm run build:release && npm run patch"
61
+ "prepublishOnly": "npm run build:release"
63
62
  },
64
63
  "publishConfig": {
65
64
  "access": "public"
Binary file
package/pkg/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dot-agent/kernel-dsl",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "main": "dot_agent_kernel_dsl.js",
6
6
  "types": "dot_agent_kernel_dsl.d.ts",
package/pkg/index.js DELETED
@@ -1,99 +0,0 @@
1
- let _initialized = false;
2
- let _module = null;
3
-
4
- // Complete WASI + Rust runtime shim - 31 functions required
5
- const wasiShim = {
6
- // WASI file descriptor operations (5)
7
- fd_write: () => 0,
8
- fd_close: () => 0,
9
- fd_seek: () => 0,
10
- fd_prestat_get: () => 0,
11
- fd_prestat_dir_name: () => 0,
12
-
13
- // WASI environment (2)
14
- environ_get: () => 0,
15
- environ_sizes_get: () => 0,
16
-
17
- // WASI time (1)
18
- clock_time_get: () => 0,
19
-
20
- // WASI misc (1)
21
- random_get: () => 0,
22
- proc_exit: () => 0,
23
-
24
- // Rust UB Sanitizer handlers (11)
25
- __ubsan_handle_type_mismatch_v1: () => 0,
26
- __ubsan_handle_alignment_assumption: () => 0,
27
- __ubsan_handle_out_of_bounds: () => 0,
28
- __ubsan_handle_nonnull_arg: () => 0,
29
- __ubsan_handle_load_invalid_value: () => 0,
30
- __ubsan_handle_builtin_unreachable: () => 0,
31
- __ubsan_handle_add_overflow: () => 0,
32
- __ubsan_handle_sub_overflow: () => 0,
33
- __ubsan_handle_mul_overflow: () => 0,
34
- __ubsan_handle_divrem_overflow: () => 0,
35
- __ubsan_handle_shift_out_of_bounds: () => 0,
36
- __ubsan_handle_pointer_overflow: () => 0,
37
-
38
- // wasm-bindgen JS interop (8)
39
- __wbg_call_9c758de292015997: () => 0,
40
- __wbg_new_d90091b82fdf5b91: () => 0,
41
- __wbg_new_ce1ab61c1c2b300d: () => 0,
42
- __wbg_push_a6822215aa43e71c: () => 0,
43
- __wbg_set_6be42768c690e380: () => 0,
44
- __wbg_set_dca99999bba88a9a: () => 0,
45
- __wbg___wbindgen_throw_1506f2235d1bdba0: () => 0,
46
-
47
- // wasm-bindgen internal (3)
48
- __wbindgen_init_externref_table: () => 0,
49
- __wbindgen_cast_0000000000000001: () => 0,
50
- __wbindgen_cast_0000000000000002: () => 0,
51
- };
52
-
53
- export class AgentDSLKernel {
54
- constructor() {
55
- if (!_initialized) throw new Error('Must call init() first');
56
- this._kernel = new _module.AgentDSLKernel();
57
- }
58
-
59
- get_current_state() { return this._kernel.get_current_state(); }
60
- get_graph() { return this._kernel.get_graph(); }
61
- get_memory() { return this._kernel.get_memory(); }
62
- get_valid_intents() { return this._kernel.get_valid_intents(); }
63
- load_behavior(text) { return this._kernel.load_behavior(text); }
64
- observe(callback) { return this._kernel.observe(callback); }
65
- send_complete() { return this._kernel.send_complete(); }
66
- send_event(event) { return this._kernel.send_event(event); }
67
- send_failed() { return this._kernel.send_failed(); }
68
- send_fallback() { return this._kernel.send_fallback(); }
69
- send_intent(intent) { return this._kernel.send_intent(intent); }
70
- send_offtopic() { return this._kernel.send_offtopic(); }
71
- tick_prompt() { return this._kernel.tick_prompt(); }
72
- free() { return this._kernel.free(); }
73
- }
74
-
75
- export async function init() {
76
- if (_initialized) return;
77
-
78
- try {
79
- const bgModule = await import('./pkg/dot_agent_kernel_dsl_bg.js');
80
- const wasmPath = new URL('./pkg/dot_agent_kernel_dsl_bg.wasm', import.meta.url);
81
- const wasmResponse = await fetch(wasmPath);
82
- const wasmBuffer = await wasmResponse.arrayBuffer();
83
-
84
- const importObject = {
85
- env: wasiShim,
86
- wasi_snapshot_preview1: wasiShim,
87
- './dot_agent_kernel_dsl_bg.js': { ...bgModule }
88
- };
89
-
90
- const wasmModule = await WebAssembly.instantiate(wasmBuffer, importObject);
91
- bgModule.__wbg_set_wasm(wasmModule.instance.exports);
92
- _module = await import('./pkg/dot_agent_kernel_dsl.js');
93
-
94
- _initialized = true;
95
- } catch (err) {
96
- console.error('Failed to initialize wasm:', err);
97
- throw err;
98
- }
99
- }