import type { AgentTool } from "@caupulican/pi-agent-core"; import type { TruncationResult } from "@caupulican/pi-agent-core/node"; import { type Static, Type } from "typebox"; import type { ToolDefinition } from "../extensions/types.ts"; import { type PythonRuntimeOutcome } from "../python-runtime.ts"; export declare const DEFAULT_PYTHON_TIMEOUT_SECONDS = 30; export declare const MAX_PYTHON_TIMEOUT_SECONDS = 300; export declare const MAX_PYTHON_OUTPUT_BYTES = 200000; declare const pythonSchema: Type.TObject<{ code: Type.TOptional; scriptPath: Type.TOptional; args: Type.TOptional>; cwd: Type.TOptional; timeoutSeconds: Type.TOptional; maxOutputBytes: Type.TOptional; }>; export type PythonToolInput = Static; export interface PythonToolDetails { mode: "code" | "script"; cwd: string; uvPath: string; pythonPath: string; scriptPath?: string; args: string[]; exitCode: number | null; signal: string | null; timedOut: boolean; stdoutTruncation?: TruncationResult; stderrTruncation?: TruncationResult; stdoutOutputPath?: string; stderrOutputPath?: string; stdoutOutputError?: string; stderrOutputError?: string; } export interface PythonExecutionRequest { python: string; args: string[]; cwd: string; stdin?: string; timeoutMs: number; signal?: AbortSignal; env: NodeJS.ProcessEnv; onStdout: (chunk: Buffer) => void; onStderr: (chunk: Buffer) => void; } export interface PythonExecutionResult { exitCode: number | null; reason: "exited" | "aborted" | "timeout"; signal: string | null; } export interface PythonOperations { exec(request: PythonExecutionRequest): Promise; } export interface PythonToolOptions { resolveRuntime?: () => Promise; operations?: PythonOperations; /** Additional process environment resolved from the final execution cwd. */ environment?: (cwd: string) => NodeJS.ProcessEnv; /** Owner-only variables that must never reach model-controlled Python. */ omitEnvironmentVariables?: readonly string[]; /** Override only for tests or embedded runtimes; production uses the process work directory. */ outputDirectory?: string; } export declare function resolvePythonToolPath(base: string, requested: string, platform?: NodeJS.Platform): string; export declare function createPythonToolDefinition(baseCwd: string, options?: PythonToolOptions): ToolDefinition; export declare function createPythonTool(baseCwd: string, options?: PythonToolOptions): AgentTool; export {}; //# sourceMappingURL=python.d.ts.map