/** * pop task claim — claim an open task (v6 expired-claim takeover aware). * * Pre-flight (skippable with --no-preflight) reads the authoritative task * state via the TaskManager lens BEFORE any transaction: * - UNCLAIMED → proceed (fail fast if it requires an application) * - CLAIMED, claim expired → proceed as a takeover (v6: claimTask succeeds * iff claimDeadline/absoluteDeadline strictly * passed, emitting TaskClaimExpired first) * - CLAIMED, not expired → fail fast naming the claimer + time remaining * - SUBMITTED/COMPLETED/CANCELLED → fail fast with the status name * * After success the receipt logs are parsed: TaskClaimExpired confirms the * takeover, TaskClaimDeadlineSet echoes the submit-by deadline. */ import type { Argv, ArgumentsCamelCase } from 'yargs'; import { ethers } from 'ethers'; import { TxResult } from '../../lib/tx'; import { TaskOnChain } from '../../lib/task-lens'; interface ClaimArgs { org: string; task: string; chain?: number; rpc?: string; 'private-key'?: string; 'dry-run'?: boolean; yes?: boolean; preflight?: boolean; 'idempotency-key'?: string; 'no-idempotency'?: boolean; } /** * Read the task via the lens, mapping unreadable tasks to a precondition * failure. Shared shape across claim/assign/approve-app/apply preflights. */ export declare function readTaskForPreflight(provider: ethers.providers.Provider, taskManagerAddress: string, taskLabel: string): Promise; /** * Gate a claim-style write (claim/assign/approve-app/apply) on the v6 * takeover rules. Returns true when this write is an expired-claim takeover. * Throws PreconditionError (exit 4) on every non-claimable state, BEFORE any * transaction is sent. */ export declare function gateClaimableTask(task: TaskOnChain, taskLabel: string, action: string): boolean; /** * Post-success deadline echo shared by claim/assign/approve-app: pull * TaskClaimExpired (takeover confirmation) and TaskClaimDeadlineSet (the * submit-by deadline the contract actually recorded) out of the receipt * logs. Returns additive success fields; prints nothing. */ export declare function claimReceiptFields(result: TxResult): Record; /** * Human echo after a successful claim-style write: takeover confirmation, * submit-by countdown, and a warning when the absolute deadline cuts the * completion window short (the earlier cutoff always applies on-chain). */ export declare function echoClaimReceipt(fields: Record, task: TaskOnChain | null, who: string): void; export declare const claimHandler: { builder: (yargs: Argv) => Argv<{ task: string; } & { "idempotency-key": string | undefined; } & { "no-idempotency": boolean; }>; handler: (argv: ArgumentsCamelCase) => Promise; }; export {};