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-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.
|
|
213
234
|
*
|
|
214
235
|
* # Errors
|
|
215
236
|
*
|
|
216
|
-
*
|
|
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.
|
|
304
|
+
*
|
|
305
|
+
* # Errors
|
|
306
|
+
*
|
|
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
|
-
*
|
|
239
|
-
*
|
|
240
|
-
* # Errors
|
|
241
|
-
*
|
|
242
|
-
* Rejects for empty input, a queued or terminal turn, a full steer queue,
|
|
243
|
-
* or a stopped driver.
|
|
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.
|
|
329
|
+
* Serializes exact aggregate usage for this completed logical turn.
|
|
256
330
|
*
|
|
257
331
|
* # Errors
|
|
258
332
|
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
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,33 @@ function __wbg_get_imports() {
|
|
|
306
390
|
const ret = arg0.call(arg1, arg2);
|
|
307
391
|
return ret;
|
|
308
392
|
}, arguments); },
|
|
309
|
-
|
|
393
|
+
__wbg_close_01cad5fe38e81c86: 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_5611ecc28eb874ce: 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_3feefd1f718bb4db: function(arg0, arg1) {
|
|
317
401
|
globalThis.nanocodexHost.emitEvent(getStringFromWasm0(arg0, arg1));
|
|
318
402
|
},
|
|
319
|
-
|
|
403
|
+
__wbg_executeCode_8137943d0e1986eb: 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
|
-
const ret =
|
|
407
|
+
__wbg_executeTool_e4208b9be8ad5132: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
|
|
408
|
+
const ret = globalThis.nanocodexHost.executeTool(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7));
|
|
325
409
|
return ret;
|
|
326
|
-
},
|
|
327
|
-
|
|
328
|
-
|
|
410
|
+
}, arguments); },
|
|
411
|
+
__wbg_getRandomValues_ceb34d8ffce7e87f: function() { return handleError(function (arg0, arg1) {
|
|
412
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
413
|
+
}, arguments); },
|
|
414
|
+
__wbg_getTime_d6f070c088c9b5ed: function(arg0) {
|
|
415
|
+
const ret = arg0.getTime();
|
|
329
416
|
return ret;
|
|
330
417
|
},
|
|
331
|
-
|
|
332
|
-
const ret = arg0.
|
|
418
|
+
__wbg_getTimezoneOffset_dc9862c79e5a81a3: function(arg0) {
|
|
419
|
+
const ret = arg0.getTimezoneOffset();
|
|
333
420
|
return ret;
|
|
334
421
|
},
|
|
335
422
|
__wbg_get_78f252d074a84d0b: function() { return handleError(function (arg0, arg1) {
|
|
@@ -356,6 +443,10 @@ function __wbg_get_imports() {
|
|
|
356
443
|
const ret = new Intl.DateTimeFormat(arg0, arg1);
|
|
357
444
|
return ret;
|
|
358
445
|
},
|
|
446
|
+
__wbg_new_cc984128914cfc6f: function(arg0) {
|
|
447
|
+
const ret = new Date(arg0);
|
|
448
|
+
return ret;
|
|
449
|
+
},
|
|
359
450
|
__wbg_new_da52cf8fe3429cb2: function() {
|
|
360
451
|
const ret = new Object();
|
|
361
452
|
return ret;
|
|
@@ -367,7 +458,7 @@ function __wbg_get_imports() {
|
|
|
367
458
|
const a = state0.a;
|
|
368
459
|
state0.a = 0;
|
|
369
460
|
try {
|
|
370
|
-
return
|
|
461
|
+
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
462
|
} finally {
|
|
372
463
|
state0.a = a;
|
|
373
464
|
}
|
|
@@ -378,18 +469,18 @@ function __wbg_get_imports() {
|
|
|
378
469
|
state0.a = 0;
|
|
379
470
|
}
|
|
380
471
|
},
|
|
381
|
-
|
|
472
|
+
__wbg_next_ad2796bd351c174b: function() { return handleError(function (arg0, arg1) {
|
|
382
473
|
const ret = globalThis.nanocodexHost.next(arg0 >>> 0, arg1 >>> 0);
|
|
383
474
|
return ret;
|
|
384
475
|
}, arguments); },
|
|
385
|
-
__wbg_now_86c0d4ba3fa605b8: function() {
|
|
386
|
-
const ret = Date.now();
|
|
387
|
-
return ret;
|
|
388
|
-
},
|
|
389
476
|
__wbg_now_e7c6795a7f81e10f: function(arg0) {
|
|
390
477
|
const ret = arg0.now();
|
|
391
478
|
return ret;
|
|
392
479
|
},
|
|
480
|
+
__wbg_now_f663ab0a5177b799: function() { return handleError(function () {
|
|
481
|
+
const ret = Date.now();
|
|
482
|
+
return ret;
|
|
483
|
+
}, arguments); },
|
|
393
484
|
__wbg_performance_3fcf6e32a7e1ed0a: function(arg0) {
|
|
394
485
|
const ret = arg0.performance;
|
|
395
486
|
return ret;
|
|
@@ -409,14 +500,14 @@ function __wbg_get_imports() {
|
|
|
409
500
|
const ret = arg0.resolvedOptions();
|
|
410
501
|
return ret;
|
|
411
502
|
},
|
|
412
|
-
|
|
503
|
+
__wbg_send_864d9417bda59954: function() { return handleError(function (arg0, arg1, arg2) {
|
|
413
504
|
const ret = globalThis.nanocodexHost.send(arg0 >>> 0, getStringFromWasm0(arg1, arg2));
|
|
414
505
|
return ret;
|
|
415
506
|
}, arguments); },
|
|
416
|
-
|
|
417
|
-
const ret = globalThis.nanocodexHost.sleep(arg0 >>> 0);
|
|
507
|
+
__wbg_sleep_926d4c81d29ad90a: function() { return handleError(function (arg0, arg1, arg2) {
|
|
508
|
+
const ret = globalThis.nanocodexHost.sleep(getStringFromWasm0(arg0, arg1), arg2 >>> 0);
|
|
418
509
|
return ret;
|
|
419
|
-
},
|
|
510
|
+
}, arguments); },
|
|
420
511
|
__wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
|
|
421
512
|
const ret = typeof global === 'undefined' ? null : global;
|
|
422
513
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
@@ -441,19 +532,35 @@ function __wbg_get_imports() {
|
|
|
441
532
|
const ret = arg0.then(arg1);
|
|
442
533
|
return ret;
|
|
443
534
|
},
|
|
444
|
-
|
|
535
|
+
__wbg_toolDefinitions_fc0bd1da5e037164: function() { return handleError(function (arg0, arg1, arg2) {
|
|
445
536
|
const ret = globalThis.nanocodexHost.toolDefinitions(getStringFromWasm0(arg1, arg2));
|
|
446
537
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
447
538
|
const len1 = WASM_VECTOR_LEN;
|
|
448
539
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
449
540
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
541
|
+
}, arguments); },
|
|
542
|
+
__wbg_toolMode_4ce2699746be96ac: function(arg0, arg1, arg2) {
|
|
543
|
+
const ret = globalThis.nanocodexHost.toolMode(getStringFromWasm0(arg1, arg2));
|
|
544
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
545
|
+
const len1 = WASM_VECTOR_LEN;
|
|
546
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
547
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
548
|
+
},
|
|
549
|
+
__wbg_turnresult_new: function(arg0) {
|
|
550
|
+
const ret = TurnResult.__wrap(arg0);
|
|
551
|
+
return ret;
|
|
450
552
|
},
|
|
451
553
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
452
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
554
|
+
// 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`.
|
|
453
555
|
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
556
|
return ret;
|
|
455
557
|
},
|
|
456
|
-
__wbindgen_cast_0000000000000002: function(arg0
|
|
558
|
+
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
559
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
560
|
+
const ret = arg0;
|
|
561
|
+
return ret;
|
|
562
|
+
},
|
|
563
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
457
564
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
458
565
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
459
566
|
return ret;
|
|
@@ -481,8 +588,8 @@ function wasm_bindgen_6c97e59ea7837008___convert__closures_____invoke___wasm_bin
|
|
|
481
588
|
}
|
|
482
589
|
}
|
|
483
590
|
|
|
484
|
-
function
|
|
485
|
-
wasm.
|
|
591
|
+
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) {
|
|
592
|
+
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
593
|
}
|
|
487
594
|
|
|
488
595
|
const NanocodexFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -491,6 +598,9 @@ const NanocodexFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
491
598
|
const TurnFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
492
599
|
? { register: () => {}, unregister: () => {} }
|
|
493
600
|
: new FinalizationRegistry(ptr => wasm.__wbg_turn_free(ptr, 1));
|
|
601
|
+
const TurnResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
602
|
+
? { register: () => {}, unregister: () => {} }
|
|
603
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_turnresult_free(ptr, 1));
|
|
494
604
|
|
|
495
605
|
function addToExternrefTable0(obj) {
|
|
496
606
|
const idx = wasm.__externref_table_alloc();
|
|
@@ -573,6 +683,11 @@ function debugString(val) {
|
|
|
573
683
|
return className;
|
|
574
684
|
}
|
|
575
685
|
|
|
686
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
687
|
+
ptr = ptr >>> 0;
|
|
688
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
689
|
+
}
|
|
690
|
+
|
|
576
691
|
let cachedDataViewMemory0 = null;
|
|
577
692
|
function getDataViewMemory0() {
|
|
578
693
|
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;
|