/**
 * AG-UI protocol TypeScript types.
 */
type AguiEventType = "RUN_STARTED" | "RUN_FINISHED" | "RUN_ERROR" | "TEXT_MESSAGE_START" | "TEXT_MESSAGE_CONTENT" | "TEXT_MESSAGE_END" | "TOOL_CALL_START" | "TOOL_CALL_ARGS" | "TOOL_CALL_END" | "TOOL_CALL_RESULT" | "STATE_SNAPSHOT" | "CUSTOM";
interface RunStartedEvent {
    type: "RUN_STARTED";
    threadId: string;
    runId: string;
}
interface RunFinishedEvent {
    type: "RUN_FINISHED";
    threadId: string;
    runId: string;
}
interface RunErrorEvent {
    type: "RUN_ERROR";
    message: string;
}
interface TextMessageStartEvent {
    type: "TEXT_MESSAGE_START";
    messageId: string;
    role: string;
}
interface TextMessageContentEvent {
    type: "TEXT_MESSAGE_CONTENT";
    messageId: string;
    delta: string;
}
interface TextMessageEndEvent {
    type: "TEXT_MESSAGE_END";
    messageId: string;
}
interface ToolCallStartEvent {
    type: "TOOL_CALL_START";
    toolCallId: string;
    toolCallName: string;
    parentMessageId: string;
    parentToolCallId?: string;
}
interface ToolCallArgsEvent {
    type: "TOOL_CALL_ARGS";
    toolCallId: string;
    delta: string;
}
interface ToolCallEndEvent {
    type: "TOOL_CALL_END";
    toolCallId: string;
}
interface ToolCallResultEvent {
    type: "TOOL_CALL_RESULT";
    toolCallId: string;
    messageId: string;
    content: string;
    role: string;
    parentToolCallId?: string;
}
interface StateSnapshotEvent {
    type: "STATE_SNAPSHOT";
    snapshot: Record<string, unknown>;
}
interface CustomEvent {
    type: "CUSTOM";
    name: string;
    value: Record<string, unknown>;
}
type AguiEvent = RunStartedEvent | RunFinishedEvent | RunErrorEvent | TextMessageStartEvent | TextMessageContentEvent | TextMessageEndEvent | ToolCallStartEvent | ToolCallArgsEvent | ToolCallEndEvent | ToolCallResultEvent | StateSnapshotEvent | CustomEvent;
interface AguiToolCallFunction {
    name: string;
    arguments: string;
}
interface AguiToolCall {
    id: string;
    type: "function";
    function: AguiToolCallFunction;
}
interface AguiMessage {
    id: string;
    role: "user" | "assistant" | "tool" | "system";
    content: string;
    toolCalls?: AguiToolCall[];
    toolCallId?: string;
}
interface RunAgentInput {
    threadId: string;
    runId: string;
    repositoryId?: string;
    messages: AguiMessage[];
    tools: unknown[];
    context: unknown[];
    state: Record<string, unknown>;
    forwardedProps: Record<string, unknown>;
}

interface InterruptPayload {
    action: string;
    file: string;
    description: string;
}
declare const AGENT_TOOL_NAMES: Set<string>;
declare function isAgentTool(name: string): boolean;
interface TextBlock {
    id: string;
    type: "text";
    text: string;
}
interface ToolCallBlock {
    id: string;
    type: "tool_call";
    toolCallId: string;
    toolName: string;
    toolArgs: string;
    toolArgsParsed: Record<string, unknown> | null;
    toolStatus: "streaming" | "executing" | "done" | "error";
    toolResult: {
        stdout: string;
        stderr: string;
        returnCode: number;
    } | null;
    toolResultRaw: string;
    subAgentToolCalls?: ToolCallBlock[];
    elapsedSeconds?: number;
}
interface InterruptBlock {
    id: string;
    type: "interrupt";
    interrupt: InterruptPayload;
}
interface ErrorBlock {
    id: string;
    type: "error";
    message: string;
}
type MessageBlock = TextBlock | ToolCallBlock | InterruptBlock | ErrorBlock;
interface ChatMessage {
    id: string;
    role: "user" | "assistant";
    blocks: MessageBlock[];
    timestamp: number;
}
type AnalysisStateSnapshot = Record<string, unknown> | null;

type WikiPageType = "overview" | "module" | "entity" | "workflow" | "dd";
type WikiPageKind = "overview" | "concept" | "component" | "integration" | "workflow" | "entity" | "operations";
type WikiPageStatus = "generated" | "fallback" | "partial";
type WikiJobStage = "scanning" | "planning" | "exploring" | "synthesizing" | "reviewing" | "publishing" | "guides" | "done";
type WikiTaskKind = "plan" | "explore" | "synthesize" | "review" | "publish";
type WikiTaskStatus = "queued" | "running" | "completed" | "failed" | "skipped";
type WikiArtifactConfidence = "high" | "medium" | "low";
type WikiSectionType = "markdown" | "facts" | "references" | "navigation" | "diagram" | "hero" | "callouts" | "capabilities";
interface WikiCodeReference {
    label: string;
    path: string;
    line?: number;
    endLine?: number;
    symbol?: string;
    nodeId?: string;
    relation?: string;
    description?: string;
}
interface WikiDiagramSpec {
    id: string;
    title: string;
    kind: "structure" | "dependency" | "sequence" | "workflow";
    mermaid: string;
    sourceNodeIds: string[];
    sourceEdgeKeys: string[];
}
interface WikiSection {
    id: string;
    title: string;
    type: WikiSectionType;
    sourceNodeIds?: string[];
    sourceEdgeKeys?: string[];
    markdown?: string;
    items?: string[];
    references?: WikiCodeReference[];
    relatedPageIds?: string[];
    diagram?: WikiDiagramSpec;
}
interface WikiCollection {
    id: string;
    title: string;
    pageIds: string[];
}
interface WikiDocMapPage {
    id: string;
    title: string;
    kind: WikiPageKind;
    pageType: WikiPageType;
    path: string;
    goal: string;
    audience: string;
    moduleId?: string;
    candidateFiles: string[];
    candidateNodeIds: string[];
    relatedPageIds: string[];
    requiredEvidenceTypes: string[];
}
interface WikiDocMap {
    generatedAt: string;
    rootPageId: string;
    pages: WikiDocMapPage[];
}
interface WikiResearchArtifact {
    id: string;
    pageId: string;
    summary: string;
    businessPurposeHypotheses: string[];
    keyFiles: string[];
    keySymbols: WikiCodeReference[];
    entryPoints: WikiCodeReference[];
    dependencies: string[];
    externalBoundaries: string[];
    candidateWorkflows: string[];
    confidence: WikiArtifactConfidence;
    sourceNodeIds: string[];
    sourceEdgeKeys: string[];
    notes: string[];
    diagramCandidates: WikiDiagramSpec[];
}
interface WikiReviewResult {
    pageId: string;
    status: "approved" | "partial";
    warnings: string[];
    diagramErrors: string[];
    missingEvidenceSections: string[];
}
interface WikiTaskRecord {
    id: string;
    kind: WikiTaskKind;
    pageId?: string;
    title: string;
    status: WikiTaskStatus;
    startedAt?: string;
    finishedAt?: string;
    error?: string;
    warnings?: string[];
    artifactIds?: string[];
}
interface WikiGenerationJob {
    repositoryId?: string;
    sourcePath: string;
    stage: WikiJobStage;
    startedAt: string;
    updatedAt: string;
    finishedAt?: string;
    pageCount: number;
    partialPageCount: number;
    taskCounts: Record<WikiTaskKind, {
        queued: number;
        running: number;
        completed: number;
        failed: number;
        skipped: number;
    }>;
    tasks: WikiTaskRecord[];
    warnings: string[];
}
interface WikiPageSummary {
    id: string;
    title: string;
    pageType: WikiPageType;
    kind?: WikiPageKind;
    status?: WikiPageStatus;
    path: string;
    summary: string;
    displayTitle?: string;
    displaySummary?: string;
    audience?: string;
    domain?: string;
    componentType?: string;
    readNext?: string[];
    generationWarnings?: string[];
    diagramErrors?: string[];
    sourceNodeIds: string[];
    sourceEdgeKeys: string[];
    primaryFiles: string[];
    childPageIds: string[];
    markdownPath?: string;
}
interface WikiPage extends WikiPageSummary {
    generatedAt: string;
    sections: WikiSection[];
    researchArtifactIds?: string[];
    reviewWarnings?: string[];
}
interface WikiNavigationNode {
    id: string;
    title: string;
    pageId: string;
    pageType: WikiPageType;
    path?: string;
    children: WikiNavigationNode[];
}
interface WikiManifest {
    version: number;
    generatedAt: string;
    rootPageId: string;
    navigation: WikiNavigationNode;
    pages: WikiPageSummary[];
    collections?: WikiCollection[];
}

export { AGENT_TOOL_NAMES, type AguiEvent, type AguiEventType, type AguiMessage, type AguiToolCall, type AguiToolCallFunction, type AnalysisStateSnapshot, type ChatMessage, type CustomEvent, type ErrorBlock, type InterruptBlock, type InterruptPayload, type MessageBlock, type RunAgentInput, type RunErrorEvent, type RunFinishedEvent, type RunStartedEvent, type StateSnapshotEvent, type TextBlock, type TextMessageContentEvent, type TextMessageEndEvent, type TextMessageStartEvent, type ToolCallArgsEvent, type ToolCallBlock, type ToolCallEndEvent, type ToolCallResultEvent, type ToolCallStartEvent, type WikiArtifactConfidence, type WikiCodeReference, type WikiCollection, type WikiDiagramSpec, type WikiDocMap, type WikiDocMapPage, type WikiGenerationJob, type WikiJobStage, type WikiManifest, type WikiNavigationNode, type WikiPage, type WikiPageKind, type WikiPageStatus, type WikiPageSummary, type WikiPageType, type WikiResearchArtifact, type WikiReviewResult, type WikiSection, type WikiSectionType, type WikiTaskKind, type WikiTaskRecord, type WikiTaskStatus, isAgentTool };
