import { type QueryKey } from "@tanstack/react-query"; import { type Location, type NavigateOptions } from "react-router"; import { type AgentChatViewTransitionOptions } from "./chat-view-transition.js"; export interface SemanticNavigationCommandEnvelope { key: string; command: NavigateCommand; } export interface UseSemanticNavigationStateOptions { state: NavigationState | null | undefined; navigationKeys?: readonly string[]; commandKeys?: readonly string[]; browserTabId?: string; commandQueryKey?: QueryKey; requestSource?: string; commandRefetchInterval?: number | false; enabled?: boolean; keepalive?: boolean; writeDebounceMs?: number; getCommandDedupKey?: (command: NavigateCommand) => string; onCommand: (command: NavigateCommand) => void | Promise; onError?: (error: unknown) => void; } export interface UseSemanticNavigationStateResult { navigationState: NavigationState | null; command: SemanticNavigationCommandEnvelope | null | undefined; commandQueryKey: QueryKey; clearCommand: () => Promise; } export interface AgentRouteLocation { pathname: string; search: string; hash: string; searchParams: URLSearchParams; location: Location; } export interface WorkspaceAppRouteTarget { type: "workspace-app"; path: string; } export type AgentRouteTarget = string | WorkspaceAppRouteTarget; export interface UseAgentRouteStateOptions { getNavigationState: (location: AgentRouteLocation) => NavigationState | null | undefined; getCommandPath: (command: NavigateCommand) => AgentRouteTarget | null | undefined; navigationKey?: string; commandKey?: string; browserTabId?: string; requestSource?: string; writeGlobalNavigation?: boolean; readGlobalCommandFallback?: boolean; commandQueryKey?: QueryKey; refetchInterval?: number | false; enabled?: boolean; keepalive?: boolean; writeDebounceMs?: number; getCommandDedupKey?: (command: NavigateCommand) => string; navigateOptions?: NavigateOptions | ((command: NavigateCommand) => NavigateOptions | undefined); agentChatViewTransition?: boolean | AgentChatViewTransitionOptions | ((command: NavigateCommand, path: string) => boolean | AgentChatViewTransitionOptions | undefined); onNavigate?: (command: NavigateCommand, path: string) => void; onError?: (error: unknown) => void; } export interface UseAgentRouteStateResult extends UseSemanticNavigationStateResult { } export declare function useSemanticNavigationState(options: UseSemanticNavigationStateOptions): UseSemanticNavigationStateResult; export declare function useAgentRouteState(options: UseAgentRouteStateOptions): UseAgentRouteStateResult;