/* 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; }