nanocodex 0.2.0 → 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 +72 -13
- package/actions/events.mjs +105 -22
- package/actions/index.mjs +2 -0
- package/actions/session.d.mts +7 -1
- package/actions/session.mjs +10 -0
- package/actions/turn.d.mts +18 -5
- package/actions/turn.mjs +7 -2
- package/browser/Agent.d.mts +0 -3
- package/browser/Agent.mjs +12 -2
- package/browser/host.mjs +11 -7
- package/browser/index.d.mts +4 -0
- package/index.d.mts +4 -0
- package/internal.mjs +225 -24
- package/node/Agent.d.mts +0 -5
- package/node/Agent.mjs +9 -2
- package/node/host.mjs +33 -12
- package/node/index.d.mts +4 -0
- package/package.json +3 -3
- package/pkg-node/nanocodex.d.ts +69 -38
- package/pkg-node/nanocodex.js +193 -89
- package/pkg-node/nanocodex_bg.wasm +0 -0
- package/pkg-node/nanocodex_bg.wasm.d.ts +7 -2
- package/pkg-web/nanocodex.d.ts +76 -40
- package/pkg-web/nanocodex.js +191 -88
- package/pkg-web/nanocodex_bg.wasm +0 -0
- package/pkg-web/nanocodex_bg.wasm.d.ts +7 -2
- package/runtime/code-runtime.mjs +29 -12
- package/types.d.mts +38 -3
- 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,11 +130,11 @@ class Nanocodex {
|
|
|
120
130
|
}
|
|
121
131
|
}
|
|
122
132
|
/**
|
|
123
|
-
*
|
|
133
|
+
* Enables or disables priority processing for subsequently accepted turns.
|
|
124
134
|
*
|
|
125
135
|
* # Errors
|
|
126
136
|
*
|
|
127
|
-
* Rejects after the
|
|
137
|
+
* Rejects after the driver stops.
|
|
128
138
|
* @param {boolean} enabled
|
|
129
139
|
* @returns {Promise<void>}
|
|
130
140
|
*/
|
|
@@ -133,11 +143,11 @@ class Nanocodex {
|
|
|
133
143
|
return ret;
|
|
134
144
|
}
|
|
135
145
|
/**
|
|
136
|
-
*
|
|
146
|
+
* Changes the reasoning effort for subsequently accepted turns.
|
|
137
147
|
*
|
|
138
148
|
* # Errors
|
|
139
149
|
*
|
|
140
|
-
* Rejects an
|
|
150
|
+
* Rejects an invalid effort or a stopped driver.
|
|
141
151
|
* @param {string} thinking
|
|
142
152
|
* @returns {Promise<void>}
|
|
143
153
|
*/
|
|
@@ -148,7 +158,19 @@ class Nanocodex {
|
|
|
148
158
|
return ret;
|
|
149
159
|
}
|
|
150
160
|
/**
|
|
151
|
-
*
|
|
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.
|
|
152
174
|
*
|
|
153
175
|
* # Errors
|
|
154
176
|
*
|
|
@@ -164,7 +186,7 @@ if (Symbol.dispose) Nanocodex.prototype[Symbol.dispose] = Nanocodex.prototype.fr
|
|
|
164
186
|
exports.Nanocodex = Nanocodex;
|
|
165
187
|
|
|
166
188
|
/**
|
|
167
|
-
*
|
|
189
|
+
* JavaScript binding over one shared Rust turn.
|
|
168
190
|
*/
|
|
169
191
|
class Turn {
|
|
170
192
|
static __wrap(ptr) {
|
|
@@ -184,11 +206,11 @@ class Turn {
|
|
|
184
206
|
wasm.__wbg_turn_free(ptr, 0);
|
|
185
207
|
}
|
|
186
208
|
/**
|
|
187
|
-
*
|
|
209
|
+
* Cancels this exact active or queued turn.
|
|
188
210
|
*
|
|
189
211
|
* # Errors
|
|
190
212
|
*
|
|
191
|
-
* Rejects if the turn is already terminal or
|
|
213
|
+
* Rejects if the turn is already terminal or its driver stopped.
|
|
192
214
|
* @returns {Promise<void>}
|
|
193
215
|
*/
|
|
194
216
|
cancel() {
|
|
@@ -196,31 +218,100 @@ class Turn {
|
|
|
196
218
|
return ret;
|
|
197
219
|
}
|
|
198
220
|
/**
|
|
199
|
-
*
|
|
221
|
+
* Waits for the final assistant message.
|
|
200
222
|
*
|
|
201
223
|
* # Errors
|
|
202
224
|
*
|
|
203
|
-
* Rejects when the model run
|
|
204
|
-
*
|
|
205
|
-
* @returns {Promise<string>}
|
|
225
|
+
* Rejects when the model run or driver fails.
|
|
226
|
+
* @returns {Promise<TurnResult>}
|
|
206
227
|
*/
|
|
207
228
|
result() {
|
|
208
229
|
const ret = wasm.turn_result(this.__wbg_ptr);
|
|
209
230
|
return ret;
|
|
210
231
|
}
|
|
211
232
|
/**
|
|
212
|
-
*
|
|
233
|
+
* Injects text input at the active turn's next safe model boundary.
|
|
234
|
+
*
|
|
235
|
+
* # Errors
|
|
236
|
+
*
|
|
237
|
+
* Rejects if the turn is not active or its driver stopped.
|
|
238
|
+
* @param {string} instruction
|
|
239
|
+
* @returns {Promise<void>}
|
|
240
|
+
*/
|
|
241
|
+
steer(instruction) {
|
|
242
|
+
const ptr0 = passStringToWasm0(instruction, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
243
|
+
const len0 = WASM_VECTOR_LEN;
|
|
244
|
+
const ret = wasm.turn_steer(this.__wbg_ptr, ptr0, len0);
|
|
245
|
+
return ret;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Injects browser-safe multimodal input at the active turn's next boundary.
|
|
249
|
+
*
|
|
250
|
+
* # Errors
|
|
251
|
+
*
|
|
252
|
+
* Rejects malformed input or a turn that is no longer active.
|
|
253
|
+
* @param {string} content_json
|
|
254
|
+
* @returns {Promise<void>}
|
|
255
|
+
*/
|
|
256
|
+
steerContent(content_json) {
|
|
257
|
+
const ptr0 = passStringToWasm0(content_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
258
|
+
const len0 = WASM_VECTOR_LEN;
|
|
259
|
+
const ret = wasm.turn_steerContent(this.__wbg_ptr, ptr0, len0);
|
|
260
|
+
return ret;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
if (Symbol.dispose) Turn.prototype[Symbol.dispose] = Turn.prototype.free;
|
|
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.
|
|
213
304
|
*
|
|
214
305
|
* # Errors
|
|
215
306
|
*
|
|
216
|
-
* Throws
|
|
307
|
+
* Throws when serialization fails.
|
|
217
308
|
* @returns {string}
|
|
218
309
|
*/
|
|
219
310
|
snapshot() {
|
|
220
311
|
let deferred2_0;
|
|
221
312
|
let deferred2_1;
|
|
222
313
|
try {
|
|
223
|
-
const ret = wasm.
|
|
314
|
+
const ret = wasm.turnresult_snapshot(this.__wbg_ptr);
|
|
224
315
|
var ptr1 = ret[0];
|
|
225
316
|
var len1 = ret[1];
|
|
226
317
|
if (ret[3]) {
|
|
@@ -235,41 +326,34 @@ class Turn {
|
|
|
235
326
|
}
|
|
236
327
|
}
|
|
237
328
|
/**
|
|
238
|
-
*
|
|
329
|
+
* Serializes exact aggregate usage for this completed logical turn.
|
|
239
330
|
*
|
|
240
331
|
* # Errors
|
|
241
332
|
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
* @param {string} instruction
|
|
245
|
-
* @returns {Promise<void>}
|
|
246
|
-
*/
|
|
247
|
-
steer(instruction) {
|
|
248
|
-
const ptr0 = passStringToWasm0(instruction, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
249
|
-
const len0 = WASM_VECTOR_LEN;
|
|
250
|
-
const ret = wasm.turn_steer(this.__wbg_ptr, ptr0, len0);
|
|
251
|
-
return ret;
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Inject ordered browser-safe text, image, or audio input at this active
|
|
255
|
-
* turn's next safe model boundary.
|
|
256
|
-
*
|
|
257
|
-
* # Errors
|
|
258
|
-
*
|
|
259
|
-
* Rejects for malformed or empty content, local filesystem inputs, a
|
|
260
|
-
* queued or terminal turn, a full steer queue, or a stopped driver.
|
|
261
|
-
* @param {string} content_json
|
|
262
|
-
* @returns {Promise<void>}
|
|
333
|
+
* Throws when serialization fails.
|
|
334
|
+
* @returns {string}
|
|
263
335
|
*/
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
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
|
+
}
|
|
269
353
|
}
|
|
270
354
|
}
|
|
271
|
-
if (Symbol.dispose)
|
|
272
|
-
exports.
|
|
355
|
+
if (Symbol.dispose) TurnResult.prototype[Symbol.dispose] = TurnResult.prototype.free;
|
|
356
|
+
exports.TurnResult = TurnResult;
|
|
273
357
|
function __wbg_get_imports() {
|
|
274
358
|
const import0 = {
|
|
275
359
|
__proto__: null,
|
|
@@ -306,30 +390,29 @@ function __wbg_get_imports() {
|
|
|
306
390
|
const ret = arg0.call(arg1, arg2);
|
|
307
391
|
return ret;
|
|
308
392
|
}, arguments); },
|
|
309
|
-
|
|
393
|
+
__wbg_close_84b985b15720666a: function(arg0) {
|
|
310
394
|
globalThis.nanocodexHost.close(arg0 >>> 0);
|
|
311
395
|
},
|
|
312
|
-
|
|
313
|
-
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));
|
|
314
398
|
return ret;
|
|
315
399
|
}, arguments); },
|
|
316
|
-
|
|
400
|
+
__wbg_emitEvent_52491cc5b9c996ad: function(arg0, arg1) {
|
|
317
401
|
globalThis.nanocodexHost.emitEvent(getStringFromWasm0(arg0, arg1));
|
|
318
402
|
},
|
|
319
|
-
|
|
403
|
+
__wbg_executeCode_616baf56d3c8480c: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
320
404
|
const ret = globalThis.nanocodexHost.executeCode(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5));
|
|
321
405
|
return ret;
|
|
322
406
|
}, arguments); },
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
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();
|
|
329
412
|
return ret;
|
|
330
413
|
},
|
|
331
|
-
|
|
332
|
-
const ret = arg0.
|
|
414
|
+
__wbg_getTimezoneOffset_dc9862c79e5a81a3: function(arg0) {
|
|
415
|
+
const ret = arg0.getTimezoneOffset();
|
|
333
416
|
return ret;
|
|
334
417
|
},
|
|
335
418
|
__wbg_get_78f252d074a84d0b: function() { return handleError(function (arg0, arg1) {
|
|
@@ -356,6 +439,10 @@ function __wbg_get_imports() {
|
|
|
356
439
|
const ret = new Intl.DateTimeFormat(arg0, arg1);
|
|
357
440
|
return ret;
|
|
358
441
|
},
|
|
442
|
+
__wbg_new_cc984128914cfc6f: function(arg0) {
|
|
443
|
+
const ret = new Date(arg0);
|
|
444
|
+
return ret;
|
|
445
|
+
},
|
|
359
446
|
__wbg_new_da52cf8fe3429cb2: function() {
|
|
360
447
|
const ret = new Object();
|
|
361
448
|
return ret;
|
|
@@ -367,7 +454,7 @@ function __wbg_get_imports() {
|
|
|
367
454
|
const a = state0.a;
|
|
368
455
|
state0.a = 0;
|
|
369
456
|
try {
|
|
370
|
-
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);
|
|
371
458
|
} finally {
|
|
372
459
|
state0.a = a;
|
|
373
460
|
}
|
|
@@ -378,18 +465,18 @@ function __wbg_get_imports() {
|
|
|
378
465
|
state0.a = 0;
|
|
379
466
|
}
|
|
380
467
|
},
|
|
381
|
-
|
|
468
|
+
__wbg_next_4acad3c8f1e88dfb: function() { return handleError(function (arg0, arg1) {
|
|
382
469
|
const ret = globalThis.nanocodexHost.next(arg0 >>> 0, arg1 >>> 0);
|
|
383
470
|
return ret;
|
|
384
471
|
}, arguments); },
|
|
385
|
-
__wbg_now_86c0d4ba3fa605b8: function() {
|
|
386
|
-
const ret = Date.now();
|
|
387
|
-
return ret;
|
|
388
|
-
},
|
|
389
472
|
__wbg_now_e7c6795a7f81e10f: function(arg0) {
|
|
390
473
|
const ret = arg0.now();
|
|
391
474
|
return ret;
|
|
392
475
|
},
|
|
476
|
+
__wbg_now_f663ab0a5177b799: function() { return handleError(function () {
|
|
477
|
+
const ret = Date.now();
|
|
478
|
+
return ret;
|
|
479
|
+
}, arguments); },
|
|
393
480
|
__wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
|
|
394
481
|
const ret = arg0.performance;
|
|
395
482
|
return ret;
|
|
@@ -409,14 +496,14 @@ function __wbg_get_imports() {
|
|
|
409
496
|
const ret = arg0.resolvedOptions();
|
|
410
497
|
return ret;
|
|
411
498
|
},
|
|
412
|
-
|
|
499
|
+
__wbg_send_bdd41ab8e18f6042: function() { return handleError(function (arg0, arg1, arg2) {
|
|
413
500
|
const ret = globalThis.nanocodexHost.send(arg0 >>> 0, getStringFromWasm0(arg1, arg2));
|
|
414
501
|
return ret;
|
|
415
502
|
}, arguments); },
|
|
416
|
-
|
|
417
|
-
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);
|
|
418
505
|
return ret;
|
|
419
|
-
},
|
|
506
|
+
}, arguments); },
|
|
420
507
|
__wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
|
|
421
508
|
const ret = typeof global === 'undefined' ? null : global;
|
|
422
509
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
@@ -441,19 +528,28 @@ function __wbg_get_imports() {
|
|
|
441
528
|
const ret = arg0.then(arg1);
|
|
442
529
|
return ret;
|
|
443
530
|
},
|
|
444
|
-
|
|
531
|
+
__wbg_toolDefinitions_4f496f9fbb096753: function() { return handleError(function (arg0, arg1, arg2) {
|
|
445
532
|
const ret = globalThis.nanocodexHost.toolDefinitions(getStringFromWasm0(arg1, arg2));
|
|
446
533
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
447
534
|
const len1 = WASM_VECTOR_LEN;
|
|
448
535
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
449
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;
|
|
450
541
|
},
|
|
451
542
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
452
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
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`.
|
|
453
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_);
|
|
454
545
|
return ret;
|
|
455
546
|
},
|
|
456
|
-
__wbindgen_cast_0000000000000002: function(arg0
|
|
547
|
+
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
548
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
549
|
+
const ret = arg0;
|
|
550
|
+
return ret;
|
|
551
|
+
},
|
|
552
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
457
553
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
458
554
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
459
555
|
return ret;
|
|
@@ -481,8 +577,8 @@ function wasm_bindgen_6c97e59ea7837008___convert__closures_____invoke___wasm_bin
|
|
|
481
577
|
}
|
|
482
578
|
}
|
|
483
579
|
|
|
484
|
-
function
|
|
485
|
-
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);
|
|
486
582
|
}
|
|
487
583
|
|
|
488
584
|
const NanocodexFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -491,6 +587,9 @@ const NanocodexFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
491
587
|
const TurnFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
492
588
|
? { register: () => {}, unregister: () => {} }
|
|
493
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));
|
|
494
593
|
|
|
495
594
|
function addToExternrefTable0(obj) {
|
|
496
595
|
const idx = wasm.__externref_table_alloc();
|
|
@@ -573,6 +672,11 @@ function debugString(val) {
|
|
|
573
672
|
return className;
|
|
574
673
|
}
|
|
575
674
|
|
|
675
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
676
|
+
ptr = ptr >>> 0;
|
|
677
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
678
|
+
}
|
|
679
|
+
|
|
576
680
|
let cachedDataViewMemory0 = null;
|
|
577
681
|
function getDataViewMemory0() {
|
|
578
682
|
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
Binary file
|
|
@@ -3,6 +3,8 @@
|
|
|
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];
|
|
@@ -11,14 +13,17 @@ export const nanocodex_promptContent: (a: number, b: number, c: number) => [numb
|
|
|
11
13
|
export const nanocodex_sessionId: (a: number) => [number, number];
|
|
12
14
|
export const nanocodex_setFastMode: (a: number, b: number) => any;
|
|
13
15
|
export const nanocodex_setThinking: (a: number, b: number, c: number) => any;
|
|
16
|
+
export const nanocodex_shutdown: (a: number) => any;
|
|
14
17
|
export const nanocodex_spawn: (a: number) => any;
|
|
15
18
|
export const turn_cancel: (a: number) => any;
|
|
16
19
|
export const turn_result: (a: number) => any;
|
|
17
|
-
export const turn_snapshot: (a: number) => [number, number, number, number];
|
|
18
20
|
export const turn_steer: (a: number, b: number, c: number) => any;
|
|
19
21
|
export const turn_steerContent: (a: number, b: number, c: number) => any;
|
|
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];
|
|
20
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];
|
|
21
|
-
export const
|
|
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;
|
|
22
27
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
23
28
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
24
29
|
export const __wbindgen_exn_store: (a: number) => void;
|