/** * Reset-time parsing for usage-limit messages. * * Runtimes say when a usage limit lifts in many shapes: * * - Claude Code: `You've hit your limit · resets 3pm (America/Los_Angeles)`, * `resets Oct 6, 9am`, `Your limit will reset at 5pm (Asia/Shanghai).`, * `continuing automatically at 3pm`, the limit menu's `Wait here, then * continue automatically at 8pm`, the old `usage limit reached|1767225600` * (epoch seconds) and the API's `resets 2026-08-08 00:00 UTC`. * - Codex: `try again at 4:05 PM`, `try again at Oct 3rd, 2026 4:05 PM`, * `try again in 4 days 7 hours 3 minutes`. * - Others: `retry in 45s`, `resets in 2h 5m`. * * A clock time without a date is the next time that clock time comes round * (in the named IANA time zone, else this machine's). Unparseable text * gives null — the caller then relies on the switch-back probe. * * @module services/runtime-fallback/reset-time */ /** Wall-clock parts in a time zone. */ interface WallParts { year: number; month: number; day: number; hour: number; minute: number; } /** * Whether a string is a time zone `Intl` accepts. * * @param tz - Candidate (IANA name or `UTC`) * @returns True when usable */ export declare function isValidTimeZone(tz: string | null | undefined): tz is string; /** * The instant at which a wall-clock time occurs in a time zone. * * @param wall - Wall-clock parts * @param tz - Time zone (undefined = this machine's) * @returns Epoch ms */ export declare function zonedWallTimeToEpoch(wall: WallParts, tz: string | undefined): number; /** * Parse a relative duration like `4 days 7 hours 3 minutes` / `2h 5m`. * * @param text - Duration text * @returns Milliseconds, or null */ export declare function parseRelativeDuration(text: string): number | null; /** * Find when a usage limit resets, from the text of the limit message. * * @param text - Normalized terminal / error text * @param now - Current time (ms) * @param defaultTimeZone - Zone for clock times that name none (default: this machine's) * @returns Epoch ms of the reset, or null when the text names none * * @example * ```ts * parseResetTime("You've hit your limit · resets 3pm (UTC)", Date.UTC(2026, 9, 1, 12)); * // Date.UTC(2026, 9, 1, 15) * ``` */ export declare function parseResetTime(text: string, now: number, defaultTimeZone?: string): number | null; export {}; //# sourceMappingURL=reset-time.d.ts.map