import { type BrandProfile, type Options } from "@yanlinglabs/winter-agent-sdk"; import { type RunHome, type RunLeg } from "./types.js"; export interface RunHomeApplyTarget { leg: RunLeg; /** The generation's own working directory (`Options.cwd`). */ cwd: string | undefined; /** The router's resolved brand. */ brand: BrandProfile; /** * The shared runtime home the router's store lives in. `undefined` means the router was created * without `requireRunHome`, i.e. on the pre-WS-21 layout, where no run home can be applied. */ storeHome: string | undefined; } /** The refusals, in the order a host would want to hear them. Throws `RunHomeError`. */ export declare function assertRunHomeApplicable(runHome: unknown, target: RunHomeApplyTarget): asserts runHome is RunHome; /** * FIX ROUND 1, M1: THE OPTIONS A RUN HOME DECIDES are refused from the caller, on either leg. The run * folder carries the plugins (`enabledPlugins`), the skills, the agents (rewritten, F19c), the output * style (effective settings); the brand is the router's own. A caller-supplied agent would skip the F19c * rewrite, and a caller-supplied brand would re-spell the env prefix the router's variables use. * `trustedWorkspace` and `plansDirectory` stay: they are host policy. */ export declare const RUN_HOME_DECIDED_OPTIONS: readonly ["plugins", "skills", "agents", "outputStyle", "brand"]; export declare function assertNoRunHomeDecidedOptions(options: object): void; /** The Winter child's host variables for a run home (spec §3.1, §3.7; the claude twins in comments). */ export declare function winterRunHomeEnv(runHome: RunHome, brand: Pick): Record; /** `autoMemoryEnabled` as the run home's effective settings say it (absent = claude's default, on). */ export declare function runHomeAutoMemoryEnabled(runHome: Pick): boolean; /** * The Winter leg's options for a run home: the caller's own, with the run home's env laid OVER the * caller's (the router's value wins for every variable only the router sets), `settingSources: * ["user"]`, and the auto-memory pin (`autoMemory.directory`, the twin of claude's * `autoMemoryDirectory`). A caller asking for the project or local source is refused: under a run * home the router merged those tiers itself, and a child reading them again would read the * repository's own files (ruling Q1). */ export declare function applyWinterRunHome(options: T, runHome: RunHome, brand: Pick): T; /** * FIX ROUND 1, M6: the Winter leg's Query, observed for its END. `onEnd` runs once, when the query * settles — its stream done, a `return()`/`throw()` that finished it, a rejection (the runtime's own * failure), or `Symbol.asyncDispose` — and never before: `runHomeOutcome` answers `pending` while the * incarnation runs, and a host disposes only on `safe` (spec §3.8). * * WHAT "ENDS" CAN MEAN HERE: the Winter `Query` exposes no process-exit signal, so the observable end * is the stream's settlement, after which the SDK has closed the child's stdin. That is the same * point the host itself can observe; nothing later is visible through the peer. * * Every other member (`interrupt`, `setModel`, `messaging`, …) is the peer's own, bound to it, so the * observed query is a drop-in for the peer's. */ export declare function observeQueryEnd>(query: Q, onEnd: () => void): Q;