/**
 * Router management -- named, task-typed allowlists of (harness, model/tier,
 * account) that constrain an Agent Router decision. A router is a
 * generalization of a profile (a profile ≡ a router pinned to one harness and
 * one account). Stored as YAML files under ~/.agents/routers/.
 *
 * Routers resolve as a layered resource (project > user > system, like other
 * resources -- see resources.ts) but are always CREATED in the user layer,
 * mirroring profiles.ts.
 */
/** Per-harness allowlist inside a router: eligible models/tiers + linked accounts. */
export interface RouterHarnessAllowlist {
    /** Concrete model ids and/or tier tokens (cheap|default|best|ultra) eligible under this router. */
    models: string[];
    /** Durable credential accounts eligible under this router. Routing is limited to these. */
    accounts?: string[];
}
/** A named router: a reusable, task-typed allowlist of harnesses x models/tiers x accounts. */
export interface Router {
    name: string;
    /** Free-text task type this router serves (e.g. "research", "prod-refactor"). */
    task?: string;
    /** Allowlist -- only these harness x model/tier x account combos are eligible under this router. */
    harnesses: Record<string, RouterHarnessAllowlist>;
    /** Scoped policy weights, applied within the router (consumed by routing, a later ticket). */
    weights?: {
        cost?: number;
        success?: number;
        headroom?: number;
    };
    /** Opt-in re-route of a pinned target when it's exhausted (consumed by routing, a later ticket). */
    hijack?: boolean;
}
/** Directory this machine writes router YAML files to (user layer). */
export declare function routersDir(): string;
/** Validate a router name against the allowed pattern. Throws on invalid input. */
export declare function validateRouterName(name: string): void;
/** Check whether a router resolves, project > user > system (like other resources). */
export declare function routerExists(name: string, cwd?: string): boolean;
/**
 * The layer a router currently resolves from ('project' | 'user' | 'system' |
 * an extra-repo alias), or null if it doesn't resolve. `writeRouter` and
 * `deleteRouter` only ever touch the user layer, so a caller that edits or
 * removes a router MUST check this first -- editing a router that resolves
 * from a non-user layer would silently write to a user-layer file that stays
 * permanently shadowed (the edit "succeeds" but is never read back).
 */
export declare function routerSource(name: string, cwd?: string): string | null;
/** Read a router, resolved project > user > system. Throws if not found or malformed. */
export declare function readRouter(name: string, cwd?: string): Router;
/** Write a router to disk atomically (write-to-tmp then rename). Always writes the user layer. */
export declare function writeRouter(router: Router): void;
/** Delete a router from the user layer. Returns false if it did not exist there. */
export declare function deleteRouter(name: string): boolean;
/**
 * Rename a router on disk, re-keying the user-layer file and preserving every
 * field (harness allowlists, weights, linked accounts, hijack flag).
 *
 * Throws if `oldName` does not resolve, if it resolves from a non-user layer
 * (renaming would write a shadowed user-layer copy -- see {@link routerSource}),
 * or if `newName` already resolves in any layer. There is no `--force` /
 * overwrite path -- a collision is a hard error directing the user to remove
 * the target first.
 */
export declare function renameRouter(oldName: string, newName: string): void;
/**
 * Fail-loud token validation (E1 of the Agent Router spec): a router MUST NOT
 * persist a harness id or model/tier token this machine cannot vouch for.
 * Throws naming the first invalid token found; the caller (route.ts) never
 * calls {@link writeRouter} when this throws, so an invalid `create`/`allow`
 * writes nothing.
 *
 * A harness id must be a real, registered agent (`AGENTS` in agents.ts) --
 * checked regardless of whether that harness is installed on this machine,
 * since a router is fleet-wide config and the harness may only run
 * elsewhere. A model/tier token is valid when it is one of the four
 * cross-harness tier tokens (cheap|default|best|ultra, always installable-
 * agnostic), OR a concrete model id this machine can actually verify: either
 * one of the harness's resolved tier rungs (`resolveTierMap` -- covers
 * curated/no-catalog harnesses like Droid with zero install required) or a
 * member of its extracted catalog (`getModelCatalog`, when a version of that
 * harness is installed here). A concrete id for a harness with neither --
 * not installed here, no curated ladder -- cannot be verified and is
 * rejected rather than accepted unverified.
 */
export declare function validateRouter(router: Router): void;
/**
 * List every router resolved project > user > system (deduplicated union,
 * project wins on a name collision -- same precedence as {@link resolveResource}).
 * Malformed files are silently skipped, surfaced via `agents route view <name>`.
 */
export declare function listRouters(cwd?: string): Router[];
