/**
 * qaf-value-stream module — public entrypoint (ADR 019).
 *
 * Owner: SupplierPulse / QAF (QVS-Programm)
 *
 * QVS-P1 (KAR-970): maps parsed QAF manufacturing rows to VsmNode/VsmConnection
 * (pure, versioned — MAPPING_VERSION), assesses whether a parsed file has
 * capability-eligible manufacturing steps, classifies process names
 * conservatively (never auto-'va'), and suggests a default VSM title.
 *
 * QVS-P2 (KAR-971): wires the P1 pure functions to real qaf_file /
 * qaf_manufacturing_step rows (qaf-source.ts, RLS-scoped), adds the
 * preview/duplicate-hint/transactional-creation services, and the
 * `value_stream_imports` audit table (migration, not applied by app code).
 * Still feature-flagged off (`qafValueStream`) — see
 * reports/qaf-value-stream-architecture.md for the full phase plan.
 *
 * Anything not re-exported from this file is internal and may change without
 * notice. Cross-module access goes through this entrypoint only — no deep
 * imports into this module's internal/.
 *
 * tdd-guard:skip — pure re-export barrel; logic is tested in internal/__tests__.
 */

// ── Mapper ──────────────────────────────────────────────────────────────────
export { mapQafRowsToVsmNodes, MAPPING_VERSION } from './internal/mapper'

// ── Capability ──────────────────────────────────────────────────────────────
export { assessManufacturingCapability } from './internal/manufacturing-capability'

// ── VA classification ────────────────────────────────────────────────────────
export { conservativeVaClass } from './internal/va-classification'

// ── Naming ────────────────────────────────────────────────────────────────────
export { buildDefaultTitle } from './internal/naming'
export type { DefaultTitleParts } from './internal/naming'

// ── QAF source loading (QVS-P2) ─────────────────────────────────────────────
export { loadQafSourceRows, computePreviewToken } from './internal/qaf-source'
export type { QafFileRef, QafSourceRows, PreviewTokenInput, MappedQafSource, QvsFileLevelContext } from './internal/qaf-source'

// ── Multi-QAF variant context (QVS-P4) ──────────────────────────────────────
export { loadMultiQafVariantContext } from './internal/multi-qaf-context'
export type { MultiQafVariantSummary, QvsVariantContext } from './internal/multi-qaf-context'

// ── Preview (QVS-P2/P4) ──────────────────────────────────────────────────────
export { buildQafValueStreamPreview, buildPreviewFromRows } from './internal/preview'
export type { QvsImportPreview, BuildPreviewOptions } from './internal/preview'

// ── Duplicates (QVS-P2) ──────────────────────────────────────────────────────
export { findExistingImports } from './internal/duplicates'
export type { QvsExistingImport, FindExistingImportsResult } from './internal/duplicates'

// ── Creation (QVS-P2/P4) ─────────────────────────────────────────────────────
export { createValueStreamFromQaf, createValueStreamsForVariants, severityForQvsWarningCode } from './internal/creation'
export type {
  QvsPreviewConfirmation,
  QvsCreationResult,
  QvsCreationError,
  QvsCreationOutcome,
  QvsVariantTagging,
  QvsPerVariantOutcome,
  QvsVariantForCreation,
} from './internal/creation'

// ── Sync / Reimport (QVS-P5) ────────────────────────────────────────────────
export { computeSyncDelta, applySyncAdoption } from './internal/sync'
export type { ComputeSyncDeltaInput } from './internal/sync'
export {
  loadValueStreamSyncDelta,
  applyValueStreamSyncSelection,
  createComparisonValueStreamFromSync,
  listReimportSourceCandidates,
} from './internal/reimport'
export type {
  QvsSyncDeltaView,
  QvsSyncDeltaOutcome,
  QvsSyncApplyOutcome,
  QvsSyncApplyError,
  QvsReimportSourceCandidate,
} from './internal/reimport'
export { buildReimportComparisonTitle } from './internal/naming'

// ── Types ─────────────────────────────────────────────────────────────────────
export type {
  IdFactory,
  MapperOptions,
  MapperResult,
  ExcludedRow,
  MissingFieldReason,
  MissingFieldReasonCode,
  QvsWarning,
  QvsWarningCode,
  QvsWarningSeverity,
  CapabilityAssessment,
  QvsSyncStatus,
  QvsFieldSyncStatus,
  QvsFieldDelta,
  QvsStepDelta,
  QvsUnmatchedStep,
  QvsSyncSummary,
  QvsSyncDelta,
  QvsSyncAdoptionMode,
  QvsFieldAdoptionSelection,
  QvsConflictResolution,
  QvsRemovedStepDecision,
  QvsNewStepSelection,
  QvsSyncAdoptionPlan,
  QvsSyncApplySummary,
  QvsSyncApplyResult,
} from './internal/types'
