UNPKG

@codebuff/sdk

Version:

Official SDK for Codebuff — AI coding agent & framework

1,352 lines (1,350 loc) 88.5 kB
// Generated by dts-bundle-generator v9.5.1 import { Language, Parser, Query } from 'web-tree-sitter'; import { WebSocket as WebSocket$1 } from 'ws'; import { z } from 'zod/v4'; import { JSONSchema } from 'zod/v4/core'; export type JSONValue = null | string | number | boolean | JSONObject | JSONArray; export declare const jsonValueSchema: z.ZodType<JSONValue>; export declare const jsonObjectSchema: z.ZodType<JSONObject>; export type JSONObject = { [key: string]: JSONValue; }; export declare const jsonArraySchema: z.ZodType<JSONArray>; export type JSONArray = JSONValue[]; export declare const systemMessageSchema: z.ZodIntersection<z.ZodObject<{ role: z.ZodLiteral<"system">; content: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; timeToLive: z.ZodOptional<z.ZodUnion<readonly [ z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt"> ]>>; keepDuringTruncation: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>>; export type SystemMessage = z.infer<typeof systemMessageSchema>; export declare const userMessageSchema: z.ZodIntersection<z.ZodObject<{ role: z.ZodLiteral<"user">; content: z.ZodUnion<readonly [ z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[ z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; image: z.ZodUnion<readonly [ z.ZodUnion<readonly [ z.ZodString, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodCustom<ArrayBuffer, ArrayBuffer>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>> ]>, z.ZodCustom<URL, URL> ]>; mediaType: z.ZodOptional<z.ZodString>; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"file">; data: z.ZodUnion<readonly [ z.ZodUnion<readonly [ z.ZodString, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodCustom<ArrayBuffer, ArrayBuffer>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>> ]>, z.ZodCustom<URL, URL> ]>; filename: z.ZodOptional<z.ZodString>; mediaType: z.ZodString; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; }, z.core.$strip> ]>> ]>; }, z.core.$strip>, z.ZodObject<{ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; timeToLive: z.ZodOptional<z.ZodUnion<readonly [ z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt"> ]>>; keepDuringTruncation: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>>; export type UserMessage = z.infer<typeof userMessageSchema>; export declare const assistantMessageSchema: z.ZodIntersection<z.ZodObject<{ role: z.ZodLiteral<"assistant">; content: z.ZodUnion<readonly [ z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[ z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"reasoning">; text: z.ZodString; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool-call">; toolCallId: z.ZodString; toolName: z.ZodString; input: z.ZodRecord<z.ZodString, z.ZodUnknown>; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; providerExecuted: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip> ]>> ]>; }, z.core.$strip>, z.ZodObject<{ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; timeToLive: z.ZodOptional<z.ZodUnion<readonly [ z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt"> ]>>; keepDuringTruncation: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>>; export type AssistantMessage = z.infer<typeof assistantMessageSchema>; export declare const toolMessageSchema: z.ZodIntersection<z.ZodObject<{ role: z.ZodLiteral<"tool">; content: z.ZodObject<{ type: z.ZodLiteral<"tool-result">; toolCallId: z.ZodString; toolName: z.ZodString; output: z.ZodArray<z.ZodDiscriminatedUnion<[ z.ZodObject<{ type: z.ZodLiteral<"json">; value: z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"media">; data: z.ZodString; mediaType: z.ZodString; }, z.core.$strip> ]>>; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; timeToLive: z.ZodOptional<z.ZodUnion<readonly [ z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt"> ]>>; keepDuringTruncation: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>>; export type ToolMessage = z.infer<typeof toolMessageSchema>; export declare const messageSchema: z.ZodIntersection<z.ZodUnion<readonly [ z.ZodIntersection<z.ZodObject<{ role: z.ZodLiteral<"system">; content: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; timeToLive: z.ZodOptional<z.ZodUnion<readonly [ z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt"> ]>>; keepDuringTruncation: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{ role: z.ZodLiteral<"user">; content: z.ZodUnion<readonly [ z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[ z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; image: z.ZodUnion<readonly [ z.ZodUnion<readonly [ z.ZodString, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodCustom<ArrayBuffer, ArrayBuffer>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>> ]>, z.ZodCustom<URL, URL> ]>; mediaType: z.ZodOptional<z.ZodString>; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"file">; data: z.ZodUnion<readonly [ z.ZodUnion<readonly [ z.ZodString, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodCustom<ArrayBuffer, ArrayBuffer>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>> ]>, z.ZodCustom<URL, URL> ]>; filename: z.ZodOptional<z.ZodString>; mediaType: z.ZodString; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; }, z.core.$strip> ]>> ]>; }, z.core.$strip>, z.ZodObject<{ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; timeToLive: z.ZodOptional<z.ZodUnion<readonly [ z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt"> ]>>; keepDuringTruncation: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{ role: z.ZodLiteral<"assistant">; content: z.ZodUnion<readonly [ z.ZodString, z.ZodArray<z.ZodDiscriminatedUnion<[ z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"reasoning">; text: z.ZodString; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool-call">; toolCallId: z.ZodString; toolName: z.ZodString; input: z.ZodRecord<z.ZodString, z.ZodUnknown>; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; providerExecuted: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip> ]>> ]>; }, z.core.$strip>, z.ZodObject<{ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; timeToLive: z.ZodOptional<z.ZodUnion<readonly [ z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt"> ]>>; keepDuringTruncation: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{ role: z.ZodLiteral<"tool">; content: z.ZodObject<{ type: z.ZodLiteral<"tool-result">; toolCallId: z.ZodString; toolName: z.ZodString; output: z.ZodArray<z.ZodDiscriminatedUnion<[ z.ZodObject<{ type: z.ZodLiteral<"json">; value: z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"media">; data: z.ZodString; mediaType: z.ZodString; }, z.core.$strip> ]>>; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; timeToLive: z.ZodOptional<z.ZodUnion<readonly [ z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt"> ]>>; keepDuringTruncation: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>> ]>, z.ZodObject<{ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; timeToLive: z.ZodOptional<z.ZodUnion<readonly [ z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt"> ]>>; keepDuringTruncation: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>>; export type Message = z.infer<typeof messageSchema>; export declare const dataContentSchema: z.ZodUnion<readonly [ z.ZodString, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodCustom<ArrayBuffer, ArrayBuffer>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>> ]>; export type DataContent = z.infer<typeof dataContentSchema>; type ToolName = "add_message" | "code_search" | "end_turn" | "find_files" | "read_docs" | "read_files" | "run_file_change_hooks" | "run_terminal_command" | "set_messages" | "set_output" | "spawn_agents" | "str_replace" | "think_deeply" | "web_search" | "write_file"; interface ToolParamsMap { add_message: AddMessageParams; code_search: CodeSearchParams; end_turn: EndTurnParams; find_files: FindFilesParams; read_docs: ReadDocsParams; read_files: ReadFilesParams; run_file_change_hooks: RunFileChangeHooksParams; run_terminal_command: RunTerminalCommandParams; set_messages: SetMessagesParams; set_output: SetOutputParams; spawn_agents: SpawnAgentsParams; str_replace: StrReplaceParams; think_deeply: ThinkDeeplyParams; web_search: WebSearchParams; write_file: WriteFileParams; } interface AddMessageParams { role: "user" | "assistant"; content: string; } interface CodeSearchParams { /** The pattern to search for. */ pattern: string; /** Optional ripgrep flags to customize the search (e.g., "-i" for case-insensitive, "-t ts" for TypeScript files only, "-A 3" for 3 lines after match, "-B 2" for 2 lines before match, "--type-not test" to exclude test files). */ flags?: string; /** Optional working directory to search within, relative to the project root. Defaults to searching the entire project. */ cwd?: string; /** Maximum number of results to return. Defaults to 30. */ maxResults?: number; } interface EndTurnParams { } interface FindFilesParams { /** A brief natural language description of the files or the name of a function or class you are looking for. It's also helpful to mention a directory or two to look within. */ prompt: string; } interface ReadDocsParams { /** The library or framework name (e.g., "Next.js", "MongoDB", "React"). Use the official name as it appears in documentation if possible. Only public libraries available in Context7's database are supported, so small or private libraries may not be available. */ libraryTitle: string; /** Specific topic to focus on (e.g., "routing", "hooks", "authentication") */ topic: string; /** Optional maximum number of tokens to return. Defaults to 20000. Values less than 10000 are automatically increased to 10000. */ max_tokens?: number; } interface ReadFilesParams { /** List of file paths to read. */ paths: string[]; } interface RunFileChangeHooksParams { /** List of file paths that were changed and should trigger file change hooks */ files: string[]; } interface RunTerminalCommandParams { /** CLI command valid for user's OS. */ command: string; /** Either SYNC (waits, returns output) or BACKGROUND (runs in background). Default SYNC */ process_type?: "SYNC" | "BACKGROUND"; /** The working directory to run the command in. Default is the project root. */ cwd?: string; /** Set to -1 for no timeout. Does not apply for BACKGROUND commands. Default 30 */ timeout_seconds?: number; } interface SetMessagesParams { messages: any; } interface SetOutputParams { } interface SpawnAgentsParams { agents: { /** Agent to spawn */ agent_type: string; /** Prompt to send to the agent */ prompt?: string; /** Parameters object for the agent (if any) */ params?: Record<string, any>; }[]; } interface StrReplaceParams { /** The path to the file to edit. */ path: string; /** Array of replacements to make. */ replacements: { /** The string to replace. This must be an *exact match* of the string you want to replace, including whitespace and punctuation. */ old: string; /** The string to replace the corresponding old string with. Can be empty to delete. */ new: string; /** Whether to allow multiple replacements of old string. */ allowMultiple?: boolean; }[]; } interface ThinkDeeplyParams { /** Detailed step-by-step analysis. Initially keep each step concise (max ~5-7 words per step). */ thought: string; } interface WebSearchParams { /** The search query to find relevant web content */ query: string; /** Search depth - 'standard' for quick results, 'deep' for more comprehensive search. Default is 'standard'. */ depth?: "standard" | "deep"; } interface WriteFileParams { /** Path to the file relative to the **project root** */ path: string; /** What the change is intended to do in only one sentence. */ instructions: string; /** Edit snippet to apply to the file. */ content: string; } type GetToolParams<T extends ToolName> = ToolParamsMap[T]; type JSONValue$1 = null | string | number | boolean | JSONObject$1 | JSONArray$1; type JSONObject$1 = { [key: string]: JSONValue$1; }; type JSONArray$1 = JSONValue$1[]; type JsonSchema = { type?: "object" | "array" | "string" | "number" | "boolean" | "null" | "integer"; description?: string; properties?: Record<string, JsonSchema | boolean>; required?: string[]; enum?: Array<string | number | boolean | null>; [k: string]: unknown; }; type JsonObjectSchema = JsonSchema & { type: "object"; }; declare const toolResultOutputSchema: z.ZodDiscriminatedUnion<[ z.ZodObject<{ type: z.ZodLiteral<"json">; value: z.ZodType<JSONValue$1, unknown, z.core.$ZodTypeInternals<JSONValue$1, unknown>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"media">; data: z.ZodString; mediaType: z.ZodString; }, z.core.$strip> ]>; type ToolResultOutput = z.infer<typeof toolResultOutputSchema>; declare const messageSchema$1: z.ZodIntersection<z.ZodUnion<readonly [ z.ZodIntersection<z.ZodObject<{ role: z.ZodLiteral<"system">; content: z.ZodString; }, z.core.$strip>, z.ZodObject<{ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue$1, unknown, z.core.$ZodTypeInternals<JSONValue$1, unknown>>>>>; timeToLive: z.ZodOptional<z.ZodUnion<readonly [ z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt"> ]>>; keepDuringTruncation: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{ role: z.ZodLiteral<"user">; content: z.ZodUnion<readonly [ z.ZodString, z.ZodArray<z.ZodUnion<readonly [ z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue$1, unknown, z.core.$ZodTypeInternals<JSONValue$1, unknown>>>>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; image: z.ZodUnion<readonly [ z.ZodUnion<readonly [ z.ZodString, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodCustom<ArrayBuffer, ArrayBuffer>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>> ]>, z.ZodCustom<URL, URL> ]>; mediaType: z.ZodOptional<z.ZodString>; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue$1, unknown, z.core.$ZodTypeInternals<JSONValue$1, unknown>>>>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"file">; data: z.ZodUnion<readonly [ z.ZodUnion<readonly [ z.ZodString, z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>, z.ZodCustom<ArrayBuffer, ArrayBuffer>, z.ZodCustom<Buffer<ArrayBufferLike>, Buffer<ArrayBufferLike>> ]>, z.ZodCustom<URL, URL> ]>; filename: z.ZodOptional<z.ZodString>; mediaType: z.ZodString; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue$1, unknown, z.core.$ZodTypeInternals<JSONValue$1, unknown>>>>>; }, z.core.$strip> ]>> ]>; }, z.core.$strip>, z.ZodObject<{ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue$1, unknown, z.core.$ZodTypeInternals<JSONValue$1, unknown>>>>>; timeToLive: z.ZodOptional<z.ZodUnion<readonly [ z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt"> ]>>; keepDuringTruncation: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{ role: z.ZodLiteral<"assistant">; content: z.ZodUnion<readonly [ z.ZodString, z.ZodArray<z.ZodUnion<readonly [ z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue$1, unknown, z.core.$ZodTypeInternals<JSONValue$1, unknown>>>>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"reasoning">; text: z.ZodString; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue$1, unknown, z.core.$ZodTypeInternals<JSONValue$1, unknown>>>>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool-call">; toolCallId: z.ZodString; toolName: z.ZodString; input: z.ZodRecord<z.ZodString, z.ZodUnknown>; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue$1, unknown, z.core.$ZodTypeInternals<JSONValue$1, unknown>>>>>; providerExecuted: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip> ]>> ]>; }, z.core.$strip>, z.ZodObject<{ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue$1, unknown, z.core.$ZodTypeInternals<JSONValue$1, unknown>>>>>; timeToLive: z.ZodOptional<z.ZodUnion<readonly [ z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt"> ]>>; keepDuringTruncation: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>>, z.ZodIntersection<z.ZodObject<{ role: z.ZodLiteral<"tool">; content: z.ZodObject<{ type: z.ZodLiteral<"tool-result">; toolCallId: z.ZodString; toolName: z.ZodString; output: z.ZodArray<z.ZodDiscriminatedUnion<[ z.ZodObject<{ type: z.ZodLiteral<"json">; value: z.ZodType<JSONValue$1, unknown, z.core.$ZodTypeInternals<JSONValue$1, unknown>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"media">; data: z.ZodString; mediaType: z.ZodString; }, z.core.$strip> ]>>; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue$1, unknown, z.core.$ZodTypeInternals<JSONValue$1, unknown>>>>>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue$1, unknown, z.core.$ZodTypeInternals<JSONValue$1, unknown>>>>>; timeToLive: z.ZodOptional<z.ZodUnion<readonly [ z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt"> ]>>; keepDuringTruncation: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>> ]>, z.ZodObject<{ providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue$1, unknown, z.core.$ZodTypeInternals<JSONValue$1, unknown>>>>>; timeToLive: z.ZodOptional<z.ZodUnion<readonly [ z.ZodLiteral<"agentStep">, z.ZodLiteral<"userPrompt"> ]>>; keepDuringTruncation: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>>; type Message$1 = z.infer<typeof messageSchema$1>; type ToolName$1 = Tools.ToolName; export interface AgentDefinition { /** Unique identifier for this agent. Must contain only lowercase letters, numbers, and hyphens, e.g. 'code-reviewer' */ id: string; /** Version string (if not provided, will default to '0.0.1' and be bumped on each publish) */ version?: string; /** Publisher ID for the agent. Must be provided if you want to publish the agent. */ publisher?: string; /** Human-readable name for the agent */ displayName: string; /** AI model to use for this agent. Can be any model in OpenRouter: https://openrouter.ai/models */ model: ModelName; /** * https://openrouter.ai/docs/use-cases/reasoning-tokens * One of `max_tokens` or `effort` is required. * If `exclude` is true, reasoning will be removed from the response. Default is false. */ reasoningOptions?: { enabled?: boolean; exclude?: boolean; } & ({ max_tokens: number; } | { effort: "high" | "medium" | "low"; }); /** Tools this agent can use. */ toolNames?: (ToolName$1 | (string & {}))[]; /** Other agents this agent can spawn, like 'codebuff/file-picker@0.0.1'. * * Use the fully qualified agent id from the agent store, including publisher and version: 'codebuff/file-picker@0.0.1' * (publisher and version are required!) * * Or, use the agent id from a local agent file in your .agents directory: 'file-picker'. */ spawnableAgents?: string[]; /** The input schema required to spawn the agent. Provide a prompt string and/or a params object or none. * 80% of the time you want just a prompt string with a description: * inputSchema: { * prompt: { type: 'string', description: 'A description of what info would be helpful to the agent' } * } */ inputSchema?: { prompt?: { type: "string"; description?: string; }; params?: JsonObjectSchema; }; /** Whether to include conversation history from the parent agent in context. * * Defaults to false. * Use this if the agent needs to know all the previous messages in the conversation. */ includeMessageHistory?: boolean; /** How the agent should output a response to its parent (defaults to 'last_message') * * last_message: The last message from the agent, typically after using tools. * * all_messages: All messages from the agent, including tool calls and results. * * structured_output: Make the agent output a JSON object. Can be used with outputSchema or without if you want freeform json output. */ outputMode?: "last_message" | "all_messages" | "structured_output"; /** JSON schema for structured output (when outputMode is 'structured_output') */ outputSchema?: JsonObjectSchema; /** Prompt for when and why to spawn this agent. Include the main purpose and use cases. * * This field is key if the agent is intended to be spawned by other agents. */ spawnerPrompt?: string; /** Background information for the agent. Fairly optional. Prefer using instructionsPrompt for agent instructions. */ systemPrompt?: string; /** Instructions for the agent. * * IMPORTANT: Updating this prompt is the best way to shape the agent's behavior. * This prompt is inserted after each user input. */ instructionsPrompt?: string; /** Prompt inserted at each agent step. * * Powerful for changing the agent's behavior, but usually not necessary for smart models. * Prefer instructionsPrompt for most instructions. */ stepPrompt?: string; /** Programmatically step the agent forward and run tools. * * You can either yield: * - A tool call object with toolName and input properties. * - 'STEP' to run agent's model and generate one assistant message. * - 'STEP_ALL' to run the agent's model until it uses the end_turn tool or stops includes no tool calls in a message. * * Or use 'return' to end the turn. * * Example 1: * function* handleSteps({ agentStep, prompt, params}) { * const { toolResult } = yield { * toolName: 'read_files', * input: { paths: ['file1.txt', 'file2.txt'] } * } * yield 'STEP_ALL' * * // Optionally do a post-processing step here... * yield { * toolName: 'set_output', * input: { * output: 'The files were read successfully.', * }, * } * } * * Example 2: * handleSteps: function* ({ agentState, prompt, params }) { * while (true) { * yield { * toolName: 'spawn_agents', * input: { * agents: [ * { * agent_type: 'thinker', * prompt: 'Think deeply about the user request', * }, * ], * }, * } * const { stepsComplete } = yield 'STEP' * if (stepsComplete) break * } * } */ handleSteps?: (context: AgentStepContext) => Generator<ToolCall | "STEP" | "STEP_ALL", void, { agentState: AgentState; toolResult: ToolResultOutput[] | undefined; stepsComplete: boolean; }>; } interface AgentState { agentId: string; runId: string; parentId: string | undefined; /** The agent's conversation history: messages from the user and the assistant. */ messageHistory: Message$1[]; /** The last value set by the set_output tool. This is a plain object or undefined if not set. */ output: Record<string, any> | undefined; } interface AgentStepContext { agentState: AgentState; prompt?: string; params?: Record<string, any>; } type ToolCall<T extends ToolName$1 = ToolName$1> = { [K in T]: { toolName: K; input: Tools.GetToolParams<K>; includeToolCall?: boolean; }; }[T]; type ModelName = "openai/gpt-5" | "openai/gpt-5-chat" | "openai/gpt-5-mini" | "openai/gpt-5-nano" | "anthropic/claude-4-sonnet-20250522" | "anthropic/claude-opus-4.1" | "google/gemini-2.5-pro" | "google/gemini-2.5-flash" | "google/gemini-2.5-flash-lite" | "x-ai/grok-4-07-09" | "x-ai/grok-code-fast-1" | "qwen/qwen3-coder" | "qwen/qwen3-coder:nitro" | "qwen/qwen3-235b-a22b-2507" | "qwen/qwen3-235b-a22b-2507:nitro" | "qwen/qwen3-235b-a22b-thinking-2507" | "qwen/qwen3-235b-a22b-thinking-2507:nitro" | "qwen/qwen3-30b-a3b" | "qwen/qwen3-30b-a3b:nitro" | "deepseek/deepseek-chat-v3-0324" | "deepseek/deepseek-chat-v3-0324:nitro" | "deepseek/deepseek-r1-0528" | "deepseek/deepseek-r1-0528:nitro" | "moonshotai/kimi-k2" | "moonshotai/kimi-k2:nitro" | "z-ai/glm-4.5" | "z-ai/glm-4.5:nitro" | (string & {}); export interface LanguageConfig { extensions: string[]; wasmFile: string; queryText: string; parser?: Parser; query?: Query; language?: Language; } export interface RuntimeLanguageLoader { loadLanguage(wasmFile: string): Promise<Language>; initParser(): Promise<void>; } export declare const WASM_FILES: { readonly "tree-sitter-c-sharp.wasm": "tree-sitter-c-sharp.wasm"; readonly "tree-sitter-cpp.wasm": "tree-sitter-cpp.wasm"; readonly "tree-sitter-go.wasm": "tree-sitter-go.wasm"; readonly "tree-sitter-java.wasm": "tree-sitter-java.wasm"; readonly "tree-sitter-javascript.wasm": "tree-sitter-javascript.wasm"; readonly "tree-sitter-python.wasm": "tree-sitter-python.wasm"; readonly "tree-sitter-ruby.wasm": "tree-sitter-ruby.wasm"; readonly "tree-sitter-rust.wasm": "tree-sitter-rust.wasm"; readonly "tree-sitter-tsx.wasm": "tree-sitter-tsx.wasm"; readonly "tree-sitter-typescript.wasm": "tree-sitter-typescript.wasm"; }; export declare const languageTable: LanguageConfig[]; /** * Set a custom WASM directory for loading tree-sitter WASM files. * This can be useful for custom packaging or deployment scenarios. */ export declare function setWasmDir(dir: string): void; export declare function getWasmDir(): string | undefined; export declare function findLanguageConfigByExtension(filePath: string): LanguageConfig | undefined; export declare function createLanguageConfig(filePath: string, runtimeLoader: RuntimeLanguageLoader): Promise<LanguageConfig | undefined>; export declare function getLanguageConfig(filePath: string): Promise<LanguageConfig | undefined>; export declare const DEBUG_PARSING = false; export interface TokenCallerMap { [filePath: string]: { [token: string]: string[]; }; } export interface FileTokenData { tokenScores: { [filePath: string]: { [token: string]: number; }; }; tokenCallers: TokenCallerMap; } export declare function getFileTokenScores(projectRoot: string, filePaths: string[], readFile?: (filePath: string) => string | null): Promise<FileTokenData>; export declare function parseTokens(filePath: string, languageConfig: LanguageConfig, readFile?: (filePath: string) => string | null): { numLines: number; identifiers: string[]; calls: string[]; }; declare const toolCallPartSchema: z.ZodObject<{ type: z.ZodLiteral<"tool-call">; toolCallId: z.ZodString; toolName: z.ZodString; input: z.ZodRecord<z.ZodString, z.ZodUnknown>; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; providerExecuted: z.ZodOptional<z.ZodBoolean>; }, z.core.$strip>; type ToolCallPart = z.infer<typeof toolCallPartSchema>; declare const toolResultOutputSchema$1: z.ZodDiscriminatedUnion<[ z.ZodObject<{ type: z.ZodLiteral<"json">; value: z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"media">; data: z.ZodString; mediaType: z.ZodString; }, z.core.$strip> ]>; type ToolResultOutput$1 = z.infer<typeof toolResultOutputSchema$1>; declare const toolResultPartSchema: z.ZodObject<{ type: z.ZodLiteral<"tool-result">; toolCallId: z.ZodString; toolName: z.ZodString; output: z.ZodArray<z.ZodDiscriminatedUnion<[ z.ZodObject<{ type: z.ZodLiteral<"json">; value: z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"media">; data: z.ZodString; mediaType: z.ZodString; }, z.core.$strip> ]>>; providerOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodType<JSONValue, unknown, z.core.$ZodTypeInternals<JSONValue, unknown>>>>>; }, z.core.$strip>; type ToolResultPart = z.infer<typeof toolResultPartSchema>; declare const toolNames: readonly [ "add_subgoal", "add_message", "browser_logs", "code_search", "create_plan", "end_turn", "find_files", "read_docs", "read_files", "run_file_change_hooks", "run_terminal_command", "set_messages", "set_output", "spawn_agents", "spawn_agents_async", "spawn_agent_inline", "str_replace", "think_deeply", "update_subgoal", "web_search", "write_file" ]; declare const publishedTools: readonly [ "add_message", "code_search", "end_turn", "find_files", "read_docs", "read_files", "run_file_change_hooks", "run_terminal_command", "set_messages", "set_output", "spawn_agents", "str_replace", "think_deeply", "web_search", "write_file" ]; type ToolName$2 = (typeof toolNames)[number]; type PublishedToolName = (typeof publishedTools)[number]; export type CustomToolDefinition<N extends string = string, Args extends any = any, Input extends any = any> = { toolName: N; zodSchema: z.ZodType<Args, Input>; inputJsonSchema: JSONSchema.BaseSchema; description: string; endsAgentStep: boolean; exampleInputs: Input[]; execute: (params: Args) => Promise<ToolResultOutput$1[]>; }; /** * Creates a CustomToolDefinition object * * @param toolName the name of the tool * @param inputSchema a Zod4 schema describing the input of the tool. * @param description a description of the tool to be passed to the LLM. This should describe what the tool does and when to use it. * @param endsAgentStep whether the tool ends the agent step. If `true`, this will be used as a "stop sequence" for the LLM. i.e. it will not be able to call any other tools after this one in a single step and must wait for the tool results. Used for tools that give more information to the LLM. * @param exampleInputs an array of example inputs for the tool. * @param execute what to do when the tool is called. Can be either a sync or async. Must return an array of {@linkcode ToolResultOutput} * @returns a {@linkcode CustomToolDefinition} object */ export declare function getCustomToolDefinition<ToolName extends string, Args extends any, Input extends any>({ toolName, inputSchema, description, endsAgentStep, exampleInputs, execute, }: { toolName: ToolName extends ToolName$2 ? ToolName & { error: `Use overrideTools instead of custom tool for name: ${ToolName}`; } : ToolName; inputSchema: z.ZodType<Args, Input>; description: string; endsAgentStep?: boolean; exampleInputs?: Input[]; execute: (params: Args) => Promise<ToolResultOutput$1[]> | ToolResultOutput$1[]; }): CustomToolDefinition<ToolName, Args, Input>; interface FileTreeNode { name: string; type: "file" | "directory"; filePath: string; lastReadTime?: number; children?: FileTreeNode[]; } declare const subgoalSchema: z.ZodObject<{ objective: z.ZodOptional<z.ZodString>; status: z.ZodOptional<z.ZodEnum<{ NOT_STARTED: "NOT_STARTED"; IN_PROGRESS: "IN_PROGRESS"; COMPLETE: "COMPLETE"; ABORTED: "ABORTED"; }>>; plan: z.ZodOptional<z.ZodString>; logs: z.ZodArray<z.ZodString>; }, z.core.$strip>; type Subgoal = z.infer<typeof subgoalSchema>; declare const AgentStateSchema: z.ZodType<{ agentId: string; agentType: AgentTemplateType | null; agentContext: Record<string, Subgoal>; ancestorRunIds: string[]; runId?: string; subagents: AgentState$1[]; childRunIds: string[]; messageHistory: Message[]; stepsRemaining: number; creditsUsed: number; directCreditsUsed: number; output?: Record<string, any>; parentId?: string; }>; type AgentState$1 = z.infer<typeof AgentStateSchema>; declare const AgentOutputSchema: z.ZodDiscriminatedUnion<[ z.ZodObject<{ type: z.ZodLiteral<"structuredOutput">; value: z.ZodUnion<[ z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodNull ]>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"lastMessage">; value: z.ZodAny; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"allMessages">; value: z.ZodArray<z.ZodAny>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"error">; message: z.ZodString; }, z.core.$strip> ]>; type AgentOutput = z.infer<typeof AgentOutputSchema>; declare const agentTemplateTypeSchema: z.ZodEnum<{ base: "base"; base_lite: "base_lite"; base_max: "base_max"; base_experimental: "base_experimental"; claude4_gemini_thinking: "claude4_gemini_thinking"; superagent: "superagent"; base_agent_builder: "base_agent_builder"; ask: "ask"; planner: "planner"; dry_run: "dry_run"; thinker: "thinker"; file_picker: "file_picker"; file_explorer: "file_explorer"; researcher: "researcher"; reviewer: "reviewer"; agent_builder: "agent_builder"; example_programmatic: "example_programmatic"; }>; type AgentTemplateType = z.infer<typeof agentTemplateTypeSchema> | (string & {}); declare const SessionStateSchema: z.ZodObject<{ fileContext: z.ZodObject<{ projectRoot: z.ZodString; cwd: z.ZodString; fileTree: z.ZodArray<z.ZodCustom<FileTreeNode, FileTreeNode>>; fileTokenScores: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>; tokenCallers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>>; knowledgeFiles: z.ZodRecord<z.ZodString, z.ZodString>; userKnowledgeFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>; agentTemplates: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>; customToolDefinitions: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{ inputJsonSchema: z.ZodAny; endsAgentStep: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>; description: z.ZodOptional<z.ZodString>; exampleInputs: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodAny>>>; }, z.core.$strip>>>; codebuffConfig: z.ZodOptional<z.ZodObject<{ description: z.ZodOptional<z.ZodAny>; startupProcesses: z.ZodOptional<z.ZodArray<z.ZodObject<{ name: z.ZodString; command: z.ZodString; cwd: z.ZodOptional<z.ZodString>; enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>; stdoutFile: z.ZodOptional<z.ZodString>; stderrFile: z.ZodOptional<z.ZodString>; }, z.core.$strip>>>; fileChangeHooks: z.ZodOptional<z.ZodArray<z.ZodObject<{ name: z.ZodString; command: z.ZodString; cwd: z.ZodOptional<z.ZodString>; filePattern: z.ZodOptional<z.ZodString>; enabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>; }, z.core.$strip>>>; maxAgentSteps: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; baseAgent: z.ZodOptional<z.ZodString>; addedSpawnableAgents: z.ZodOptional<z.ZodArray<z.ZodString>>; removedSpawnableAgents: z.ZodOptional<z.ZodArray<z.ZodString>>; spawnableAgents: z.ZodOptional<z.ZodArray<z.ZodString>>; }, z.core.$loose>>; gitChanges: z.ZodObject<{ status: z.ZodString; diff: z.ZodString; diffCached: z.ZodString; lastCommitMessages: z.ZodString; }, z.core.$strip>; changesSinceLastChat: z.ZodRecord<z.ZodString, z.ZodString>; shellConfigFiles: z.ZodRecord<z.ZodString, z.ZodString>; systemInfo: z.ZodObject<{ platform: z.ZodString; shell: z.ZodString; nodeVersion: z.ZodString; arch: z.ZodString; homedir: z.ZodString; cpus: z.ZodNumber; }, z.core.$strip>; }, z.core.$strip>; mainAgentState: z.ZodType<{ agentId: string; agentType: AgentTemplateType | null; agentContext: Record<string, Subgoal>; ancestorRunIds: string[]; runId?: string; subagents: AgentState$1[]; childRunIds: string[]; messageHistory: Message[]; stepsRemaining: number; creditsUsed: number; directCreditsUsed: number; output?: Record<string, any>; parentId?: string; }, unknown, z.core.$ZodTypeInternals<{ agentId: string; agentType: AgentTemplateType | null; agentContext: Record<string, Subgoal>; ancestorRunIds: string[]; runId?: string; subagents: AgentState$1[]; childRunIds: string[]; messageHistory: Message[]; stepsRemaining: number; creditsUsed: number; directCreditsUsed: number; output?: Record<string, any>; parentId?: string; }, unknown>>; }, z.core.$strip>; type SessionState = z.infer<typeof SessionStateSchema>; export type RunState = { sessionState: SessionState; output: AgentOutput; }; export declare function initialSessionState(cwd: string, options: { projectFiles?: Record<string, string>; knowledgeFiles?: Record<string, string>; agentDefinitions?: AgentDefinition[]; customToolDefinitions?: CustomToolDefinition[]; maxAgentSteps?: number; }): Promise<{ fileContext: { projectRoot: string; cwd: string; fileTree: FileTreeNode[]; fileTokenScores: Record<string, Record<string, number>>; knowledgeFiles: Record<string, string>; agentTemplates: Record<string, any>; customToolDefinitions: Record<string, { inputJsonSchema: any; endsAgentStep: boolean; description?: string | undefined; exampleInputs?: Record<string, any>[] | undefined; }>; gitChanges: { status: string; diff: string; diffCached: string; lastCommitMessages: string; }; changesSinceLastChat: Record<string, string>; shellConfigFiles: Record<string, string>; systemInfo: { platform: string; shell: string; nodeVersion: string; arch: string; homedir: string; cpus: number; }; tokenCallers?: Record<string, Record<string, string[]>> | undefined; userKnowledgeFiles?: Record<string, string> | undefined; codebuffConfig?: { [x: string]: unknown; maxAgentSteps: number; description?: any; startupProcesses?: { name: string; command: string; enabled: boolean; cwd?: string | undefined; stdoutFile?: string | undefined; stderrFile?: string | undefined; }[] | undefined; fileChangeHooks?: { name: string; command: string; enabled: boolean; cwd?: string | undefined; filePattern?: string | undefined; }[] | undefined; baseAgent?: string | undefined; addedSpawnableAgents?: string[] | undefined; removedSpawnableAgents?: string[] | undefined; spawnableAgents?: string[] | undefined; } | undefined; }; mainAgentState: { agentId: string; agentType: AgentTemplateType | null; agentContext: Record<string, Subgoal>; ancestorRunIds: string[]; runId?: string; subagents: AgentState$1[]; childRunIds: string[]; messageHistory: Message[]; stepsRemaining: number; creditsUsed: number; directCreditsUsed: number; output?: Record<string, any>; parentId?: string; }; }>; export declare function generateInitialRunState({ cwd, projectFiles, knowledgeFiles, agentDefinitions, customToolDefinitions, maxAgentSteps, }: { cwd: string; projectFiles?: Record<string, string>; knowledgeFiles?: Record<string, string>; agentDefinitions?: AgentDefinition[]; customToolDefinitions?: CustomToolDefinition[]; maxAgentSteps?: number; }): Promise<RunState>; export declare function withAdditionalMessage({ runState, message, }: { runState: RunState; message: Message; }): RunState; export declare function withMessageHistory({ runState, messages, }: { runState: RunState; messages: Message[]; }): RunState; /** * Applies overrides to an existing session state, allowing specific fields to be updated * even when continuing from a previous run. */ export declare function applyOverridesToSessionState(cwd: string, baseSessionState: SessionState, overrides: { projectFiles?: Record<string, string>; knowledgeFiles?: Record<string, string>; agentDefinitions?: AgentDefinition[]; customToolDefinitions?: CustomToolDefinition[]; maxAgentSteps?: number; }): Promise<SessionState>; declare const $toolParams: { add_message: { toolName: "add_message"; endsAgentStep: true; parameters: z.ZodObject<{ role: z.ZodEnum<{ user: "user"; assistant: "assistant"; }>; content: z.ZodString; }, z.core.$strip>; outputs: z.ZodTuple<[ ], null>; }; add_subgoal: { toolName: "add_subgoal"; endsAgentStep: false; parameters: z.ZodObject<{ id: z.ZodString; objective: z.ZodString; status: z.ZodEnum<{ NOT_STARTED: "NOT_STARTED"; IN_PROGRESS: "IN_PROGRESS"; COMPLETE: "COMPLETE"; ABORTED: "ABORTED"; }>; plan: z.ZodOptional<z.ZodString>; log: z.ZodOptional<z.ZodString>; }, z.core.$strip>; outputs: z.ZodTuple<[ z.ZodObject<{ type: z.ZodLiteral<"json">; value: z.ZodObject<{ message: z.ZodString; }, z.core.$strip>; }, z.core.$strip> ], null>; }; browser_logs: { toolName: "browser_logs"; endsAgentStep: true; parameters: z.ZodObject<{ type: z.ZodString; url: z.ZodString; waitUntil: z.ZodOptional<z.ZodEnum<{ networkidle0: "networkidle0"; load: "load"; domcontentloaded: "domcontentloaded"; }>>; }, z.core.$strip>; outputs: z.ZodTuple<[ z.ZodObject<{ type: z.ZodLiteral<"json">; value: z.ZodObject<{ success: z.ZodBoolean; error: z.ZodOptional<z.ZodString>; logs: z.ZodArray<z.ZodObject<{ type: z.ZodEnum<{ error: "error"; warning: "warning"; info: "info"; debug: "debug"; verbose: "verbose"; }>; message: z.ZodString; timestamp: z.ZodNumber; location: z.ZodOptional<z.ZodString>; stack: z.ZodOptional<z.ZodString>; category: z.ZodOptional<z.ZodString>; level: z.ZodOptional<z.ZodNumber>; source: z.ZodDefault<z.ZodEnum<{ tool: "tool"; browser: "browser"; }>>; }, z.core.$strip>>; logFilter: z.ZodOptional<z.ZodObject<{ types: z.ZodOptional<z.ZodArray<z.ZodEnum<{ error: "error"; warning: "warning"; info: "info"; debug: "debug"; verbose: "verbose"; }>>>; minLevel: z.ZodOptional<z.ZodNumber>; categories: z.ZodOptional<z.ZodArray<z.ZodString>>; }, z.core.$strip>>; networkEvents: z.ZodOptional<z.ZodArray<z.ZodObject<{ url: z.ZodString; method: z.ZodString; status: z.ZodOptional<z.ZodNumber>; errorText: z.ZodOptional<z.ZodString>; timestamp: z.ZodNumber; }, z.core.$strip>>>; metrics: z.ZodOptional<z.ZodObject<{ loadTime: z.ZodNumber; memoryUsage: z.ZodNumber; jsErrors: z.ZodNumber; networkErrors: z.ZodNumber; ttfb: z.ZodOptional<z.ZodNumber>; lcp: z.ZodOptional<z.ZodNumber>; fcp: z.ZodOptional<z.ZodNumber>; domContentLoaded: z.ZodOptional<z.ZodNumber>; sessionDuration: z.ZodOptional<z.ZodNumber>; }, z.core.$strip>>; screenshots: z.ZodOptional<z.ZodObject<{ pre: z.ZodOptional<z.ZodObject<{ type: z.ZodLiteral<"image">; source: z.ZodObject<{ type: z.ZodLiteral<"base64">; media_type: z.ZodLiteral<"image/jpeg">; data: z.ZodString; }, z.core.$strip>; }, z.core.$strip>>; post: z.ZodObject<{ type: z.ZodLiteral<"image">; source: z.ZodObject<{ type: z.ZodLiteral<"base64">; media_type: z.ZodLiteral<"image/jpeg">; data: z.ZodString; }, z.core.$strip>; }, z.core.$strip>; }, z.core.$strip>>; }, z.core.$strip>; }, z.core.$strip> ], null>; }; code_search: { toolName: "code_search"; endsAgentStep: true; parameters: z.ZodObject<{ pattern: z.ZodString; flags: z.ZodOptional<z.ZodString>; cwd: z.ZodOptional<z.ZodString>; maxResults: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; }, z.core.$strip>; outputs: z.ZodTuple<[ z.ZodObject<{ type: z.ZodLiteral<"json">; value: z.ZodUnion<readonly [ z.ZodObject<{ stdout: z.ZodString; stderr: z.ZodOptional<z.ZodString>; exitCode: z.ZodOptional<z.ZodNumber>; message: z.ZodString; }, z.core.$strip>, z.ZodObject<{ errorMessage: z.ZodString; }, z.core.$strip> ]>; }, z.core.$strip> ], null>; }; create_plan: { toolName: "create_plan"; endsAgentStep: false; parameters: z.ZodObject<{ path: z.ZodString; plan: z.ZodString; }, z.core.$strip>; outputs: z.ZodTuple<[ z.ZodObject<{ type: z.ZodLiteral<"json">; value: z.ZodUnion<readonly [ z.ZodObject<{ file: z.ZodString; message: z.ZodString; unifiedDiff: z.ZodString; }, z.core.$strip>, z.ZodObject<{ file: z.ZodString; errorMessage: z.ZodString; patch: z.ZodOptional<z.ZodString>; }, z.core.$strip> ]>; }, z.core.$strip> ], null>; }; end_turn: { toolName: "end_turn"; endsAgentStep: true; parameters: z.ZodObject<{}, z.core.$strip>; outputs: z.ZodTuple<[ ], null>; }; find_files: { toolName: "find_files"; endsAgentStep: true; parameters: z.ZodObject<{ prompt: z.ZodString; }, z.core.$strip>; outputs: z.ZodTuple<[ z.ZodObject<{ type: z.ZodLiteral<"json">; value: z.ZodUnion<readonly [ z.ZodArray<z.ZodUnion<readonly [ z.ZodObject<{ path: z.ZodString; content: z.ZodString; referencedBy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>; }, z.core.$strip>, z.ZodObject<{ path: z.ZodString; contentOmittedForLength: z.ZodLiteral<true>; }, z.core.$strip> ]>>, z.ZodObject<{ message: z.ZodString; }, z.core.$strip> ]>; }, z.core.$strip> ], null>; }; read_docs: { too