// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { CoderProviderConfig } from "./CoderProviderConfig";

/**
 * Coder-specific slice of [`AppState`].
 *
 * Only frontend-side affordance pointers — the actual session
 * content lives under
 * `<XDG_DATA_HOME>/moon-ide/coder-sessions/<project-slug>/<id>.jsonl`,
 * not here. See [`crate::session`] / `crates/moon-coder/src/sessions.rs`
 * for the on-disk format.
 */
export type CoderAppState = { 
/**
 * Last-opened session id **per workspace folder**. Restored on
 * launch when the user revisits a folder: the active folder's
 * entry decides which session the panel mounts. Per the
 * multi-session design, every project gets its own slot so a
 * re-open of folder X resumes X's last session even if the
 * user has worked in folder Y in between. Cleared per-folder
 * when the matching session gets deleted; an `open_session`
 * call updates that folder's entry.
 */
last_session_by_folder: { [key in string]: string }, 
/**
 * Slug of the "standard" model driving the main agent loop +
 * every sub-agent. Empty means "use the hardcoded default"
 * (`DEFAULT_STANDARD_MODEL` in `crates/moon-coder/src/defaults.rs`).
 * Format mirrors what the HF Inference Providers router accepts
 * in the request body — bare `Qwen/Qwen3.5-397B-A17B`, or
 * suffixed with `:scaleway` / `:fastest` / etc.
 */
standard_model: string, 
/**
 * Slug of the "cheap" model used for auto-rename, branch-name
 * suggester, commit-message suggester, compaction summary, and
 * folder-summary onboarding. Same format as `standard_model`.
 * Empty = `DEFAULT_CHEAP_MODEL`.
 */
cheap_model: string, 
/**
 * Organisation slug to send as the `X-HF-Bill-To` header on every
 * inference call. Empty = bill the user's personal account.
 * The user must be a paying member of the org and the org must
 * have inference credits, otherwise the router rejects the
 * request — we surface the router's error verbatim.
 */
bill_to: string, 
/**
 * User-added OpenAI-compatible providers (OpenRouter, locally
 * hosted vLLM / Ollama / llama.cpp, …). The HF route is
 * always implicitly available and is **not** in this list —
 * it's the default when [`active_provider`] is `None`.
 *
 * Each entry carries its own `standard_model` / `cheap_model`
 * because slugs aren't portable between hosts (an OpenRouter
 * `anthropic/claude-3.5-sonnet` doesn't resolve on HF and vice
 * versa). Switching the active provider swaps the picks the
 * runner uses with it.
 *
 * API keys do **not** live here. They're stored in the OS
 * keyring under `service=moon-ide`, `account=coder-provider:<id>`
 * — moving them out of `state.json` keeps secrets off disk in a
 * file the user might commit by accident.
 *
 * [`active_provider`]: Self::active_provider
 */
providers: Array<CoderProviderConfig>, 
/**
 * Id of the currently active provider — `None` for the
 * implicit HF route. When `Some(id)`, must match one of
 * [`providers`](Self::providers)`.id`; the runner falls back
 * to HF on a mismatch (e.g. the entry was deleted out of
 * band) and a `tracing::warn!` notes the orphan.
 */
active_provider: string | null, 
/**
 * Per-slug context-window caps in tokens. Slug =
 * [`CoderModels::context_window`]'s lookup key — the full
 * wire model id including any `:provider` suffix
 * (`Qwen/Qwen3.5-397B-A17B:scaleway`) for HF or the bare
 * id (`anthropic/claude-opus-4`) for user providers. When
 * the map carries an entry for the slug the runner returns
 * `min(catalog_window, cap)` instead of the raw catalog
 * number.
 *
 * Use case: a model that technically advertises a 1M-token
 * window but performs measurably worse past ~250k. Capping
 * here arms compaction earlier and keeps the usage ring
 * honest without forcing the user to remember to switch
 * models.
 *
 * Empty map = no caps. Caps for slugs no longer in the
 * active picks are kept on disk so flipping back picks the
 * cap up again — there's no GC because the storage cost is
 * trivial and dropping live entries on a model swap would
 * be more surprising than helpful.
 */
context_window_overrides: { [key in string]: number }, };
