/** * [ref] seam #2 — the resource/preempt durable-suspend opt-in decision ([ref] "失败≠没做完" third state). * * Pure so it is unit-testable in isolation (the spec is otherwise assembled inside main.ts's bootstrap). When a * task opts in, a budget/turns/walltime limit OR a scheduler preempt durably SUSPENDS the task (resumable via * `POST /v1/assistant/tasks/:id/resume`) instead of FAILING; absent ⇒ a limit still FAILS. * * 🔴 EXCLUDE verify/cascade tasks. Core runs their implementation via `runWithVerification`/`runCascade`, which * map an inner durable suspend to a FAILED result (`errorCode: "unexpected.suspended"`,内层 status * "needs_review" 时铸 `"unexpected.needs_review"` —— 真源是 core `agents/suspend-guard.js` 的 * `mapNestedSuspend`;`suspended.*` 三码是 bg 子代/委派报告面的词,不落在这条 TaskResult 腿上). The service would then * `setTerminal(failed)` while core had already minted a pending `resource_limit` checkpoint + suspended the * remote VM — ORPHANING both (the run row is terminal, so nothing resumes them). So a resource-limit hit on a * verify/cascade task must FAIL CLEANLY (no suspend), exactly as before the flag. This exclusion is the SAME * boundary the `preemptSignal` wiring enforces in runs.ts (stream-path only), so eligibility and the signal stay * aligned. (Cross review wtyc7ist3 HIGH finding: without this, enabling RESOURCE_SUSPEND leaks a suspended * VM + checkpoint on every verify/cascade task that hits a resource limit.) */ export declare function resourceSuspendOptIn(opts: { /** `RESOURCE_SUSPEND=true` (the worker-level switch). */ enabled: boolean; /** `RESOURCE_SUSPEND_TTL_SEC` — 0 ⇒ core default (30d) by omitting `ttlMs`. */ ttlSec: number; /** This task requested the developer-mode verify gate (`body.verify === true`). */ isVerify: boolean; /** This task requested the cascade ladder (`body.cascade === true`). */ isCascade: boolean; /** Multi-tenant isolation key — the SAME key durableApproval uses (the principal; "_" when auth is off). */ scope: string; /** [ref] S-3:`RESOURCE_SUSPEND_TOTAL_TOKENS`(跨片 token 总额)。0/缺省 ⇒ 不铸键。 */ totalTokens?: number; /** [ref] S-3:`RESOURCE_SUSPEND_TOTAL_BUDGET_USD`(跨片 $ 总额)。0/缺省 ⇒ 不铸键。 */ totalBudgetUsd?: number; /** [ref] S-3:`RESOURCE_SUSPEND_MAX_SLICES`(跨片 slice 数上限)。0/缺省 ⇒ 不铸键。 */ maxSlices?: number; }): { scope: string; ttlMs?: number; totalTokens?: number; totalBudgetUsd?: number; maxSlices?: number; } | undefined; //# sourceMappingURL=resource-suspend.d.ts.map