/**
 * The skill-aware `SubscriptionDispatcher`. Sits between the event router
 * and the existing registries: receives a `(subscription, event)` pair,
 * resolves the target, and invokes it in the right way.
 *
 * Step 14 wires the subagent target end-to-end:
 *   - synthesize a `SubagentTask` with `task.context.trigger` (shape
 *     matches issue #515) and a canned `task.prompt` that tells the model
 *     a trigger fired and what its payload looks like;
 *   - hand the task to a `SubagentExecutorLike` to run.
 *
 * Command and tool targets are stubbed - plan open question 4 still owes
 * a concrete re-injection design for command targets, and tool targets
 * are explicitly out of scope per plan step 8.
 *
 * See `agents/2026-05-20-skills-unification-plan.md` step 14.
 */
import type { SubscriptionDispatcher } from '../events/event-router.js';
import type { Event, Subscription } from '../events/types.js';
import type { SubagentResult, SubagentTask } from '../subagents/types.js';
import type { DevelopmentMode } from '../types/core.js';
export interface SubagentExecutorLike {
    execute(task: SubagentTask): Promise<SubagentResult>;
}
export type ExecutorFactory = (mode: DevelopmentMode) => SubagentExecutorLike;
export interface UnsupportedTargetLogger {
    (subscription: Subscription, reason: string): void;
}
/**
 * Wraps `CheckpointManager.saveCheckpoint` so the dispatcher can be
 * exercised in isolation. Returns the checkpoint id (used in surfaced
 * activity messages so the user can revert).
 */
export interface Checkpointer {
    create(reason: string): Promise<string>;
}
/**
 * Summary the dispatcher emits after each triggered run, intended for the
 * daemon's activity surface: a chat message via the message queue and an
 * OS notification. The dispatcher is registry-agnostic, so it only knows
 * what it just did - it's up to the daemon to fan this out into UI.
 */
export interface TriggeredRunActivity {
    subscription: Subscription;
    event: Event;
    mode: DevelopmentMode;
    result: SubagentResult;
    checkpointId?: string;
    durationMs: number;
}
export type ActivityListener = (activity: TriggeredRunActivity) => void;
export interface SkillDispatcherOptions {
    /**
     * Build a subagent executor for a given mode. The dispatcher calls this
     * per dispatch so it can choose `headless` for unattended runs and
     * `plan` for `confirm: true` subscriptions without mutating shared
     * executor state across concurrent dispatches.
     */
    buildExecutor: ExecutorFactory;
    /**
     * Called when an event targets a kind the dispatcher does not (yet)
     * support. Defaults to a no-op; production wiring routes this through
     * `logError` from the message queue.
     */
    onUnsupportedTarget?: UnsupportedTargetLogger;
    /**
     * Snapshot file state before the triggered run starts. The dispatcher
     * skips this for `confirm: true` subscriptions (plan-mode runs make no
     * file mutations to revert).
     */
    checkpointer?: Checkpointer;
    /**
     * Called after each completed triggered run, regardless of success.
     * Production wiring fans this out to chat-message injection and the
     * `triggeredRunComplete` OS notification.
     */
    onActivity?: ActivityListener;
}
export declare class SkillDispatcher implements SubscriptionDispatcher {
    private readonly options;
    constructor(options: SkillDispatcherOptions);
    dispatch(subscription: Subscription, event: Event): Promise<void>;
    private dispatchAgent;
}
/**
 * Pick the development mode the triggered run should execute in. Default
 * is `headless` (autonomous, no foreground prompts). `confirm: true` opts
 * the subscription into `plan` mode, which surfaces what the subagent
 * would have done without applying any mutations.
 */
export declare function modeForSubscription(subscription: Subscription): DevelopmentMode;
/**
 * Build the `SubagentTask` for a triggered subagent run. Exported so the
 * registrar's spec - and later the daemon - can inspect the exact shape
 * without standing up a full router.
 */
export declare function buildTriggeredTask(subscription: Subscription, event: Event): SubagentTask;
//# sourceMappingURL=dispatcher.d.ts.map