@kb-labs/qa-core 2.94.0 → 2.98.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.ts CHANGED
@@ -1,6 +1,72 @@
1
- export { L as LastRunData, c as collectSubmoduleInfo, g as getSubmoduleInfo, a as getWorkspacePackages, l as loadLastRun, r as runCustomChecks, b as runLintCheck, d as runQA, e as runTestCheck, f as runTypeCheck, s as saveLastRun } from './last-run-store-C1AkskWI.js';
2
- export { captureBaseline, compareWithBaseline, createBaselineFromResults, loadBaseline, saveBaseline } from './baseline/index.js';
3
- export { analyzeEnrichedTrends, analyzeTrends, appendEntry, appendTrendEntry, createHistoryEntry, detectRegressions, getPackageTimeline, loadHistory, loadTrendHistory, saveHistory } from './history/index.js';
4
- export { ReportSection, buildBaselineReport, buildDetailedJsonReport, buildDetailedRunReport, buildHistoryTable, buildJsonReport, buildRegressionsReport, buildRunReport, buildTrendsReport, groupErrors, groupResults } from './report/index.js';
5
- export { resolveCategories } from './categories/index.js';
6
- import '@kb-labs/qa-contracts';
1
+ import { ShellAPI } from '@kb-labs/sdk';
2
+ import { DevkitRunOutput, DevkitCheckOutput, DevkitStatsOutput, DevkitStatusOutput, DevkitGateOutput, SnapshotGit, RunSnapshot, CheckSnapshot, StatsSnapshot, GateSnapshot, BaselineData, TrendAnalysis, RegressionDetection, BaselineCheckDiff, PackageTimeline } from '@kb-labs/qa-contracts';
3
+ export { ReportSection, buildBaselineDiffReport, buildBaselineReport, buildCheckJsonReport, buildCheckReport, buildHistoryTable, buildRegressionsReport, buildRunJsonReport, buildRunReport, buildStatsJsonReport, buildStatsReport, buildTrendsReport, formatTaskName } from './report/index.js';
4
+
5
+ /**
6
+ * Resolve the kb-devkit binary path.
7
+ *
8
+ * Resolution order:
9
+ * 1. configPath (from QAPluginConfig.devkitPath) — absolute or relative to rootDir
10
+ * 2. tools/kb-devkit/kb-devkit relative to rootDir (workspace-local copy)
11
+ * 3. "kb-devkit" — resolved from PATH at spawn time
12
+ *
13
+ * The shell permission whitelist matches by basename, so passing a full path
14
+ * to shell.exec() works correctly when allow: ['kb-devkit'] is declared.
15
+ */
16
+ declare function resolveDevkitBin(rootDir: string, configPath?: string): string;
17
+
18
+ interface DevkitAdapterOptions {
19
+ binaryPath: string;
20
+ cwd: string;
21
+ shell: ShellAPI;
22
+ timeoutMs?: number;
23
+ }
24
+ declare class DevkitAdapter {
25
+ private readonly bin;
26
+ private readonly cwd;
27
+ private readonly shell;
28
+ private readonly timeout;
29
+ constructor(opts: DevkitAdapterOptions);
30
+ run(tasks: string[]): Promise<DevkitRunOutput>;
31
+ check(): Promise<DevkitCheckOutput>;
32
+ stats(): Promise<DevkitStatsOutput>;
33
+ status(): Promise<DevkitStatusOutput>;
34
+ gate(): Promise<DevkitGateOutput>;
35
+ version(): Promise<string>;
36
+ private invoke;
37
+ }
38
+
39
+ /**
40
+ * Capture current git context using ctx.api.shell.
41
+ * Returns undefined if the directory is not a git repo or git is unavailable.
42
+ */
43
+ declare function captureGit(shell: ShellAPI, cwd: string): Promise<SnapshotGit | undefined>;
44
+
45
+ declare class SnapshotStore {
46
+ private readonly rootDir;
47
+ private readonly maxEntries;
48
+ constructor(rootDir: string, maxEntries?: number);
49
+ loadRunHistory(): RunSnapshot[];
50
+ saveRun(raw: DevkitRunOutput, tasks: string[], durationMs: number, git?: SnapshotGit, runContext?: Record<string, unknown>): RunSnapshot;
51
+ latestRun(): RunSnapshot | null;
52
+ loadCheckHistory(): CheckSnapshot[];
53
+ saveCheck(raw: DevkitCheckOutput, durationMs: number, git?: SnapshotGit, runContext?: Record<string, unknown>): CheckSnapshot;
54
+ latestCheck(): CheckSnapshot | null;
55
+ loadStatsHistory(): StatsSnapshot[];
56
+ saveStats(raw: DevkitStatsOutput, durationMs: number, git?: SnapshotGit, runContext?: Record<string, unknown>): StatsSnapshot;
57
+ latestStats(): StatsSnapshot | null;
58
+ loadGateHistory(): GateSnapshot[];
59
+ saveGate(raw: DevkitGateOutput, durationMs: number, git?: SnapshotGit, runContext?: Record<string, unknown>): GateSnapshot;
60
+ loadBaseline(): BaselineData | null;
61
+ saveBaseline(check: DevkitCheckOutput, stats: DevkitStatsOutput, git?: SnapshotGit): BaselineData;
62
+ }
63
+
64
+ declare function analyzeTrends(history: RunSnapshot[], window?: number): TrendAnalysis;
65
+
66
+ declare function detectRegressions(history: RunSnapshot[]): RegressionDetection;
67
+
68
+ declare function compareWithBaseline(currentCheck: DevkitCheckOutput, currentStats: DevkitStatsOutput, baseline: BaselineData): BaselineCheckDiff;
69
+
70
+ declare function buildPackageTimeline(history: RunSnapshot[], packageName: string): PackageTimeline;
71
+
72
+ export { DevkitAdapter, type DevkitAdapterOptions, SnapshotStore, analyzeTrends, buildPackageTimeline, captureGit, compareWithBaseline, detectRegressions, resolveDevkitBin };