/** Session identity resolution for one terminal runner invocation. * * Turns parsed startup flags into the session this process will run, and maps * a session id onto a filename-safe export default. Resolution reads persisted * headers, so it is the runner's only pre-composition persistence IO; the * remaining helpers are pure. * * @module @deepseek-ai/dsh-code/session-target */ import type { SessionId, SessionEvent } from '@deepseek-ai/dsh-session'; import type { SessionPersistence } from '@deepseek-ai/dsh-session-persistence'; import type { TuiStartup } from '../startup.ts'; /** The session identity this invocation will run, plus whether it is resumed. */ export interface Target { sessionId: string; resume: boolean; mode?: string; cwd?: string; seed?: readonly SessionEvent[]; parentSession?: SessionId; /** Marks the session as a subagent conversation in the durable header. */ origin?: 'subagent'; seedLength?: number; } /** * Reduce a session id to a filename-safe /export default-name suffix. Session * ids are normally minted `session-`, but `--session` accepts arbitrary * user text: path separators must never leak into the default export filename * (which would escape the session cwd). * @param id - the session id. * @returns at most the last 8 filename-safe characters. */ export declare function exportSessionIdSuffix(id: string): string; /** * Resolve the invocation's target session against the persisted headers. * @param startup - the parsed startup flags. * @param persistence - the persistence service; required for resume/latest. * @param cwd - the working directory `--continue` filters by. * @returns the target identity. * @throws with a user-facing message when the flags name nothing resolvable. */ export declare function resolveTarget(startup: TuiStartup, persistence: SessionPersistence | undefined, cwd: string): Promise;