/**
 * Pi Connector
 * Subprocess connector for pi.dev CLI — a minimal terminal coding harness.
 * Spawns `pi` with --print mode and parses JSON output.
 */
import type { TrajectoryStep } from '../../../types/index.js';
import { SubprocessConnector } from '../../../services/connectors/subprocess/SubprocessConnector.js';
import type { ConnectorAuth, ConnectorRequest, ConnectorResponse, ConnectorProgressCallback, ConnectorRawEventCallback, SubprocessConfig } from '../../../services/connectors/types.js';
/**
 * Configuration options for Pi connector
 * Passed via agent.connectorConfig in agent-health.config.ts
 */
export interface PiConnectorConfig {
    env?: Record<string, string>;
    /** Path to pi package to load (e.g., ./observio-sample-agent/pi-package) */
    packagePath?: string;
    /** Pi model override (e.g., 'claude-sonnet-4-5') */
    model?: string;
    /** Working directory for pi */
    workingDir?: string;
    /** Timeout in ms (default: 600000 = 10 minutes) */
    timeout?: number;
    /** Additional CLI args to pass to pi */
    additionalArgs?: string[];
}
/**
 * Pi CLI Connector
 * Invokes pi.dev as a subprocess for agent evaluation
 */
export declare class PiConnector extends SubprocessConnector {
    readonly type: "pi";
    readonly name = "Pi (pi.dev)";
    traceContext: {
        propagateEnv: boolean;
        serviceName: string;
    };
    private piOutputBuffer;
    private piThinkingBuffer;
    private piTextBuffer;
    constructor(config?: Partial<SubprocessConfig>);
    /**
     * Build prompt for Pi
     */
    buildPayload(request: ConnectorRequest): string;
    /**
     * Parse Pi streaming output (JSON format)
     * Pi's --mode json produces NDJSON lines
     */
    protected parseStreamingOutput(chunk: string, trajectory: TrajectoryStep[], onProgress?: ConnectorProgressCallback): void;
    /**
     * Parse a single JSON event from Pi output.
     *
     * Pi's --mode json NDJSON format uses these event types:
     *  - session, agent_start, agent_end — lifecycle (ignored)
     *  - turn_start, turn_end — turn boundaries
     *  - message_start / message_end — full message with content blocks
     *  - message_update — streaming deltas with assistantMessageEvent
     */
    private parsePiEvent;
    /**
     * Parse final output for Pi
     */
    parseResponse(data: {
        stdout: string;
        stderr: string;
        exitCode: number;
    }): TrajectoryStep[];
    /**
     * Flush remaining buffers when the subprocess stream ends.
     */
    protected onBeforeStreamEnd(trajectory: TrajectoryStep[], onProgress?: ConnectorProgressCallback): void;
    /**
     * Reset state and apply connectorConfig
     */
    execute(endpoint: string, request: ConnectorRequest, auth: ConnectorAuth, onProgress?: ConnectorProgressCallback, onRawEvent?: ConnectorRawEventCallback): Promise<ConnectorResponse>;
    /**
     * Health check - verify pi command exists
     */
    healthCheck(endpoint: string, auth: ConnectorAuth): Promise<boolean>;
}
/** Singleton instance for registry */
export declare const piConnector: PiConnector;
/**
 * Create a Pi connector with the Agent Health package pre-configured
 */
export declare function createAgentHealthPiConnector(packagePath?: string): PiConnector;
//# sourceMappingURL=PiConnector.d.ts.map