nanocodex 0.1.1 → 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/README.md +170 -6
- package/actions/events.mjs +105 -22
- package/actions/index.mjs +4 -0
- package/actions/session.d.mts +14 -2
- package/actions/session.mjs +24 -1
- package/actions/turn.d.mts +22 -3
- package/actions/turn.mjs +10 -0
- package/browser/Agent.d.mts +5 -5
- package/browser/Agent.mjs +31 -6
- package/browser/host.mjs +51 -7
- package/browser/index.d.mts +5 -0
- package/index.d.mts +5 -0
- package/internal.mjs +237 -21
- package/node/Agent.d.mts +3 -7
- package/node/Agent.mjs +48 -8
- package/node/host.mjs +78 -13
- package/node/index.d.mts +5 -0
- package/package.json +3 -3
- package/pkg-node/nanocodex.d.ts +84 -29
- package/pkg-node/nanocodex.js +221 -63
- package/pkg-node/nanocodex_bg.wasm +0 -0
- package/pkg-node/nanocodex_bg.wasm.d.ts +10 -2
- package/pkg-web/nanocodex.d.ts +94 -31
- package/pkg-web/nanocodex.js +220 -63
- package/pkg-web/nanocodex_bg.wasm +0 -0
- package/pkg-web/nanocodex_bg.wasm.d.ts +10 -2
- package/runtime/code-runtime.mjs +35 -12
- package/types.d.mts +67 -2
- package/scripts/check-package.mjs +0 -38
package/pkg-node/nanocodex.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* @ts-self-types="./nanocodex.d.ts" */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* JavaScript binding over the shared Rust agent lifecycle.
|
|
5
5
|
*/
|
|
6
6
|
class Nanocodex {
|
|
7
7
|
static __wrap(ptr) {
|
|
@@ -21,7 +21,19 @@ class Nanocodex {
|
|
|
21
21
|
wasm.__wbg_nanocodex_free(ptr, 0);
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Compacts retained history immediately without fabricating a user prompt.
|
|
25
|
+
*
|
|
26
|
+
* # Errors
|
|
27
|
+
*
|
|
28
|
+
* Throws when compaction or the agent driver fails.
|
|
29
|
+
* @returns {Promise<void>}
|
|
30
|
+
*/
|
|
31
|
+
compact() {
|
|
32
|
+
const ret = wasm.nanocodex_compact(this.__wbg_ptr);
|
|
33
|
+
return ret;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Forks the latest safe committed model boundary.
|
|
25
37
|
*
|
|
26
38
|
* # Errors
|
|
27
39
|
*
|
|
@@ -33,26 +45,25 @@ class Nanocodex {
|
|
|
33
45
|
return ret;
|
|
34
46
|
}
|
|
35
47
|
/**
|
|
36
|
-
*
|
|
48
|
+
* Forks from an exact completed historical turn.
|
|
37
49
|
*
|
|
38
50
|
* # Errors
|
|
39
51
|
*
|
|
40
|
-
* Rejects if the
|
|
41
|
-
*
|
|
42
|
-
* @param {Turn} turn
|
|
52
|
+
* Rejects if the result belongs to another agent or the driver stopped.
|
|
53
|
+
* @param {TurnResult} result
|
|
43
54
|
* @returns {Promise<Nanocodex>}
|
|
44
55
|
*/
|
|
45
|
-
forkFrom(
|
|
46
|
-
_assertClass(
|
|
47
|
-
const ret = wasm.nanocodex_forkFrom(this.__wbg_ptr,
|
|
56
|
+
forkFrom(result) {
|
|
57
|
+
_assertClass(result, TurnResult);
|
|
58
|
+
const ret = wasm.nanocodex_forkFrom(this.__wbg_ptr, result.__wbg_ptr);
|
|
48
59
|
return ret;
|
|
49
60
|
}
|
|
50
61
|
/**
|
|
51
|
-
*
|
|
62
|
+
* Builds an agent from its JavaScript JSON configuration.
|
|
52
63
|
*
|
|
53
64
|
* # Errors
|
|
54
65
|
*
|
|
55
|
-
* Throws when the JSON or
|
|
66
|
+
* Throws when the JSON or agent policy is invalid.
|
|
56
67
|
* @param {string} config_json
|
|
57
68
|
*/
|
|
58
69
|
constructor(config_json) {
|
|
@@ -67,11 +78,11 @@ class Nanocodex {
|
|
|
67
78
|
return this;
|
|
68
79
|
}
|
|
69
80
|
/**
|
|
70
|
-
*
|
|
81
|
+
* Accepts a text prompt and returns its independently awaitable turn.
|
|
71
82
|
*
|
|
72
83
|
* # Errors
|
|
73
84
|
*
|
|
74
|
-
* Throws when the prompt is empty
|
|
85
|
+
* Throws when the prompt is empty.
|
|
75
86
|
* @param {string} instruction
|
|
76
87
|
* @returns {Turn}
|
|
77
88
|
*/
|
|
@@ -85,12 +96,11 @@ class Nanocodex {
|
|
|
85
96
|
return Turn.__wrap(ret[0]);
|
|
86
97
|
}
|
|
87
98
|
/**
|
|
88
|
-
*
|
|
99
|
+
* Accepts browser-safe multimodal input encoded as JSON.
|
|
89
100
|
*
|
|
90
101
|
* # Errors
|
|
91
102
|
*
|
|
92
|
-
* Throws for malformed
|
|
93
|
-
* stopped driver.
|
|
103
|
+
* Throws for malformed, empty, or local-filesystem input.
|
|
94
104
|
* @param {string} content_json
|
|
95
105
|
* @returns {Turn}
|
|
96
106
|
*/
|
|
@@ -104,7 +114,7 @@ class Nanocodex {
|
|
|
104
114
|
return Turn.__wrap(ret[0]);
|
|
105
115
|
}
|
|
106
116
|
/**
|
|
107
|
-
*
|
|
117
|
+
* Returns the stable `UUIDv7` session identity.
|
|
108
118
|
* @returns {string}
|
|
109
119
|
*/
|
|
110
120
|
get sessionId() {
|
|
@@ -120,7 +130,47 @@ class Nanocodex {
|
|
|
120
130
|
}
|
|
121
131
|
}
|
|
122
132
|
/**
|
|
123
|
-
*
|
|
133
|
+
* Enables or disables priority processing for subsequently accepted turns.
|
|
134
|
+
*
|
|
135
|
+
* # Errors
|
|
136
|
+
*
|
|
137
|
+
* Rejects after the driver stops.
|
|
138
|
+
* @param {boolean} enabled
|
|
139
|
+
* @returns {Promise<void>}
|
|
140
|
+
*/
|
|
141
|
+
setFastMode(enabled) {
|
|
142
|
+
const ret = wasm.nanocodex_setFastMode(this.__wbg_ptr, enabled);
|
|
143
|
+
return ret;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Changes the reasoning effort for subsequently accepted turns.
|
|
147
|
+
*
|
|
148
|
+
* # Errors
|
|
149
|
+
*
|
|
150
|
+
* Rejects an invalid effort or a stopped driver.
|
|
151
|
+
* @param {string} thinking
|
|
152
|
+
* @returns {Promise<void>}
|
|
153
|
+
*/
|
|
154
|
+
setThinking(thinking) {
|
|
155
|
+
const ptr0 = passStringToWasm0(thinking, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
156
|
+
const len0 = WASM_VECTOR_LEN;
|
|
157
|
+
const ret = wasm.nanocodex_setThinking(this.__wbg_ptr, ptr0, len0);
|
|
158
|
+
return ret;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Gracefully stops the driver and joins every resource owned by this agent.
|
|
162
|
+
*
|
|
163
|
+
* # Errors
|
|
164
|
+
*
|
|
165
|
+
* Rejects when the driver had already stopped or cleanup fails.
|
|
166
|
+
* @returns {Promise<void>}
|
|
167
|
+
*/
|
|
168
|
+
shutdown() {
|
|
169
|
+
const ret = wasm.nanocodex_shutdown(this.__wbg_ptr);
|
|
170
|
+
return ret;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Starts a clean sibling with the same private agent policy.
|
|
124
174
|
*
|
|
125
175
|
* # Errors
|
|
126
176
|
*
|
|
@@ -136,7 +186,7 @@ if (Symbol.dispose) Nanocodex.prototype[Symbol.dispose] = Nanocodex.prototype.fr
|
|
|
136
186
|
exports.Nanocodex = Nanocodex;
|
|
137
187
|
|
|
138
188
|
/**
|
|
139
|
-
*
|
|
189
|
+
* JavaScript binding over one shared Rust turn.
|
|
140
190
|
*/
|
|
141
191
|
class Turn {
|
|
142
192
|
static __wrap(ptr) {
|
|
@@ -156,11 +206,11 @@ class Turn {
|
|
|
156
206
|
wasm.__wbg_turn_free(ptr, 0);
|
|
157
207
|
}
|
|
158
208
|
/**
|
|
159
|
-
*
|
|
209
|
+
* Cancels this exact active or queued turn.
|
|
160
210
|
*
|
|
161
211
|
* # Errors
|
|
162
212
|
*
|
|
163
|
-
* Rejects if the turn is already terminal or
|
|
213
|
+
* Rejects if the turn is already terminal or its driver stopped.
|
|
164
214
|
* @returns {Promise<void>}
|
|
165
215
|
*/
|
|
166
216
|
cancel() {
|
|
@@ -168,25 +218,23 @@ class Turn {
|
|
|
168
218
|
return ret;
|
|
169
219
|
}
|
|
170
220
|
/**
|
|
171
|
-
*
|
|
221
|
+
* Waits for the final assistant message.
|
|
172
222
|
*
|
|
173
223
|
* # Errors
|
|
174
224
|
*
|
|
175
|
-
* Rejects when the model run
|
|
176
|
-
*
|
|
177
|
-
* @returns {Promise<string>}
|
|
225
|
+
* Rejects when the model run or driver fails.
|
|
226
|
+
* @returns {Promise<TurnResult>}
|
|
178
227
|
*/
|
|
179
228
|
result() {
|
|
180
229
|
const ret = wasm.turn_result(this.__wbg_ptr);
|
|
181
230
|
return ret;
|
|
182
231
|
}
|
|
183
232
|
/**
|
|
184
|
-
*
|
|
233
|
+
* Injects text input at the active turn's next safe model boundary.
|
|
185
234
|
*
|
|
186
235
|
* # Errors
|
|
187
236
|
*
|
|
188
|
-
* Rejects
|
|
189
|
-
* or a stopped driver.
|
|
237
|
+
* Rejects if the turn is not active or its driver stopped.
|
|
190
238
|
* @param {string} instruction
|
|
191
239
|
* @returns {Promise<void>}
|
|
192
240
|
*/
|
|
@@ -197,13 +245,11 @@ class Turn {
|
|
|
197
245
|
return ret;
|
|
198
246
|
}
|
|
199
247
|
/**
|
|
200
|
-
*
|
|
201
|
-
* turn's next safe model boundary.
|
|
248
|
+
* Injects browser-safe multimodal input at the active turn's next boundary.
|
|
202
249
|
*
|
|
203
250
|
* # Errors
|
|
204
251
|
*
|
|
205
|
-
* Rejects
|
|
206
|
-
* queued or terminal turn, a full steer queue, or a stopped driver.
|
|
252
|
+
* Rejects malformed input or a turn that is no longer active.
|
|
207
253
|
* @param {string} content_json
|
|
208
254
|
* @returns {Promise<void>}
|
|
209
255
|
*/
|
|
@@ -216,6 +262,98 @@ class Turn {
|
|
|
216
262
|
}
|
|
217
263
|
if (Symbol.dispose) Turn.prototype[Symbol.dispose] = Turn.prototype.free;
|
|
218
264
|
exports.Turn = Turn;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* JavaScript binding over one completed Rust turn result.
|
|
268
|
+
*/
|
|
269
|
+
class TurnResult {
|
|
270
|
+
static __wrap(ptr) {
|
|
271
|
+
const obj = Object.create(TurnResult.prototype);
|
|
272
|
+
obj.__wbg_ptr = ptr;
|
|
273
|
+
TurnResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
274
|
+
return obj;
|
|
275
|
+
}
|
|
276
|
+
__destroy_into_raw() {
|
|
277
|
+
const ptr = this.__wbg_ptr;
|
|
278
|
+
this.__wbg_ptr = 0;
|
|
279
|
+
TurnResultFinalization.unregister(this);
|
|
280
|
+
return ptr;
|
|
281
|
+
}
|
|
282
|
+
free() {
|
|
283
|
+
const ptr = this.__destroy_into_raw();
|
|
284
|
+
wasm.__wbg_turnresult_free(ptr, 0);
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Returns the final assistant message.
|
|
288
|
+
* @returns {string}
|
|
289
|
+
*/
|
|
290
|
+
get finalMessage() {
|
|
291
|
+
let deferred1_0;
|
|
292
|
+
let deferred1_1;
|
|
293
|
+
try {
|
|
294
|
+
const ret = wasm.turnresult_finalMessage(this.__wbg_ptr);
|
|
295
|
+
deferred1_0 = ret[0];
|
|
296
|
+
deferred1_1 = ret[1];
|
|
297
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
298
|
+
} finally {
|
|
299
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Serializes this completed boundary's resumable session snapshot.
|
|
304
|
+
*
|
|
305
|
+
* # Errors
|
|
306
|
+
*
|
|
307
|
+
* Throws when serialization fails.
|
|
308
|
+
* @returns {string}
|
|
309
|
+
*/
|
|
310
|
+
snapshot() {
|
|
311
|
+
let deferred2_0;
|
|
312
|
+
let deferred2_1;
|
|
313
|
+
try {
|
|
314
|
+
const ret = wasm.turnresult_snapshot(this.__wbg_ptr);
|
|
315
|
+
var ptr1 = ret[0];
|
|
316
|
+
var len1 = ret[1];
|
|
317
|
+
if (ret[3]) {
|
|
318
|
+
ptr1 = 0; len1 = 0;
|
|
319
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
320
|
+
}
|
|
321
|
+
deferred2_0 = ptr1;
|
|
322
|
+
deferred2_1 = len1;
|
|
323
|
+
return getStringFromWasm0(ptr1, len1);
|
|
324
|
+
} finally {
|
|
325
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Serializes exact aggregate usage for this completed logical turn.
|
|
330
|
+
*
|
|
331
|
+
* # Errors
|
|
332
|
+
*
|
|
333
|
+
* Throws when serialization fails.
|
|
334
|
+
* @returns {string}
|
|
335
|
+
*/
|
|
336
|
+
usage() {
|
|
337
|
+
let deferred2_0;
|
|
338
|
+
let deferred2_1;
|
|
339
|
+
try {
|
|
340
|
+
const ret = wasm.turnresult_usage(this.__wbg_ptr);
|
|
341
|
+
var ptr1 = ret[0];
|
|
342
|
+
var len1 = ret[1];
|
|
343
|
+
if (ret[3]) {
|
|
344
|
+
ptr1 = 0; len1 = 0;
|
|
345
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
346
|
+
}
|
|
347
|
+
deferred2_0 = ptr1;
|
|
348
|
+
deferred2_1 = len1;
|
|
349
|
+
return getStringFromWasm0(ptr1, len1);
|
|
350
|
+
} finally {
|
|
351
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
if (Symbol.dispose) TurnResult.prototype[Symbol.dispose] = TurnResult.prototype.free;
|
|
356
|
+
exports.TurnResult = TurnResult;
|
|
219
357
|
function __wbg_get_imports() {
|
|
220
358
|
const import0 = {
|
|
221
359
|
__proto__: null,
|
|
@@ -252,30 +390,29 @@ function __wbg_get_imports() {
|
|
|
252
390
|
const ret = arg0.call(arg1, arg2);
|
|
253
391
|
return ret;
|
|
254
392
|
}, arguments); },
|
|
255
|
-
|
|
393
|
+
__wbg_close_84b985b15720666a: function(arg0) {
|
|
256
394
|
globalThis.nanocodexHost.close(arg0 >>> 0);
|
|
257
395
|
},
|
|
258
|
-
|
|
259
|
-
const ret = globalThis.nanocodexHost.connect(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5));
|
|
396
|
+
__wbg_connect_fdf81494b56b3a0a: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) {
|
|
397
|
+
const ret = globalThis.nanocodexHost.connect(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), arg4 === 0 ? undefined : getStringFromWasm0(arg4, arg5), arg6 !== 0, getStringFromWasm0(arg7, arg8), arg9 === 0 ? undefined : getStringFromWasm0(arg9, arg10));
|
|
260
398
|
return ret;
|
|
261
399
|
}, arguments); },
|
|
262
|
-
|
|
400
|
+
__wbg_emitEvent_52491cc5b9c996ad: function(arg0, arg1) {
|
|
263
401
|
globalThis.nanocodexHost.emitEvent(getStringFromWasm0(arg0, arg1));
|
|
264
402
|
},
|
|
265
|
-
|
|
403
|
+
__wbg_executeCode_616baf56d3c8480c: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
266
404
|
const ret = globalThis.nanocodexHost.executeCode(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5));
|
|
267
405
|
return ret;
|
|
268
406
|
}, arguments); },
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
const ret = arg0.getFullYear();
|
|
407
|
+
__wbg_getRandomValues_ceb34d8ffce7e87f: function() { return handleError(function (arg0, arg1) {
|
|
408
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
409
|
+
}, arguments); },
|
|
410
|
+
__wbg_getTime_d6f070c088c9b5ed: function(arg0) {
|
|
411
|
+
const ret = arg0.getTime();
|
|
275
412
|
return ret;
|
|
276
413
|
},
|
|
277
|
-
|
|
278
|
-
const ret = arg0.
|
|
414
|
+
__wbg_getTimezoneOffset_dc9862c79e5a81a3: function(arg0) {
|
|
415
|
+
const ret = arg0.getTimezoneOffset();
|
|
279
416
|
return ret;
|
|
280
417
|
},
|
|
281
418
|
__wbg_get_78f252d074a84d0b: function() { return handleError(function (arg0, arg1) {
|
|
@@ -302,6 +439,10 @@ function __wbg_get_imports() {
|
|
|
302
439
|
const ret = new Intl.DateTimeFormat(arg0, arg1);
|
|
303
440
|
return ret;
|
|
304
441
|
},
|
|
442
|
+
__wbg_new_cc984128914cfc6f: function(arg0) {
|
|
443
|
+
const ret = new Date(arg0);
|
|
444
|
+
return ret;
|
|
445
|
+
},
|
|
305
446
|
__wbg_new_da52cf8fe3429cb2: function() {
|
|
306
447
|
const ret = new Object();
|
|
307
448
|
return ret;
|
|
@@ -313,7 +454,7 @@ function __wbg_get_imports() {
|
|
|
313
454
|
const a = state0.a;
|
|
314
455
|
state0.a = 0;
|
|
315
456
|
try {
|
|
316
|
-
return
|
|
457
|
+
return wasm_bindgen_6c97e59ea7837008___convert__closures_____invoke___js_sys_d57619d9eac2c6da___Function_fn_wasm_bindgen_6c97e59ea7837008___JsValue_____wasm_bindgen_6c97e59ea7837008___sys__Undefined___js_sys_d57619d9eac2c6da___Function_fn_wasm_bindgen_6c97e59ea7837008___JsValue_____wasm_bindgen_6c97e59ea7837008___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
317
458
|
} finally {
|
|
318
459
|
state0.a = a;
|
|
319
460
|
}
|
|
@@ -324,18 +465,18 @@ function __wbg_get_imports() {
|
|
|
324
465
|
state0.a = 0;
|
|
325
466
|
}
|
|
326
467
|
},
|
|
327
|
-
|
|
468
|
+
__wbg_next_4acad3c8f1e88dfb: function() { return handleError(function (arg0, arg1) {
|
|
328
469
|
const ret = globalThis.nanocodexHost.next(arg0 >>> 0, arg1 >>> 0);
|
|
329
470
|
return ret;
|
|
330
471
|
}, arguments); },
|
|
331
|
-
__wbg_now_86c0d4ba3fa605b8: function() {
|
|
332
|
-
const ret = Date.now();
|
|
333
|
-
return ret;
|
|
334
|
-
},
|
|
335
472
|
__wbg_now_e7c6795a7f81e10f: function(arg0) {
|
|
336
473
|
const ret = arg0.now();
|
|
337
474
|
return ret;
|
|
338
475
|
},
|
|
476
|
+
__wbg_now_f663ab0a5177b799: function() { return handleError(function () {
|
|
477
|
+
const ret = Date.now();
|
|
478
|
+
return ret;
|
|
479
|
+
}, arguments); },
|
|
339
480
|
__wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
|
|
340
481
|
const ret = arg0.performance;
|
|
341
482
|
return ret;
|
|
@@ -355,14 +496,14 @@ function __wbg_get_imports() {
|
|
|
355
496
|
const ret = arg0.resolvedOptions();
|
|
356
497
|
return ret;
|
|
357
498
|
},
|
|
358
|
-
|
|
499
|
+
__wbg_send_bdd41ab8e18f6042: function() { return handleError(function (arg0, arg1, arg2) {
|
|
359
500
|
const ret = globalThis.nanocodexHost.send(arg0 >>> 0, getStringFromWasm0(arg1, arg2));
|
|
360
501
|
return ret;
|
|
361
502
|
}, arguments); },
|
|
362
|
-
|
|
363
|
-
const ret = globalThis.nanocodexHost.sleep(arg0 >>> 0);
|
|
503
|
+
__wbg_sleep_c32f4fdaac627991: function() { return handleError(function (arg0, arg1, arg2) {
|
|
504
|
+
const ret = globalThis.nanocodexHost.sleep(getStringFromWasm0(arg0, arg1), arg2 >>> 0);
|
|
364
505
|
return ret;
|
|
365
|
-
},
|
|
506
|
+
}, arguments); },
|
|
366
507
|
__wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
|
|
367
508
|
const ret = typeof global === 'undefined' ? null : global;
|
|
368
509
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
@@ -387,19 +528,28 @@ function __wbg_get_imports() {
|
|
|
387
528
|
const ret = arg0.then(arg1);
|
|
388
529
|
return ret;
|
|
389
530
|
},
|
|
390
|
-
|
|
531
|
+
__wbg_toolDefinitions_4f496f9fbb096753: function() { return handleError(function (arg0, arg1, arg2) {
|
|
391
532
|
const ret = globalThis.nanocodexHost.toolDefinitions(getStringFromWasm0(arg1, arg2));
|
|
392
533
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
393
534
|
const len1 = WASM_VECTOR_LEN;
|
|
394
535
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
395
536
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
537
|
+
}, arguments); },
|
|
538
|
+
__wbg_turnresult_new: function(arg0) {
|
|
539
|
+
const ret = TurnResult.__wrap(arg0);
|
|
540
|
+
return ret;
|
|
396
541
|
},
|
|
397
542
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
398
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
399
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
543
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 446, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
544
|
+
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6c97e59ea7837008___convert__closures_____invoke___wasm_bindgen_6c97e59ea7837008___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_6c97e59ea7837008___JsError___true_);
|
|
545
|
+
return ret;
|
|
546
|
+
},
|
|
547
|
+
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
548
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
549
|
+
const ret = arg0;
|
|
400
550
|
return ret;
|
|
401
551
|
},
|
|
402
|
-
|
|
552
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
403
553
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
404
554
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
405
555
|
return ret;
|
|
@@ -420,15 +570,15 @@ function __wbg_get_imports() {
|
|
|
420
570
|
};
|
|
421
571
|
}
|
|
422
572
|
|
|
423
|
-
function
|
|
424
|
-
const ret = wasm.
|
|
573
|
+
function wasm_bindgen_6c97e59ea7837008___convert__closures_____invoke___wasm_bindgen_6c97e59ea7837008___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_6c97e59ea7837008___JsError___true_(arg0, arg1, arg2) {
|
|
574
|
+
const ret = wasm.wasm_bindgen_6c97e59ea7837008___convert__closures_____invoke___wasm_bindgen_6c97e59ea7837008___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_6c97e59ea7837008___JsError___true_(arg0, arg1, arg2);
|
|
425
575
|
if (ret[1]) {
|
|
426
576
|
throw takeFromExternrefTable0(ret[0]);
|
|
427
577
|
}
|
|
428
578
|
}
|
|
429
579
|
|
|
430
|
-
function
|
|
431
|
-
wasm.
|
|
580
|
+
function wasm_bindgen_6c97e59ea7837008___convert__closures_____invoke___js_sys_d57619d9eac2c6da___Function_fn_wasm_bindgen_6c97e59ea7837008___JsValue_____wasm_bindgen_6c97e59ea7837008___sys__Undefined___js_sys_d57619d9eac2c6da___Function_fn_wasm_bindgen_6c97e59ea7837008___JsValue_____wasm_bindgen_6c97e59ea7837008___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
|
|
581
|
+
wasm.wasm_bindgen_6c97e59ea7837008___convert__closures_____invoke___js_sys_d57619d9eac2c6da___Function_fn_wasm_bindgen_6c97e59ea7837008___JsValue_____wasm_bindgen_6c97e59ea7837008___sys__Undefined___js_sys_d57619d9eac2c6da___Function_fn_wasm_bindgen_6c97e59ea7837008___JsValue_____wasm_bindgen_6c97e59ea7837008___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
|
|
432
582
|
}
|
|
433
583
|
|
|
434
584
|
const NanocodexFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -437,6 +587,9 @@ const NanocodexFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
437
587
|
const TurnFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
438
588
|
? { register: () => {}, unregister: () => {} }
|
|
439
589
|
: new FinalizationRegistry(ptr => wasm.__wbg_turn_free(ptr, 1));
|
|
590
|
+
const TurnResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
591
|
+
? { register: () => {}, unregister: () => {} }
|
|
592
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_turnresult_free(ptr, 1));
|
|
440
593
|
|
|
441
594
|
function addToExternrefTable0(obj) {
|
|
442
595
|
const idx = wasm.__externref_table_alloc();
|
|
@@ -519,6 +672,11 @@ function debugString(val) {
|
|
|
519
672
|
return className;
|
|
520
673
|
}
|
|
521
674
|
|
|
675
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
676
|
+
ptr = ptr >>> 0;
|
|
677
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
678
|
+
}
|
|
679
|
+
|
|
522
680
|
let cachedDataViewMemory0 = null;
|
|
523
681
|
function getDataViewMemory0() {
|
|
524
682
|
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
Binary file
|
|
@@ -3,19 +3,27 @@
|
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_nanocodex_free: (a: number, b: number) => void;
|
|
5
5
|
export const __wbg_turn_free: (a: number, b: number) => void;
|
|
6
|
+
export const __wbg_turnresult_free: (a: number, b: number) => void;
|
|
7
|
+
export const nanocodex_compact: (a: number) => any;
|
|
6
8
|
export const nanocodex_fork: (a: number) => any;
|
|
7
9
|
export const nanocodex_forkFrom: (a: number, b: number) => any;
|
|
8
10
|
export const nanocodex_new: (a: number, b: number) => [number, number, number];
|
|
9
11
|
export const nanocodex_prompt: (a: number, b: number, c: number) => [number, number, number];
|
|
10
12
|
export const nanocodex_promptContent: (a: number, b: number, c: number) => [number, number, number];
|
|
11
13
|
export const nanocodex_sessionId: (a: number) => [number, number];
|
|
14
|
+
export const nanocodex_setFastMode: (a: number, b: number) => any;
|
|
15
|
+
export const nanocodex_setThinking: (a: number, b: number, c: number) => any;
|
|
16
|
+
export const nanocodex_shutdown: (a: number) => any;
|
|
12
17
|
export const nanocodex_spawn: (a: number) => any;
|
|
13
18
|
export const turn_cancel: (a: number) => any;
|
|
14
19
|
export const turn_result: (a: number) => any;
|
|
15
20
|
export const turn_steer: (a: number, b: number, c: number) => any;
|
|
16
21
|
export const turn_steerContent: (a: number, b: number, c: number) => any;
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
22
|
+
export const turnresult_finalMessage: (a: number) => [number, number];
|
|
23
|
+
export const turnresult_snapshot: (a: number) => [number, number, number, number];
|
|
24
|
+
export const turnresult_usage: (a: number) => [number, number, number, number];
|
|
25
|
+
export const wasm_bindgen_6c97e59ea7837008___convert__closures_____invoke___wasm_bindgen_6c97e59ea7837008___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_6c97e59ea7837008___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
26
|
+
export const wasm_bindgen_6c97e59ea7837008___convert__closures_____invoke___js_sys_d57619d9eac2c6da___Function_fn_wasm_bindgen_6c97e59ea7837008___JsValue_____wasm_bindgen_6c97e59ea7837008___sys__Undefined___js_sys_d57619d9eac2c6da___Function_fn_wasm_bindgen_6c97e59ea7837008___JsValue_____wasm_bindgen_6c97e59ea7837008___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
19
27
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
20
28
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
21
29
|
export const __wbindgen_exn_store: (a: number) => void;
|