import type { SessionCloseTarget, SessionCreateTarget, SessionLifecycleResponse, SessionResumeTarget } from "./index"; export type LifecycleCommandVerb = "session_create" | "session_close" | "session_resume"; /** A parsed, validated lifecycle command (transport identity added by caller). */ export type ParsedLifecycleCommand = { kind: "create"; target: SessionCreateTarget; modelPreset?: string; } | { kind: "close"; target: SessionCloseTarget; } | { kind: "resume"; target: SessionResumeTarget; } | { kind: "recent"; which: "create" | "resume" | "all"; } | { kind: "usage"; message: string; } | { kind: "reject"; reason: "invalid_target" | "prompt_unsupported"; message: string; } | { kind: "none"; }; /** True when the text begins with any /session_* token, regardless of addressability. */ export declare function isLifecycleCommandLikeText(text: string | undefined): boolean; /** True when the text begins an addressable /session_* command (cheap pre-gate). */ export declare function isLifecycleCommandText(text: string | undefined, ctx?: { chatType?: string; botUsername?: string; }): boolean; /** * Parse a paired-chat message into a lifecycle command. Returns `none` for * non-lifecycle text, `usage`/`reject` for malformed input (no side effect), or * a validated `create`/`close`/`resume`/`recent` intent. * * The caller MUST have already enforced paired-chat authorization; this function * performs grammar + target validation only. */ export declare function parseLifecycleCommand(text: string | undefined, ctx?: { chatType?: string; botUsername?: string; }): ParsedLifecycleCommand; /** The canonical usage text (exported for the daemon's help replies). */ export declare function lifecycleUsage(): string; /** * Shared target validator reused at the policy/effect boundary (after paired-chat * auth, before any side effect). Returns null when valid, or an `invalid_target` * reason. The orchestrator remains authoritative; this is a defensive pre-check * the parser and any other entry point share. */ export declare function validateLifecycleTarget(verb: LifecycleCommandVerb, target: SessionCreateTarget | SessionCloseTarget | SessionResumeTarget): { ok: true; } | { ok: false; reason: "invalid_target"; message: string; }; export declare function normalizeLifecyclePath(value: string): string | undefined; /** * Map a lifecycle response/error to a user-facing Telegram message (G010). * * Only derives text from sessionId, mode, reason, a safe message, the originating * lifecycle verb, and candidate {sessionId,path} — never a token or prompt. Each * error reason gets tailored, actionable copy; an "in progress" pending response * is surfaced distinctly. */ export declare function formatLifecycleOutcome(r: SessionLifecycleResponse, verb?: LifecycleCommandVerb): string;