import { type ProfileEntry } from './manifest.js'; import { type BindingId, type BindingResolution, type RawTerminalInput } from '../keybindings/index.js'; declare const PROFILE_MENU_ACTIONS: readonly ["crtr.profile.menu.abort", "crtr.profile.menu.up", "crtr.profile.menu.down", "crtr.profile.menu.select", "crtr.profile.menu.accept-default", "crtr.profile.menu.slot.1", "crtr.profile.menu.slot.2", "crtr.profile.menu.slot.3", "crtr.profile.menu.slot.4", "crtr.profile.menu.slot.5", "crtr.profile.menu.slot.6", "crtr.profile.menu.slot.7", "crtr.profile.menu.slot.8", "crtr.profile.menu.slot.9", "crtr.profile.menu.create", "crtr.profile.menu.search-existing", "crtr.profile.menu.use-root", "crtr.profile.menu.set-default", "crtr.profile.menu.add-directory", "crtr.profile.menu.unpin"]; declare const PROFILE_SEARCH_ACTIONS: readonly ["crtr.profile.search.abort", "crtr.profile.search.back", "crtr.profile.search.pick", "crtr.profile.search.up", "crtr.profile.search.down", "crtr.profile.search.delete"]; export declare function resolveProfileMenuAction(bindings: BindingResolution, raw: RawTerminalInput): (typeof PROFILE_MENU_ACTIONS)[number] | null; export declare function resolveProfileSearchAction(bindings: BindingResolution, raw: RawTerminalInput): (typeof PROFILE_SEARCH_ACTIONS)[number] | null; /** Whether a profile's purview covers `cwd` (cwd at/under one of its project * dirs, or a project dir under cwd — the workspace-root case). Exported for * `crtr profile default set`, which rejects pinning a profile that doesn't * cover cwd (the selector would ignore/self-heal such a pin anyway). */ export declare function profileCoversCwd(entry: ProfileEntry, cwd: string): boolean; /** Select the profile a node about to boot at `cwd` should run under. * * 1. `explicitProfile` present → resolve id/name via `loadProfileManifest`. If * its manifest does not already cover `cwd` and the session is interactive, * offer to add `cwd` to its purview (default yes). Bump `last_used_at`, * return the id. * 1b. Else, a per-cwd PINNED default (menu `d`) that still covers `cwd` is * auto-picked outright — interactive and headless alike, no prompt (that is * what "default" means). Interactive prints a breadcrumb naming it and how * to change it. `forcePicker` (`crtr --pick-profile`) bypasses the pin to * re-open the menu. A stale pin (profile gone / no longer covering) is * cleared and ignored. * 2. Else, if EXACTLY ONE profile's project dir IS `cwd` (you're at a project * root, unambiguously one owner), auto-pick it with no prompt — the * strongest signal. If SEVERAL profiles claim `cwd` exactly, it's genuinely * ambiguous: interactive → menu among them + create; headless → MRU. * 3. Else, among profiles whose project list otherwise COVERS `cwd` (cwd sits * in a subdir of, or a workspace above, one of their project dirs): * - Interactive: prompt with a MENU of those covering profiles + "create * a new profile here", BEFORE pi boots (no root option — the directory * is covered). Default is the MRU covering profile. * - Non-interactive: auto-pick the MRU covering profile, no prompt. * 4. Else — nothing covers cwd walking all the way up. Interactive: prompt to * create a profile here, select an existing profile (a searchable list of * every profile, for when you started somewhere none of them cover and * can't recall the exact name — the pick then offers to adopt cwd), or use * the root profile. Non-interactive (no TTY): * default to the root profile and print the recovery instruction to STDERR — * never stdout, which the caller may be piping. */ export declare function selectProfileForCwd(cwd: string, explicitProfile?: string | null, forcePicker?: boolean): Promise; export {};