export interface UiSettings { /** * Where the app actually is, when it is not where the config says. * * Overrides the origin of every target while keeping the config's routes, * recipes and sign-in hook, which is the difference between this and the * zero-config `--url`. */ baseUrl: string | null; /** * The project directory whose calls to action may be clicked, or null. * * Still the directory rather than a bare boolean, even though the file now * lives inside that directory: `.lookout/` gets copied, and worktree tooling * copies it wholesale. A `true` would carry one checkout's yes into another, * and navigation discovery actuates what it plans, destructive controls * included. That is a promise about one repository on one dev stack, not a * preference about the reader. */ navigationFor: string | null; /** * The project a server started in THIS directory should serve, or null to * serve this directory itself. * * Written when somebody points the settings panel somewhere else, and read * at startup, which is what makes the choice survive a restart: `lookout ui` * still resolves the directory it was launched in the way every verb does, * and then asks that directory where it was last told to look. */ projectDir: string | null; /** * Which model each AI judges this project with, keyed by its tool key. * * Per project rather than per browser, unlike the tool selector, because it * is not a preference about the reader: the ledger caches a verdict against * the model that gave it, so judging this project with a different model is a * different body of evidence about this repository. An absent key means * lookout's own default, which the settings panel reports rather than * guessing at. */ judgeModels: Record; } export declare const EMPTY_SETTINGS: UiSettings; /** * A model name that can be handed to a CLI as an argument. * * The value reaches a spawn as the word after `--model`, so the one thing it * must not be able to do is arrive as a flag of its own: a leading dash would * let a stored setting turn into an option nobody typed. Everything real is * letters, digits and the three separators the vendors' names use, which is * narrow enough to say no to the rest without a list of models that goes stale. */ export declare function validModel(value: string): string | null; export declare function settingsPath(projectDir: string): string; export declare function loadSettings(projectDir: string): Promise; export declare function saveSettings(projectDir: string, s: UiSettings): Promise; export declare function updateSettings(projectDir: string, mutate: (settings: UiSettings) => T | Promise): Promise<{ settings: UiSettings; result: T; }>; /** * Write down which project a server launched HERE should serve. * * Read-modify-write rather than a save of what the session is holding: the * session's settings belong to the project being served, and this file belongs * to the directory the server was started in. Once those are two different * places, saving one over the other is how a base URL ends up in a repository * that never had one. */ export declare function rememberProject(launchDir: string, projectDir: string | null): Promise; /** * Whether this project's calls to action may be clicked on the next run. * * One function because two places ask: the settings view the page paints its * toggle from, and the spawn that decides whether to pass --navigation. Two * spellings of the same comparison is how a page comes to show a control that * is on while the run it starts is off. */ export declare function navigationConsented(s: UiSettings, projectDir: string | null): boolean; /** A base URL is only usable if it parses and names a host. */ export declare function validBaseUrl(value: string): string | null;