nanocodex 0.2.0 → 0.4.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 +111 -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 +14 -6
- package/browser/Agent.mjs +21 -2
- package/browser/host.d.mts +33 -1
- package/browser/host.mjs +53 -11
- package/browser/index.d.mts +4 -0
- package/index.d.mts +4 -0
- package/internal.mjs +233 -24
- package/node/Agent.d.mts +1 -5
- package/node/Agent.mjs +13 -2
- package/node/host.mjs +39 -12
- package/node/index.d.mts +4 -0
- package/package.json +8 -3
- package/pkg-node/nanocodex.d.ts +69 -38
- package/pkg-node/nanocodex.js +203 -88
- 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 +201 -87
- package/pkg-web/nanocodex_bg.wasm +0 -0
- package/pkg-web/nanocodex_bg.wasm.d.ts +7 -2
- package/runtime/code-runtime.mjs +58 -12
- package/types.d.mts +40 -3
- package/wasm.d.mts +4 -0
- package/scripts/check-package.mjs +0 -38
package/pkg-web/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
|
export class Nanocodex {
|
|
7
7
|
static __wrap(ptr) {
|
|
@@ -21,7 +21,19 @@ export 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 @@ export 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 @@ export 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 @@ export 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 @@ export 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 @@ export 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 @@ export 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 @@ export 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
|
*
|
|
@@ -163,7 +185,7 @@ export class Nanocodex {
|
|
|
163
185
|
if (Symbol.dispose) Nanocodex.prototype[Symbol.dispose] = Nanocodex.prototype.free;
|
|
164
186
|
|
|
165
187
|
/**
|
|
166
|
-
*
|
|
188
|
+
* JavaScript binding over one shared Rust turn.
|
|
167
189
|
*/
|
|
168
190
|
export class Turn {
|
|
169
191
|
static __wrap(ptr) {
|
|
@@ -183,11 +205,11 @@ export class Turn {
|
|
|
183
205
|
wasm.__wbg_turn_free(ptr, 0);
|
|
184
206
|
}
|
|
185
207
|
/**
|
|
186
|
-
*
|
|
208
|
+
* Cancels this exact active or queued turn.
|
|
187
209
|
*
|
|
188
210
|
* # Errors
|
|
189
211
|
*
|
|
190
|
-
* Rejects if the turn is already terminal or
|
|
212
|
+
* Rejects if the turn is already terminal or its driver stopped.
|
|
191
213
|
* @returns {Promise<void>}
|
|
192
214
|
*/
|
|
193
215
|
cancel() {
|
|
@@ -195,31 +217,99 @@ export class Turn {
|
|
|
195
217
|
return ret;
|
|
196
218
|
}
|
|
197
219
|
/**
|
|
198
|
-
*
|
|
220
|
+
* Waits for the final assistant message.
|
|
199
221
|
*
|
|
200
222
|
* # Errors
|
|
201
223
|
*
|
|
202
|
-
* Rejects when the model run
|
|
203
|
-
*
|
|
204
|
-
* @returns {Promise<string>}
|
|
224
|
+
* Rejects when the model run or driver fails.
|
|
225
|
+
* @returns {Promise<TurnResult>}
|
|
205
226
|
*/
|
|
206
227
|
result() {
|
|
207
228
|
const ret = wasm.turn_result(this.__wbg_ptr);
|
|
208
229
|
return ret;
|
|
209
230
|
}
|
|
210
231
|
/**
|
|
211
|
-
*
|
|
232
|
+
* Injects text input at the active turn's next safe model boundary.
|
|
212
233
|
*
|
|
213
234
|
* # Errors
|
|
214
235
|
*
|
|
215
|
-
*
|
|
236
|
+
* Rejects if the turn is not active or its driver stopped.
|
|
237
|
+
* @param {string} instruction
|
|
238
|
+
* @returns {Promise<void>}
|
|
239
|
+
*/
|
|
240
|
+
steer(instruction) {
|
|
241
|
+
const ptr0 = passStringToWasm0(instruction, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
242
|
+
const len0 = WASM_VECTOR_LEN;
|
|
243
|
+
const ret = wasm.turn_steer(this.__wbg_ptr, ptr0, len0);
|
|
244
|
+
return ret;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Injects browser-safe multimodal input at the active turn's next boundary.
|
|
248
|
+
*
|
|
249
|
+
* # Errors
|
|
250
|
+
*
|
|
251
|
+
* Rejects malformed input or a turn that is no longer active.
|
|
252
|
+
* @param {string} content_json
|
|
253
|
+
* @returns {Promise<void>}
|
|
254
|
+
*/
|
|
255
|
+
steerContent(content_json) {
|
|
256
|
+
const ptr0 = passStringToWasm0(content_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
257
|
+
const len0 = WASM_VECTOR_LEN;
|
|
258
|
+
const ret = wasm.turn_steerContent(this.__wbg_ptr, ptr0, len0);
|
|
259
|
+
return ret;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
if (Symbol.dispose) Turn.prototype[Symbol.dispose] = Turn.prototype.free;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* JavaScript binding over one completed Rust turn result.
|
|
266
|
+
*/
|
|
267
|
+
export class TurnResult {
|
|
268
|
+
static __wrap(ptr) {
|
|
269
|
+
const obj = Object.create(TurnResult.prototype);
|
|
270
|
+
obj.__wbg_ptr = ptr;
|
|
271
|
+
TurnResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
272
|
+
return obj;
|
|
273
|
+
}
|
|
274
|
+
__destroy_into_raw() {
|
|
275
|
+
const ptr = this.__wbg_ptr;
|
|
276
|
+
this.__wbg_ptr = 0;
|
|
277
|
+
TurnResultFinalization.unregister(this);
|
|
278
|
+
return ptr;
|
|
279
|
+
}
|
|
280
|
+
free() {
|
|
281
|
+
const ptr = this.__destroy_into_raw();
|
|
282
|
+
wasm.__wbg_turnresult_free(ptr, 0);
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Returns the final assistant message.
|
|
286
|
+
* @returns {string}
|
|
287
|
+
*/
|
|
288
|
+
get finalMessage() {
|
|
289
|
+
let deferred1_0;
|
|
290
|
+
let deferred1_1;
|
|
291
|
+
try {
|
|
292
|
+
const ret = wasm.turnresult_finalMessage(this.__wbg_ptr);
|
|
293
|
+
deferred1_0 = ret[0];
|
|
294
|
+
deferred1_1 = ret[1];
|
|
295
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
296
|
+
} finally {
|
|
297
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Serializes this completed boundary's resumable session snapshot.
|
|
302
|
+
*
|
|
303
|
+
* # Errors
|
|
304
|
+
*
|
|
305
|
+
* Throws when serialization fails.
|
|
216
306
|
* @returns {string}
|
|
217
307
|
*/
|
|
218
308
|
snapshot() {
|
|
219
309
|
let deferred2_0;
|
|
220
310
|
let deferred2_1;
|
|
221
311
|
try {
|
|
222
|
-
const ret = wasm.
|
|
312
|
+
const ret = wasm.turnresult_snapshot(this.__wbg_ptr);
|
|
223
313
|
var ptr1 = ret[0];
|
|
224
314
|
var len1 = ret[1];
|
|
225
315
|
if (ret[3]) {
|
|
@@ -234,40 +324,33 @@ export class Turn {
|
|
|
234
324
|
}
|
|
235
325
|
}
|
|
236
326
|
/**
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
* # Errors
|
|
240
|
-
*
|
|
241
|
-
* Rejects for empty input, a queued or terminal turn, a full steer queue,
|
|
242
|
-
* or a stopped driver.
|
|
243
|
-
* @param {string} instruction
|
|
244
|
-
* @returns {Promise<void>}
|
|
245
|
-
*/
|
|
246
|
-
steer(instruction) {
|
|
247
|
-
const ptr0 = passStringToWasm0(instruction, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
248
|
-
const len0 = WASM_VECTOR_LEN;
|
|
249
|
-
const ret = wasm.turn_steer(this.__wbg_ptr, ptr0, len0);
|
|
250
|
-
return ret;
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Inject ordered browser-safe text, image, or audio input at this active
|
|
254
|
-
* turn's next safe model boundary.
|
|
327
|
+
* Serializes exact aggregate usage for this completed logical turn.
|
|
255
328
|
*
|
|
256
329
|
* # Errors
|
|
257
330
|
*
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
* @param {string} content_json
|
|
261
|
-
* @returns {Promise<void>}
|
|
331
|
+
* Throws when serialization fails.
|
|
332
|
+
* @returns {string}
|
|
262
333
|
*/
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
334
|
+
usage() {
|
|
335
|
+
let deferred2_0;
|
|
336
|
+
let deferred2_1;
|
|
337
|
+
try {
|
|
338
|
+
const ret = wasm.turnresult_usage(this.__wbg_ptr);
|
|
339
|
+
var ptr1 = ret[0];
|
|
340
|
+
var len1 = ret[1];
|
|
341
|
+
if (ret[3]) {
|
|
342
|
+
ptr1 = 0; len1 = 0;
|
|
343
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
344
|
+
}
|
|
345
|
+
deferred2_0 = ptr1;
|
|
346
|
+
deferred2_1 = len1;
|
|
347
|
+
return getStringFromWasm0(ptr1, len1);
|
|
348
|
+
} finally {
|
|
349
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
350
|
+
}
|
|
268
351
|
}
|
|
269
352
|
}
|
|
270
|
-
if (Symbol.dispose)
|
|
353
|
+
if (Symbol.dispose) TurnResult.prototype[Symbol.dispose] = TurnResult.prototype.free;
|
|
271
354
|
function __wbg_get_imports() {
|
|
272
355
|
const import0 = {
|
|
273
356
|
__proto__: null,
|
|
@@ -304,30 +387,33 @@ function __wbg_get_imports() {
|
|
|
304
387
|
const ret = arg0.call(arg1, arg2);
|
|
305
388
|
return ret;
|
|
306
389
|
}, arguments); },
|
|
307
|
-
|
|
390
|
+
__wbg_close_01cad5fe38e81c86: function(arg0) {
|
|
308
391
|
globalThis.nanocodexHost.close(arg0 >>> 0);
|
|
309
392
|
},
|
|
310
|
-
|
|
311
|
-
const ret = globalThis.nanocodexHost.connect(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5));
|
|
393
|
+
__wbg_connect_5611ecc28eb874ce: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) {
|
|
394
|
+
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));
|
|
312
395
|
return ret;
|
|
313
396
|
}, arguments); },
|
|
314
|
-
|
|
397
|
+
__wbg_emitEvent_3feefd1f718bb4db: function(arg0, arg1) {
|
|
315
398
|
globalThis.nanocodexHost.emitEvent(getStringFromWasm0(arg0, arg1));
|
|
316
399
|
},
|
|
317
|
-
|
|
400
|
+
__wbg_executeCode_8137943d0e1986eb: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
318
401
|
const ret = globalThis.nanocodexHost.executeCode(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5));
|
|
319
402
|
return ret;
|
|
320
403
|
}, arguments); },
|
|
321
|
-
|
|
322
|
-
const ret =
|
|
404
|
+
__wbg_executeTool_e4208b9be8ad5132: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
|
|
405
|
+
const ret = globalThis.nanocodexHost.executeTool(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7));
|
|
323
406
|
return ret;
|
|
324
|
-
},
|
|
325
|
-
|
|
326
|
-
|
|
407
|
+
}, arguments); },
|
|
408
|
+
__wbg_getRandomValues_ceb34d8ffce7e87f: function() { return handleError(function (arg0, arg1) {
|
|
409
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
410
|
+
}, arguments); },
|
|
411
|
+
__wbg_getTime_d6f070c088c9b5ed: function(arg0) {
|
|
412
|
+
const ret = arg0.getTime();
|
|
327
413
|
return ret;
|
|
328
414
|
},
|
|
329
|
-
|
|
330
|
-
const ret = arg0.
|
|
415
|
+
__wbg_getTimezoneOffset_dc9862c79e5a81a3: function(arg0) {
|
|
416
|
+
const ret = arg0.getTimezoneOffset();
|
|
331
417
|
return ret;
|
|
332
418
|
},
|
|
333
419
|
__wbg_get_78f252d074a84d0b: function() { return handleError(function (arg0, arg1) {
|
|
@@ -354,6 +440,10 @@ function __wbg_get_imports() {
|
|
|
354
440
|
const ret = new Intl.DateTimeFormat(arg0, arg1);
|
|
355
441
|
return ret;
|
|
356
442
|
},
|
|
443
|
+
__wbg_new_cc984128914cfc6f: function(arg0) {
|
|
444
|
+
const ret = new Date(arg0);
|
|
445
|
+
return ret;
|
|
446
|
+
},
|
|
357
447
|
__wbg_new_da52cf8fe3429cb2: function() {
|
|
358
448
|
const ret = new Object();
|
|
359
449
|
return ret;
|
|
@@ -365,7 +455,7 @@ function __wbg_get_imports() {
|
|
|
365
455
|
const a = state0.a;
|
|
366
456
|
state0.a = 0;
|
|
367
457
|
try {
|
|
368
|
-
return
|
|
458
|
+
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);
|
|
369
459
|
} finally {
|
|
370
460
|
state0.a = a;
|
|
371
461
|
}
|
|
@@ -376,18 +466,18 @@ function __wbg_get_imports() {
|
|
|
376
466
|
state0.a = 0;
|
|
377
467
|
}
|
|
378
468
|
},
|
|
379
|
-
|
|
469
|
+
__wbg_next_ad2796bd351c174b: function() { return handleError(function (arg0, arg1) {
|
|
380
470
|
const ret = globalThis.nanocodexHost.next(arg0 >>> 0, arg1 >>> 0);
|
|
381
471
|
return ret;
|
|
382
472
|
}, arguments); },
|
|
383
|
-
__wbg_now_86c0d4ba3fa605b8: function() {
|
|
384
|
-
const ret = Date.now();
|
|
385
|
-
return ret;
|
|
386
|
-
},
|
|
387
473
|
__wbg_now_e7c6795a7f81e10f: function(arg0) {
|
|
388
474
|
const ret = arg0.now();
|
|
389
475
|
return ret;
|
|
390
476
|
},
|
|
477
|
+
__wbg_now_f663ab0a5177b799: function() { return handleError(function () {
|
|
478
|
+
const ret = Date.now();
|
|
479
|
+
return ret;
|
|
480
|
+
}, arguments); },
|
|
391
481
|
__wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
|
|
392
482
|
const ret = arg0.performance;
|
|
393
483
|
return ret;
|
|
@@ -407,14 +497,14 @@ function __wbg_get_imports() {
|
|
|
407
497
|
const ret = arg0.resolvedOptions();
|
|
408
498
|
return ret;
|
|
409
499
|
},
|
|
410
|
-
|
|
500
|
+
__wbg_send_864d9417bda59954: function() { return handleError(function (arg0, arg1, arg2) {
|
|
411
501
|
const ret = globalThis.nanocodexHost.send(arg0 >>> 0, getStringFromWasm0(arg1, arg2));
|
|
412
502
|
return ret;
|
|
413
503
|
}, arguments); },
|
|
414
|
-
|
|
415
|
-
const ret = globalThis.nanocodexHost.sleep(arg0 >>> 0);
|
|
504
|
+
__wbg_sleep_926d4c81d29ad90a: function() { return handleError(function (arg0, arg1, arg2) {
|
|
505
|
+
const ret = globalThis.nanocodexHost.sleep(getStringFromWasm0(arg0, arg1), arg2 >>> 0);
|
|
416
506
|
return ret;
|
|
417
|
-
},
|
|
507
|
+
}, arguments); },
|
|
418
508
|
__wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
|
|
419
509
|
const ret = typeof global === 'undefined' ? null : global;
|
|
420
510
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
@@ -439,19 +529,35 @@ function __wbg_get_imports() {
|
|
|
439
529
|
const ret = arg0.then(arg1);
|
|
440
530
|
return ret;
|
|
441
531
|
},
|
|
442
|
-
|
|
532
|
+
__wbg_toolDefinitions_fc0bd1da5e037164: function() { return handleError(function (arg0, arg1, arg2) {
|
|
443
533
|
const ret = globalThis.nanocodexHost.toolDefinitions(getStringFromWasm0(arg1, arg2));
|
|
444
534
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
445
535
|
const len1 = WASM_VECTOR_LEN;
|
|
446
536
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
447
537
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
538
|
+
}, arguments); },
|
|
539
|
+
__wbg_toolMode_4ce2699746be96ac: function(arg0, arg1, arg2) {
|
|
540
|
+
const ret = globalThis.nanocodexHost.toolMode(getStringFromWasm0(arg1, arg2));
|
|
541
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
542
|
+
const len1 = WASM_VECTOR_LEN;
|
|
543
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
544
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
545
|
+
},
|
|
546
|
+
__wbg_turnresult_new: function(arg0) {
|
|
547
|
+
const ret = TurnResult.__wrap(arg0);
|
|
548
|
+
return ret;
|
|
448
549
|
},
|
|
449
550
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
450
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
551
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 455, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
451
552
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_6c97e59ea7837008___convert__closures_____invoke___wasm_bindgen_6c97e59ea7837008___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_6c97e59ea7837008___JsError___true_);
|
|
452
553
|
return ret;
|
|
453
554
|
},
|
|
454
|
-
__wbindgen_cast_0000000000000002: function(arg0
|
|
555
|
+
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
556
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
557
|
+
const ret = arg0;
|
|
558
|
+
return ret;
|
|
559
|
+
},
|
|
560
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
455
561
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
456
562
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
457
563
|
return ret;
|
|
@@ -479,8 +585,8 @@ function wasm_bindgen_6c97e59ea7837008___convert__closures_____invoke___wasm_bin
|
|
|
479
585
|
}
|
|
480
586
|
}
|
|
481
587
|
|
|
482
|
-
function
|
|
483
|
-
wasm.
|
|
588
|
+
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) {
|
|
589
|
+
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);
|
|
484
590
|
}
|
|
485
591
|
|
|
486
592
|
const NanocodexFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -489,6 +595,9 @@ const NanocodexFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
489
595
|
const TurnFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
490
596
|
? { register: () => {}, unregister: () => {} }
|
|
491
597
|
: new FinalizationRegistry(ptr => wasm.__wbg_turn_free(ptr, 1));
|
|
598
|
+
const TurnResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
599
|
+
? { register: () => {}, unregister: () => {} }
|
|
600
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_turnresult_free(ptr, 1));
|
|
492
601
|
|
|
493
602
|
function addToExternrefTable0(obj) {
|
|
494
603
|
const idx = wasm.__externref_table_alloc();
|
|
@@ -571,6 +680,11 @@ function debugString(val) {
|
|
|
571
680
|
return className;
|
|
572
681
|
}
|
|
573
682
|
|
|
683
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
684
|
+
ptr = ptr >>> 0;
|
|
685
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
686
|
+
}
|
|
687
|
+
|
|
574
688
|
let cachedDataViewMemory0 = null;
|
|
575
689
|
function getDataViewMemory0() {
|
|
576
690
|
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;
|