/** * Resolution of the `ownership` posture options (`Engine.create({ ownership })`) * into {@link ResolvedOptions}. Extracted from `construction.ts` to keep that * file under the `max-lines` ceiling; mirrors the second-instance resolver's * "only validate when the feature is enabled" discipline. * * `ownership` is a three-member discriminated union — `'none'`, `'lease'` * (a single store-wide lease), and `'workflow-lease'` (per-workflow fencing, * ADR 0002 at * `documentation/contributing/architecture-decisions/0002-multiengine-per-workflow-ownership.md`). * This module resolves and validates the option surface only: it resolves the * `workflowClaimTtl`/`workflowClaimRenewInterval` tuning fields and rejects * incoherent configuration. The fencing behavior itself lives in the claim * registry, the ownership bootstrap, and the fenced-write path. * * @module core/engine/ownership-options */ import type { EngineConstructorOptions, ResolvedOptions } from './engine-internal-types.ts'; import { WORKFLOW_CLAIM_TTL_SAFETY_MULTIPLIER } from './workflow-claim-transitions.ts'; /** Default lease time-to-live for `ownership: 'lease'`. */ export declare const DEFAULT_LEASE_TTL_MS = 30000; /** Default lease renewal interval for `ownership: 'lease'`. */ export declare const DEFAULT_LEASE_RENEW_INTERVAL_MS = 5000; /** Default boot-time lease acquisition wait window for `ownership: 'lease'`. */ export declare const DEFAULT_LEASE_WAIT_TIMEOUT_MS = 60000; /** Default per-workflow claim time-to-live for `ownership: 'workflow-lease'`. */ export declare const DEFAULT_WORKFLOW_CLAIM_TTL_MS = 30000; /** Default per-workflow claim renewal interval for `ownership: 'workflow-lease'`. */ export declare const DEFAULT_WORKFLOW_CLAIM_RENEW_INTERVAL_MS = 5000; export { WORKFLOW_CLAIM_TTL_SAFETY_MULTIPLIER }; export declare function resolveBackgroundTaskMode(options: EngineConstructorOptions | undefined): ResolvedOptions['backgroundTaskMode']; /** * Resolve the ownership posture and its per-mode tuning into their * `ResolvedOptions` fields. Defaults to `'none'`. The lease and workflow-claim * durations are documented as "ignored" outside their own mode, so they are * only normalized (and thus only able to throw on an invalid value) when that * mode is actually selected — an invalid duration must not make an off-by- * default config fatal at boot. */ export declare function resolveOwnershipFields(options: EngineConstructorOptions | undefined): Pick;