export type AgentTab = 'activity' | 'files' | 'channels' | 'profile' | 'reminders'; export declare const AGENT_TABS: readonly AgentTab[]; export declare const DEFAULT_TAB: AgentTab; export declare const AGENT_FILES_SEGMENT = "files"; export interface UrlLocation { agentId: string | null; tab: AgentTab | null; } /** * Parse `/`, `/agents/`, `/agents//` into URL state. * - Bare `/` → both null. * - `/agents/` → tab null (AgentBootstrap will replaceState to `activity`). * - Unknown tab → null (validation layer will normalize). * - Anything else (trailing slashes, extra segments) → null/null (treated as `/`). */ export declare function parseLocation(pathname: string): UrlLocation; export declare function buildPath(loc: { agentId: string | null; tab: AgentTab | null; }): string; export interface AgentFileLocation { agentId: string; filePath: string | null; } /** * Parse an agent Files browse path into `{ agentId, filePath }`, or `null` for * any non-files path (so the caller falls back to tab routing). */ export declare function parseAgentFilePath(pathname: string): AgentFileLocation | null; export declare function buildAgentFilePath(agentId: string, filePath: string | null): string; /** * Build the backend raw-bytes URL for an agent home file (img src / iframe / * open-raw target). Per-segment encoding keeps `/` literal, matching the * server's decode of the `` tail. Mirrors `buildKbRawPath`'s shape. */ export declare function buildAgentFileRawPath(agentId: string, filePath: string): string; export interface KbLocation { id: string | null; filePath: string | null; } /** * Parse a kb browse path into `{ id, filePath }`, or `null` for any * non-kb path (so the caller falls back to agent routing). */ export declare function parseKbPath(pathname: string): KbLocation | null; export declare function buildKbPath(loc: KbLocation): string; /** * Build the backend raw-bytes URL for a tracked file (iframe / img / asset * target). Per-segment encoding keeps `/` literal as path separators, matching * the server's decode of the `/` tail. */ export declare function buildKbRawPath(id: string, filePath: string): string; /** * Inputs `reconcileLocation` needs from the current web state. We accept a * minimal shape so the function is trivially testable without constructing the * full route context. */ export interface ReconcileSnapshot { agents: ReadonlyArray<{ feishu?: { connected?: boolean; }; id: string; slack?: { connected?: boolean; }; }>; agentStatuses: ReadonlyArray<{ agentId: string; currentItemId?: string; queueDepth: number; }>; selectedAgentId?: string; } /** * Decide whether the current URL state needs a replaceState canonicalization. * Returns the desired target, or `null` when no change is needed. * * - Unknown agentId → reset to `/` (next pass re-picks). * - No agentId in URL → pick most-recently-active / selected / first. * - Valid agentId, no tab → fill in DEFAULT_TAB (or 'profile' if not-connected). * - Otherwise → no-op. * * Sidebar/mobile-nav clicks navigate to `/agents/:id` (no tab), so this * function handles the default-tab selection. Explicit tab clicks from the * header nav set a specific tab and are NOT overridden here — a not-connected * agent can visit Activity and see the empty state. */ export declare function reconcileLocation(snapshot: ReconcileSnapshot, current: UrlLocation): UrlLocation | null; //# sourceMappingURL=url-routes.d.ts.map