OptionalcloseDrop session affinity without deleting reusable checkpoints.
OptionalprefetchPrepare a reusable prefix before execution. The returned release ends request interest; cache residency and IO remain implementation-owned.
Optionalns: stringOptionalsessionId: stringTransfer state and its optional backing release to storage. If this throws, ownership stays with the caller; successful return transfers ownership even when storage immediately spills or disposes the entry.
Optionalns: stringOptionalretain: () => voidOptionalattachments: AttachmentOptionalsessionId: stringOptionalreclaimGive optional retained state back to the allocator at an execution boundary. This never rejects or changes the active request.
Return owned state for a usable session continuation, otherwise the longest usable prefix, or null on a miss. Session identity is an affinity hint and never changes the content or numerical namespace. Namespace distinguishes incompatible artifacts, methods and adapters.
Optionalns: stringOptionalsessionId: string
Storage is independent of request scheduling and the method producing state. Both prefill and decode can publish processed-token prefixes. State is opaque here; its backend/method defines layout and alignment. Implementations own prefix selection, retention and storage tiers.