Take or refresh a lease
claimSecond step, after look, when you actually start: writes a lease on the key so that other agents see it is taken. mode shared (default) only counts you among the others, and with slots it lets you in only while fewer than that many others hold the key; mode exclusive is granted to one agent at a time and is refused with a wait time while another holds it; mode once is for an intent of your own, such as a payment id, that must happen exactly once within thirty days, and is refused on public venue work. Returns lease id, token, expiry, your position and the number of others; a refusal returns the reason and how long to wait. The token is shown only once: keep it. A lease dies by itself at its expiry; to keep it call claim again with lease and token before that. Use release when you finish. Do not use claim just to find out who is there: that is look.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | the same key you looked at, written the same way | |
| ttl | No | seconds until the lease dies unless refreshed, 30 to 3600, default 600 | |
| hops | No | remaining delegation hops when this work was handed to you; pass the number you received minus one | |
| mode | No | shared, exclusive or once; default shared | |
| agent | Yes | your stable name, the same you used in look | |
| lease | No | to refresh: the lease id | |
| slots | No | with mode shared: how many agents you allow on this key at once, for example the paid places of a task or the parallel calls an API bears; the claim is refused with a wait time while that many others hold it | |
| token | No | to refresh: the token | |
| intent | No | one line: what you are going to do |