import type { TeepeeConfig, ExecutionMode } from './config.js'; import type { Database as DatabaseType } from 'better-sqlite3'; import type { SandboxRunner, SandboxOptions } from './sandbox/runner.js'; import { type StreamEvent } from './stream-parsers.js'; export interface JobResult { output: string; exitCode: number; timedOut: boolean; stderr?: string; error?: string; signal?: NodeJS.Signals | null; } /** * Build the stdin context for an agent invocation. * * Format: * [teepee/v1] * [system] * * * [messages] * * [current] * */ export interface ArtifactContextEntry { id: number; kind: string; title: string; current_version: number; } export declare function buildContext(db: DatabaseType, agentName: string, topicId: number, triggerMessageId: number, language: string, config: TeepeeConfig, basePath: string, topicArtifacts?: ArtifactContextEntry[], artifactOpResults?: string, artifactWriteError?: string, userInputResults?: string): string; export interface RunAgentOptions { command: string; context: string; /** * Idle timeout in milliseconds. If no stdout/stderr chunk is received for * this many ms, the runner sends SIGTERM, waits killGraceMs, and then * SIGKILL. A falsy value disables idle-timeout enforcement for this run. */ timeoutMs?: number; /** * Grace window in ms between SIGTERM and SIGKILL when the idle timeout fires. * Defaults to 5000. */ killGraceMs?: number; cwd: string; executionMode?: ExecutionMode; sandboxRunner?: SandboxRunner; sandboxOptions?: SandboxOptions; onChunk?: (chunk: string) => void; /** Called for each StreamEvent extracted from provider output. */ onActivity?: (event: StreamEvent) => void; outputDir?: string; } /** * Run an agent command, piping context to stdin and streaming stdout. * Supports both host and sandboxed execution modes. */ export declare function runAgent(commandOrOpts: string | RunAgentOptions, context?: string, timeoutMs?: number, cwd?: string, onChunk?: (chunk: string) => void): Promise; //# sourceMappingURL=executor.d.ts.map