executable-stories-formatters 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CIInfo, T as TestRunResult, a as TestCaseResult, S as StoryStep, D as DocEntry, b as TestStatus$1, N as NormalizedTicket, A as Attachment, c as DocPhase, O as OtelSpan, d as StepResult, e as CIProvider, R as RawStatus, f as RawAttachment, g as RawRun, h as RawCIInfo, i as adaptJestRun, j as adaptPlaywrightRun, k as adaptVitestRun } from './index-it3Pkmqv.cjs';
2
- export { l as CIInfo, m as CoverageSummary, J as JestAdapterOptions, n as JestAggregatedResult, o as JestFileResult, p as JestTestResult, q as OtelAttributeValue, P as PlaywrightAdapterOptions, r as PlaywrightAnnotation, s as PlaywrightAttachment, t as PlaywrightError, u as PlaywrightLocation, v as PlaywrightStatus, w as PlaywrightTestCase, x as PlaywrightTestResult, y as RawStepEvent, z as RawTestCase, B as STORY_META_KEY, E as StepKeyword, F as StepMode, G as StoryFileReport, H as StoryMeta, I as TestCaseAttempt, K as TestCaseEvidence, V as VitestAdapterOptions, L as VitestSerializedError, M as VitestState, Q as VitestTestCase, U as VitestTestModule, W as VitestTestResult, X as toCIInfo, Y as toRawCIInfo } from './index-it3Pkmqv.cjs';
1
+ import { C as CIInfo, T as TestRunResult, a as TestCaseResult, S as StoryStep, D as DocEntry, b as TestStatus$1, N as NormalizedTicket, A as Attachment, c as DocPhase, O as OtelSpan, d as StepResult, e as CIProvider, R as RawStatus, f as RawAttachment, g as RawRun, h as RawCIInfo, i as adaptJestRun, j as adaptPlaywrightRun, k as adaptVitestRun } from './index-CbWFyoTx.cjs';
2
+ export { l as CIInfo, m as CoverageSummary, J as JestAdapterOptions, n as JestAggregatedResult, o as JestFileResult, p as JestTestResult, q as OtelAttributeValue, P as PlaywrightAdapterOptions, r as PlaywrightAnnotation, s as PlaywrightAttachment, t as PlaywrightError, u as PlaywrightLocation, v as PlaywrightStatus, w as PlaywrightTestCase, x as PlaywrightTestResult, y as RawStepEvent, z as RawTestCase, B as STORY_META_KEY, E as StepKeyword, F as StepMode, G as StoryFileReport, H as StoryMeta, I as TestCaseAttempt, K as TestCaseEvidence, V as VitestAdapterOptions, L as VitestSerializedError, M as VitestState, Q as VitestTestCase, U as VitestTestModule, W as VitestTestResult, X as toCIInfo, Y as toRawCIInfo } from './index-CbWFyoTx.cjs';
3
3
 
4
4
  /**
5
5
  * Notification types for webhook integrations (Slack, Teams).
@@ -150,7 +150,7 @@ interface CanonicalizeOptions {
150
150
  };
151
151
  }
152
152
  /** Output format for report generation */
153
- type OutputFormat = "astro" | "confluence" | "cucumber-json" | "cucumber-messages" | "cucumber-html" | "html" | "junit" | "markdown" | "story-report-json";
153
+ type OutputFormat = "astro" | "behavior-manifest-json" | "confluence" | "cucumber-json" | "cucumber-messages" | "cucumber-html" | "html" | "junit" | "markdown" | "scenario-index-json" | "story-report-json";
154
154
  /** Sort order for test cases in reports (deterministic for diff-friendly output) */
155
155
  type SortTestCasesMode = "id" | "source" | "none";
156
156
  /** Output mode for report routing */
@@ -221,6 +221,16 @@ interface FormatterOptions {
221
221
  /** Pretty-print JSON output. Default: true */
222
222
  pretty?: boolean;
223
223
  };
224
+ /** Scenario index JSON specific options */
225
+ scenarioIndexJson?: {
226
+ /** Pretty-print JSON output. Default: true */
227
+ pretty?: boolean;
228
+ };
229
+ /** Behavior manifest JSON specific options */
230
+ behaviorManifestJson?: {
231
+ /** Pretty-print JSON output. Default: true */
232
+ pretty?: boolean;
233
+ };
224
234
  /** HTML specific options */
225
235
  html?: {
226
236
  /** Report title. Default: "Test Results" */
@@ -387,6 +397,12 @@ interface ResolvedFormatterOptions {
387
397
  storyReportJson: {
388
398
  pretty: boolean;
389
399
  };
400
+ scenarioIndexJson: {
401
+ pretty: boolean;
402
+ };
403
+ behaviorManifestJson: {
404
+ pretty: boolean;
405
+ };
390
406
  cucumberMessages: {
391
407
  uriStrategy: "sourceFile" | "virtual";
392
408
  includeSynthetics: boolean;
@@ -779,6 +795,8 @@ interface ReportScenario {
779
795
  durationMs: number;
780
796
  tags: string[];
781
797
  tickets?: ReportTicket[];
798
+ /** Product-code paths/globs this scenario exercises (project-root-relative). */
799
+ covers?: string[];
782
800
  sourceLine?: number;
783
801
  errorMessage?: string;
784
802
  errorStack?: string;
@@ -1523,6 +1541,185 @@ declare class StoryReportJsonFormatter {
1523
1541
  format(run: TestRunResult): string;
1524
1542
  }
1525
1543
 
1544
+ interface ScenarioIndex {
1545
+ schemaVersion: "1.0";
1546
+ runId: string;
1547
+ generatedAtMs: number;
1548
+ summary: StoryReport["summary"];
1549
+ scenarios: ScenarioIndexItem[];
1550
+ }
1551
+ interface ScenarioIndexItem {
1552
+ id: string;
1553
+ title: string;
1554
+ status: TestStatus;
1555
+ feature: string;
1556
+ sourceFile: string;
1557
+ sourceLine?: number;
1558
+ tags: string[];
1559
+ tickets: Array<{
1560
+ id: string;
1561
+ url?: string;
1562
+ }>;
1563
+ covers: string[];
1564
+ durationMs: number;
1565
+ steps: ScenarioIndexStep[];
1566
+ docKinds: string[];
1567
+ error?: {
1568
+ message: string;
1569
+ stack?: string;
1570
+ };
1571
+ }
1572
+ interface ScenarioIndexStep {
1573
+ id: string;
1574
+ index: number;
1575
+ keyword: ReportStep["keyword"];
1576
+ text: string;
1577
+ status: TestStatus;
1578
+ durationMs: number;
1579
+ errorMessage?: string;
1580
+ docKinds: string[];
1581
+ }
1582
+ interface ScenarioIndexFilters {
1583
+ statuses?: TestStatus[];
1584
+ tags?: string[];
1585
+ sourceFiles?: string[];
1586
+ }
1587
+ interface ScenarioIndexJsonOptions {
1588
+ pretty?: boolean;
1589
+ filters?: ScenarioIndexFilters;
1590
+ }
1591
+ declare class ScenarioIndexJsonFormatter {
1592
+ private options;
1593
+ constructor(options?: ScenarioIndexJsonOptions);
1594
+ toIndex(run: TestRunResult): ScenarioIndex;
1595
+ format(run: TestRunResult): string;
1596
+ }
1597
+ declare function toScenarioIndex(report: StoryReport, filters?: ScenarioIndexFilters): ScenarioIndex;
1598
+
1599
+ interface BehaviorManifest {
1600
+ schemaVersion: "1.0";
1601
+ runId: string;
1602
+ generatedAtMs: number;
1603
+ summary: ScenarioIndex["summary"];
1604
+ sourceFiles: BehaviorSourceFile[];
1605
+ tags: BehaviorTag[];
1606
+ docCoverage: {
1607
+ scenariosWithDocs: number;
1608
+ scenariosWithoutDocs: number;
1609
+ docKinds: string[];
1610
+ };
1611
+ debugger: BehaviorDebuggerIssue[];
1612
+ }
1613
+ interface BehaviorSourceFile {
1614
+ path: string;
1615
+ scenarioCount: number;
1616
+ failed: number;
1617
+ tags: string[];
1618
+ }
1619
+ interface BehaviorTag {
1620
+ name: string;
1621
+ scenarioCount: number;
1622
+ }
1623
+ interface BehaviorDebuggerIssue {
1624
+ severity: "warning";
1625
+ code: "missing-docs" | "missing-tags" | "missing-covers" | "missing-source-line";
1626
+ scenarioId: string;
1627
+ title: string;
1628
+ message: string;
1629
+ }
1630
+ interface BehaviorManifestJsonOptions {
1631
+ pretty?: boolean;
1632
+ }
1633
+ declare class BehaviorManifestJsonFormatter {
1634
+ private pretty;
1635
+ constructor(options?: BehaviorManifestJsonOptions);
1636
+ toManifest(run: TestRunResult): BehaviorManifest;
1637
+ format(run: TestRunResult): string;
1638
+ }
1639
+ declare function toBehaviorManifest(report: StoryReport): BehaviorManifest;
1640
+
1641
+ /**
1642
+ * Return scenarios whose declared `covers` globs match any of the given paths.
1643
+ * Accepts many paths so callers can pass a whole changed-file list (e.g. a git diff).
1644
+ * Results are deduped (filter preserves index order, so each scenario appears once).
1645
+ */
1646
+ declare function scenariosCoveringPaths(index: ScenarioIndex, paths: string[]): ScenarioIndexItem[];
1647
+
1648
+ interface WatchOptions {
1649
+ /** Path to the raw-run (or canonical) JSON the framework adapter writes. */
1650
+ input: string;
1651
+ outputDir: string;
1652
+ outputName: string;
1653
+ formats: OutputFormat[];
1654
+ /** Input is "raw" (default) or already-canonical "canonical". */
1655
+ inputType?: "raw" | "canonical";
1656
+ /** Synthesize story metadata for plain tests (raw input only). Default true. */
1657
+ synthesize?: boolean;
1658
+ /** Coalesce rapid change events. Default 150ms. */
1659
+ debounceMs?: number;
1660
+ }
1661
+ interface RegenerateDeps {
1662
+ readFile?: (filePath: string) => string;
1663
+ }
1664
+ /**
1665
+ * Read a raw-run (or canonical) file and regenerate the requested agent
1666
+ * artifacts via the canonical {@link ReportGenerator}. Returns the written
1667
+ * file paths. This is the unit of work the watcher repeats; it is also useful
1668
+ * standalone for a one-shot regenerate.
1669
+ */
1670
+ declare function regenerateArtifacts(options: WatchOptions, deps?: RegenerateDeps): Promise<string[]>;
1671
+ interface WatchDeps extends RegenerateDeps {
1672
+ /** Watch a path, calling the listener on every change. Injectable for tests. */
1673
+ watch?: (filePath: string, listener: () => void) => {
1674
+ close: () => void;
1675
+ };
1676
+ /** Override the regenerate step (tests). */
1677
+ regenerate?: (input: string) => Promise<string[]>;
1678
+ log?: (message: string) => void;
1679
+ }
1680
+ interface WatchHandle {
1681
+ close: () => void;
1682
+ }
1683
+ /**
1684
+ * Keep the agent artifacts fresh: regenerate them whenever the framework
1685
+ * rewrites its raw-run file. Language-agnostic — any adapter that emits a
1686
+ * raw-run drives it. Pair with the host framework's own `--watch` to get a
1687
+ * behavior index that tracks the code.
1688
+ */
1689
+ declare function startWatch(options: WatchOptions, deps?: WatchDeps): WatchHandle;
1690
+
1691
+ interface BehaviorDiffEntry {
1692
+ id: string;
1693
+ title: string;
1694
+ sourceFile: string;
1695
+ kind: ScenarioChangeKind;
1696
+ baselineStatus?: TestStatus;
1697
+ currentStatus?: TestStatus;
1698
+ }
1699
+ interface BehaviorDiff {
1700
+ schemaVersion: "1.0";
1701
+ summary: {
1702
+ added: number;
1703
+ removed: number;
1704
+ regressed: number;
1705
+ fixed: number;
1706
+ changed: number;
1707
+ unchanged: number;
1708
+ };
1709
+ scenarios: BehaviorDiffEntry[];
1710
+ }
1711
+ /**
1712
+ * Classify a single scenario's status transition between two runs.
1713
+ * Shares the `ScenarioChangeKind` vocabulary with the full compare engine.
1714
+ */
1715
+ declare function classifyStatusChange(baseline: TestStatus | undefined, current: TestStatus | undefined): ScenarioChangeKind;
1716
+ /**
1717
+ * Scenario-level diff of two StoryReports, keyed by scenario id. Reports status
1718
+ * transitions (the agent triage signal), not the full field-by-field diff that
1719
+ * the human-facing compare engine produces.
1720
+ */
1721
+ declare function diffStoryReports(baseline: StoryReport, current: StoryReport): BehaviorDiff;
1722
+
1526
1723
  /**
1527
1724
  * toStoryReport — convert a canonical TestRunResult into the public
1528
1725
  * StoryReport shape consumed by UI renderers.
@@ -2910,4 +3107,4 @@ declare function normalizeVitestResults(testModules: Parameters<typeof adaptVite
2910
3107
  */
2911
3108
  declare function normalizePlaywrightResults(testResults: Parameters<typeof adaptPlaywrightRun>[0], adapterOptions?: Parameters<typeof adaptPlaywrightRun>[1], canonicalizeOptions?: CanonicalizeOptions): TestRunResult;
2912
3109
 
2913
- export { type AstroAssetResult, AstroFormatter, type AstroFormatterOptions as AstroFormatterOpts, Attachment, type BundleOptions, type BundleResult, CIProvider, type CanonicalizeOptions, type ChangeType, type ChangedFile, type ChangedFileReview, type ColocatedStyle, type CompareFormat, type CompareFormatterOptions, type ConfluenceAuth, ConfluenceFormatter, type ConfluenceFormatterOptions as ConfluenceFormatterOpts, type CopyMarkdownAssetsOptions, CucumberHtmlFormatter, type CucumberHtmlOptions, CucumberJsonFormatter, type CucumberJsonOptions, CucumberMessagesFormatter, type CucumberMessagesOptions, DocEntry, DocPhase, ES_THEME_TOKENS_CSS, ES_THEME_TOKEN_VALUES, type EvidenceStrength, type ExecutableStoriesConfig, type FetchFn, type FileChangeKind, type FlakinessLevel, type Formatter, type FormatterOptions, type GenerateArgs, type GenerateCompareResult, type GenerateDeps, type GenerateResult, type GenericWebhookNotifierOptions, type HistoryEntry, type HistoryStore, HtmlFormatter, type HtmlOptions, type HtmlTheme, type HtmlThemeName, type IJsonDataTable, type IJsonDocString, type IJsonEmbedding, type IJsonFeature, type IJsonScenario, type IJsonStep, type IJsonStepArgument, type IJsonStepResult, type IJsonTableRow, type IJsonTag, JUnitFormatter, type JUnitOptions, type JiraAuth, type JiraPublishMode, type ListScenariosArgs, type ListScenariosDeps, type Logger, MIN_FLAKINESS_SAMPLES, MIN_METRIC_SAMPLES, MIN_PERF_SAMPLES, MarkdownFormatter, type MarkdownFormatterOptions, type MarkdownOptions, type MarkdownRenderers, NormalizedTicket, type NotificationSummary, type NotifyCondition, OtelSpan, type OtelTraceContext, type OutputConfig, type OutputFormat, type OutputMode, type OutputRule, type PerformanceTrend, type PublishConfluenceArgs, type PublishConfluenceDeps, type PublishConfluenceResult, type PublishJiraArgs, type PublishJiraDeps, type PublishJiraResult, RawAttachment, RawCIInfo, RawRun, RawStatus, type ReportAttachment, type ReportCIInfo, type ReportCoverageSummary, type ReportDocCode, type ReportDocCustom, type ReportDocEntry, type ReportDocKv, type ReportDocLink, type ReportDocMermaid, type ReportDocNote, type ReportDocScreenshot, type ReportDocSection, type ReportDocTable, type ReportDocTag, type ReportFeature, ReportGenerator, type ReportScenario, type ReportStep, type ReportSummary, type ReportTicket, type ResolvedFormatterOptions, type ReviewAudience, type ReviewBand, type ReviewClaim, type ReviewContext, ReviewHtmlFormatter, type ReviewHtmlOptions, ReviewMarkdownFormatter, type ReviewMarkdownOptions, type ReviewResult, type ReviewSummary, RunDiffHtmlFormatter, type RunDiffHtmlOptions, RunDiffMarkdownFormatter, type RunDiffMarkdownOptions, type RunDiffResult, type RunDiffSummary, STORY_REPORT_SCHEMA_MAJOR, STORY_REPORT_SCHEMA_VERSION, type ScenarioChangeFlags, type ScenarioChangeKind, type ScenarioDiff, type ScenarioSnapshot, type SortTestCasesMode, type StabilityGrade, type StarlightBadge, StepResult, type StoryReport, StoryReportJsonFormatter, type StoryReportJsonOptions, type StoryReportSchemaVersion, StoryStep, TestCaseResult, type TestHistory, type TestMetrics, TestRunResult, TestStatus$1 as TestStatus, CIInfo as TypedCIInfo, type ValidationResult, type WebhookPayload, type WebhookSignerHmac, type WriteFile, adaptJestRun, adaptPlaywrightRun, adaptVitestRun, assertValidRun, buildReview, bundleAssets, calculateFlakiness, calculateStability, canonicalizeRun, clearVersionCache, computeTestMetrics, copyMarkdownAssets, createPrCommentSummary, createReportGenerator, deriveAudience, deriveChangeType, deriveStepResults, detectCI, detectPerformanceTrend, diffRuns, findGitDir, formatDuration, generateRunComparison, generateRunId, generateTestCaseId, getAvailableThemes, getCssOnlyThemes, gradeEvidence, hasSufficientHistory, isReviewableSource, isTestFile, listScenarios, loadHistory, mergeStepResults, msToNanoseconds, nanosecondsToMs, normalizeJestResults, normalizePlaywrightResults, normalizeStatus, normalizeVitestResults, parseEnvelopes, parseNdjson, publishConfluencePage, publishJiraIssue, readBranchName, readGitSha, readPackageVersion, resolveAttachment, resolveAttachments, resolveTheme, resolveTraceUrl, rewriteAssetPaths, saveHistory, sendNotifications, sendSlackNotification, sendTeamsNotification, sendWebhookNotification, signBody, slugify, stripAnsi, toStoryReport, tryGetActiveOtelContext, updateHistory, validateCanonicalRun };
3110
+ export { type AstroAssetResult, AstroFormatter, type AstroFormatterOptions as AstroFormatterOpts, Attachment, type BehaviorDebuggerIssue, type BehaviorDiff, type BehaviorDiffEntry, type BehaviorManifest, BehaviorManifestJsonFormatter, type BehaviorManifestJsonOptions, type BehaviorSourceFile, type BehaviorTag, type BundleOptions, type BundleResult, CIProvider, type CanonicalizeOptions, type ChangeType, type ChangedFile, type ChangedFileReview, type ColocatedStyle, type CompareFormat, type CompareFormatterOptions, type ConfluenceAuth, ConfluenceFormatter, type ConfluenceFormatterOptions as ConfluenceFormatterOpts, type CopyMarkdownAssetsOptions, CucumberHtmlFormatter, type CucumberHtmlOptions, CucumberJsonFormatter, type CucumberJsonOptions, CucumberMessagesFormatter, type CucumberMessagesOptions, DocEntry, DocPhase, ES_THEME_TOKENS_CSS, ES_THEME_TOKEN_VALUES, type EvidenceStrength, type ExecutableStoriesConfig, type FetchFn, type FileChangeKind, type FlakinessLevel, type Formatter, type FormatterOptions, type GenerateArgs, type GenerateCompareResult, type GenerateDeps, type GenerateResult, type GenericWebhookNotifierOptions, type HistoryEntry, type HistoryStore, HtmlFormatter, type HtmlOptions, type HtmlTheme, type HtmlThemeName, type IJsonDataTable, type IJsonDocString, type IJsonEmbedding, type IJsonFeature, type IJsonScenario, type IJsonStep, type IJsonStepArgument, type IJsonStepResult, type IJsonTableRow, type IJsonTag, JUnitFormatter, type JUnitOptions, type JiraAuth, type JiraPublishMode, type ListScenariosArgs, type ListScenariosDeps, type Logger, MIN_FLAKINESS_SAMPLES, MIN_METRIC_SAMPLES, MIN_PERF_SAMPLES, MarkdownFormatter, type MarkdownFormatterOptions, type MarkdownOptions, type MarkdownRenderers, NormalizedTicket, type NotificationSummary, type NotifyCondition, OtelSpan, type OtelTraceContext, type OutputConfig, type OutputFormat, type OutputMode, type OutputRule, type PerformanceTrend, type PublishConfluenceArgs, type PublishConfluenceDeps, type PublishConfluenceResult, type PublishJiraArgs, type PublishJiraDeps, type PublishJiraResult, RawAttachment, RawCIInfo, RawRun, RawStatus, type ReportAttachment, type ReportCIInfo, type ReportCoverageSummary, type ReportDocCode, type ReportDocCustom, type ReportDocEntry, type ReportDocKv, type ReportDocLink, type ReportDocMermaid, type ReportDocNote, type ReportDocScreenshot, type ReportDocSection, type ReportDocTable, type ReportDocTag, type ReportFeature, ReportGenerator, type ReportScenario, type ReportStep, type ReportSummary, type ReportTicket, type ResolvedFormatterOptions, type ReviewAudience, type ReviewBand, type ReviewClaim, type ReviewContext, ReviewHtmlFormatter, type ReviewHtmlOptions, ReviewMarkdownFormatter, type ReviewMarkdownOptions, type ReviewResult, type ReviewSummary, RunDiffHtmlFormatter, type RunDiffHtmlOptions, RunDiffMarkdownFormatter, type RunDiffMarkdownOptions, type RunDiffResult, type RunDiffSummary, STORY_REPORT_SCHEMA_MAJOR, STORY_REPORT_SCHEMA_VERSION, type ScenarioChangeFlags, type ScenarioChangeKind, type ScenarioDiff, type ScenarioIndex, type ScenarioIndexFilters, type ScenarioIndexItem, ScenarioIndexJsonFormatter, type ScenarioIndexJsonOptions, type ScenarioIndexStep, type ScenarioSnapshot, type SortTestCasesMode, type StabilityGrade, type StarlightBadge, StepResult, type StoryReport, StoryReportJsonFormatter, type StoryReportJsonOptions, type StoryReportSchemaVersion, StoryStep, TestCaseResult, type TestHistory, type TestMetrics, TestRunResult, TestStatus$1 as TestStatus, CIInfo as TypedCIInfo, type ValidationResult, type WatchDeps, type WatchHandle, type WatchOptions, type WebhookPayload, type WebhookSignerHmac, type WriteFile, adaptJestRun, adaptPlaywrightRun, adaptVitestRun, assertValidRun, buildReview, bundleAssets, calculateFlakiness, calculateStability, canonicalizeRun, classifyStatusChange, clearVersionCache, computeTestMetrics, copyMarkdownAssets, createPrCommentSummary, createReportGenerator, deriveAudience, deriveChangeType, deriveStepResults, detectCI, detectPerformanceTrend, diffRuns, diffStoryReports, findGitDir, formatDuration, generateRunComparison, generateRunId, generateTestCaseId, getAvailableThemes, getCssOnlyThemes, gradeEvidence, hasSufficientHistory, isReviewableSource, isTestFile, listScenarios, loadHistory, mergeStepResults, msToNanoseconds, nanosecondsToMs, normalizeJestResults, normalizePlaywrightResults, normalizeStatus, normalizeVitestResults, parseEnvelopes, parseNdjson, publishConfluencePage, publishJiraIssue, readBranchName, readGitSha, readPackageVersion, regenerateArtifacts, resolveAttachment, resolveAttachments, resolveTheme, resolveTraceUrl, rewriteAssetPaths, saveHistory, scenariosCoveringPaths, sendNotifications, sendSlackNotification, sendTeamsNotification, sendWebhookNotification, signBody, slugify, startWatch, stripAnsi, toBehaviorManifest, toScenarioIndex, toStoryReport, tryGetActiveOtelContext, updateHistory, validateCanonicalRun };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as CIInfo, T as TestRunResult, a as TestCaseResult, S as StoryStep, D as DocEntry, b as TestStatus$1, N as NormalizedTicket, A as Attachment, c as DocPhase, O as OtelSpan, d as StepResult, e as CIProvider, R as RawStatus, f as RawAttachment, g as RawRun, h as RawCIInfo, i as adaptJestRun, j as adaptPlaywrightRun, k as adaptVitestRun } from './index-it3Pkmqv.js';
2
- export { l as CIInfo, m as CoverageSummary, J as JestAdapterOptions, n as JestAggregatedResult, o as JestFileResult, p as JestTestResult, q as OtelAttributeValue, P as PlaywrightAdapterOptions, r as PlaywrightAnnotation, s as PlaywrightAttachment, t as PlaywrightError, u as PlaywrightLocation, v as PlaywrightStatus, w as PlaywrightTestCase, x as PlaywrightTestResult, y as RawStepEvent, z as RawTestCase, B as STORY_META_KEY, E as StepKeyword, F as StepMode, G as StoryFileReport, H as StoryMeta, I as TestCaseAttempt, K as TestCaseEvidence, V as VitestAdapterOptions, L as VitestSerializedError, M as VitestState, Q as VitestTestCase, U as VitestTestModule, W as VitestTestResult, X as toCIInfo, Y as toRawCIInfo } from './index-it3Pkmqv.js';
1
+ import { C as CIInfo, T as TestRunResult, a as TestCaseResult, S as StoryStep, D as DocEntry, b as TestStatus$1, N as NormalizedTicket, A as Attachment, c as DocPhase, O as OtelSpan, d as StepResult, e as CIProvider, R as RawStatus, f as RawAttachment, g as RawRun, h as RawCIInfo, i as adaptJestRun, j as adaptPlaywrightRun, k as adaptVitestRun } from './index-CbWFyoTx.js';
2
+ export { l as CIInfo, m as CoverageSummary, J as JestAdapterOptions, n as JestAggregatedResult, o as JestFileResult, p as JestTestResult, q as OtelAttributeValue, P as PlaywrightAdapterOptions, r as PlaywrightAnnotation, s as PlaywrightAttachment, t as PlaywrightError, u as PlaywrightLocation, v as PlaywrightStatus, w as PlaywrightTestCase, x as PlaywrightTestResult, y as RawStepEvent, z as RawTestCase, B as STORY_META_KEY, E as StepKeyword, F as StepMode, G as StoryFileReport, H as StoryMeta, I as TestCaseAttempt, K as TestCaseEvidence, V as VitestAdapterOptions, L as VitestSerializedError, M as VitestState, Q as VitestTestCase, U as VitestTestModule, W as VitestTestResult, X as toCIInfo, Y as toRawCIInfo } from './index-CbWFyoTx.js';
3
3
 
4
4
  /**
5
5
  * Notification types for webhook integrations (Slack, Teams).
@@ -150,7 +150,7 @@ interface CanonicalizeOptions {
150
150
  };
151
151
  }
152
152
  /** Output format for report generation */
153
- type OutputFormat = "astro" | "confluence" | "cucumber-json" | "cucumber-messages" | "cucumber-html" | "html" | "junit" | "markdown" | "story-report-json";
153
+ type OutputFormat = "astro" | "behavior-manifest-json" | "confluence" | "cucumber-json" | "cucumber-messages" | "cucumber-html" | "html" | "junit" | "markdown" | "scenario-index-json" | "story-report-json";
154
154
  /** Sort order for test cases in reports (deterministic for diff-friendly output) */
155
155
  type SortTestCasesMode = "id" | "source" | "none";
156
156
  /** Output mode for report routing */
@@ -221,6 +221,16 @@ interface FormatterOptions {
221
221
  /** Pretty-print JSON output. Default: true */
222
222
  pretty?: boolean;
223
223
  };
224
+ /** Scenario index JSON specific options */
225
+ scenarioIndexJson?: {
226
+ /** Pretty-print JSON output. Default: true */
227
+ pretty?: boolean;
228
+ };
229
+ /** Behavior manifest JSON specific options */
230
+ behaviorManifestJson?: {
231
+ /** Pretty-print JSON output. Default: true */
232
+ pretty?: boolean;
233
+ };
224
234
  /** HTML specific options */
225
235
  html?: {
226
236
  /** Report title. Default: "Test Results" */
@@ -387,6 +397,12 @@ interface ResolvedFormatterOptions {
387
397
  storyReportJson: {
388
398
  pretty: boolean;
389
399
  };
400
+ scenarioIndexJson: {
401
+ pretty: boolean;
402
+ };
403
+ behaviorManifestJson: {
404
+ pretty: boolean;
405
+ };
390
406
  cucumberMessages: {
391
407
  uriStrategy: "sourceFile" | "virtual";
392
408
  includeSynthetics: boolean;
@@ -779,6 +795,8 @@ interface ReportScenario {
779
795
  durationMs: number;
780
796
  tags: string[];
781
797
  tickets?: ReportTicket[];
798
+ /** Product-code paths/globs this scenario exercises (project-root-relative). */
799
+ covers?: string[];
782
800
  sourceLine?: number;
783
801
  errorMessage?: string;
784
802
  errorStack?: string;
@@ -1523,6 +1541,185 @@ declare class StoryReportJsonFormatter {
1523
1541
  format(run: TestRunResult): string;
1524
1542
  }
1525
1543
 
1544
+ interface ScenarioIndex {
1545
+ schemaVersion: "1.0";
1546
+ runId: string;
1547
+ generatedAtMs: number;
1548
+ summary: StoryReport["summary"];
1549
+ scenarios: ScenarioIndexItem[];
1550
+ }
1551
+ interface ScenarioIndexItem {
1552
+ id: string;
1553
+ title: string;
1554
+ status: TestStatus;
1555
+ feature: string;
1556
+ sourceFile: string;
1557
+ sourceLine?: number;
1558
+ tags: string[];
1559
+ tickets: Array<{
1560
+ id: string;
1561
+ url?: string;
1562
+ }>;
1563
+ covers: string[];
1564
+ durationMs: number;
1565
+ steps: ScenarioIndexStep[];
1566
+ docKinds: string[];
1567
+ error?: {
1568
+ message: string;
1569
+ stack?: string;
1570
+ };
1571
+ }
1572
+ interface ScenarioIndexStep {
1573
+ id: string;
1574
+ index: number;
1575
+ keyword: ReportStep["keyword"];
1576
+ text: string;
1577
+ status: TestStatus;
1578
+ durationMs: number;
1579
+ errorMessage?: string;
1580
+ docKinds: string[];
1581
+ }
1582
+ interface ScenarioIndexFilters {
1583
+ statuses?: TestStatus[];
1584
+ tags?: string[];
1585
+ sourceFiles?: string[];
1586
+ }
1587
+ interface ScenarioIndexJsonOptions {
1588
+ pretty?: boolean;
1589
+ filters?: ScenarioIndexFilters;
1590
+ }
1591
+ declare class ScenarioIndexJsonFormatter {
1592
+ private options;
1593
+ constructor(options?: ScenarioIndexJsonOptions);
1594
+ toIndex(run: TestRunResult): ScenarioIndex;
1595
+ format(run: TestRunResult): string;
1596
+ }
1597
+ declare function toScenarioIndex(report: StoryReport, filters?: ScenarioIndexFilters): ScenarioIndex;
1598
+
1599
+ interface BehaviorManifest {
1600
+ schemaVersion: "1.0";
1601
+ runId: string;
1602
+ generatedAtMs: number;
1603
+ summary: ScenarioIndex["summary"];
1604
+ sourceFiles: BehaviorSourceFile[];
1605
+ tags: BehaviorTag[];
1606
+ docCoverage: {
1607
+ scenariosWithDocs: number;
1608
+ scenariosWithoutDocs: number;
1609
+ docKinds: string[];
1610
+ };
1611
+ debugger: BehaviorDebuggerIssue[];
1612
+ }
1613
+ interface BehaviorSourceFile {
1614
+ path: string;
1615
+ scenarioCount: number;
1616
+ failed: number;
1617
+ tags: string[];
1618
+ }
1619
+ interface BehaviorTag {
1620
+ name: string;
1621
+ scenarioCount: number;
1622
+ }
1623
+ interface BehaviorDebuggerIssue {
1624
+ severity: "warning";
1625
+ code: "missing-docs" | "missing-tags" | "missing-covers" | "missing-source-line";
1626
+ scenarioId: string;
1627
+ title: string;
1628
+ message: string;
1629
+ }
1630
+ interface BehaviorManifestJsonOptions {
1631
+ pretty?: boolean;
1632
+ }
1633
+ declare class BehaviorManifestJsonFormatter {
1634
+ private pretty;
1635
+ constructor(options?: BehaviorManifestJsonOptions);
1636
+ toManifest(run: TestRunResult): BehaviorManifest;
1637
+ format(run: TestRunResult): string;
1638
+ }
1639
+ declare function toBehaviorManifest(report: StoryReport): BehaviorManifest;
1640
+
1641
+ /**
1642
+ * Return scenarios whose declared `covers` globs match any of the given paths.
1643
+ * Accepts many paths so callers can pass a whole changed-file list (e.g. a git diff).
1644
+ * Results are deduped (filter preserves index order, so each scenario appears once).
1645
+ */
1646
+ declare function scenariosCoveringPaths(index: ScenarioIndex, paths: string[]): ScenarioIndexItem[];
1647
+
1648
+ interface WatchOptions {
1649
+ /** Path to the raw-run (or canonical) JSON the framework adapter writes. */
1650
+ input: string;
1651
+ outputDir: string;
1652
+ outputName: string;
1653
+ formats: OutputFormat[];
1654
+ /** Input is "raw" (default) or already-canonical "canonical". */
1655
+ inputType?: "raw" | "canonical";
1656
+ /** Synthesize story metadata for plain tests (raw input only). Default true. */
1657
+ synthesize?: boolean;
1658
+ /** Coalesce rapid change events. Default 150ms. */
1659
+ debounceMs?: number;
1660
+ }
1661
+ interface RegenerateDeps {
1662
+ readFile?: (filePath: string) => string;
1663
+ }
1664
+ /**
1665
+ * Read a raw-run (or canonical) file and regenerate the requested agent
1666
+ * artifacts via the canonical {@link ReportGenerator}. Returns the written
1667
+ * file paths. This is the unit of work the watcher repeats; it is also useful
1668
+ * standalone for a one-shot regenerate.
1669
+ */
1670
+ declare function regenerateArtifacts(options: WatchOptions, deps?: RegenerateDeps): Promise<string[]>;
1671
+ interface WatchDeps extends RegenerateDeps {
1672
+ /** Watch a path, calling the listener on every change. Injectable for tests. */
1673
+ watch?: (filePath: string, listener: () => void) => {
1674
+ close: () => void;
1675
+ };
1676
+ /** Override the regenerate step (tests). */
1677
+ regenerate?: (input: string) => Promise<string[]>;
1678
+ log?: (message: string) => void;
1679
+ }
1680
+ interface WatchHandle {
1681
+ close: () => void;
1682
+ }
1683
+ /**
1684
+ * Keep the agent artifacts fresh: regenerate them whenever the framework
1685
+ * rewrites its raw-run file. Language-agnostic — any adapter that emits a
1686
+ * raw-run drives it. Pair with the host framework's own `--watch` to get a
1687
+ * behavior index that tracks the code.
1688
+ */
1689
+ declare function startWatch(options: WatchOptions, deps?: WatchDeps): WatchHandle;
1690
+
1691
+ interface BehaviorDiffEntry {
1692
+ id: string;
1693
+ title: string;
1694
+ sourceFile: string;
1695
+ kind: ScenarioChangeKind;
1696
+ baselineStatus?: TestStatus;
1697
+ currentStatus?: TestStatus;
1698
+ }
1699
+ interface BehaviorDiff {
1700
+ schemaVersion: "1.0";
1701
+ summary: {
1702
+ added: number;
1703
+ removed: number;
1704
+ regressed: number;
1705
+ fixed: number;
1706
+ changed: number;
1707
+ unchanged: number;
1708
+ };
1709
+ scenarios: BehaviorDiffEntry[];
1710
+ }
1711
+ /**
1712
+ * Classify a single scenario's status transition between two runs.
1713
+ * Shares the `ScenarioChangeKind` vocabulary with the full compare engine.
1714
+ */
1715
+ declare function classifyStatusChange(baseline: TestStatus | undefined, current: TestStatus | undefined): ScenarioChangeKind;
1716
+ /**
1717
+ * Scenario-level diff of two StoryReports, keyed by scenario id. Reports status
1718
+ * transitions (the agent triage signal), not the full field-by-field diff that
1719
+ * the human-facing compare engine produces.
1720
+ */
1721
+ declare function diffStoryReports(baseline: StoryReport, current: StoryReport): BehaviorDiff;
1722
+
1526
1723
  /**
1527
1724
  * toStoryReport — convert a canonical TestRunResult into the public
1528
1725
  * StoryReport shape consumed by UI renderers.
@@ -2910,4 +3107,4 @@ declare function normalizeVitestResults(testModules: Parameters<typeof adaptVite
2910
3107
  */
2911
3108
  declare function normalizePlaywrightResults(testResults: Parameters<typeof adaptPlaywrightRun>[0], adapterOptions?: Parameters<typeof adaptPlaywrightRun>[1], canonicalizeOptions?: CanonicalizeOptions): TestRunResult;
2912
3109
 
2913
- export { type AstroAssetResult, AstroFormatter, type AstroFormatterOptions as AstroFormatterOpts, Attachment, type BundleOptions, type BundleResult, CIProvider, type CanonicalizeOptions, type ChangeType, type ChangedFile, type ChangedFileReview, type ColocatedStyle, type CompareFormat, type CompareFormatterOptions, type ConfluenceAuth, ConfluenceFormatter, type ConfluenceFormatterOptions as ConfluenceFormatterOpts, type CopyMarkdownAssetsOptions, CucumberHtmlFormatter, type CucumberHtmlOptions, CucumberJsonFormatter, type CucumberJsonOptions, CucumberMessagesFormatter, type CucumberMessagesOptions, DocEntry, DocPhase, ES_THEME_TOKENS_CSS, ES_THEME_TOKEN_VALUES, type EvidenceStrength, type ExecutableStoriesConfig, type FetchFn, type FileChangeKind, type FlakinessLevel, type Formatter, type FormatterOptions, type GenerateArgs, type GenerateCompareResult, type GenerateDeps, type GenerateResult, type GenericWebhookNotifierOptions, type HistoryEntry, type HistoryStore, HtmlFormatter, type HtmlOptions, type HtmlTheme, type HtmlThemeName, type IJsonDataTable, type IJsonDocString, type IJsonEmbedding, type IJsonFeature, type IJsonScenario, type IJsonStep, type IJsonStepArgument, type IJsonStepResult, type IJsonTableRow, type IJsonTag, JUnitFormatter, type JUnitOptions, type JiraAuth, type JiraPublishMode, type ListScenariosArgs, type ListScenariosDeps, type Logger, MIN_FLAKINESS_SAMPLES, MIN_METRIC_SAMPLES, MIN_PERF_SAMPLES, MarkdownFormatter, type MarkdownFormatterOptions, type MarkdownOptions, type MarkdownRenderers, NormalizedTicket, type NotificationSummary, type NotifyCondition, OtelSpan, type OtelTraceContext, type OutputConfig, type OutputFormat, type OutputMode, type OutputRule, type PerformanceTrend, type PublishConfluenceArgs, type PublishConfluenceDeps, type PublishConfluenceResult, type PublishJiraArgs, type PublishJiraDeps, type PublishJiraResult, RawAttachment, RawCIInfo, RawRun, RawStatus, type ReportAttachment, type ReportCIInfo, type ReportCoverageSummary, type ReportDocCode, type ReportDocCustom, type ReportDocEntry, type ReportDocKv, type ReportDocLink, type ReportDocMermaid, type ReportDocNote, type ReportDocScreenshot, type ReportDocSection, type ReportDocTable, type ReportDocTag, type ReportFeature, ReportGenerator, type ReportScenario, type ReportStep, type ReportSummary, type ReportTicket, type ResolvedFormatterOptions, type ReviewAudience, type ReviewBand, type ReviewClaim, type ReviewContext, ReviewHtmlFormatter, type ReviewHtmlOptions, ReviewMarkdownFormatter, type ReviewMarkdownOptions, type ReviewResult, type ReviewSummary, RunDiffHtmlFormatter, type RunDiffHtmlOptions, RunDiffMarkdownFormatter, type RunDiffMarkdownOptions, type RunDiffResult, type RunDiffSummary, STORY_REPORT_SCHEMA_MAJOR, STORY_REPORT_SCHEMA_VERSION, type ScenarioChangeFlags, type ScenarioChangeKind, type ScenarioDiff, type ScenarioSnapshot, type SortTestCasesMode, type StabilityGrade, type StarlightBadge, StepResult, type StoryReport, StoryReportJsonFormatter, type StoryReportJsonOptions, type StoryReportSchemaVersion, StoryStep, TestCaseResult, type TestHistory, type TestMetrics, TestRunResult, TestStatus$1 as TestStatus, CIInfo as TypedCIInfo, type ValidationResult, type WebhookPayload, type WebhookSignerHmac, type WriteFile, adaptJestRun, adaptPlaywrightRun, adaptVitestRun, assertValidRun, buildReview, bundleAssets, calculateFlakiness, calculateStability, canonicalizeRun, clearVersionCache, computeTestMetrics, copyMarkdownAssets, createPrCommentSummary, createReportGenerator, deriveAudience, deriveChangeType, deriveStepResults, detectCI, detectPerformanceTrend, diffRuns, findGitDir, formatDuration, generateRunComparison, generateRunId, generateTestCaseId, getAvailableThemes, getCssOnlyThemes, gradeEvidence, hasSufficientHistory, isReviewableSource, isTestFile, listScenarios, loadHistory, mergeStepResults, msToNanoseconds, nanosecondsToMs, normalizeJestResults, normalizePlaywrightResults, normalizeStatus, normalizeVitestResults, parseEnvelopes, parseNdjson, publishConfluencePage, publishJiraIssue, readBranchName, readGitSha, readPackageVersion, resolveAttachment, resolveAttachments, resolveTheme, resolveTraceUrl, rewriteAssetPaths, saveHistory, sendNotifications, sendSlackNotification, sendTeamsNotification, sendWebhookNotification, signBody, slugify, stripAnsi, toStoryReport, tryGetActiveOtelContext, updateHistory, validateCanonicalRun };
3110
+ export { type AstroAssetResult, AstroFormatter, type AstroFormatterOptions as AstroFormatterOpts, Attachment, type BehaviorDebuggerIssue, type BehaviorDiff, type BehaviorDiffEntry, type BehaviorManifest, BehaviorManifestJsonFormatter, type BehaviorManifestJsonOptions, type BehaviorSourceFile, type BehaviorTag, type BundleOptions, type BundleResult, CIProvider, type CanonicalizeOptions, type ChangeType, type ChangedFile, type ChangedFileReview, type ColocatedStyle, type CompareFormat, type CompareFormatterOptions, type ConfluenceAuth, ConfluenceFormatter, type ConfluenceFormatterOptions as ConfluenceFormatterOpts, type CopyMarkdownAssetsOptions, CucumberHtmlFormatter, type CucumberHtmlOptions, CucumberJsonFormatter, type CucumberJsonOptions, CucumberMessagesFormatter, type CucumberMessagesOptions, DocEntry, DocPhase, ES_THEME_TOKENS_CSS, ES_THEME_TOKEN_VALUES, type EvidenceStrength, type ExecutableStoriesConfig, type FetchFn, type FileChangeKind, type FlakinessLevel, type Formatter, type FormatterOptions, type GenerateArgs, type GenerateCompareResult, type GenerateDeps, type GenerateResult, type GenericWebhookNotifierOptions, type HistoryEntry, type HistoryStore, HtmlFormatter, type HtmlOptions, type HtmlTheme, type HtmlThemeName, type IJsonDataTable, type IJsonDocString, type IJsonEmbedding, type IJsonFeature, type IJsonScenario, type IJsonStep, type IJsonStepArgument, type IJsonStepResult, type IJsonTableRow, type IJsonTag, JUnitFormatter, type JUnitOptions, type JiraAuth, type JiraPublishMode, type ListScenariosArgs, type ListScenariosDeps, type Logger, MIN_FLAKINESS_SAMPLES, MIN_METRIC_SAMPLES, MIN_PERF_SAMPLES, MarkdownFormatter, type MarkdownFormatterOptions, type MarkdownOptions, type MarkdownRenderers, NormalizedTicket, type NotificationSummary, type NotifyCondition, OtelSpan, type OtelTraceContext, type OutputConfig, type OutputFormat, type OutputMode, type OutputRule, type PerformanceTrend, type PublishConfluenceArgs, type PublishConfluenceDeps, type PublishConfluenceResult, type PublishJiraArgs, type PublishJiraDeps, type PublishJiraResult, RawAttachment, RawCIInfo, RawRun, RawStatus, type ReportAttachment, type ReportCIInfo, type ReportCoverageSummary, type ReportDocCode, type ReportDocCustom, type ReportDocEntry, type ReportDocKv, type ReportDocLink, type ReportDocMermaid, type ReportDocNote, type ReportDocScreenshot, type ReportDocSection, type ReportDocTable, type ReportDocTag, type ReportFeature, ReportGenerator, type ReportScenario, type ReportStep, type ReportSummary, type ReportTicket, type ResolvedFormatterOptions, type ReviewAudience, type ReviewBand, type ReviewClaim, type ReviewContext, ReviewHtmlFormatter, type ReviewHtmlOptions, ReviewMarkdownFormatter, type ReviewMarkdownOptions, type ReviewResult, type ReviewSummary, RunDiffHtmlFormatter, type RunDiffHtmlOptions, RunDiffMarkdownFormatter, type RunDiffMarkdownOptions, type RunDiffResult, type RunDiffSummary, STORY_REPORT_SCHEMA_MAJOR, STORY_REPORT_SCHEMA_VERSION, type ScenarioChangeFlags, type ScenarioChangeKind, type ScenarioDiff, type ScenarioIndex, type ScenarioIndexFilters, type ScenarioIndexItem, ScenarioIndexJsonFormatter, type ScenarioIndexJsonOptions, type ScenarioIndexStep, type ScenarioSnapshot, type SortTestCasesMode, type StabilityGrade, type StarlightBadge, StepResult, type StoryReport, StoryReportJsonFormatter, type StoryReportJsonOptions, type StoryReportSchemaVersion, StoryStep, TestCaseResult, type TestHistory, type TestMetrics, TestRunResult, TestStatus$1 as TestStatus, CIInfo as TypedCIInfo, type ValidationResult, type WatchDeps, type WatchHandle, type WatchOptions, type WebhookPayload, type WebhookSignerHmac, type WriteFile, adaptJestRun, adaptPlaywrightRun, adaptVitestRun, assertValidRun, buildReview, bundleAssets, calculateFlakiness, calculateStability, canonicalizeRun, classifyStatusChange, clearVersionCache, computeTestMetrics, copyMarkdownAssets, createPrCommentSummary, createReportGenerator, deriveAudience, deriveChangeType, deriveStepResults, detectCI, detectPerformanceTrend, diffRuns, diffStoryReports, findGitDir, formatDuration, generateRunComparison, generateRunId, generateTestCaseId, getAvailableThemes, getCssOnlyThemes, gradeEvidence, hasSufficientHistory, isReviewableSource, isTestFile, listScenarios, loadHistory, mergeStepResults, msToNanoseconds, nanosecondsToMs, normalizeJestResults, normalizePlaywrightResults, normalizeStatus, normalizeVitestResults, parseEnvelopes, parseNdjson, publishConfluencePage, publishJiraIssue, readBranchName, readGitSha, readPackageVersion, regenerateArtifacts, resolveAttachment, resolveAttachments, resolveTheme, resolveTraceUrl, rewriteAssetPaths, saveHistory, scenariosCoveringPaths, sendNotifications, sendSlackNotification, sendTeamsNotification, sendWebhookNotification, signBody, slugify, startWatch, stripAnsi, toBehaviorManifest, toScenarioIndex, toStoryReport, tryGetActiveOtelContext, updateHistory, validateCanonicalRun };