/** * Per-session Windows shell-engine state (D4 — the engine is the sole state mutator). * * `cwd`/`envDelta` are threaded into every `python-engine` invocation and updated from the * engine's control frame after each run; the PS tier consumes the same state through the * EXISTING `shell-session.ts` seams (`lastRequestedCwd` re-entry, `shallowEnvEquals` respawn). * This module owns no process/spawn logic — it is pure state carriage. */ export interface WindowsShellState { cwd: string; /** Host-requested cwd used to detect an intentional caller cwd change. */ hostCwd?: string; envDelta: Record; } /** The engine control-frame shape this module consumes (subset of the full §1.3 frame). */ export interface EngineFrameState { cwd: string; envDelta: Record; } /** Get or lazily create the per-session-key Windows shell state. */ export declare function getOrCreateWindowsShellState(sessionKey: string): WindowsShellState; /** Drop a session's engine state (agent teardown). Safe to call for keys that never ran. */ export declare function disposeWindowsShellState(sessionKey: string): void; /** * Fold an engine control frame into the session state: `cwd` is set verbatim; `envDelta` entries * apply string => set, `null` => delete (§1.3). */ export declare function applyEngineFrame(state: WindowsShellState, frame: EngineFrameState): void; /** * The cwd a NEXT call (engine or PS tier) must use: the state-adjusted cwd once the engine has run * at least one `cd`, otherwise the host-requested cwd. Both tiers call this with the SAME session * state so a `cd` in the engine is observed by the very next PS-tier call. */ export declare function resolveEffectiveCwd(state: WindowsShellState, requestedCwd: string): string; /** * The env a NEXT call (engine or PS tier) must use: the base env plus every `export`/`unset` the * engine has applied so far. */ export declare function mergeEffectiveEnv(state: WindowsShellState, baseEnv: NodeJS.ProcessEnv): NodeJS.ProcessEnv; //# sourceMappingURL=windows-shell-state.d.ts.map