import type { McpServerUsageInput, ResourceRef } from "@stigmer/sdk";
import type { AgentResolution } from "../agent";
import { type UseWorkspaceEntriesReturn } from "../workspace";
import { type UseSessionVariablesReturn } from "../execution/useSessionVariables";
import type { SessionComposerSubmitContext } from "../composer";
import { type HarnessOption } from "../models/harness";
import { type UseSessionConversationReturn } from "./useSessionConversation";
import { type UsePersistedModelReturn } from "./usePersistedModel";
/** Options for {@link useSessionPageFlow}. */
export interface UseSessionPageFlowOptions {
    /** Session ID to load and manage. */
    readonly sessionId: string;
    /** Organization slug. */
    readonly org: string;
}
/** Return value of {@link useSessionPageFlow}. */
export interface UseSessionPageFlowReturn {
    /** Full conversation state from `useSessionConversation`. */
    readonly conv: UseSessionConversationReturn;
    /**
     * Session's execution harness (read-only, derived from session spec).
     *
     * Use this to:
     * - Filter the model selector for follow-up messages
     * - Render a harness badge in the session header
     *
     * Defaults to `"native"` while the session is loading.
     */
    readonly harness: HarnessOption;
    /** Persisted model selection: `[modelId, setModelId]`. */
    readonly model: UsePersistedModelReturn;
    /** Currently selected agent reference (derived from session, or overridden by user). */
    readonly agentRef: ResourceRef | null;
    /** Update the agent reference for future follow-ups. */
    readonly setAgentRef: (ref: ResourceRef | null) => void;
    /** Current agent resolution state. */
    readonly resolution: AgentResolution | null;
    /** Update the agent resolution. */
    readonly setResolution: (r: AgentResolution | null) => void;
    /** Active MCP server configurations for follow-ups. */
    readonly mcpServerUsages: McpServerUsageInput[];
    /** Update MCP server configurations. */
    readonly setMcpServerUsages: (usages: McpServerUsageInput[]) => void;
    /** Active skill references for follow-ups. */
    readonly skillRefs: ResourceRef[];
    /** Update skill references. */
    readonly setSkillRefs: (refs: ResourceRef[]) => void;
    /** Workspace entries manager (synced from session on load). */
    readonly workspace: UseWorkspaceEntriesReturn;
    /** Session variables (per-execution secrets) manager. */
    readonly sessionVariables: UseSessionVariablesReturn;
    /**
     * Submit a follow-up message. Handles agent override resolution
     * (if the user changed the agent mid-session) and delegates to
     * `conv.sendFollowUp` with all managed state.
     */
    readonly handleSubmit: (message: string, model?: string, context?: SessionComposerSubmitContext) => Promise<void>;
    /**
     * The most relevant execution for sidebar display — the active
     * streaming execution, or the last completed one.
     */
    readonly displayExecution: UseSessionConversationReturn["activeStreamExecution"];
    /**
     * All executions for widget display (completed + active stream).
     */
    readonly allExecutions: UseSessionConversationReturn["completedExecutions"];
    /**
     * Sandbox workspace root for file path normalization, or `undefined`
     * when the session has no git-repo workspace entries.
     */
    readonly sandboxWorkspaceRoot: string | undefined;
}
/**
 * Orchestrates the session page experience.
 *
 * Composes `useSessionConversation` with agent resolution, workspace
 * synchronization, model persistence, and follow-up submission logic.
 * Returns everything a session page needs to render its UI without
 * duplicating domain orchestration.
 *
 * Framework-agnostic — works identically in Next.js, Vite, Tauri, or
 * any React environment. The consumer provides layout, error states,
 * and loading skeletons.
 *
 * @example
 * ```tsx
 * const flow = useSessionPageFlow({ sessionId: "ses_abc", org: "acme" });
 *
 * if (flow.conv.isLoading) return <Spinner />;
 * if (flow.conv.loadError) return <ErrorView error={flow.conv.loadError} />;
 *
 * return (
 *   <>
 *     <MessageThread
 *       executions={flow.conv.completedExecutions}
 *       activeStreamExecution={flow.conv.activeStreamExecution}
 *       sandboxWorkspaceRoot={flow.sandboxWorkspaceRoot}
 *     />
 *     <SessionComposer
 *       onSubmit={flow.handleSubmit}
 *       isSubmitting={flow.conv.isSending}
 *       disabled={!flow.conv.canSendFollowUp}
 *       workspace={flow.workspace}
 *       agentRef={flow.agentRef}
 *       onAgentRefChange={flow.setAgentRef}
 *       onAgentResolutionChange={flow.setResolution}
 *       defaultModelId={flow.model[0]}
 *       onModelChange={flow.model[1]}
 *     />
 *   </>
 * );
 * ```
 */
export declare function useSessionPageFlow(options: UseSessionPageFlowOptions): UseSessionPageFlowReturn;
//# sourceMappingURL=useSessionPageFlow.d.ts.map