/** * Query helpers that read the workflow visibility indexes laid down by * {@link buildWorkflowVisibilityIndexTransition} / backfill. Each helper * produces a `Set` of candidate workflow ids; the caller * intersects sets across dimensions to narrow the slow-path scan. * * Every helper assumes the visibility-index watermark is `current` — the * caller checks {@link getWorkflowVisibilityWatermark} once per query and * uses the current full-scan correctness path when it is `stale`. * * @module core/engine/workflow-visibility-queries */ import { type Storage } from '../../storage/interface.ts'; import type { FailureCategory, WorkflowStatus } from '../types/identity.ts'; import type { TimeRange } from '../types/list-options.ts'; /** * Match every workflow whose `status` appears in `statuses`. Empty input * returns an empty set (intersection short-circuits to "no matches"). */ export declare function queryWorkflowStatusIndex(storage: Storage, statuses: readonly WorkflowStatus[]): Promise>; /** Match every workflow with the given `type`. */ export declare function queryWorkflowTypeIndex(storage: Storage, type: string): Promise>; /** * Time-range scan over `wf-idx-{kind}:` (created, updated, or deadline). * Returns the candidate ids the engine post-filter will refine. */ export declare function queryWorkflowTimeRangeIndex(storage: Storage, kind: 'created' | 'updated' | 'deadline', range: TimeRange): Promise>; /** * Enumerate candidate workflow ids whose raw id starts with `idPrefix`. * Uses the primary-key `wf:{enc(prefix)}` scan, which is sound because the * encoder is identity + concatenation-preserving on the validated safe * subset (see `src/storage/interface.test.ts`). The caller still re-checks * `state.id.startsWith(idPrefix)` as a defensive post-filter. */ export declare function queryWorkflowIdPrefixCandidates(storage: Storage, idPrefix: string): Promise>; /** * Re-export for callers that only need the failure-category value type. * Keeps imports tidy at the call sites. */ export type { FailureCategory };