nanocodex 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +116 -0
- package/actions/events.d.mts +10 -0
- package/actions/events.mjs +91 -0
- package/actions/index.d.mts +12 -0
- package/actions/index.mjs +20 -0
- package/actions/session.d.mts +14 -0
- package/actions/session.mjs +9 -0
- package/actions/turn.d.mts +30 -0
- package/actions/turn.mjs +22 -0
- package/browser/Agent.d.mts +25 -0
- package/browser/Agent.mjs +54 -0
- package/browser/host.d.mts +20 -0
- package/browser/host.mjs +161 -0
- package/browser/index.d.mts +13 -0
- package/browser/index.mjs +2 -0
- package/index.d.mts +19 -0
- package/index.mjs +1 -0
- package/internal.mjs +303 -0
- package/node/Agent.d.mts +24 -0
- package/node/Agent.mjs +51 -0
- package/node/host.mjs +204 -0
- package/node/index.d.mts +13 -0
- package/node/index.mjs +2 -0
- package/package.json +61 -0
- package/pkg-node/nanocodex.d.ts +109 -0
- package/pkg-node/nanocodex.js +652 -0
- package/pkg-node/nanocodex_bg.wasm +0 -0
- package/pkg-node/nanocodex_bg.wasm.d.ts +27 -0
- package/pkg-node/package.json +1 -0
- package/pkg-web/nanocodex.d.ts +161 -0
- package/pkg-web/nanocodex.js +745 -0
- package/pkg-web/nanocodex_bg.wasm +0 -0
- package/pkg-web/nanocodex_bg.wasm.d.ts +27 -0
- package/pkg-web/package.json +1 -0
- package/runtime/code-runtime.mjs +191 -0
- package/scripts/check-package.mjs +38 -0
- package/types.d.mts +82 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Persistent WASM agent handle hosted by Node.js or a browser Worker.
|
|
6
|
+
*/
|
|
7
|
+
export class Nanocodex {
|
|
8
|
+
free(): void;
|
|
9
|
+
[Symbol.dispose](): void;
|
|
10
|
+
/**
|
|
11
|
+
* Fork the latest safe committed model boundary.
|
|
12
|
+
*
|
|
13
|
+
* # Errors
|
|
14
|
+
*
|
|
15
|
+
* Rejects before the first safe boundary or after the driver stops.
|
|
16
|
+
*/
|
|
17
|
+
fork(): Promise<Nanocodex>;
|
|
18
|
+
/**
|
|
19
|
+
* Fork from the exact checkpoint retained by a completed historical turn.
|
|
20
|
+
*
|
|
21
|
+
* # Errors
|
|
22
|
+
*
|
|
23
|
+
* Rejects if the turn is incomplete, belongs to another lineage, or the
|
|
24
|
+
* driver stops.
|
|
25
|
+
*/
|
|
26
|
+
forkFrom(turn: Turn): Promise<Nanocodex>;
|
|
27
|
+
/**
|
|
28
|
+
* Build a persistent agent from a JSON configuration object.
|
|
29
|
+
*
|
|
30
|
+
* # Errors
|
|
31
|
+
*
|
|
32
|
+
* Throws when the JSON or required configuration is invalid.
|
|
33
|
+
*/
|
|
34
|
+
constructor(config_json: string);
|
|
35
|
+
/**
|
|
36
|
+
* Accept a prompt immediately and return its independently awaitable turn.
|
|
37
|
+
*
|
|
38
|
+
* # Errors
|
|
39
|
+
*
|
|
40
|
+
* Throws when the prompt is empty or the agent driver has stopped.
|
|
41
|
+
*/
|
|
42
|
+
prompt(instruction: string): Turn;
|
|
43
|
+
/**
|
|
44
|
+
* Accept ordered browser-safe text, image, or audio input encoded as JSON.
|
|
45
|
+
*
|
|
46
|
+
* # Errors
|
|
47
|
+
*
|
|
48
|
+
* Throws for malformed or empty content, local filesystem inputs, or a
|
|
49
|
+
* stopped driver.
|
|
50
|
+
*/
|
|
51
|
+
promptContent(content_json: string): Turn;
|
|
52
|
+
/**
|
|
53
|
+
* Start a clean sibling with the same configuration and tools.
|
|
54
|
+
*
|
|
55
|
+
* # Errors
|
|
56
|
+
*
|
|
57
|
+
* Rejects after the driver stops.
|
|
58
|
+
*/
|
|
59
|
+
spawn(): Promise<Nanocodex>;
|
|
60
|
+
/**
|
|
61
|
+
* Stable session identifier used to route this agent's event stream.
|
|
62
|
+
*/
|
|
63
|
+
readonly sessionId: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Completion and control handle for one accepted WASM turn.
|
|
68
|
+
*/
|
|
69
|
+
export class Turn {
|
|
70
|
+
private constructor();
|
|
71
|
+
free(): void;
|
|
72
|
+
[Symbol.dispose](): void;
|
|
73
|
+
/**
|
|
74
|
+
* Cancel this exact active or queued turn.
|
|
75
|
+
*
|
|
76
|
+
* # Errors
|
|
77
|
+
*
|
|
78
|
+
* Rejects if the turn is already terminal or the driver stops.
|
|
79
|
+
*/
|
|
80
|
+
cancel(): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Wait for the turn and return its final assistant message.
|
|
83
|
+
*
|
|
84
|
+
* # Errors
|
|
85
|
+
*
|
|
86
|
+
* Rejects when the model run fails, the driver stops, or two consumers
|
|
87
|
+
* await the same pending turn concurrently.
|
|
88
|
+
*/
|
|
89
|
+
result(): Promise<string>;
|
|
90
|
+
/**
|
|
91
|
+
* Inject input at this active turn's next safe model boundary.
|
|
92
|
+
*
|
|
93
|
+
* # Errors
|
|
94
|
+
*
|
|
95
|
+
* Rejects for empty input, a queued or terminal turn, a full steer queue,
|
|
96
|
+
* or a stopped driver.
|
|
97
|
+
*/
|
|
98
|
+
steer(instruction: string): Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* Inject ordered browser-safe text, image, or audio input at this active
|
|
101
|
+
* turn's next safe model boundary.
|
|
102
|
+
*
|
|
103
|
+
* # Errors
|
|
104
|
+
*
|
|
105
|
+
* Rejects for malformed or empty content, local filesystem inputs, a
|
|
106
|
+
* queued or terminal turn, a full steer queue, or a stopped driver.
|
|
107
|
+
*/
|
|
108
|
+
steerContent(content_json: string): Promise<void>;
|
|
109
|
+
}
|