import type { Api } from "../../../api.js"; /** * When the proxy token baked into the running harness stops being safe to * reuse. * * The server re-arms the token on every proxy call, so the clock runs from * the last turn that reached Anthropic rather than from when it was minted. * Anchoring it to mint time instead would tear down a conversation that is * still going — a cold start, a replayed history preamble and the loss of * Claude Code's in-session memory, for a token that had not expired. * * Exported for tests. */ export declare function proxyTokenDeadlineMs(input: { mintedAtMs: number; lastUsedAtMs: number | undefined; ttlMs: number; }): number; /** * The result of trying to take the chat for one local turn. `busy` is an * answer rather than a failure — another session is mid-turn — so it does not * end the session the way a transport error does. */ export type ChatTurnClaim = { outcome: "claimed"; } | { outcome: "busy"; } | { outcome: "unavailable"; error: unknown; }; /** * Take the chat for one local turn. * * Exported for tests. */ export declare function claimChatTurn(api: Api, chatUuid: string, ownerId: string): Promise; /** * Report an API failure the way every other call in the CLI does, and exit. * Never returns: `handleApiCall` exits on a recognised API error, and anything * else is rethrown for the top-level handler. */ export declare function reportApiFailure(error: unknown): Promise; /** * Hand the chat back after a turn. * * Recording the turn already does this, but a turn that spent nothing has * nothing to record — a stall, an expired token, a workspace out of credits — * and the claim would sit there until it expired, telling the next process the * chat was busy. * * Best effort: the TTL is the backstop, and a reply the user has already read * must not fail on the way out. */ export declare function releaseChatTurn(api: Api, chatUuid: string, ownerId: string): Promise; //# sourceMappingURL=claim.d.ts.map