import { type ChildProcess } from "node:child_process";
import type { HubLogSink } from "../tui/hub-log.js";
import type { SourceConfig, SourceRuntimeStatus } from "./source-types.js";
export type SpawnStdioSource = (options: {
    command: string;
    args: string[];
    cwd: string;
    env: NodeJS.ProcessEnv;
}) => ChildProcess;
/** Bridges parsed source stdout into the hub agent session (after Task 5). */
export interface SourceHostInboundBridge {
    submitFromSource: (sourceName: string, agentId: string, text: string) => Promise<void>;
}
export interface SourceConfigMutationTarget {
    resourceId: string;
    configResourceId: string;
    configPath?: string;
    name: string;
    agentId: string;
}
export interface SourceHostOptions {
    cwd: string;
    spawnStdio?: SpawnStdioSource;
    inbound?: SourceHostInboundBridge;
    loadSources?: () => SourceConfig[];
    logs?: HubLogSink;
    sourceMutators?: {
        pause: (resourceId: string, target?: SourceConfigMutationTarget) => void;
        resume: (resourceId: string, target?: SourceConfigMutationTarget) => void;
        remove: (resourceId: string, target?: SourceConfigMutationTarget) => void;
    };
}
export declare class SourceHost {
    private readonly cwd;
    private readonly spawnStdio;
    private readonly inbound;
    private readonly loadSources;
    private readonly logs;
    private readonly sourceMutators;
    private readonly statuses;
    private readonly children;
    private readonly stdoutUtf8Decoders;
    private readonly stdoutLineBuffers;
    private readonly stdoutLineChains;
    private readonly sourceMetaByResourceId;
    private stopping;
    constructor(options: SourceHostOptions);
    getStatuses(): SourceRuntimeStatus[];
    private setStatus;
    private log;
    private attachChildDiagnostics;
    private appendStdoutLines;
    private enqueueStdoutLine;
    private processStdoutLine;
    private startOne;
    start(): Promise<void>;
    private killChild;
    private requireKnownResourceId;
    private requireMatchingResourceIds;
    private mutateMatchingConfigEntries;
    pauseSource(resourceId: string): Promise<void>;
    restartSource(resourceId: string): Promise<void>;
    removeSource(resourceId: string): Promise<void>;
    stop(): Promise<void>;
}
//# sourceMappingURL=source-host.d.ts.map