UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

18 lines (17 loc) • 1.08 kB
/** * The Runner's same-Runner settle claims on checkpoint tokens. A claim is PER ATTEMPT: every in-Runner actor that settles a * row (a resume's resolve, an in-Runner expire) opens its own claim with its CAS attempt and closes exactly that claim, once, * when its duty is decided (a lost CAS, or the winner's duty done). A token is held while ANY attempt's claim is open — so a * losing attempt never closes a winner's still-open claim, and a stream-side reap that loses its own expire preserves the * paused-env reap record for whichever same-Runner winner is still on its way to it. */ import type { CheckpointToken } from "../checkpoint-store.js"; export declare class LocalClaims { #private; /** Open one attempt's claim on `token` (with its CAS attempt). */ open(token: CheckpointToken): void; /** Close one attempt's claim on `token` — the attempt's own, once, at its duty decision. */ close(token: CheckpointToken): void; /** Whether any same-Runner attempt's claim on `token` is open. */ held(token: CheckpointToken): boolean; }