/**
 * Shared session event type definitions for Guild CLI
 *
 * These types match the backend event system from the messaging refactor (PR #819).
 * All CLI commands should import these types instead of defining their own.
 */
export type TaskStatus = 'CREATED' | 'DISPATCHED' | 'STARTED' | 'RUNNING' | 'WAITING' | 'DONE' | 'ERROR' | 'INTERRUPTED';
export interface BaseTaskFields {
    id: string;
    status: TaskStatus;
    created_at: string;
    updated_at: string;
}
/** Serialized agent reference returned by the backend */
export interface AgentRef {
    id: string;
    name: string;
    full_name: string;
}
export interface SessionTaskAgentItem extends BaseTaskFields {
    agent: AgentRef;
    parent_task_id: string | null;
}
export interface SessionTaskToolItem extends BaseTaskFields {
    tool_name: string;
    tool_call_id: string;
    parent_task: SessionTaskItem | null;
}
export type SessionTaskItem = SessionTaskAgentItem | SessionTaskToolItem;
export interface SessionTaskAgent extends SessionTaskAgentItem {
    parent_task: SessionTaskItem | null;
}
export interface SessionTaskTool extends SessionTaskToolItem {
    parent_task: SessionTaskItem | null;
}
export type SessionTask = SessionTaskAgent | SessionTaskTool;
/**
 * Internal task names that should be hidden from user-facing displays.
 * These are coordination/UI mechanisms, not meaningful tasks to show.
 *
 * - ui_notify: Internal notification dispatch
 * - ui_prompt: User input prompts (shown via dedicated UI, not task panel)
 * - __submit__: Internal message submission
 * - guild_credentials_request: Credential configuration prompts (shown via dedicated UI)
 */
export declare const FILTERED_TASK_NAMES: Set<string>;
/** Check if a task/tool name should be filtered from display */
export declare function isFilteredTaskName(name: string): boolean;
/** Check if task is an agent task (has agent property) */
export declare function isAgentTask(task: SessionTask): task is SessionTaskAgent;
/** Check if task is a tool task (has tool_name property) */
export declare function isToolTask(task: SessionTask): task is SessionTaskTool;
/** Extract display name from an agent reference */
export declare function getAgentName(agent: AgentRef | null | undefined): string;
/**
 * Check if a task's agent matches a target agent identifier.
 *
 * Target format: "@scope/owner~name" (e.g. "@guildai/guildai~agent-builder") or simple name ("assistant")
 * AgentRef format: { name: "agent-builder", full_name: "guildai~agent-builder", ... }
 */
export declare function matchesAgent(taskAgent: AgentRef | null | undefined, targetAgent: string): boolean;
/** Get display name for a task - agent name or tool name */
export declare function getTaskDisplayName(task: SessionTask): string;
/** Resolve the display name for an event's originating agent. */
export declare function getEventAgentName(event: {
    task?: SessionTaskItem | SessionTask;
}, fallbackName?: string): string;
/** Get task type label */
export declare function getTaskTypeLabel(task: SessionTask): string;
export interface BaseEvent {
    id: string;
    created_at: string;
    updated_at: string;
    task?: SessionTaskItem;
}
export interface UserMessageEvent extends BaseEvent {
    type: 'user_message';
    author_id: string;
    content: string;
}
export interface RuntimeStartEvent extends BaseEvent {
    type: 'runtime_start';
    content: Record<string, unknown>;
}
export interface RuntimeRunningEvent extends BaseEvent {
    type: 'runtime_running';
}
export interface RuntimeWaitingEvent extends BaseEvent {
    type: 'runtime_waiting';
}
export interface RuntimeErrorEvent extends BaseEvent {
    type: 'runtime_error';
    content: string;
    stack: string | null;
}
export interface RuntimeDoneEvent extends BaseEvent {
    type: 'runtime_done';
    content: Record<string, unknown>;
}
export interface TextContent {
    type: 'text';
    data: string;
}
export interface UnknownContent {
    type: string;
    data?: unknown;
}
export interface MultipartContent {
    type: 'multipart/mixed';
    parts: UnknownContent[];
}
export interface ResponseStreamContent {
    type: 'application/guild-response-stream';
    stream_id: string;
    sequence: number;
    status: 'streaming' | 'done' | 'continued' | 'aborted';
    text: string;
    is_delta?: boolean;
}
export type AgentNotificationMessageContent = TextContent | MultipartContent | ResponseStreamContent;
export interface AgentNotificationMessageEvent extends BaseEvent {
    type: 'agent_notification_message';
    content: AgentNotificationMessageContent;
}
export interface AgentNotificationProgressEvent extends BaseEvent {
    type: 'agent_notification_progress';
    content: TextContent;
}
export interface AgentNotificationErrorEvent extends BaseEvent {
    type: 'agent_notification_error';
    content: TextContent;
}
export interface AgentConsoleEvent extends BaseEvent {
    type: 'agent_console';
    level: 'debug' | 'info' | 'warn' | 'error';
    content: string;
}
export interface TriggerMessageEvent extends BaseEvent {
    type: 'trigger_message';
    content: {
        type: 'text';
        data: string;
    };
}
export interface SystemErrorEvent extends BaseEvent {
    type: 'system_error';
    content: TextContent;
    details?: Record<string, unknown>;
}
export interface LlmStartEvent extends BaseEvent {
    type: 'llm_start';
    provider: string;
    payload: Record<string, unknown>;
}
export interface LlmDoneEvent extends BaseEvent {
    type: 'llm_done';
    status_code: number;
    body: string;
}
/** Agent info as returned in install request */
export interface RequestedAgent {
    id: string;
    name: string;
    description: string;
}
/** Agent install request - when an agent wants to install another agent */
export interface AgentInstallRequestEvent extends BaseEvent {
    type: 'agent_install_request';
    requested_agent: RequestedAgent;
    agent: AgentRef | null;
    is_fulfilled: boolean;
    installed_agent: {
        id: string;
    } | null;
}
/** Credentials request - when an agent needs third-party service access */
export interface CredentialsRequestEvent extends BaseEvent {
    type: 'credentials_request';
    service: 'GITHUB' | 'SLACK' | 'LINEAR';
    agent: AgentRef | null;
    is_fulfilled: boolean;
}
/** Check if event is an unfulfilled agent install request */
export declare function isUnfulfilledAgentInstallRequest(event: SessionEvent): event is AgentInstallRequestEvent;
/** Check if event is an unfulfilled credentials request */
export declare function isUnfulfilledCredentialsRequest(event: SessionEvent): event is CredentialsRequestEvent;
/** Check if an agent notification message is a transient response stream draft. */
export declare function isResponseStreamEvent(event: SessionEvent): event is AgentNotificationMessageEvent & {
    content: ResponseStreamContent;
};
/** Check if a response stream event carries the final generated text. */
export declare function isDoneResponseStreamEvent(event: SessionEvent): event is AgentNotificationMessageEvent & {
    content: ResponseStreamContent & {
        status: 'done';
    };
};
/** Apply a response-stream payload to the accumulated display text. */
export declare function applyResponseStreamText(currentText: string, content: ResponseStreamContent): string;
/** Extract display text from notification content. */
export declare function getAgentNotificationText(event: AgentNotificationMessageEvent): string;
/** Check if an event belongs to the root task or has no task context. */
export declare function isRootTaskEvent(event: SessionEvent): boolean;
export interface InterruptedEvent extends BaseEvent {
    type: 'interrupted';
    interrupted_at: string;
    interrupted_by_id: string;
}
export type SessionEvent = UserMessageEvent | RuntimeStartEvent | RuntimeRunningEvent | RuntimeWaitingEvent | RuntimeErrorEvent | RuntimeDoneEvent | AgentNotificationMessageEvent | AgentNotificationProgressEvent | AgentNotificationErrorEvent | AgentConsoleEvent | TriggerMessageEvent | SystemErrorEvent | LlmStartEvent | LlmDoneEvent | AgentInstallRequestEvent | CredentialsRequestEvent | InterruptedEvent;
export interface Session {
    id: string;
    workspace_id?: string;
    created_at?: string;
    session_url?: string;
}
//# sourceMappingURL=session-events.d.ts.map