import type { AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
/** Options for {@link useAgentExecutionActions}. */
export interface UseAgentExecutionActionsOptions {
    /**
     * Called after any lifecycle action (cancel, terminate, pause, resume)
     * succeeds. Receives the updated execution returned by the server.
     * Useful for triggering a refetch so the UI reflects the new phase.
     */
    readonly onSuccess?: (execution: AgentExecution) => void;
}
/** Return value of {@link useAgentExecutionActions}. */
export interface UseAgentExecutionActionsReturn {
    /** Cancel a running execution gracefully (PENDING or IN_PROGRESS only). */
    readonly cancel: (reason?: string) => Promise<AgentExecution | null>;
    /** Terminate a running execution immediately (PENDING or IN_PROGRESS only). */
    readonly terminate: (reason?: string) => Promise<AgentExecution | null>;
    /** Pause a running execution (PENDING or IN_PROGRESS only). */
    readonly pause: (reason?: string) => Promise<AgentExecution | null>;
    /** Resume a paused execution. */
    readonly resume: () => Promise<AgentExecution | null>;
    /**
     * Stop a running execution with progressive escalation.
     *
     * The first call gracefully {@link cancel}s — the agent gets a chance to
     * checkpoint and clean up. If the user presses Stop again because the run
     * is still winding down, this escalates to a forceful {@link terminate}.
     * The escalation state is keyed to the execution id, so a fresh execution
     * always starts from a graceful cancel.
     *
     * @param reason - Optional audit message recorded with the cancel/terminate.
     */
    readonly stop: (reason?: string) => Promise<AgentExecution | null>;
    /** `true` while any action is in flight. */
    readonly isSubmitting: boolean;
    /** Error from the last failed action, or `null`. */
    readonly error: Error | null;
    /** Reset `error` to `null`. */
    readonly clearError: () => void;
}
/**
 * Behavior hook that encapsulates agent execution lifecycle actions.
 *
 * The agent-execution analog of {@link useWorkflowExecutionActions}: each
 * action calls the corresponding RPC and returns the updated execution, or
 * `null` on failure (with `error` populated).
 *
 * Pass `null` for `executionId` to disable all actions (they become no-ops
 * that return `null`).
 *
 * Headless by design — embedders can wire a custom Stop/Cancel control
 * directly to this hook. The session chat uses it via
 * {@link useSessionConversation}'s `stop` / `isStoppable`.
 *
 * @example
 * ```tsx
 * const actions = useAgentExecutionActions(executionId, {
 *   onSuccess: () => refetch(),
 * });
 *
 * // A single Stop button that escalates on repeat press.
 * <button onClick={() => actions.stop()} disabled={actions.isSubmitting}>
 *   Stop
 * </button>
 * ```
 */
export declare function useAgentExecutionActions(executionId: string | null, options?: UseAgentExecutionActionsOptions): UseAgentExecutionActionsReturn;
//# sourceMappingURL=useAgentExecutionActions.d.ts.map