import type { ControlPlanePendingApproval, ControlPlaneSessionEventEnvelope } from '../../api/types.js';
export type ClientSharedSessionActivity = Extract<ControlPlaneSessionEventEnvelope, {
    type: 'session.event';
}>['activities'][number];
export type ClientSharedAgentActivityStatus = {
    label: string;
    detail?: string;
    startedAt: string;
    tone: 'info' | 'warning';
};
export type ClientSharedSessionLatestUpdate = {
    label: string;
    detail?: string;
    tone: 'info' | 'success' | 'warning' | 'error';
};
export type ClientSharedRecentEditDiff = {
    id: string;
    runId: string;
    step?: number;
    toolCallId: string;
    path: string;
    action?: string;
    patch: string;
    truncated: boolean;
    timestamp: string;
};
type ActivityOf<ActivityType extends ClientSharedSessionActivity['type']> = Extract<ClientSharedSessionActivity, {
    type: ActivityType;
}>;
type PendingApprovalActivity = ActivityOf<'tool.approval_requested'> | ActivityOf<'tool.approval_resolved'>;
type WorkspaceChangedActivity = ActivityOf<'loop.finished'> | ActivityOf<'tool.completed'> | ActivityOf<'direct_shell.completed'>;
export type ClientSharedSessionPlan = ActivityOf<'plan.updated'>;
export type ClientSharedSessionActivityEffects = {
    onAssistantStream?: (activity: ActivityOf<'assistant.stream'>, liveStatus: string | undefined) => void;
    onRunStarted?: (activity: ActivityOf<'loop.started'> | ActivityOf<'direct_shell.started'>, liveStatus: string | undefined) => void;
    onRunFinished?: (activity: ActivityOf<'loop.finished'> | ActivityOf<'direct_shell.completed'>, liveStatus: string | undefined) => void;
    onRecentEditDiff?: (diff: ClientSharedRecentEditDiff, activity: ActivityOf<'tool.completed'>) => void;
    onPlanUpdated?: (activity: ClientSharedSessionPlan) => void;
    onPlanCleared?: () => void;
    onLiveStatus?: (activity: ClientSharedSessionActivity, liveStatus: string | undefined) => void;
    onCurrentActivityChanged?: (activity: ClientSharedAgentActivityStatus | undefined) => void;
    onPendingApprovalChanged?: (activity: PendingApprovalActivity) => void;
    onWorkspaceChanged?: (activity: WorkspaceChangedActivity) => void;
};
/**
 * Owns client-side effects derived from API-provided session activities.
 *
 * Core/live owns the activity vocabulary and facts. This service owns only the
 * frontend-neutral consequences shared by web-v2 and cli-v2, including active
 * plan lifetime: a plan is visible after `plan.updated` and cleared when a new
 * run starts or the current run finishes.
 */
export declare class ClientSharedSessionActivityService {
    private static readonly effectHandlers;
    private static readonly liveStatusHandlers;
    private static readonly latestUpdateHandlers;
    static applyActivity(activity: ClientSharedSessionActivity, effects: ClientSharedSessionActivityEffects): void;
    static resolveLatestUpdate(activity: ClientSharedSessionActivity): ClientSharedSessionLatestUpdate | undefined;
    static projectRecentEditDiff(activity: ActivityOf<'tool.completed'>): ClientSharedRecentEditDiff | undefined;
    private static formatLiveStatus;
    static formatPendingApprovalLabel(approval: NonNullable<ControlPlanePendingApproval>): string | undefined;
    static formatToolLabel(activity: ClientSharedSessionActivity): string;
    static formatToolName(activity: ClientSharedSessionActivity): string;
    static formatToolFallbackLabel(activity: Extract<ClientSharedSessionActivity, {
        type: 'tool.fallback';
    }>): string | undefined;
    static formatStepDetail(step: number | undefined): string | undefined;
    static createThinkingStatus(startedAt?: string): ClientSharedAgentActivityStatus;
    static formatElapsed(startedAt: string, now?: Date): string;
    static resolveRunOutcomeTone(outcome: string): ClientSharedSessionLatestUpdate['tone'];
    private static formatStep;
    private static applyLiveStatus;
}
export {};
//# sourceMappingURL=session-activity-service.d.ts.map