/* tslint:disable */ /* eslint-disable */ /** * JavaScript binding over the shared Rust agent lifecycle. */ export class Nanocodex { free(): void; [Symbol.dispose](): void; /** * Compacts retained history immediately without fabricating a user prompt. * * # Errors * * Throws when compaction or the agent driver fails. */ compact(): Promise; /** * Forks the latest safe committed model boundary. * * # Errors * * Rejects before the first safe boundary or after the driver stops. */ fork(): Promise; /** * Forks from an exact completed historical turn. * * # Errors * * Rejects if the result belongs to another agent or the driver stopped. */ forkFrom(result: TurnResult): Promise; /** * Builds an agent from its JavaScript JSON configuration. * * # Errors * * Throws when the JSON or agent policy is invalid. */ constructor(config_json: string); /** * Accepts a text prompt and returns its independently awaitable turn. * * # Errors * * Throws when the prompt is empty. */ prompt(instruction: string): Turn; /** * Accepts browser-safe multimodal input encoded as JSON. * * # Errors * * Throws for malformed, empty, or local-filesystem input. */ promptContent(content_json: string): Turn; /** * Enables or disables priority processing for subsequently accepted turns. * * # Errors * * Rejects after the driver stops. */ setFastMode(enabled: boolean): Promise; /** * Changes the reasoning effort for subsequently accepted turns. * * # Errors * * Rejects an invalid effort or a stopped driver. */ setThinking(thinking: string): Promise; /** * Gracefully stops the driver and joins every resource owned by this agent. * * # Errors * * Rejects when the driver had already stopped or cleanup fails. */ shutdown(): Promise; /** * Starts a clean sibling with the same private agent policy. * * # Errors * * Rejects after the driver stops. */ spawn(): Promise; /** * Returns the stable `UUIDv7` session identity. */ readonly sessionId: string; } /** * JavaScript binding over one shared Rust turn. */ export class Turn { private constructor(); free(): void; [Symbol.dispose](): void; /** * Cancels this exact active or queued turn. * * # Errors * * Rejects if the turn is already terminal or its driver stopped. */ cancel(): Promise; /** * Waits for the final assistant message. * * # Errors * * Rejects when the model run or driver fails. */ result(): Promise; /** * Injects text input at the active turn's next safe model boundary. * * # Errors * * Rejects if the turn is not active or its driver stopped. */ steer(instruction: string): Promise; /** * Injects browser-safe multimodal input at the active turn's next boundary. * * # Errors * * Rejects malformed input or a turn that is no longer active. */ steerContent(content_json: string): Promise; } /** * JavaScript binding over one completed Rust turn result. */ export class TurnResult { private constructor(); free(): void; [Symbol.dispose](): void; /** * Serializes this completed boundary's resumable session snapshot. * * # Errors * * Throws when serialization fails. */ snapshot(): string; /** * Serializes exact aggregate usage for this completed logical turn. * * # Errors * * Throws when serialization fails. */ usage(): string; /** * Returns the final assistant message. */ readonly finalMessage: string; } export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; export interface InitOutput { readonly memory: WebAssembly.Memory; readonly __wbg_nanocodex_free: (a: number, b: number) => void; readonly __wbg_turn_free: (a: number, b: number) => void; readonly __wbg_turnresult_free: (a: number, b: number) => void; readonly nanocodex_compact: (a: number) => any; readonly nanocodex_fork: (a: number) => any; readonly nanocodex_forkFrom: (a: number, b: number) => any; readonly nanocodex_new: (a: number, b: number) => [number, number, number]; readonly nanocodex_prompt: (a: number, b: number, c: number) => [number, number, number]; readonly nanocodex_promptContent: (a: number, b: number, c: number) => [number, number, number]; readonly nanocodex_sessionId: (a: number) => [number, number]; readonly nanocodex_setFastMode: (a: number, b: number) => any; readonly nanocodex_setThinking: (a: number, b: number, c: number) => any; readonly nanocodex_shutdown: (a: number) => any; readonly nanocodex_spawn: (a: number) => any; readonly turn_cancel: (a: number) => any; readonly turn_result: (a: number) => any; readonly turn_steer: (a: number, b: number, c: number) => any; readonly turn_steerContent: (a: number, b: number, c: number) => any; readonly turnresult_finalMessage: (a: number) => [number, number]; readonly turnresult_snapshot: (a: number) => [number, number, number, number]; readonly turnresult_usage: (a: number) => [number, number, number, number]; readonly 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]; readonly 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; readonly __wbindgen_malloc: (a: number, b: number) => number; readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number; readonly __wbindgen_exn_store: (a: number) => void; readonly __externref_table_alloc: () => number; readonly __wbindgen_externrefs: WebAssembly.Table; readonly __wbindgen_destroy_closure: (a: number, b: number) => void; readonly __externref_table_dealloc: (a: number) => void; readonly __wbindgen_free: (a: number, b: number, c: number) => void; readonly __wbindgen_start: () => void; } export type SyncInitInput = BufferSource | WebAssembly.Module; /** * Instantiates the given `module`, which can either be bytes or * a precompiled `WebAssembly.Module`. * * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated. * * @returns {InitOutput} */ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput; /** * If `module_or_path` is {RequestInfo} or {URL}, makes a request and * for everything else, calls `WebAssembly.instantiate` directly. * * @param {{ module_or_path: InitInput | Promise }} module_or_path - Passing `InitInput` directly is deprecated. * * @returns {Promise} */ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise } | InitInput | Promise): Promise;