import { bO as Lens, h as AppType, y as BrowserAction, cS as QaTarget, A as ActionPolicy, c as ActionPolicyDecision, dm as Result, dP as SurfaceError, E as BrowserLocator, cH as QaEvidenceArtifact, aQ as EvidenceBundle, dG as StateStore, N as CandidateFinding, S as CandidateFlow, cF as QaDegradation, G as BrowserQaFlow, cJ as QaRun, bj as FlowRun, cD as PromotedFindingSidecar, cO as QaSeverity, bm as FlowRunSummary, b1 as Finding, e2 as TrackedFinding, a0 as CaptureArtifactType, dJ as SurfaceConfig, Z as Capture, bU as ModelAvailability, m as ArtifactRedactionMetadata, _ as CaptureArtifact, c2 as ModelEgressPolicy, ck as ModelRequest, cm as ModelResponse, ce as ModelProvider, aB as DirectSubscriptionChannelId, aP as Evidence, c_ as ReconciliationQuestion, q as ArtifactWriter, bN as KnowledgeSource, d2 as ReconciliationService, dW as Target, a7 as CaptureOptions, a2 as CaptureBackend, cB as ProjectStateSnapshot, bq as FrameworkAdapter, bv as GateEvaluator, bB as GroundingTool, bI as IssueExporter, de as ReportRenderer, af as ComponentMap, dA as SourceFileRef, b2 as FindingDraft, d9 as RedactionRule, bu as GateEvaluationContext, bw as GatePolicy, bA as GateResult, e5 as TrackedFindingsDiff, bc as FindingsEnvelope, B as Backlog, ct as PersistedArtifactRef, dc as Report, bM as KnowledgeEntry, db as RelevanceQuery, d_ as Theme, cA as ProjectRunRecord } from './interfaces-CiF17usq.js'; export { a as ActionPolicyCategory, b as ActionPolicyCategorySchema, d as ActionPolicyDecisionSchema, e as ActionPolicyRule, f as ActionPolicyRuleSchema, g as ActionPolicySchema, i as AppTypeSchema, j as ApplyVerdictsToBacklogInput, k as ApplyWaiversInput, l as AriaAttributeSuggestedPatchSchema, r as BacklogEntry, s as BacklogEntrySchema, t as BacklogSchema, u as Baseline, v as BrokenFindingIdentityAssignment, w as BrokenFindingIdentityAssignmentSchema, x as BrokenIdentityDriftResultSchema, z as BrowserActionName, C as BrowserActionNameSchema, D as BrowserActionSchema, F as BrowserLocatorSchema, H as BrowserQaFlowSchema, I as BrowserQaFlowStep, J as BrowserQaFlowStepSchema, O as CandidateFindingIdSchema, P as CandidateFindingSchema, Q as CandidateFindingSidecar, R as CandidateFindingSidecarSchema, T as CandidateFlowIdSchema, U as CandidateFlowSchema, V as CandidateFlowSidecar, W as CandidateFlowSidecarSchema, X as CandidateVerdictPromotion, Y as CandidateVerdictPromotionSchema, a3 as CaptureConfig, a4 as CaptureConfigLayerSchema, a5 as CaptureConfigSchema, aa as CitedHeuristicEvidence, ab as CitedHeuristicEvidenceSchema, ac as CliErrorEnvelope, ad as CliExitCode, ae as CliExitCodeSchema, ah as ConfidenceBand, ai as ConfidenceBandSchema, aj as ConfidenceCutoffs, ak as ConfidenceCutoffsLayerSchema, al as ConfidenceCutoffsSchema, am as ContrastHexSuggestedPatchSchema, an as CreateBaselineInput, ao as CreateCandidateVerdictPromotionInput, ap as CreateSelfGroundingReportInput, aq as CreateSurfaceErrorOptions, ar as CreateTrackedFindingInput, as as CreateVerdictInput, at as DEFAULT_FINDINGS_POLICY, au as DEFAULT_SURFACE_CONFIG, aw as Depth, ax as DepthSchema, ay as DiffableTrackedFinding, az as Dimensions, aA as DimensionsSchema, aC as DirectSubscriptionChannelIdSchema, aD as DirectSubscriptionChannelPolicyBlock, aE as DirectSubscriptionChannelPolicyBlockSchema, aF as DomEvidence, aG as DomEvidenceSchema, aH as EdgeErrorContext, aI as EnvironmentGroup, aJ as EnvironmentGroupSchema, aK as EvaluationConfig, aL as EvaluationConfigLayerSchema, aM as EvaluationConfigSchema, aN as EvaluationMethod, aO as EvaluationMethodSchema, aR as EvidenceBundleIdSchema, aS as EvidenceBundleSchema, aT as EvidenceBundleSidecar, aU as EvidenceBundleSidecarSchema, aV as EvidenceSchema, aW as ExplorationState, aX as ExplorationStateSchema, aY as ExplorationSummary, aZ as ExplorationSummarySchema, a_ as ExportTarget, a$ as ExportTargetSchema, b3 as FindingDraftSchema, b4 as FindingIdentity, b5 as FindingIdentityAssignment, b6 as FindingIdentityAssignmentSchema, b7 as FindingIdentityCandidate, b8 as FindingIdentityCandidateSchema, b9 as FindingIdentitySchema, ba as FindingSchema, bb as FindingStatus, bd as FindingsEnvelopeSchema, be as FindingsPolicy, bf as FindingsPolicyLayerSchema, bg as FindingsPolicySchema, bh as FixtureAccount, bi as FixtureAccountSchema, bk as FlowRunIdSchema, bl as FlowRunSchema, bn as FlowRunSummarySchema, bo as FlowStepResult, bp as FlowStepResultSchema, bt as GateDisposition, bx as GatePolicy, by as GatePolicyLayerSchema, bz as GatePolicySchema, bC as IdentityAnchorKind, bD as IdentityAnchorKindSchema, bE as IdentityDriftResult, bF as IdentityDriftResultSchema, bJ as JUDGED_COVERAGE_UNAVAILABLE_MESSAGE, bR as Location, bS as LocationSchema, bT as McpStructuredError, bV as ModelAvailabilitySchema, bW as ModelChannelId, bX as ModelChannelIdSchema, bY as ModelCompletionAdapter, bZ as ModelConfig, b_ as ModelConfigLayerSchema, b$ as ModelConfigSchema, c0 as ModelEgressMode, c1 as ModelEgressModeSchema, c3 as ModelEgressPolicyLayerSchema, c4 as ModelEgressPolicySchema, c5 as ModelFallbackConfig, c6 as ModelFallbackConfigLayerSchema, c7 as ModelFallbackConfigSchema, c8 as ModelFallbackMode, c9 as ModelFallbackModeSchema, ca as ModelLensSkip, cb as ModelLensSkipSchema, cc as ModelPrompt, cd as ModelPromptSchema, cf as ModelProviderConfig, cg as ModelProviderConfigInput, ch as ModelProviderConfigSchema, ci as ModelProviderId, cj as ModelProviderResolution, cl as ModelRequestSchema, cn as ModelResponseSchema, co as ModelSourceKind, cp as ModelSourceKindSchema, cq as ModelUnavailableReason, cr as ModelUnavailableReasonSchema, cu as Preset, cv as PresetSchema, cE as PromotedFindingSidecarSchema, cG as QaDegradationSchema, cI as QaEvidenceArtifactSchema, cK as QaRunIdSchema, cL as QaRunSchema, cM as QaRunSidecar, cN as QaRunSidecarSchema, cP as QaSeveritySchema, cR as QaStatusSchema, cT as QaTargetSchema, cU as ReconciledFinding, cV as ReconciledFindingSchema, cW as ReconciliationChannel, cX as ReconciliationChannelSchema, cY as ReconciliationInput, cZ as ReconciliationInputSchema, c$ as ReconciliationQuestionSchema, d0 as ReconciliationResult, d1 as ReconciliationResultSchema, d3 as ReconciliationUnavailableChannel, d4 as ReconciliationUnavailableChannelSchema, d5 as ReconciliationUnavailableReason, d6 as ReconciliationUnavailableReasonSchema, d7 as Rect, d8 as RectSchema, da as RedactionRuleSchema, df as ReportingConfig, dg as ReportingConfigLayerSchema, dh as ReportingConfigSchema, di as ReproStep, dj as ReproStepSchema, dk as ResetEndpoint, dl as ResetEndpointSchema, dn as SURFACE_ERROR_DEFINITIONS, dp as ScreenshotEgressPolicy, dq as ScreenshotEgressPolicySchema, dr as ScreenshotRegionEvidence, ds as ScreenshotRegionEvidenceSchema, dt as SelfGroundingReport, du as SelfGroundingReportSchema, dv as SeverityBand, dw as SeverityBandSchema, dx as SeverityCutoffs, dy as SeverityCutoffsLayerSchema, dz as SeverityCutoffsSchema, dB as StableFindingIdentityAssignment, dC as StableFindingIdentityAssignmentSchema, dD as StableIdentityDriftResultSchema, dE as Stack, dF as StackSchema, dH as SuggestedPatch, dI as SuggestedPatchSchema, dK as SurfaceConfigLayer, dL as SurfaceConfigLayerSchema, dM as SurfaceConfigLayers, dN as SurfaceConfigLayersSchema, dO as SurfaceConfigSchema, dQ as SurfaceErrorCode, dR as SurfaceErrorCodeSchema, dS as SurfaceErrorDefinition, dT as SurfaceErrorKind, dU as SurfaceErrorKindSchema, dV as SurfaceErrorSchema, dY as TargetSizeSuggestedPatchSchema, e0 as ToolResultEvidence, e1 as ToolResultEvidenceSchema, e3 as TrackedFindingHistoryEntry, e4 as TrackedFindingTransition, e6 as TrackedFindingsDiffEntry, e7 as ValidationCheck, e8 as Verdict, e9 as VerdictDecision, ea as VerdictDecisionSchema, eb as VerdictReusePolicy, ec as VerdictReusePolicySchema, ed as VerdictSchema, ee as Viewport, eh as ViewportSchema, ei as Waiver, ej as applyVerdictsToBacklog, ek as applyWaiversToTrackedFindings, el as assignFindingIdentities, em as createBaseline, en as createCandidateVerdictPromotion, eo as createConfiguredModelProvider, ep as createReconciliationService, eq as createSelfGroundingReport, er as createSurfaceError, es as createTrackedFinding, et as createUnavailableModelProvider, eu as createVerdict, ev as deriveFindingIdentity, ew as deriveFindingIdentityCandidate, ex as diffTrackedFindings, ey as err, ez as exitCodeForSurfaceError, eA as identityInternalsForTesting, eB as isErr, eC as isOk, eD as isWaiverActive, eE as matchFindingIdentity, eF as modelSkipForLens, eG as ok, eH as reconcileFindings, eI as resolveModelProviderConfig, eJ as resolveSurfaceConfig, eK as scoreFinding, eL as synthesizeBacklog, eM as toCliErrorEnvelope, eN as toMcpError, eO as transitionTrackedFinding } from './interfaces-CiF17usq.js'; import { z } from 'zod'; import { DestinationStream, Logger } from 'pino'; import { LockOptions } from 'proper-lockfile'; /** * Creates the built-in measured accessibility lens from normalized grounding evidence. */ declare function createAccessibilityLens(): Lens; declare const OverlayReleaseTierSchema: z.ZodEnum<{ gate: "gate"; committed: "committed"; should: "should"; }>; type OverlayReleaseTier = z.infer; declare const OverlayAcceptanceCriteriaSchema: z.ZodObject<{ summary: z.ZodString; checks: z.ZodArray; riskSignals: z.ZodArray; }, z.core.$strict>; type OverlayAcceptanceCriteria = z.infer; declare const AppTypeOverlaySchema: z.ZodObject<{ appType: z.ZodEnum<{ generic: "generic"; "saas-dashboard": "saas-dashboard"; "e-commerce": "e-commerce"; marketing: "marketing"; admin: "admin"; "content-media": "content-media"; }>; defaultPersona: z.ZodString; defaultTask: z.ZodString; discoverySignals: z.ZodArray; label: z.ZodString; releaseTier: z.ZodEnum<{ gate: "gate"; committed: "committed"; should: "should"; }>; routeHints: z.ZodArray; lensCriteria: z.ZodRecord; riskSignals: z.ZodArray; }, z.core.$strict>>; }, z.core.$strict>; type AppTypeOverlay = z.infer; declare const REGISTERED_APP_TYPE_OVERLAYS: readonly ["generic", "saas-dashboard", "e-commerce", "marketing"]; type RegisteredAppTypeOverlay = (typeof REGISTERED_APP_TYPE_OVERLAYS)[number]; declare const COMMITTED_WEB_APP_TYPE_OVERLAYS: readonly ["saas-dashboard", "e-commerce", "marketing"]; declare const APP_TYPE_OVERLAY_YAML_HEADER = "# Generated from packages/core/src/app-type-overlays.ts. Do not edit by hand."; declare const APP_TYPE_OVERLAY_REGISTRY: Readonly; }>>; declare function hasRegisteredAppTypeOverlay(appType: AppType): appType is RegisteredAppTypeOverlay; declare function getAppTypeOverlay(appType?: AppType): Readonly; declare function listAppTypeOverlays(): readonly Readonly[]; declare function serializeAppTypeOverlayToYaml(overlay: AppTypeOverlay): string; type ClassifyBrowserActionInput = { readonly action: BrowserAction; readonly effectiveTarget: QaTarget; readonly policy: ActionPolicy; readonly runTarget?: QaTarget; }; type ResolveActionPolicyInput = { readonly fixtureRoots?: readonly string[]; readonly policyRef?: string; readonly projectRoot?: string; }; type ResolvedActionPolicy = { readonly policy: ActionPolicy; readonly source: "builtin" | "file"; readonly sourcePath?: string; }; type ValidateFlowIsolationPolicyInput = { readonly ci: boolean; readonly flow: { readonly isolation?: { readonly fixtureAccountId?: string; readonly mutatesState?: boolean; readonly resetEndpointId?: string; readonly resetRequired?: boolean; }; readonly teardown?: { readonly always?: readonly BrowserAction[]; }; }; readonly policy: ActionPolicy; readonly target: QaTarget; }; type FlowIsolationPolicyValidation = { readonly gateEligible: boolean; readonly resetSatisfied: boolean; }; declare function createBuiltInSafeActionPolicy(): ActionPolicy; declare function classifyBrowserAction(input: ClassifyBrowserActionInput): ActionPolicyDecision; declare function resolveActionPolicy(input: ResolveActionPolicyInput): Promise>; declare function validateFlowIsolationPolicy(input: ValidateFlowIsolationPolicyInput): Result; declare function effectiveTargetForAction(action: BrowserAction, fallback: QaTarget): QaTarget; type BrowserQaAgentBrowserCommandResult = { readonly exitCode: number; readonly stderr: string; readonly stdout: string; }; type BrowserQaAgentBrowserCommandInvocation = { readonly args: readonly string[]; readonly command: string; readonly env: Readonly>; readonly result: BrowserQaAgentBrowserCommandResult; readonly stdin?: string; }; type BrowserQaAgentBrowserCommandInput = Omit; type BrowserQaAgentBrowserCommandRunner = (input: BrowserQaAgentBrowserCommandInput) => Promise; type AgentBrowserCliDriverOptions = { readonly baseEnv?: NodeJS.ProcessEnv; readonly binary?: string; readonly projectRoot?: string; readonly runCommand?: BrowserQaAgentBrowserCommandRunner; readonly stateDir?: string; }; type AgentBrowserEnvironmentInput = { readonly baseEnv?: NodeJS.ProcessEnv; readonly extraAllowlist?: readonly string[]; }; type BrowserQaSession = { readonly createdAt: string; readonly executableSignature: string; readonly id: string; readonly lockfilePath: string; readonly manifestPath: string; readonly owner: "surface"; readonly ownerToken: string; readonly processGroup: string; readonly profileDir: string; readonly qaRunId: string; readonly startedAt: string; readonly target: QaTarget; }; type BrowserQaDriverValueRef = { readonly kind: "literal"; readonly value: string; } | { readonly kind: "secret"; readonly name: string; readonly value: string; }; type BrowserQaDriverActionInput = { readonly expect?: Readonly>; readonly locator?: BrowserLocator; readonly stepId?: string; readonly theme?: string; readonly timeoutMs?: number; readonly url?: string; readonly value?: string; readonly valueRef?: BrowserQaDriverValueRef; readonly viewport?: QaTarget["viewport"]; readonly wait?: Readonly>; }; type BrowserQaDriver = { startSession(input: { readonly qaRunId: string; readonly target: QaTarget; }): Promise>; stopSession(sessionId: string): Promise>; navigate(input: BrowserQaDriverActionInput): Promise>; click(input: BrowserQaDriverActionInput): Promise>; dblclick(input: BrowserQaDriverActionInput): Promise>; focus(input: BrowserQaDriverActionInput): Promise>; fill(input: BrowserQaDriverActionInput): Promise>; type(input: BrowserQaDriverActionInput): Promise>; press(input: BrowserQaDriverActionInput): Promise>; hover(input: BrowserQaDriverActionInput): Promise>; select(input: BrowserQaDriverActionInput): Promise>; upload(input: BrowserQaDriverActionInput): Promise>; check(input: BrowserQaDriverActionInput): Promise>; uncheck(input: BrowserQaDriverActionInput): Promise>; scroll(input: BrowserQaDriverActionInput): Promise>; wait(input: BrowserQaDriverActionInput): Promise>; pushState(input: BrowserQaDriverActionInput): Promise>; setViewport(input: BrowserQaDriverActionInput): Promise>; setTheme(input: BrowserQaDriverActionInput): Promise>; assertText(input: BrowserQaDriverActionInput): Promise>; assertElementState(input: BrowserQaDriverActionInput & { readonly state: "checked" | "enabled" | "visible"; }): Promise>; captureState(): Promise, SurfaceError>>; getConsoleSummary(): Promise, SurfaceError>>; getNetworkSummary(): Promise, SurfaceError>>; getReactDiagnostics(): Promise, SurfaceError>>; getVitals(): Promise, SurfaceError>>; cleanupStaleSessions(input?: { readonly dryRun?: boolean; }): Promise>; }; declare function createAgentBrowserCliDriver(options?: AgentBrowserCliDriverOptions): BrowserQaDriver; declare function createAgentBrowserEnvironment(input?: AgentBrowserEnvironmentInput): Record; declare function redactAgentBrowserCommand(command: readonly string[], secrets: readonly string[]): string[]; type FileQaEvidenceStoreOptions = { readonly projectRoot?: string; readonly stateDir?: string; readonly stateStore: StateStore; }; type QaEvidenceArtifactInput = { readonly bytes: Uint8Array; readonly id: string; readonly mcpReadable?: boolean; readonly mediaType: string; readonly qaKind: QaEvidenceArtifact["kind"]; readonly sensitiveRaw?: boolean; }; type WriteEvidenceBundleInput = { readonly artifacts: readonly QaEvidenceArtifactInput[]; readonly bundle: EvidenceBundle; }; type ReadArtifactByRegisteredRefInput = { readonly artifactId: string; readonly maxBytes?: number; readonly refId: string; }; type QaArtifactReadResult = { readonly artifactId: string; readonly mediaType: string; readonly sha256: string; readonly sizeBytes: number; readonly text?: string; readonly truncated: boolean; }; type QaEvidenceStore = { writeBundle(input: WriteEvidenceBundleInput): Promise>; readBundle(id: string): Promise>; readArtifactByRegisteredRef(input: ReadArtifactByRegisteredRefInput): Promise>; }; declare function createFileQaEvidenceStore(options: FileQaEvidenceStoreOptions): QaEvidenceStore; type BrowserQaExploreInput = { readonly actionPolicyRef?: string; readonly allowedDomains?: readonly string[]; readonly evidence?: "minimal" | "failures" | "full"; readonly maxActions: number; readonly maxDepth: number; readonly maxStates: number; readonly network?: "summary" | "har" | "off"; readonly qaRunId: string; readonly scope?: string; readonly sessionMode?: "isolated" | "shared"; readonly stateLockTimeoutMs?: number; readonly target: QaTarget; readonly task?: string; readonly video?: "off" | "failures" | "all"; }; type BrowserQaLoadedState = { readonly actions: readonly BrowserAction[]; readonly authStatus: "authenticated" | "anonymous" | "auth-drift" | "reauthenticated"; readonly depth: number; readonly dialogState?: string; readonly framePath?: readonly string[]; readonly snapshotRef?: string; readonly theme?: "light" | "dark"; readonly title?: string; readonly url: string; }; type BrowserQaExploreResult = { readonly attemptedActions: number; readonly candidateFindings: readonly CandidateFinding[]; readonly candidateFlows: readonly CandidateFlow[]; readonly degradation: readonly QaDegradation[]; readonly deniedActions: number; readonly visitedStates: number; }; type BrowserQaExplorerHarness = { readonly actionPolicy: ActionPolicy; readonly executeAction: (action: BrowserAction) => Promise>; readonly loadState: (input: { readonly actionPath: readonly BrowserAction[]; readonly depth: number; readonly target: QaTarget; }) => Promise>; readonly now?: () => string; readonly shouldCreateCandidateFlow?: (state: BrowserQaLoadedState) => boolean; readonly writeCandidate: (candidate: CandidateFinding) => Promise>; readonly writeCandidateFlow: (flow: CandidateFlow) => Promise>; readonly writeEvidenceBundle: (input: WriteEvidenceBundleInput) => Promise>; }; type BrowserQaExplorer = { explore(input: BrowserQaExploreInput): Promise>; }; declare function createBrowserQaExplorer(harness: BrowserQaExplorerHarness): BrowserQaExplorer; declare function deriveExplorationStateId(state: BrowserQaLoadedState): string; type ParseBrowserQaFlowOptions = { readonly sourcePath: string; }; type FlowTargetCliOptions = { readonly baseUrl?: string; readonly localhost?: boolean; readonly target?: string; readonly url?: string; }; type ResolveFlowTargetInput = { readonly cli?: FlowTargetCliOptions; readonly configTarget?: QaTarget; readonly defaultTarget?: QaTarget; readonly flowTarget?: QaTarget; }; type LegacyRouteFlowInput = { readonly id: string; readonly targets: readonly string[]; }; type ImportedLegacyRouteFlow = BrowserQaFlow & { readonly degradation: readonly QaDegradation[]; }; declare function parseBrowserQaFlow(source: string, options: ParseBrowserQaFlowOptions): Result; declare function resolveFlowTarget(input: ResolveFlowTargetInput): QaTarget | undefined; declare function validateFlowTargetCli(cli: FlowTargetCliOptions | undefined): Result; declare function importLegacyRouteFlow(input: LegacyRouteFlowInput): Result; type FileQaRunStoreOptions = { readonly projectRoot?: string; readonly stateDir?: string; readonly stateStore: StateStore; }; type QaRunStore = { writeRun(run: QaRun): Promise>; readRun(id: string): Promise>; readRunManifestRef(id: string): Promise>; writeCandidate(candidate: CandidateFinding): Promise>; readCandidate(id: string): Promise>; writeCandidateFlow(flow: CandidateFlow): Promise>; readCandidateFlow(id: string): Promise>; listCandidateFlows(): Promise>; writeFlowRun(flowRun: FlowRun): Promise>; readFlowRun(id: string): Promise>; listFlowRuns(): Promise>; writeEvidenceBundle(bundle: EvidenceBundle): Promise>; readEvidenceBundle(id: string): Promise>; writePromotedFinding(promotedFinding: PromotedFindingSidecar): Promise>; readPromotedFinding(id: string): Promise>; }; type SharedRunRef = { readonly id: string; readonly manifestDigest: string; readonly manifestPath: string; }; declare function createFileQaRunStore(options: FileQaRunStoreOptions): QaRunStore; type FlowRunnerDriver = BrowserQaDriver; type FlowRunnerRunContext = { readonly actionPolicy?: ActionPolicy; readonly actionPolicyRef?: string; readonly ci?: boolean; readonly qaRunId: string; readonly source?: FlowRun["source"]; readonly target: QaTarget; }; type FlowRunnerResult = FlowRun & { readonly degradation: readonly QaDegradation[]; }; type FlowRunner = { runFlow(flow: BrowserQaFlow, context: FlowRunnerRunContext): Promise>; }; type FlowRunnerOptions = { readonly actionPolicy?: ActionPolicy; readonly driver: FlowRunnerDriver; readonly evidenceStore: Pick; readonly now?: () => string; readonly qaStore: Pick; }; type BrowserQaFlowServiceRunInput = { readonly actionPolicyRef?: string; readonly allowedDomains?: readonly string[]; readonly ci?: boolean; readonly flowPath: string; readonly qaRunId?: string; readonly targetCli?: FlowTargetCliOptions; readonly writeRun?: boolean; }; type BrowserQaFlowServiceRunOutput = { readonly flowRun: FlowRunnerResult; readonly qaRunId: string; }; type BrowserQaFlowService = { runFlowFile(input: BrowserQaFlowServiceRunInput): Promise>; listFlows(input?: { readonly candidates?: boolean; }): Promise>; showFlow(id: string): Promise>; promoteFlow(input: { readonly candidateFlowId: string; readonly outPath: string; }): Promise>; updateFlowRefs(input: { readonly flowPath: string; }): Promise>; }; type BrowserQaFlowServiceOptions = { readonly flowRunner: FlowRunner; readonly projectRoot?: string; readonly qaStore: Pick; readonly stateDir?: string; }; declare function createFlowRunner(options: FlowRunnerOptions): FlowRunner; declare function createBrowserQaFlowService(options: BrowserQaFlowServiceOptions): BrowserQaFlowService; type BrowserQaFlowRunForGate = { readonly flowId?: string; readonly gateEligible?: boolean; readonly highestFailedSeverity?: QaSeverity; readonly id: string; readonly source?: { readonly ref?: string; }; readonly steps?: readonly { readonly completedAt?: string; readonly startedAt?: string; }[]; readonly status: "passed" | "failed" | "degraded"; readonly target?: { readonly kind?: string; readonly ref?: string; }; }; type BrowserQaGateTargetCliOptions = { readonly baseUrl?: string | undefined; readonly localhost?: boolean | string | undefined; readonly target?: string | undefined; readonly url?: string | undefined; }; type BrowserQaGateFlowRunsInput = { readonly actionPolicyRef?: string; readonly ci: boolean; readonly projectRoot?: string; readonly targetCli?: FlowTargetCliOptions; readonly withFlows: boolean | string; }; declare function browserQaFlowRunsForGate(composition: unknown, input: BrowserQaGateFlowRunsInput): Promise>; declare function browserQaGateTargetCli(options: BrowserQaGateTargetCliOptions): Result; declare function browserQaFlowSeverityFromWithFlows(withFlows: boolean | string): QaSeverity; type QaReportArtifactSummary = { readonly checksum: string; readonly id: string; readonly kind: QaEvidenceArtifact["kind"]; readonly mcpReadable: boolean; readonly mediaType: string; readonly path: string; readonly redacted: boolean; readonly sensitiveRaw: boolean; readonly sizeBytes: number; }; type QaReportEvidenceBundleSummary = { readonly artifacts: readonly QaReportArtifactSummary[]; readonly containsSensitiveRaw: boolean; readonly id: string; readonly manifestPath: string; readonly qaRunId: string; readonly redacted: boolean; readonly sanitizedAtCapture: boolean; readonly sourceRunManifestDigest: string; }; type QaReportManifest = { readonly candidateFindings: readonly string[]; readonly candidateFlows: readonly string[]; readonly completedAt?: string; readonly degradation: readonly QaDegradation[]; readonly evidenceBundles: readonly QaReportEvidenceBundleSummary[]; readonly flowRuns: QaRun["flowRuns"]; readonly findings: readonly string[]; readonly mode: QaRun["mode"]; readonly qaRunId: string; readonly reportId: string; readonly startedAt: string; readonly status: QaRun["status"]; readonly target: QaTarget; }; type QaReportInput = { readonly artifactSummaries?: readonly string[]; readonly evidenceBundles: readonly EvidenceBundle[]; readonly qaRun: QaRun; readonly reportId: string; }; declare function createQaReportManifest(input: QaReportInput): QaReportManifest; declare function createQaJsonReport(input: QaReportInput): string; declare function createQaMarkdownReport(input: QaReportInput): string; type BrowserQaRunInput = { readonly actionPolicyRef?: string; readonly allowedDomains?: readonly string[]; readonly ci?: boolean; readonly evidence?: "minimal" | "failures" | "full"; readonly explore?: boolean; readonly flows?: readonly string[]; readonly maxActions?: number; readonly maxDepth?: number; readonly maxStates?: number; readonly network?: "summary" | "har" | "off"; readonly qaRunId?: string; readonly scope?: string; readonly sessionMode?: "isolated" | "shared"; readonly stateLockTimeoutMs?: number; readonly target: QaTarget; readonly task?: string; readonly video?: "off" | "failures" | "all"; }; type BrowserQaRunResult = { readonly candidateFindings: readonly CandidateFinding[]; readonly candidateFlows: readonly CandidateFlow[]; readonly degradation: readonly QaDegradation[]; readonly evidenceBundles: readonly string[]; readonly exploration?: { readonly candidateFindings: number; readonly candidateFlows: number; readonly visitedStates: number; }; readonly findings: readonly string[]; readonly flowRuns: readonly FlowRunSummary[]; readonly mode: "flow" | "explore" | "hybrid"; readonly qaRunId: string; readonly target: QaTarget; }; type BrowserQaExploreCommandInput = Omit & { readonly qaRunId?: string; }; type BrowserQaExploreCommandResult = BrowserQaExploreResult & { readonly qaRunId: string; }; type BrowserQaEvidenceSummary = { readonly refId: string; readonly summaries: readonly unknown[]; }; type BrowserQaReportFormat = "md" | "json" | "manifest"; type BrowserQaReportResult = { readonly format: BrowserQaReportFormat; readonly report: string | QaReportManifest; }; type BrowserQaReplayResult = { readonly promotion?: unknown; readonly replayStatus: string; }; type BrowserQaCleanupResult = { readonly cleaned: readonly string[]; readonly dryRun: boolean; readonly skipped: readonly string[]; }; type BrowserQaOrchestratorHarness = { readonly cleanupStaleSessions: (input: { readonly dryRun: boolean; }) => Promise>; readonly now?: () => string; readonly readEvidence: (input: { readonly refId: string; }) => Promise>; readonly readEvidenceBundle?: (input: { readonly refId: string; }) => Promise>; readonly readRun?: (input: { readonly runId: string; }) => Promise>; readonly replay: (input: { readonly promoteOnRepro: boolean; readonly refId: string; }) => Promise>; readonly promoteCandidateByVerdict?: (input: { readonly refId: string; readonly reason: string; readonly verdictId: string; }) => Promise>; readonly resolveFlows?: (patterns: readonly string[]) => Promise>; readonly runExplore: (input: BrowserQaExploreInput) => Promise>; readonly runFlow: (flowRef: string, input: BrowserQaRunInput) => Promise>; readonly writeRun: (run: QaRun) => Promise>; }; type BrowserQaOrchestrator = { cleanup(input: { readonly dryRun?: boolean; }): Promise>; readEvidence(input: { readonly refId: string; }): Promise>; reportQa(input: { readonly format?: BrowserQaReportFormat; readonly runId: string; }): Promise>; replay(input: { readonly promoteOnRepro?: boolean; readonly refId: string; }): Promise>; promoteCandidateByVerdict(input: { readonly refId: string; readonly reason: string; readonly verdictId: string; }): Promise>; runExplore(input: BrowserQaExploreCommandInput): Promise>; runQa(input: BrowserQaRunInput): Promise>; }; declare function createBrowserQaOrchestrator(harness: BrowserQaOrchestratorHarness): BrowserQaOrchestrator; type ReplayCandidateContext = { readonly promoteOnRepro?: boolean; readonly qaRunId: string; }; type VerdictPromotionContext = { readonly reason: string; readonly verdictId: string; }; type ReplayConditionResult = { readonly evidenceBundleId?: string; readonly reproduced: boolean; }; type PromotedCandidateFinding = CandidateFinding & { readonly finding?: Finding; readonly promotedFinding?: PromotedFindingSidecar; readonly trackedFinding?: TrackedFinding; }; type ReplayPromoterHarness = { readonly now?: () => string; readonly readCandidate: (id: string) => Promise>; readonly readEvidenceBundle?: (id: string) => Promise>; readonly replayCandidateCondition: (candidate: CandidateFinding, context: ReplayCandidateContext) => Promise>; readonly writeCandidate: (candidate: CandidateFinding) => Promise>; readonly writePromotedFinding: (promotion: PromotedFindingSidecar) => Promise>; readonly writeTrackedFinding?: (trackedFinding: TrackedFinding, finding?: Finding) => Promise>; }; type ReplayPromoter = { replayCandidate(id: string, context: ReplayCandidateContext): Promise>; promoteCandidateByVerdict(id: string, context: VerdictPromotionContext): Promise>; }; declare function createReplayPromoter(harness: ReplayPromoterHarness): ReplayPromoter; type LensFactoryOptions = { readonly maxDomChars?: number; readonly projectRoot?: string; }; type LensRegistration = { readonly id: string; readonly method: "measured" | "judged"; readonly requiresModel: boolean; readonly requiresLiveDom: boolean; readonly requiredArtifacts?: readonly CaptureArtifactType[]; readonly presets: readonly SurfaceConfig["evaluation"]["preset"][]; readonly create?: (options?: LensFactoryOptions) => Lens; }; type LensSkipReason = "model_unavailable" | "live_dom_unavailable" | "not_implemented"; type LensExecutionSkip = { readonly lensId: string; readonly reason: LensSkipReason; readonly message: string; }; type LensExecutionPlan = { readonly overlay: Readonly; readonly preset: SurfaceConfig["evaluation"]["preset"]; readonly selected: readonly LensRegistration[]; readonly skipped: readonly LensExecutionSkip[]; }; type InstantiatedLens = { readonly lens: Lens; readonly registration: LensRegistration; }; type SelectLensExecutionPlanInput = { readonly config: SurfaceConfig; readonly capture?: Capture; readonly modelAvailability?: ModelAvailability; readonly registry?: readonly LensRegistration[]; }; type SynthesisDecision = { readonly factKey: string; readonly sourceOfTruth: "measured" | "judged"; readonly reason: string; readonly measuredSource: string; readonly measuredValue: string; readonly judgedSource: string; readonly judgedValue: string; }; type SynthesizeMeasuredWinsInput = { readonly factKey: string; readonly measuredSource: string; readonly measuredValue: string; readonly judgedSource: string; readonly judgedValue: string; }; declare const BUILT_IN_LENS_REGISTRY: readonly [{ readonly id: "accessibility"; readonly method: "measured"; readonly requiresModel: false; readonly requiresLiveDom: true; readonly presets: readonly ["quick", "mvp", "standard", "deep", "accessibility-first", "agent-ready"]; readonly create: () => Lens; }, { readonly id: "usability"; readonly method: "judged"; readonly requiresModel: true; readonly requiredArtifacts: readonly ["dom-snapshot"]; readonly requiresLiveDom: true; readonly presets: readonly ["quick", "mvp", "standard", "deep", "agent-ready"]; readonly create: (options: LensFactoryOptions | undefined) => Lens; }, { readonly id: "visual-hierarchy"; readonly method: "judged"; readonly requiredArtifacts: readonly ["dom-snapshot", "computed-styles"]; readonly requiresModel: false; readonly requiresLiveDom: true; readonly presets: readonly ["mvp", "standard", "deep", "accessibility-first", "design-system-focused"]; readonly create: (options: LensFactoryOptions | undefined) => Lens; }, { readonly id: "content"; readonly method: "judged"; readonly requiresModel: false; readonly requiresLiveDom: true; readonly presets: readonly ["standard", "deep"]; readonly create: (options: LensFactoryOptions | undefined) => Lens; }, { readonly id: "responsiveness"; readonly method: "measured"; readonly requiresModel: false; readonly requiresLiveDom: true; readonly presets: readonly ["mvp", "standard", "deep", "accessibility-first", "conversion-focused"]; readonly create: (options: LensFactoryOptions | undefined) => Lens; }, { readonly id: "conversion"; readonly method: "judged"; readonly requiredArtifacts: readonly ["dom-snapshot"]; readonly requiresModel: true; readonly requiresLiveDom: true; readonly presets: readonly ["conversion-focused", "deep", "agent-ready"]; readonly create: (options: LensFactoryOptions | undefined) => Lens; }, { readonly id: "message-clarity"; readonly method: "judged"; readonly requiresModel: true; readonly requiresLiveDom: false; readonly presets: readonly ["standard", "deep", "conversion-focused"]; }, { readonly id: "task-completion"; readonly method: "judged"; readonly requiredArtifacts: readonly ["dom-snapshot"]; readonly requiresModel: true; readonly requiresLiveDom: true; readonly presets: readonly ["standard", "deep", "agent-ready"]; readonly create: (options: LensFactoryOptions | undefined) => Lens; }, { readonly id: "agent-implementation"; readonly method: "judged"; readonly requiresModel: true; readonly requiresLiveDom: false; readonly presets: readonly ["deep", "agent-ready"]; }, { readonly id: "data-density"; readonly method: "judged"; readonly requiresModel: true; readonly requiresLiveDom: false; readonly presets: readonly ["standard", "deep"]; }, { readonly id: "trust-and-control"; readonly method: "judged"; readonly requiresModel: true; readonly requiresLiveDom: false; readonly presets: readonly ["standard", "deep", "agent-ready"]; }, { readonly id: "trust-and-credibility"; readonly method: "judged"; readonly requiresModel: true; readonly requiresLiveDom: false; readonly presets: readonly ["standard", "deep", "conversion-focused"]; }]; declare function selectLensExecutionPlan(input: SelectLensExecutionPlanInput): LensExecutionPlan; declare function instantiateLensExecutionPlan(plan: LensExecutionPlan, options?: LensFactoryOptions): readonly InstantiatedLens[]; declare function synthesizeMeasuredWinsDecision(input: SynthesizeMeasuredWinsInput): SynthesisDecision; declare const ModelEgressBlockedReasonSchema: z.ZodEnum<{ channel_denied_by_policy: "channel_denied_by_policy"; channel_not_allowed_by_policy: "channel_not_allowed_by_policy"; model_egress_blocked_by_policy: "model_egress_blocked_by_policy"; channel_metadata_missing: "channel_metadata_missing"; screenshot_blocked_by_policy: "screenshot_blocked_by_policy"; screenshot_blocked_no_redacted_artifact: "screenshot_blocked_no_redacted_artifact"; screenshot_blocked_no_verified_redaction: "screenshot_blocked_no_verified_redaction"; primary_provider_failed_no_fallback: "primary_provider_failed_no_fallback"; }>; type ModelEgressBlockedReason = z.infer; declare const ModelEgressRedactionStatusSchema: z.ZodEnum<{ none: "none"; "text-only": "text-only"; "redacted-screenshots": "redacted-screenshots"; }>; type ModelEgressRedactionStatus = z.infer; declare const ModelEgressUnavailableChannelSchema: z.ZodObject<{ channelId: z.ZodOptional>; sourceKind: z.ZodOptional>; reason: z.ZodEnum<{ "no-model-configured": "no-model-configured"; "missing-credential": "missing-credential"; "missing-base-url": "missing-base-url"; "invalid-provider": "invalid-provider"; "invalid-config": "invalid-config"; "not-installed": "not-installed"; "auth-unavailable": "auth-unavailable"; "unsupported-capability": "unsupported-capability"; timeout: "timeout"; "command-failed": "command-failed"; "parse-failed": "parse-failed"; "prompt-cleanup-failed": "prompt-cleanup-failed"; }>; message: z.ZodString; }, z.core.$strict>; type ModelEgressUnavailableChannel = z.infer; declare const ModelEgressLedgerEntrySchema: z.ZodObject<{ runId: z.ZodString; sourceKind: z.ZodEnum<{ local: "local"; mmr: "mmr"; api: "api"; "subscription-cli": "subscription-cli"; }>; attemptedChannels: z.ZodArray>; completedChannels: z.ZodArray>; unavailableChannels: z.ZodArray>; sourceKind: z.ZodOptional>; reason: z.ZodEnum<{ "no-model-configured": "no-model-configured"; "missing-credential": "missing-credential"; "missing-base-url": "missing-base-url"; "invalid-provider": "invalid-provider"; "invalid-config": "invalid-config"; "not-installed": "not-installed"; "auth-unavailable": "auth-unavailable"; "unsupported-capability": "unsupported-capability"; timeout: "timeout"; "command-failed": "command-failed"; "parse-failed": "parse-failed"; "prompt-cleanup-failed": "prompt-cleanup-failed"; }>; message: z.ZodString; }, z.core.$strict>>; blockedReasons: z.ZodArray>; artifactClassesSent: z.ZodArray>; redactionStatus: z.ZodEnum<{ none: "none"; "text-only": "text-only"; "redacted-screenshots": "redacted-screenshots"; }>; }, z.core.$strict>; type ModelEgressLedgerEntry = z.infer; type ModelChannelPermissionInput = { readonly channelId?: unknown; readonly sourceKind?: unknown; }; type ModelChannelPermission = { readonly permitted: true; } | { readonly permitted: false; readonly reason: ModelEgressBlockedReason; readonly message: string; }; type ModelArtifactEgressDecision = { readonly artifactsToSend: readonly CaptureArtifact[]; readonly artifactClassesSent: readonly CaptureArtifactType[]; readonly blockedReasons: readonly ModelEgressBlockedReason[]; readonly redactionStatus: ModelEgressRedactionStatus; }; type MaskModelArtifactTextInput = { readonly artifactType: CaptureArtifactType; readonly text: string; readonly redaction?: ArtifactRedactionMetadata; }; type MaskModelArtifactTextResult = { readonly artifactType: CaptureArtifactType; readonly maskingStrategy: "pattern" | "structural"; readonly text: string; }; declare function isModelChannelPermitted(policy: ModelEgressPolicy, metadata: ModelChannelPermissionInput): ModelChannelPermission; declare function evaluateModelArtifactEgress(capture: Capture, policy: ModelEgressPolicy): ModelArtifactEgressDecision; declare function createModelEgressLedgerEntry(input: z.input): ModelEgressLedgerEntry; declare function maskModelArtifactText(input: MaskModelArtifactTextInput): MaskModelArtifactTextResult; declare function maskModelPlainText(text: string): string; type MaybePromise$3 = T | Promise; type MmrCapabilityProbeInput = { readonly channelId: "mmr"; readonly sourceKind: "mmr"; }; interface MmrAuditFallback { readonly id: "mmr"; availability(input?: { readonly capture?: Capture; }): MaybePromise$3>; run(input: { readonly capture: Capture; readonly request: ModelRequest; }): MaybePromise$3>; } type MmrAuditFallbackOptions = { readonly probe?: (input: MmrCapabilityProbeInput) => MaybePromise$3; }; declare function createMmrAuditFallback(options?: MmrAuditFallbackOptions): MmrAuditFallback; type MaybePromise$2 = T | Promise; type ProcessRunRequest = { readonly command: string; readonly args: readonly string[]; readonly allowedReadPaths?: readonly string[]; readonly channelId?: DirectSubscriptionChannelId; readonly cwd?: string; readonly env?: Readonly>; readonly extendEnv: false; readonly requiresFilesystemIsolation: true; readonly stdin?: string; readonly timeoutMs: number; }; type ProcessRunResult = { readonly exitCode: number; readonly stdout: string; readonly stderr: string; readonly timedOut?: boolean; }; interface ProcessRunner { readonly enforcedFilesystemIsolation?: boolean; run(request: ProcessRunRequest): MaybePromise$2; } type SubscriptionPromptFile = { readonly path: string; cleanup(): MaybePromise$2>; }; interface SubscriptionPromptStore { create(prompt: string): MaybePromise$2>; } type SubscriptionCliCapability = { readonly channelId: DirectSubscriptionChannelId; readonly command: string; readonly completionArgs: readonly string[]; readonly model: string; readonly promptDelivery: "stdin" | "prompt-file"; readonly version: string; }; type ResolveDirectProvidersResult = { readonly subscriptionProviders: readonly ModelProvider[]; readonly discoveryUnavailableChannels: readonly Extract[]; }; type SubscriptionCliProviderOptions = { readonly capability: SubscriptionCliCapability; readonly runner: ProcessRunner; readonly promptStore?: SubscriptionPromptStore; readonly timeoutMs: number; }; declare const defaultProcessRunner: ProcessRunner; declare function buildIsolatedProcessEnvironment(input: { readonly baseEnv: Readonly>; readonly isolatedRoot: string; readonly workspaceRoot: string; readonly commandEnv?: Readonly>; }): Record; declare function validateSubscriptionAuthMirrorSource(source: string): Promise; declare function resolveDirectProviders(config: SurfaceConfig, runner?: ProcessRunner): Promise; declare function createSubscriptionCliProvider(options: SubscriptionCliProviderOptions): ModelProvider; declare function resolvePromptTempParent(env?: Readonly, platform?: NodeJS.Platform): string; declare function pruneStaleSurfaceTempRoots(parent?: string, nowMs?: number): Promise; declare function cleanupActiveSubscriptionTempRootsForProcess(): Promise; declare function installSubscriptionTempRootProcessCleanupHandlers(): () => void; type MaybePromise$1 = T | Promise; type ModelProviderFactory = () => MaybePromise$1; type ResolveSubscriptionProviders = (config: SurfaceConfig) => MaybePromise$1; type AuditRunnerDependencies = { readonly artifactWriter?: ArtifactWriter; readonly knowledgeSource: KnowledgeSource; readonly lensFactoryOptions?: LensFactoryOptions; readonly lensRegistry: readonly LensRegistration[]; readonly mmrFallback?: MmrAuditFallback; readonly modelProvider?: ModelProvider; readonly modelProviderFactory?: ModelProviderFactory; readonly reconciliation?: ReconciliationService; readonly resolveSubscriptionProviders?: ResolveSubscriptionProviders; readonly subscriptionProviders?: readonly ModelProvider[]; }; type AuditRunnerInput = { readonly capture: Capture; readonly config: SurfaceConfig; readonly discoveryUnavailableChannels?: readonly Extract[]; readonly evidence?: readonly Evidence[]; readonly lensId?: string; readonly mmrFallback?: MmrAuditFallback; readonly modelProvider?: ModelProvider; readonly modelProviderFactory?: ModelProviderFactory; readonly resolveSubscriptionProviders?: ResolveSubscriptionProviders; readonly runId: string; readonly subscriptionProviders?: readonly ModelProvider[]; }; type AuditRunnerUnavailableChannel = { readonly id: string; readonly reason: string; readonly message: string; }; type AuditRunnerResult = { readonly blockedReasons: readonly ModelEgressBlockedReason[]; readonly evaluatedLenses: readonly string[]; readonly findings: readonly Finding[]; readonly modelEgress: readonly ModelEgressLedgerEntry[]; readonly reconciliationQuestions?: readonly ReconciliationQuestion[]; readonly skippedLenses: readonly LensExecutionSkip[]; readonly unavailableChannels: readonly AuditRunnerUnavailableChannel[]; }; type AuditRunner = (input: AuditRunnerInput) => MaybePromise$1>; type ModelExecutionPlan = { readonly egressEnabled: boolean; readonly useDirectSubscriptions: boolean; readonly useMmr: boolean; }; declare function createAuditRunner(dependencies: AuditRunnerDependencies): AuditRunner; declare function resolveModelExecutionPlan(config: SurfaceConfig, input: { readonly hasMmrFallback: boolean; readonly primaryProviderConfigured: boolean; }): ModelExecutionPlan; type CaptureIdFactory = (target: Target) => string; type CaptureClock = () => string; type CaptureRandomHex = () => string; interface CaptureService { capture(target: Target, options: CaptureOptions): Promise>; } interface CaptureServiceOptions { readonly artifactWriter?: ArtifactWriter; readonly backends: readonly CaptureBackend[]; readonly staticFallback: CaptureBackend; } interface PlaywrightCaptureBackendOptions { readonly available?: boolean; readonly clock?: CaptureClock; readonly idFactory?: CaptureIdFactory; readonly loadPlaywright?: () => Promise; } interface AgentBrowserCommandResult { readonly exitCode: number; readonly stderr: string; readonly stdout: string; } type AgentBrowserCommandRunner = (args: readonly string[]) => Promise; interface AgentBrowserCaptureBackendOptions { readonly available?: boolean; readonly clock?: CaptureClock; readonly command?: string; readonly idFactory?: CaptureIdFactory; readonly runCommand?: AgentBrowserCommandRunner; readonly sessionName?: string; } interface StaticCaptureBackendOptions { /** * Optional trusted source roots for static target refs. When omitted, * target refs are treated as trusted local file inputs and may point to * any readable image file on disk. */ readonly allowedSourceRoots?: readonly string[]; readonly clock?: CaptureClock; readonly idFactory?: CaptureIdFactory; } type RedactionTarget = "dom" | "screenshot"; declare function redactCaptureArtifactText(input: { readonly contents: string; readonly redactionRules?: CaptureOptions["config"]["redactionRules"]; readonly target: RedactionTarget; }): Result<{ readonly contents: string; readonly redacted: boolean; }, SurfaceError>; declare function createCaptureService(options: CaptureServiceOptions): CaptureService; declare function createPlaywrightCaptureBackend(options?: PlaywrightCaptureBackendOptions): CaptureBackend; declare function createAgentBrowserCaptureBackend(options?: AgentBrowserCaptureBackendOptions): CaptureBackend; /** * Creates the degraded static fallback backend. Static target refs are trusted * local file inputs unless allowedSourceRoots is configured. Do not pass * attacker-controlled refs without constraining source roots. */ declare function createStaticCaptureBackend(options?: StaticCaptureBackendOptions): CaptureBackend; declare function selectCaptureBackend(backends: readonly CaptureBackend[]): CaptureBackend | undefined; declare function createDefaultCaptureIdFactory(options?: { readonly clock?: CaptureClock; readonly randomHex?: CaptureRandomHex; }): CaptureIdFactory; type MaybePromise = T | Promise; declare const ExecutablePipelineStageIdSchema: z.ZodEnum<{ capture: "capture"; validation: "validation"; routes: "routes"; visual: "visual"; content: "content"; accessibility: "accessibility"; conversion: "conversion"; persona: "persona"; responsiveness: "responsiveness"; discovery: "discovery"; heuristic: "heuristic"; "cognitive-walkthrough": "cognitive-walkthrough"; innovation: "innovation"; synthesis: "synthesis"; }>; type ExecutablePipelineStageId = z.infer; declare const PipelineStageIdSchema: z.ZodEnum<{ capture: "capture"; validation: "validation"; completed: "completed"; routes: "routes"; visual: "visual"; content: "content"; accessibility: "accessibility"; conversion: "conversion"; persona: "persona"; responsiveness: "responsiveness"; discovery: "discovery"; heuristic: "heuristic"; "cognitive-walkthrough": "cognitive-walkthrough"; innovation: "innovation"; synthesis: "synthesis"; "pending-completion": "pending-completion"; }>; type PipelineStageId = z.infer; declare const PipelineEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"StageAdvanced">; runId: z.ZodString; stage: z.ZodUnion, z.ZodLiteral<"finalization">]>; sequence: z.ZodNumber; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"StageSkipped">; runId: z.ZodString; stage: z.ZodUnion, z.ZodLiteral<"finalization">]>; reason: z.ZodString; sequence: z.ZodNumber; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"AuditRunFailed">; runId: z.ZodString; stage: z.ZodUnion, z.ZodLiteral<"finalization">]>; message: z.ZodString; sequence: z.ZodNumber; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"AuditRunCompleted">; runId: z.ZodString; sequence: z.ZodNumber; }, z.core.$strict>], "type">; type PipelineEvent = z.infer; type PipelineStageDefinition = { readonly id: ExecutablePipelineStageId; readonly fr: `FR-PIPE-${number}`; readonly minDepth: SurfaceConfig["evaluation"]["depth"]; readonly presets?: readonly SurfaceConfig["evaluation"]["preset"][]; }; type PipelineStageContext = { readonly runId: string; readonly stage: PipelineStageDefinition; readonly config: SurfaceConfig; readonly state: ProjectStateSnapshot; }; type PipelineStageHandler = (context: PipelineStageContext) => MaybePromise>; type PipelineOrchestratorOptions = { readonly stateStore: StateStore; readonly handlers: Partial>; }; type PipelineRunInput = { readonly runId: string; readonly config?: SurfaceConfig; }; type PipelineRunResult = { readonly runId: string; readonly newlyCompletedStages: readonly ExecutablePipelineStageId[]; readonly skippedStages: readonly { readonly stage: ExecutablePipelineStageId; readonly reason: string; }[]; readonly events: readonly PipelineEvent[]; }; interface PipelineOrchestrator { /** * Resume behavior is driven by matching pipeline metadata for the same run and * stage plan. Legacy states without metadata, or states from a different plan, * restart the active plan from the beginning. Project state stores one active * pipeline run at a time; starting a different runId overwrites prior pipeline * metadata rather than preserving concurrent run progress. Callers must * serialize run() calls per runId; this orchestrator does not provide locking * or compare-and-swap protection around StateStore read/write cycles. * Pre-stage write failures happen before metadata can reserve a sequence, so * those retries intentionally restart event numbering from the last durable * metadata snapshot. */ run(input: PipelineRunInput): Promise>; } declare const DEFAULT_PIPELINE_STAGE_DEFINITIONS: readonly [{ readonly id: "discovery"; readonly fr: "FR-PIPE-1"; readonly minDepth: 1; }, { readonly id: "persona"; readonly fr: "FR-PIPE-2"; readonly minDepth: 1; }, { readonly id: "routes"; readonly fr: "FR-PIPE-3"; readonly minDepth: 1; }, { readonly id: "capture"; readonly fr: "FR-PIPE-4"; readonly minDepth: 1; }, { readonly id: "heuristic"; readonly fr: "FR-PIPE-5"; readonly minDepth: 1; }, { readonly id: "accessibility"; readonly fr: "FR-PIPE-6"; readonly minDepth: 1; }, { readonly id: "visual"; readonly fr: "FR-PIPE-7"; readonly minDepth: 1; }, { readonly id: "content"; readonly fr: "FR-PIPE-8"; readonly minDepth: 1; }, { readonly id: "responsiveness"; readonly fr: "FR-PIPE-9"; readonly minDepth: 1; }, { readonly id: "cognitive-walkthrough"; readonly fr: "FR-PIPE-10"; readonly minDepth: 4; }, { readonly id: "conversion"; readonly fr: "FR-PIPE-11"; readonly minDepth: 4; readonly presets: readonly ["agent-ready", "conversion-focused", "deep"]; }, { readonly id: "innovation"; readonly fr: "FR-PIPE-12"; readonly minDepth: 5; readonly presets: readonly ["deep"]; }, { readonly id: "synthesis"; readonly fr: "FR-PIPE-13"; readonly minDepth: 1; }, { readonly id: "validation"; readonly fr: "FR-PIPE-14"; readonly minDepth: 1; }]; /** Select the executable pipeline stages for the configured depth and preset. */ declare function selectPipelineStages(config?: SurfaceConfig): readonly PipelineStageDefinition[]; /** Create explicit no-op handlers for tests and metadata-only prototype wiring. */ declare function createNoopPipelineHandlers(overrides?: Partial>): Record; /** Create a stateless orchestrator with metadata-backed resume semantics. */ declare function createPipelineOrchestrator(options: PipelineOrchestratorOptions): PipelineOrchestrator; type SurfaceCompositionGeneratedAt = string | (() => string); type SurfaceCompositionOptions = { readonly browserQa?: Partial; readonly captureBackends?: readonly CaptureBackend[]; readonly frameworkAdapters?: readonly FrameworkAdapter[]; readonly generatedAt?: SurfaceCompositionGeneratedAt; readonly gateEvaluator?: GateEvaluator; readonly groundingTools?: readonly GroundingTool[]; readonly issueExporters?: readonly IssueExporter[]; readonly knowledgeRootDir?: string; readonly knowledgeSource?: KnowledgeSource; readonly lensFactoryOptions?: LensFactoryOptions; readonly lensRegistry?: readonly LensRegistration[]; readonly mmrFallback?: MmrAuditFallback; readonly modelProvider?: ModelProvider; readonly modelProviderFactory?: ModelProviderFactory; readonly pipelineHandlers?: Partial>; readonly processRunner?: ProcessRunner; readonly projectRoot?: string; readonly reportRenderers?: readonly ReportRenderer[]; readonly resolveSubscriptionProviders?: ResolveSubscriptionProviders; readonly stateDir?: string; readonly stateStore?: StateStore; readonly staticFallback?: CaptureBackend; readonly subscriptionProviders?: readonly ModelProvider[]; }; type BrowserQaComposition = { readonly driver: BrowserQaDriver; readonly evidenceStore: QaEvidenceStore; readonly flowRunner: FlowRunner; readonly flowService: BrowserQaFlowService; readonly orchestrator: BrowserQaOrchestrator; readonly qaStore: QaRunStore; }; type SurfaceComposition = { readonly browserQa: BrowserQaComposition; readonly auditRunner: AuditRunner; readonly captureBackends: readonly CaptureBackend[]; readonly captureService: CaptureService; readonly frameworkAdapters: readonly FrameworkAdapter[]; readonly gateEvaluator: GateEvaluator; readonly groundingTools: readonly GroundingTool[]; readonly issueExporters: readonly IssueExporter[]; readonly knowledgeSource: KnowledgeSource; readonly lensFactoryOptions: LensFactoryOptions; readonly lensRegistry: readonly LensRegistration[]; readonly pipelineOrchestrator: PipelineOrchestrator; readonly reportRenderers: readonly ReportRenderer[]; readonly stateDir: string; readonly stateStore: StateStore; }; /** * Build the shared core composition root consumed by interface adapters. * * CLI and MCP should both call this factory and then add package-local plugins * through the option arrays. Core wires only core-owned implementations here so * package dependencies stay one-way: plugins depend on core, never the reverse. */ declare function createSurfaceComposition(options?: SurfaceCompositionOptions): SurfaceComposition; declare const DEFAULT_COMPOSITION_STAGE_IDS: ("capture" | "validation" | "routes" | "visual" | "content" | "accessibility" | "conversion" | "persona" | "responsiveness" | "discovery" | "heuristic" | "cognitive-walkthrough" | "innovation" | "synthesis")[]; declare const TextInputSchema: z.ZodObject<{ path: z.ZodOptional; contents: z.ZodOptional; }, z.core.$strict>; type TextInput = z.infer; declare const DesignTokenSchema: z.ZodObject<{ name: z.ZodString; value: z.ZodString; }, z.core.$strict>; type DesignToken = z.infer; declare const PersonaSchema: z.ZodObject<{ goals: z.ZodDefault>; id: z.ZodString; priorKnowledge: z.ZodDefault>; }, z.core.$strict>; type Persona = z.infer; declare const TaskDefinitionSchema: z.ZodObject<{ conversionCritical: z.ZodDefault; id: z.ZodString; personaId: z.ZodOptional; steps: z.ZodDefault>; }, z.core.$strict>; type TaskDefinition = z.infer; declare const ContextIngestionInputSchema: z.ZodObject<{ component: z.ZodOptional; designTokens: z.ZodDefault>>; dom: z.ZodOptional; contents: z.ZodOptional; }, z.core.$strict>>; personas: z.ZodDefault>; id: z.ZodString; priorKnowledge: z.ZodDefault>; }, z.core.$strict>>>; scaffoldDocs: z.ZodDefault; contents: z.ZodOptional; }, z.core.$strict>>>; screenshot: z.ZodOptional; contents: z.ZodOptional; }, z.core.$strict>>; source: z.ZodOptional; contents: z.ZodOptional; }, z.core.$strict>>; sources: z.ZodDefault; contents: z.ZodOptional; }, z.core.$strict>>>; tasks: z.ZodDefault; id: z.ZodString; personaId: z.ZodOptional; steps: z.ZodDefault>; }, z.core.$strict>>>; tokenDocuments: z.ZodDefault; contents: z.ZodOptional; }, z.core.$strict>>>; }, z.core.$strict>; type ContextIngestionInput = z.input; type ContextInputKind = "component" | "source" | "dom" | "screenshot" | "design-tokens" | "scaffold-docs" | "persona" | "task"; interface InputProvenance { readonly kind: ContextInputKind; readonly ref: string; readonly present: true; readonly recordedAt: string; readonly sha256?: string; } interface IngestedContext { readonly designTokens: readonly DesignToken[]; readonly dom?: SourceFileRef; readonly personas: readonly Persona[]; readonly scaffoldDocs: readonly SourceFileRef[]; readonly screenshot?: SourceFileRef; readonly sources: readonly SourceFileRef[]; readonly tasks: readonly TaskDefinition[]; } interface ContextIngestion { readonly componentMap: ComponentMap; readonly context: IngestedContext; readonly findings: readonly FindingDraft[]; readonly provenance: readonly InputProvenance[]; readonly target: Target; } type ContextIngestorClock = () => string; interface ContextIngestorOptions { readonly adapters?: readonly FrameworkAdapter[]; readonly artifactWriter?: ArtifactWriter; readonly clock?: ContextIngestorClock; readonly projectRoot?: string; } interface ContextIngestor { ingest(input: ContextIngestionInput): Promise>; } /** * Creates a static/context ingestion service that constructs a stable Target and provenance. */ declare function createContextIngestor(options?: ContextIngestorOptions): ContextIngestor; type ContentMicrocopyLensOptions = { readonly maxReadingGrade?: number; readonly minWords?: number; readonly projectRoot?: string; }; declare function createContentMicrocopyLens(options?: ContentMicrocopyLensOptions): Lens; type DiscoveryRunInput = { readonly appTypeOverride?: AppType; readonly config?: SurfaceConfig; readonly personaHint?: string; readonly routeCandidates?: readonly string[]; readonly routeCap?: number; readonly runId: string; readonly target: Target; readonly taskHint?: string; }; declare const RouteInventoryEntrySchema: z.ZodObject<{ path: z.ZodString; source: z.ZodEnum<{ candidate: "candidate"; target: "target"; }>; }, z.core.$strict>; type RouteInventoryEntry = z.infer; declare const RouteSkippedSchema: z.ZodObject<{ path: z.ZodString; reason: z.ZodLiteral<"route_cap_exceeded">; source: z.ZodEnum<{ candidate: "candidate"; target: "target"; }>; }, z.core.$strict>; type RouteSkipped = z.infer; declare const RouteInventorySchema: z.ZodObject<{ cap: z.ZodNumber; routes: z.ZodArray; }, z.core.$strict>>; skipped: z.ZodArray; source: z.ZodEnum<{ candidate: "candidate"; target: "target"; }>; }, z.core.$strict>>; }, z.core.$strict>; type RouteInventory = z.infer; declare const PersonaTaskSchema: z.ZodObject<{ persona: z.ZodString; task: z.ZodString; }, z.core.$strict>; type PersonaTask = z.infer; declare const AppTypeClassificationSchema: z.ZodObject<{ appType: z.ZodEnum<{ generic: "generic"; "saas-dashboard": "saas-dashboard"; "e-commerce": "e-commerce"; marketing: "marketing"; admin: "admin"; "content-media": "content-media"; }>; matchedSignals: z.ZodArray; source: z.ZodEnum<{ config: "config"; "route-inventory": "route-inventory"; "target-ref": "target-ref"; "generic-fallback": "generic-fallback"; }>; }, z.core.$strict>; type AppTypeClassification = z.infer; declare const DiscoveryEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"AppTypeClassified">; appType: z.ZodEnum<{ generic: "generic"; "saas-dashboard": "saas-dashboard"; "e-commerce": "e-commerce"; marketing: "marketing"; admin: "admin"; "content-media": "content-media"; }>; overlayId: z.ZodEnum<{ generic: "generic"; "saas-dashboard": "saas-dashboard"; "e-commerce": "e-commerce"; marketing: "marketing"; admin: "admin"; "content-media": "content-media"; }>; runId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"RoutesSkipped">; cap: z.ZodNumber; runId: z.ZodString; skipped: z.ZodArray; source: z.ZodEnum<{ candidate: "candidate"; target: "target"; }>; }, z.core.$strict>>; }, z.core.$strict>], "type">; type DiscoveryEvent = z.infer; declare const DiscoveryResultSchema: z.ZodObject<{ appType: z.ZodEnum<{ generic: "generic"; "saas-dashboard": "saas-dashboard"; "e-commerce": "e-commerce"; marketing: "marketing"; admin: "admin"; "content-media": "content-media"; }>; classification: z.ZodObject<{ appType: z.ZodEnum<{ generic: "generic"; "saas-dashboard": "saas-dashboard"; "e-commerce": "e-commerce"; marketing: "marketing"; admin: "admin"; "content-media": "content-media"; }>; matchedSignals: z.ZodArray; source: z.ZodEnum<{ config: "config"; "route-inventory": "route-inventory"; "target-ref": "target-ref"; "generic-fallback": "generic-fallback"; }>; }, z.core.$strict>; events: z.ZodArray; appType: z.ZodEnum<{ generic: "generic"; "saas-dashboard": "saas-dashboard"; "e-commerce": "e-commerce"; marketing: "marketing"; admin: "admin"; "content-media": "content-media"; }>; overlayId: z.ZodEnum<{ generic: "generic"; "saas-dashboard": "saas-dashboard"; "e-commerce": "e-commerce"; marketing: "marketing"; admin: "admin"; "content-media": "content-media"; }>; runId: z.ZodString; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"RoutesSkipped">; cap: z.ZodNumber; runId: z.ZodString; skipped: z.ZodArray; source: z.ZodEnum<{ candidate: "candidate"; target: "target"; }>; }, z.core.$strict>>; }, z.core.$strict>], "type">>; overlayId: z.ZodEnum<{ generic: "generic"; "saas-dashboard": "saas-dashboard"; "e-commerce": "e-commerce"; marketing: "marketing"; admin: "admin"; "content-media": "content-media"; }>; personaTask: z.ZodObject<{ persona: z.ZodString; task: z.ZodString; }, z.core.$strict>; routeInventory: z.ZodObject<{ cap: z.ZodNumber; routes: z.ZodArray; }, z.core.$strict>>; skipped: z.ZodArray; source: z.ZodEnum<{ candidate: "candidate"; target: "target"; }>; }, z.core.$strict>>; }, z.core.$strict>; runId: z.ZodString; }, z.core.$loose>; type DiscoveryResult = z.infer; declare function runDiscovery(input: DiscoveryRunInput, options?: { readonly stateStore?: StateStore; }): Promise>; declare const REDACTED_EXPORT_VALUE = "[Redacted]"; declare function redactExportString(value: string, redactionRules: readonly RedactionRule[] | undefined): Result; declare function redactExportValue(value: T, redactionRules: readonly RedactionRule[] | undefined): Result; type CognitivePersona = { readonly goals: readonly string[]; readonly id: string; readonly priorKnowledge: "first-time" | "returning" | "expert"; }; type CognitiveTaskDefinition = { readonly conversionCritical: boolean; readonly id: string; readonly persona: CognitivePersona; readonly steps: readonly string[]; }; type TaskCompletionLensOptions = LensFactoryOptions & { readonly task?: CognitiveTaskDefinition; }; type ConversionLensOptions = LensFactoryOptions & { readonly conversionPath?: string; }; declare function createTaskCompletionLens(options?: TaskCompletionLensOptions): Lens; declare function createConversionLens(options?: ConversionLensOptions): Lens; type QaGateFlowRun = { readonly flowId?: string; readonly gateEligible?: boolean; readonly highestFailedSeverity?: QaSeverity; readonly id: string; readonly status: "passed" | "failed" | "degraded"; }; type QaGateCandidateFinding = { readonly gateEligible: boolean; readonly id: string; readonly severity: QaSeverity; }; type FlowAwareGatePolicy = GatePolicy & { readonly failOnFlowSeverityAtOrAbove?: QaSeverity; }; type FlowAwareGateInput = { readonly candidateFindings?: readonly QaGateCandidateFinding[]; readonly context?: GateEvaluationContext; readonly findings: readonly Finding[]; readonly policy: FlowAwareGatePolicy; readonly qaFlowRuns?: readonly QaGateFlowRun[]; }; type FlowAwareGateResult = GateResult & { readonly failingCandidateIds: readonly string[]; readonly failingFlowRunIds: readonly string[]; }; /** Create the default release gate evaluator for measured findings. */ declare function createGateEvaluator(): GateEvaluator; declare function evaluateGateWithQaFlows(input: FlowAwareGateInput): Result; type FindingsJsonRendererOptions = { readonly generatedAt: string; readonly degradation?: FindingsEnvelope["degradation"]; readonly redactionRules?: readonly RedactionRule[]; }; type ReportRendererRedactionOptions = { readonly redactionRules?: readonly RedactionRule[]; }; declare const SurfaceSarifLogSchema: z.ZodObject<{ $schema: z.ZodString; version: z.ZodLiteral<"2.1.0">; runs: z.ZodArray; informationUri: z.ZodString; rules: z.ZodArray; }, z.core.$loose>>; }, z.core.$loose>; }, z.core.$loose>; results: z.ZodArray; message: z.ZodObject<{ text: z.ZodString; }, z.core.$strict>; ruleId: z.ZodString; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$loose>; type SurfaceSarifLog = z.infer; type ReportArtifactSpec = { readonly renderer: ReportRenderer; readonly relativePath: string; }; type WrittenReportArtifact = { readonly artifact: PersistedArtifactRef; readonly report: Report; readonly relativePath: string; }; type RenderAndWriteReportArtifactsOptions = { readonly stateStore: StateStore; readonly findings: readonly Finding[]; readonly backlog: Backlog; readonly specs?: readonly ReportArtifactSpec[]; }; type ExplainRendererOptions = { readonly findingId: string; readonly knowledge?: KnowledgeSource; readonly redactionRules?: readonly RedactionRule[]; }; type AlternativeProposal = { readonly id: string; readonly rationale: string; readonly title: string; }; type AlternativesReportData = { readonly proposals: readonly AlternativeProposal[]; readonly target: Target; }; type AlternativesRendererOptions = ReportRendererRedactionOptions & { readonly proposals?: readonly AlternativeProposal[]; readonly target: Target; }; type DiffRendererOptions = ReportRendererRedactionOptions & { readonly afterRunId: string; readonly beforeRunId: string; readonly diff: TrackedFindingsDiff; }; declare function createFindingsJsonRenderer(options: FindingsJsonRendererOptions): ReportRenderer; declare function createSarifRenderer(options?: ReportRendererRedactionOptions): ReportRenderer; declare function createFindingsMarkdownRenderer(options?: ReportRendererRedactionOptions): ReportRenderer; declare function createBacklogMarkdownRenderer(options?: ReportRendererRedactionOptions): ReportRenderer; declare function createAgentPlanMarkdownRenderer(options?: ReportRendererRedactionOptions): ReportRenderer; declare function createValidationReportMarkdownRenderer(options?: ReportRendererRedactionOptions): ReportRenderer; declare function createExplainMarkdownRenderer(options: ExplainRendererOptions): ReportRenderer; declare function createExplainJsonRenderer(options: ExplainRendererOptions): ReportRenderer; declare function createAlternativesJsonRenderer(options: AlternativesRendererOptions): ReportRenderer; declare function createDiffJsonRenderer(options: DiffRendererOptions): ReportRenderer; declare function createBoundedAlternatives(target: Target, proposals?: readonly AlternativeProposal[]): AlternativesReportData; declare function defaultPlanningReportArtifactSpecs(options?: ReportRendererRedactionOptions): readonly ReportArtifactSpec[]; declare function renderAndWriteReportArtifacts(options: RenderAndWriteReportArtifactsOptions): Promise>; type GitHubCheckAnnotation = { readonly path: string; readonly start_line: number; readonly end_line: number; readonly annotation_level: "failure" | "notice" | "warning"; readonly message: string; readonly title?: string; readonly raw_details?: string; }; type GitHubCheckCreateInput = { readonly owner: string; readonly repo: string; readonly name: string; readonly head_sha: string; readonly status: "completed"; readonly conclusion: "failure" | "neutral" | "success"; readonly output: { readonly title: string; readonly summary: string; readonly annotations?: GitHubCheckAnnotation[]; }; }; type GitHubChecksClient = { readonly checks: { create(input: GitHubCheckCreateInput): Promise; }; }; type GitHubChecksExporterOptions = { readonly owner: string; readonly repo: string; readonly headSha: string; readonly token?: string; readonly checkName?: string; readonly userAgent?: string; readonly client?: GitHubChecksClient; readonly maxAnnotations?: number; readonly redactionRules?: readonly RedactionRule[]; }; type GitHubChecksExportInput = { readonly backlog: Backlog; readonly sarif: SurfaceSarifLog; readonly localArtifactPath?: string; }; type GitHubChecksExport = { readonly id: string; readonly target: "github-checks"; readonly status: "complete" | "failed"; readonly synced: readonly string[]; readonly unsynced: readonly string[]; readonly annotationCount: number; readonly checkName: string; }; declare function createGitHubChecksExporter(options: GitHubChecksExporterOptions): { target: "github-checks"; export: (input: GitHubChecksExportInput) => Promise>; }; type GitHubIssueCreateInput = { readonly owner: string; readonly repo: string; readonly title: string; readonly body: string; labels?: string[]; }; type GitHubIssueClient = { readonly issues: { create(input: GitHubIssueCreateInput): Promise; }; }; type GitHubIssueExporterOptions = { readonly owner: string; readonly repo: string; readonly token?: string; readonly userAgent?: string; readonly projectRoot?: string; readonly labels?: readonly string[]; readonly client?: GitHubIssueClient; readonly maxAttempts?: number; readonly initialBackoffMs?: number; readonly wait?: (milliseconds: number) => Promise; readonly redactionRules?: readonly RedactionRule[]; }; declare function createGitHubIssueExporter(options: GitHubIssueExporterOptions): IssueExporter; type ExpandExistingFilePatternOptions = { readonly projectRoot?: string; }; declare function expandExistingFilePattern(pattern: string, options?: ExpandExistingFilePatternOptions): Promise; declare function projectRelativePath(projectRoot: string, filePath: string): string; declare function toPosixPath(value: string): string; declare function wildcardMatches(pattern: string, value: string): boolean; declare function parseJson(value: string): unknown; declare function isNodeErrorWithCode(error: unknown, code: string): boolean; declare const KnowledgeCategorySchema: z.ZodEnum<{ "e-commerce": "e-commerce"; admin: "admin"; navigation: "navigation"; accessibility: "accessibility"; "core-heuristics": "core-heuristics"; forms: "forms"; states: "states"; "visual-content": "visual-content"; "design-systems": "design-systems"; conversion: "conversion"; "platform-web": "platform-web"; "agent-implementation": "agent-implementation"; dashboards: "dashboards"; "data-viz": "data-viz"; "saas-onboarding": "saas-onboarding"; "search-discovery": "search-discovery"; "trust-safety": "trust-safety"; i18n: "i18n"; }>; declare const FreshnessVolatilitySchema: z.ZodEnum<{ stable: "stable"; evolving: "evolving"; volatile: "volatile"; }>; declare const CitationSchema: z.ZodObject<{ source: z.ZodString; url: z.ZodOptional; retrievedAt: z.ZodPreprocess>>; }, z.core.$strict>; declare const FreshnessSchema: z.ZodObject<{ volatility: z.ZodEnum<{ stable: "stable"; evolving: "evolving"; volatile: "volatile"; }>; lastReviewed: z.ZodPreprocess>>; }, z.core.$strict>; type FileSystemKnowledgeSourceOptions = { readonly rootDir: string; readonly includeDrafts?: boolean; }; declare function createFileSystemKnowledgeSource(options: FileSystemKnowledgeSourceOptions): KnowledgeSource; declare function loadKnowledgeEntries(options: FileSystemKnowledgeSourceOptions): Promise>; declare function queryKnowledgeEntries(entries: readonly KnowledgeEntry[], relevanceQuery: RelevanceQuery): readonly KnowledgeEntry[]; declare const LIGHTHOUSE_ACCESSIBILITY_AUDIT_IDS: readonly ["accesskeys", "aria-allowed-attr", "aria-allowed-role", "aria-command-name", "aria-conditional-attr", "aria-deprecated-role", "aria-dialog-name", "aria-hidden-body", "aria-hidden-focus", "aria-input-field-name", "aria-meter-name", "aria-progressbar-name", "aria-prohibited-attr", "aria-required-attr", "aria-required-children", "aria-required-parent", "aria-roles", "aria-text", "aria-toggle-field-name", "aria-tooltip-name", "aria-treeitem-name", "aria-valid-attr-value", "aria-valid-attr", "button-name", "bypass", "color-contrast", "definition-list", "dlitem", "document-title", "duplicate-id-aria", "form-field-multiple-labels", "frame-title", "heading-order", "html-has-lang", "html-lang-valid", "html-xml-lang-mismatch", "image-alt", "image-redundant-alt", "input-button-name", "input-image-alt", "label", "link-in-text-block", "link-name", "list", "listitem", "meta-refresh", "meta-viewport", "object-alt", "select-name", "skip-link", "tabindex", "table-duplicate-name", "target-size", "td-headers-attr", "th-has-data-cells", "valid-lang", "video-caption", "focusable-controls", "interactive-element-affordance", "logical-tab-order", "visual-order-follows-dom", "focus-traps", "managed-focus", "use-landmarks", "offscreen-content-hidden", "custom-controls-labels", "custom-controls-roles", "empty-heading", "identical-links-same-purpose", "landmark-one-main", "label-content-name-mismatch", "table-fake-caption", "td-has-header"]; /** * Privacy-first pino wrapper for surface packages. * * Redaction has two layers: semantic field names such as `token` keep the key and redact the * value, while key names that themselves contain credential material are replaced with * `[RedactedKey]`. Values are traversed defensively with circular detection, hostile getters are * treated as sensitive, and string content is sanitized for URLs, bearer/API tokens, private keys, * and common opaque credential placeholders before pino serializes the log line. */ declare const REDACTED_LOG_VALUE = "[Redacted]"; declare const REDACTED_LOG_KEY = "[RedactedKey]"; declare const CIRCULAR_LOG_VALUE = "[Circular]"; declare const TRUNCATED_LOG_VALUE = "[Truncated]"; type SurfaceLogFields = Record; type CreateSurfaceLoggerOptions = { readonly level?: string; readonly runId?: string; readonly stream?: DestinationStream; }; /** * Return a log-safe copy that removes captured content and credential-shaped fields. */ declare function sanitizeLogFields(fields: SurfaceLogFields): SurfaceLogFields; /** * Create the structured pino logger used by surface libraries. * * The logger is intentionally opinionated: it writes privacy-safe JSON with ISO timestamps * and sanitizes base fields, child bindings, object-first logs, and formatted arguments. */ declare function createSurfaceLogger(options?: CreateSurfaceLoggerOptions): Logger; type TaskFlowStep = { readonly id: string; readonly target: Target; }; type TaskFlowCaptureRecipe = { readonly id: string; readonly steps: readonly TaskFlowStep[]; readonly themes?: readonly Theme[]; }; type CaptureContext = { readonly stateId: string; readonly theme?: Theme; }; type TaskFlowCapturedState = CaptureContext & { readonly capture: Capture; }; type TaskFlowUnreachableStep = CaptureContext & { readonly reason: string; readonly target: Target; }; type TaskFlowCaptureResult = { readonly recipeId: string; readonly captures: readonly TaskFlowCapturedState[]; readonly unreachable: readonly TaskFlowUnreachableStep[]; readonly status: "completed" | "degraded"; }; type RunTaskFlowCaptureInput = { readonly captureOptions: CaptureOptions; readonly recipe: TaskFlowCaptureRecipe; readonly service: CaptureService; }; type CaptureContextFinding = Finding & { readonly captureContext: CaptureContext; readonly tags: string[]; }; declare function runTaskFlowCapture(input: RunTaskFlowCaptureInput): Promise>; declare function tagFindingsWithCaptureContext(findings: readonly Finding[], context: CaptureContext): readonly CaptureContextFinding[]; declare const PROJECT_STATUS_RUN_HISTORY_LIMIT = 20; type ProjectStatusRunHistoryEntry = { readonly completedAt?: string; readonly completedStages?: readonly string[]; readonly findings: number; readonly runId: string; readonly skippedStages?: readonly { readonly reason: string; readonly stage: string; }[]; readonly stage?: string; readonly status: "completed" | "failed"; readonly target?: Target; }; type ProjectRunProgress = { readonly completedRuns: number; readonly failedRuns: number; readonly findings: number; }; declare function projectHasCompletedPipelineRun(state: ProjectStateSnapshot): boolean; declare function projectRunRecordHasAuditArtifacts(record: ProjectRunRecord): boolean; declare function projectStatusRunHistoryEntries(runRecords: readonly ProjectRunRecord[], options?: { readonly limit?: number; }): readonly ProjectStatusRunHistoryEntry[]; declare function projectStatusProgressForRunRecords(runRecords: readonly ProjectRunRecord[]): ProjectRunProgress; declare function projectStatusRunHistoryEntryForRecord(record: ProjectRunRecord): ProjectStatusRunHistoryEntry; declare function stateWithUpsertedProjectRunRecord(state: ProjectStateSnapshot, record: ProjectRunRecord): ProjectStateSnapshot; declare function upsertProjectRunRecord(runRecords: readonly ProjectRunRecord[], record: ProjectRunRecord): readonly ProjectRunRecord[]; declare function mergeProjectRunRecordsByRunId(runRecords: readonly ProjectRunRecord[]): readonly ProjectRunRecord[]; declare function mergeProjectRunRecords(existing: ProjectRunRecord, incoming: ProjectRunRecord): ProjectRunRecord; declare function projectPipelineRunCompletesPlan(state: ProjectStateSnapshot, record: ProjectRunRecord): boolean; type ResponsivenessStatesLensOptions = { readonly projectRoot?: string; }; /** * Creates the built-in responsiveness and UI-state lens over DOM capture artifacts. */ declare function createResponsivenessStatesLens(options?: ResponsivenessStatesLensOptions): Lens; /** Default project-local directory used for Surface state and artifacts. */ declare const SURFACE_STATE_DIR = ".surface"; /** Aggregate JSON file name inside the Surface state directory. */ declare const SURFACE_STATE_FILE = "state.json"; /** Current persisted state schema version. * * Optional pipeline metadata is additive and parsed with passthrough semantics, * so existing 1.0 readers remain compatible. */ declare const SURFACE_STATE_VERSION = "1.0"; type FileStateStoreOptions = { readonly projectRoot?: string; /** Project-root-relative child directory for state; invalid paths throw at construction time. */ readonly stateDir?: string; readonly stateVersion?: string; readonly lockOptions?: LockOptions; }; /** * Create a file-backed StateStore rooted at projectRoot/.surface by default. * Invalid configuration fails fast with TypeError; runtime IO uses Result errors. */ declare function createFileStateStore(options?: FileStateStoreOptions): StateStore; type LinearIssueInput = { readonly description: string; readonly labels?: readonly string[]; readonly teamId: string; readonly title: string; }; type JiraIssueInput = { readonly fields: { readonly description: string; readonly issuetype: { readonly name: string; }; readonly labels?: readonly string[]; readonly project: { readonly key: string; }; readonly summary: string; }; }; type LinearIssueClient = { createIssue(input: LinearIssueInput): Promise; }; type JiraIssueClient = { createIssue(input: JiraIssueInput): Promise; }; type LinearIssueExporterOptions = { readonly teamId: string; readonly apiKey?: string; readonly endpointUrl?: string; readonly labels?: readonly string[]; readonly projectRoot?: string; readonly client?: LinearIssueClient; readonly maxAttempts?: number; readonly initialBackoffMs?: number; readonly wait?: (milliseconds: number) => Promise; readonly redactionRules?: readonly RedactionRule[]; }; type JiraIssueExporterOptions = { readonly projectKey: string; readonly siteUrl?: string; readonly email?: string; readonly apiToken?: string; readonly issueType?: string; readonly labels?: readonly string[]; readonly projectRoot?: string; readonly client?: JiraIssueClient; readonly maxAttempts?: number; readonly initialBackoffMs?: number; readonly wait?: (milliseconds: number) => Promise; readonly redactionRules?: readonly RedactionRule[]; }; declare function createLinearIssueExporter(options: LinearIssueExporterOptions): IssueExporter; declare function createJiraIssueExporter(options: JiraIssueExporterOptions): IssueExporter; type UsabilityHeuristicLensOptions = LensFactoryOptions; /** * Creates the built-in judged usability lens backed by an injected model provider. */ declare function createUsabilityHeuristicLens(options?: UsabilityHeuristicLensOptions): Lens; type VisualHierarchyLensOptions = { readonly maxFontSizeSteps?: number; readonly minHeadingScaleRatio?: number; readonly projectRoot?: string; }; /** * Creates the built-in visual hierarchy lens, grounded by computed style tokens. */ declare function createVisualHierarchyLens(options?: VisualHierarchyLensOptions): Lens; declare const CORE_PACKAGE_NAME = "@zigrivers/surface-core"; export { APP_TYPE_OVERLAY_REGISTRY, APP_TYPE_OVERLAY_YAML_HEADER, ActionPolicy, ActionPolicyDecision, type AgentBrowserCaptureBackendOptions, type AgentBrowserCliDriverOptions, type AgentBrowserCommandResult, type AgentBrowserCommandRunner, type AgentBrowserEnvironmentInput, type AlternativeProposal, type AlternativesRendererOptions, type AlternativesReportData, AppType, type AppTypeClassification, AppTypeClassificationSchema, type AppTypeOverlay, AppTypeOverlaySchema, type AuditRunner, type AuditRunnerDependencies, type AuditRunnerInput, type AuditRunnerResult, type AuditRunnerUnavailableChannel, BUILT_IN_LENS_REGISTRY, Backlog, BrowserAction, BrowserLocator, type BrowserQaAgentBrowserCommandInput, type BrowserQaAgentBrowserCommandInvocation, type BrowserQaAgentBrowserCommandResult, type BrowserQaAgentBrowserCommandRunner, type BrowserQaCleanupResult, type BrowserQaComposition, type BrowserQaDriver, type BrowserQaDriverActionInput, type BrowserQaDriverValueRef, type BrowserQaEvidenceSummary, type BrowserQaExploreCommandInput, type BrowserQaExploreCommandResult, type BrowserQaExploreInput, type BrowserQaExploreResult, type BrowserQaExplorer, type BrowserQaExplorerHarness, BrowserQaFlow, type BrowserQaFlowRunForGate, type BrowserQaFlowService, type BrowserQaFlowServiceOptions, type BrowserQaFlowServiceRunInput, type BrowserQaFlowServiceRunOutput, type BrowserQaGateFlowRunsInput, type BrowserQaGateTargetCliOptions, type BrowserQaLoadedState, type BrowserQaOrchestrator, type BrowserQaOrchestratorHarness, type BrowserQaReplayResult, type BrowserQaReportFormat, type BrowserQaReportResult, type BrowserQaRunInput, type BrowserQaRunResult, type BrowserQaSession, CIRCULAR_LOG_VALUE, COMMITTED_WEB_APP_TYPE_OVERLAYS, CORE_PACKAGE_NAME, CandidateFinding, CandidateFlow, type CaptureClock, type CaptureContext, type CaptureContextFinding, type CaptureIdFactory, type CaptureRandomHex, type CaptureService, type CaptureServiceOptions, CitationSchema, type ClassifyBrowserActionInput, type CognitivePersona, type CognitiveTaskDefinition, type ContentMicrocopyLensOptions, type ContextIngestion, type ContextIngestionInput, type ContextIngestor, type ContextIngestorClock, type ContextIngestorOptions, type ContextInputKind, type ConversionLensOptions, type CreateSurfaceLoggerOptions, DEFAULT_COMPOSITION_STAGE_IDS, DEFAULT_PIPELINE_STAGE_DEFINITIONS, type DesignToken, type DiffRendererOptions, DirectSubscriptionChannelId, type DiscoveryEvent, DiscoveryEventSchema, type DiscoveryResult, DiscoveryResultSchema, type DiscoveryRunInput, Evidence, EvidenceBundle, type ExecutablePipelineStageId, ExecutablePipelineStageIdSchema, type ExpandExistingFilePatternOptions, type ExplainRendererOptions, type FileQaEvidenceStoreOptions, type FileQaRunStoreOptions, type FileSystemKnowledgeSourceOptions, Finding, FindingDraft, FindingsEnvelope, type FindingsJsonRendererOptions, type FlowAwareGateInput, type FlowAwareGatePolicy, type FlowAwareGateResult, type FlowIsolationPolicyValidation, FlowRun, FlowRunSummary, type FlowRunner, type FlowRunnerDriver, type FlowRunnerOptions, type FlowRunnerResult, type FlowRunnerRunContext, type FlowTargetCliOptions, FreshnessSchema, FreshnessVolatilitySchema, type GitHubChecksExport, type GitHubChecksExportInput, type GitHubChecksExporterOptions, type GitHubIssueExporterOptions, type ImportedLegacyRouteFlow, type IngestedContext, type InputProvenance, type InstantiatedLens, type JiraIssueClient, type JiraIssueExporterOptions, KnowledgeCategorySchema, LIGHTHOUSE_ACCESSIBILITY_AUDIT_IDS, type LegacyRouteFlowInput, type LensExecutionPlan, type LensExecutionSkip, type LensFactoryOptions, type LensRegistration, type LensSkipReason, type LinearIssueClient, type LinearIssueExporterOptions, type MaskModelArtifactTextInput, type MaskModelArtifactTextResult, type MmrAuditFallback, type MmrAuditFallbackOptions, type MmrCapabilityProbeInput, type ModelArtifactEgressDecision, ModelAvailability, type ModelChannelPermission, type ModelChannelPermissionInput, type ModelEgressBlockedReason, ModelEgressBlockedReasonSchema, type ModelEgressLedgerEntry, ModelEgressLedgerEntrySchema, ModelEgressPolicy, type ModelEgressRedactionStatus, ModelEgressRedactionStatusSchema, type ModelEgressUnavailableChannel, ModelEgressUnavailableChannelSchema, type ModelExecutionPlan, ModelProvider, type ModelProviderFactory, ModelRequest, ModelResponse, type OverlayAcceptanceCriteria, OverlayAcceptanceCriteriaSchema, type OverlayReleaseTier, OverlayReleaseTierSchema, PROJECT_STATUS_RUN_HISTORY_LIMIT, type ParseBrowserQaFlowOptions, type Persona, type PersonaTask, PersonaTaskSchema, type PipelineEvent, PipelineEventSchema, type PipelineOrchestrator, type PipelineOrchestratorOptions, type PipelineRunInput, type PipelineRunResult, type PipelineStageContext, type PipelineStageDefinition, type PipelineStageHandler, type PipelineStageId, PipelineStageIdSchema, type PlaywrightCaptureBackendOptions, type ProcessRunRequest, type ProcessRunResult, type ProcessRunner, type ProjectRunProgress, type ProjectStatusRunHistoryEntry, type PromotedCandidateFinding, PromotedFindingSidecar, type QaArtifactReadResult, QaDegradation, QaEvidenceArtifact, type QaEvidenceArtifactInput, type QaEvidenceStore, type QaGateCandidateFinding, type QaGateFlowRun, type QaReportArtifactSummary, type QaReportEvidenceBundleSummary, type QaReportInput, type QaReportManifest, QaRun, type QaRunStore, QaSeverity, QaTarget, REDACTED_EXPORT_VALUE, REDACTED_LOG_KEY, REDACTED_LOG_VALUE, REGISTERED_APP_TYPE_OVERLAYS, type ReadArtifactByRegisteredRefInput, ReconciliationQuestion, ReconciliationService, RedactionRule, type RegisteredAppTypeOverlay, type RenderAndWriteReportArtifactsOptions, type ReplayCandidateContext, type ReplayConditionResult, type ReplayPromoter, type ReplayPromoterHarness, type ReportArtifactSpec, type ReportRendererRedactionOptions, type ResolveActionPolicyInput, type ResolveDirectProvidersResult, type ResolveFlowTargetInput, type ResolveSubscriptionProviders, type ResolvedActionPolicy, type ResponsivenessStatesLensOptions, Result, type RouteInventory, type RouteInventoryEntry, RouteInventoryEntrySchema, RouteInventorySchema, type RouteSkipped, RouteSkippedSchema, type RunTaskFlowCaptureInput, SURFACE_STATE_DIR, SURFACE_STATE_FILE, SURFACE_STATE_VERSION, type SelectLensExecutionPlanInput, type SharedRunRef, type StaticCaptureBackendOptions, type SubscriptionCliCapability, type SubscriptionPromptFile, type SubscriptionPromptStore, type SurfaceComposition, type SurfaceCompositionGeneratedAt, type SurfaceCompositionOptions, SurfaceConfig, SurfaceError, type SurfaceLogFields, type SurfaceSarifLog, SurfaceSarifLogSchema, type SynthesisDecision, type SynthesizeMeasuredWinsInput, TRUNCATED_LOG_VALUE, type TaskCompletionLensOptions, type TaskDefinition, type TaskFlowCaptureRecipe, type TaskFlowCaptureResult, type TaskFlowCapturedState, type TaskFlowStep, type TaskFlowUnreachableStep, type TextInput, TrackedFinding, TrackedFindingsDiff, type UsabilityHeuristicLensOptions, type ValidateFlowIsolationPolicyInput, type VerdictPromotionContext, type VisualHierarchyLensOptions, type WriteEvidenceBundleInput, type WrittenReportArtifact, browserQaFlowRunsForGate, browserQaFlowSeverityFromWithFlows, browserQaGateTargetCli, buildIsolatedProcessEnvironment, classifyBrowserAction, cleanupActiveSubscriptionTempRootsForProcess, createAccessibilityLens, createAgentBrowserCaptureBackend, createAgentBrowserCliDriver, createAgentBrowserEnvironment, createAgentPlanMarkdownRenderer, createAlternativesJsonRenderer, createAuditRunner, createBacklogMarkdownRenderer, createBoundedAlternatives, createBrowserQaExplorer, createBrowserQaFlowService, createBrowserQaOrchestrator, createBuiltInSafeActionPolicy, createCaptureService, createContentMicrocopyLens, createContextIngestor, createConversionLens, createDefaultCaptureIdFactory, createDiffJsonRenderer, createExplainJsonRenderer, createExplainMarkdownRenderer, createFileQaEvidenceStore, createFileQaRunStore, createFileStateStore, createFileSystemKnowledgeSource, createFindingsJsonRenderer, createFindingsMarkdownRenderer, createFlowRunner, createGateEvaluator, createGitHubChecksExporter, createGitHubIssueExporter, createJiraIssueExporter, createLinearIssueExporter, createMmrAuditFallback, createModelEgressLedgerEntry, createNoopPipelineHandlers, createPipelineOrchestrator, createPlaywrightCaptureBackend, createQaJsonReport, createQaMarkdownReport, createQaReportManifest, createReplayPromoter, createResponsivenessStatesLens, createSarifRenderer, createStaticCaptureBackend, createSubscriptionCliProvider, createSurfaceComposition, createSurfaceLogger, createTaskCompletionLens, createUsabilityHeuristicLens, createValidationReportMarkdownRenderer, createVisualHierarchyLens, defaultPlanningReportArtifactSpecs, defaultProcessRunner, deriveExplorationStateId, effectiveTargetForAction, evaluateGateWithQaFlows, evaluateModelArtifactEgress, expandExistingFilePattern, getAppTypeOverlay, hasRegisteredAppTypeOverlay, importLegacyRouteFlow, installSubscriptionTempRootProcessCleanupHandlers, instantiateLensExecutionPlan, isModelChannelPermitted, isNodeErrorWithCode, listAppTypeOverlays, loadKnowledgeEntries, maskModelArtifactText, maskModelPlainText, mergeProjectRunRecords, mergeProjectRunRecordsByRunId, parseBrowserQaFlow, parseJson, projectHasCompletedPipelineRun, projectPipelineRunCompletesPlan, projectRelativePath, projectRunRecordHasAuditArtifacts, projectStatusProgressForRunRecords, projectStatusRunHistoryEntries, projectStatusRunHistoryEntryForRecord, pruneStaleSurfaceTempRoots, queryKnowledgeEntries, redactAgentBrowserCommand, redactCaptureArtifactText, redactExportString, redactExportValue, renderAndWriteReportArtifacts, resolveActionPolicy, resolveDirectProviders, resolveFlowTarget, resolveModelExecutionPlan, resolvePromptTempParent, runDiscovery, runTaskFlowCapture, sanitizeLogFields, selectCaptureBackend, selectLensExecutionPlan, selectPipelineStages, serializeAppTypeOverlayToYaml, stateWithUpsertedProjectRunRecord, synthesizeMeasuredWinsDecision, tagFindingsWithCaptureContext, toPosixPath, upsertProjectRunRecord, validateFlowIsolationPolicy, validateFlowTargetCli, validateSubscriptionAuthMirrorSource, wildcardMatches };