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.
@@ -0,0 +1,161 @@
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
+ }
110
+
111
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
112
+
113
+ export interface InitOutput {
114
+ readonly memory: WebAssembly.Memory;
115
+ readonly __wbg_nanocodex_free: (a: number, b: number) => void;
116
+ readonly __wbg_turn_free: (a: number, b: number) => void;
117
+ readonly nanocodex_fork: (a: number) => any;
118
+ readonly nanocodex_forkFrom: (a: number, b: number) => any;
119
+ readonly nanocodex_new: (a: number, b: number) => [number, number, number];
120
+ readonly nanocodex_prompt: (a: number, b: number, c: number) => [number, number, number];
121
+ readonly nanocodex_promptContent: (a: number, b: number, c: number) => [number, number, number];
122
+ readonly nanocodex_sessionId: (a: number) => [number, number];
123
+ readonly nanocodex_spawn: (a: number) => any;
124
+ readonly turn_cancel: (a: number) => any;
125
+ readonly turn_result: (a: number) => any;
126
+ readonly turn_steer: (a: number, b: number, c: number) => any;
127
+ readonly turn_steerContent: (a: number, b: number, c: number) => any;
128
+ readonly wasm_bindgen__convert__closures_____invoke__h02eb5eea4c10a535: (a: number, b: number, c: any) => [number, number];
129
+ readonly wasm_bindgen__convert__closures_____invoke__h179cb8eb2e8755ae: (a: number, b: number, c: any, d: any) => void;
130
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
131
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
132
+ readonly __wbindgen_exn_store: (a: number) => void;
133
+ readonly __externref_table_alloc: () => number;
134
+ readonly __wbindgen_externrefs: WebAssembly.Table;
135
+ readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
136
+ readonly __externref_table_dealloc: (a: number) => void;
137
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
138
+ readonly __wbindgen_start: () => void;
139
+ }
140
+
141
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
142
+
143
+ /**
144
+ * Instantiates the given `module`, which can either be bytes or
145
+ * a precompiled `WebAssembly.Module`.
146
+ *
147
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
148
+ *
149
+ * @returns {InitOutput}
150
+ */
151
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
152
+
153
+ /**
154
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
155
+ * for everything else, calls `WebAssembly.instantiate` directly.
156
+ *
157
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
158
+ *
159
+ * @returns {Promise<InitOutput>}
160
+ */
161
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;