@vitest-agent/sdk 2.4.13 → 2.5.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/index.d.ts +222 -4
- package/index.js +5 -3
- package/layers/DataReaderLive.js +101 -23
- package/layers/DataStoreLive.js +54 -6
- package/migrations/0001_initial.js +6 -2
- package/package.json +2 -2
- package/schemas/ConsoleLeaks.js +20 -3
- package/schemas/Coverage.js +1 -0
- package/schemas/RenderState.js +14 -3
- package/schemas/RunEvent.js +12 -2
- package/testing.d.ts +118 -1
- package/utils/console-leaks.js +42 -15
- package/utils/detect-non-default-discover-strategy.js +38 -0
- package/utils/format-console.js +5 -0
- package/utils/format-scoped-coverage-note.js +25 -0
- package/utils/format-terminal.js +15 -2
- package/utils/validate-phase-transition.js +20 -6
package/index.d.ts
CHANGED
|
@@ -88,6 +88,7 @@ declare const CoverageReport: Schema.Struct<{
|
|
|
88
88
|
}>>;
|
|
89
89
|
readonly scoped: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
90
90
|
readonly scopedFiles: Schema.optional<Schema.$Array<Schema.String>>;
|
|
91
|
+
readonly totalFiles: Schema.optional<Schema.Number>;
|
|
91
92
|
readonly lowCoverage: Schema.$Array<Schema.Struct<{
|
|
92
93
|
readonly file: Schema.String;
|
|
93
94
|
readonly summary: Schema.Struct<{
|
|
@@ -232,6 +233,9 @@ declare const CoverageRenderState: Schema.Struct<{
|
|
|
232
233
|
readonly expected: Schema.Number;
|
|
233
234
|
readonly actual: Schema.Number;
|
|
234
235
|
}>>;
|
|
236
|
+
readonly scoped: Schema.optional<Schema.Boolean>;
|
|
237
|
+
readonly scopedFiles: Schema.optional<Schema.Number>;
|
|
238
|
+
readonly totalFiles: Schema.optional<Schema.Number>;
|
|
235
239
|
}>;
|
|
236
240
|
/** @public */
|
|
237
241
|
type CoverageRenderState = typeof CoverageRenderState.Type;
|
|
@@ -350,6 +354,9 @@ declare const RenderState: Schema.Struct<{
|
|
|
350
354
|
readonly expected: Schema.Number;
|
|
351
355
|
readonly actual: Schema.Number;
|
|
352
356
|
}>>;
|
|
357
|
+
readonly scoped: Schema.optional<Schema.Boolean>;
|
|
358
|
+
readonly scopedFiles: Schema.optional<Schema.Number>;
|
|
359
|
+
readonly totalFiles: Schema.optional<Schema.Number>;
|
|
353
360
|
}>>;
|
|
354
361
|
readonly trend: Schema.NullOr<Schema.Struct<{
|
|
355
362
|
readonly direction: Schema.Literals<readonly ["improving", "regressing", "stable"]>;
|
|
@@ -385,6 +392,19 @@ declare const RenderState: Schema.Struct<{
|
|
|
385
392
|
* fixtures) falls back to `moduleOrder.length`.
|
|
386
393
|
*/
|
|
387
394
|
readonly collectedModules: Schema.optional<Schema.Number>;
|
|
395
|
+
/**
|
|
396
|
+
* Process-level errors with no owning module, folded from
|
|
397
|
+
* `RunFinished.unhandledErrors`. A run that never carried the field
|
|
398
|
+
* (older replay data, hand-built fixtures) defaults to `[]`. See
|
|
399
|
+
* issue #240.
|
|
400
|
+
*/
|
|
401
|
+
readonly unhandledErrors: Schema.$Array<Schema.Struct<{
|
|
402
|
+
readonly message: Schema.String;
|
|
403
|
+
readonly stack: Schema.optional<Schema.String>;
|
|
404
|
+
readonly diff: Schema.optional<Schema.String>;
|
|
405
|
+
readonly expected: Schema.optional<Schema.String>;
|
|
406
|
+
readonly received: Schema.optional<Schema.String>;
|
|
407
|
+
}>>;
|
|
388
408
|
}>;
|
|
389
409
|
/** @public */
|
|
390
410
|
type RenderState = typeof RenderState.Type;
|
|
@@ -434,6 +454,7 @@ interface ProjectSummary {
|
|
|
434
454
|
readonly failCount: number;
|
|
435
455
|
readonly skipCount: number;
|
|
436
456
|
readonly durationMs: number;
|
|
457
|
+
readonly timeoutCount?: number;
|
|
437
458
|
readonly tagCounts?: Record<string, number>;
|
|
438
459
|
readonly belowTarget?: number;
|
|
439
460
|
readonly violations?: number;
|
|
@@ -717,6 +738,7 @@ declare const AgentReport: Schema.Struct<{
|
|
|
717
738
|
}>>;
|
|
718
739
|
readonly scoped: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
719
740
|
readonly scopedFiles: Schema.optional<Schema.$Array<Schema.String>>;
|
|
741
|
+
readonly totalFiles: Schema.optional<Schema.Number>;
|
|
720
742
|
readonly lowCoverage: Schema.$Array<Schema.Struct<{
|
|
721
743
|
readonly file: Schema.String;
|
|
722
744
|
readonly summary: Schema.Struct<{
|
|
@@ -755,6 +777,10 @@ declare const AgentReport: Schema.Struct<{
|
|
|
755
777
|
readonly sample: Schema.optional<Schema.String>;
|
|
756
778
|
}>>;
|
|
757
779
|
readonly truncated: Schema.optional<Schema.Boolean>;
|
|
780
|
+
readonly fromFailingTests: Schema.optional<Schema.Struct<{
|
|
781
|
+
readonly total: Schema.Number;
|
|
782
|
+
readonly files: Schema.Number;
|
|
783
|
+
}>>;
|
|
758
784
|
}>>;
|
|
759
785
|
}>;
|
|
760
786
|
/** @public */
|
|
@@ -1095,6 +1121,9 @@ declare const RunEvent: Schema.Union<readonly [Schema.TaggedStruct<"RunStarted",
|
|
|
1095
1121
|
}>;
|
|
1096
1122
|
readonly uncoveredLines: Schema.optional<Schema.String>;
|
|
1097
1123
|
}>>;
|
|
1124
|
+
readonly scoped: Schema.optional<Schema.Boolean>;
|
|
1125
|
+
readonly scopedFiles: Schema.optional<Schema.Number>;
|
|
1126
|
+
readonly totalFiles: Schema.optional<Schema.Number>;
|
|
1098
1127
|
}>, Schema.TaggedStruct<"ThresholdViolation", {
|
|
1099
1128
|
readonly metric: Schema.Literals<readonly ["lines", "branches", "functions", "statements"]>;
|
|
1100
1129
|
readonly expected: Schema.Number;
|
|
@@ -1124,6 +1153,19 @@ declare const RunEvent: Schema.Union<readonly [Schema.TaggedStruct<"RunStarted",
|
|
|
1124
1153
|
* tracks failing modules (report replay). See issue #204.
|
|
1125
1154
|
*/
|
|
1126
1155
|
readonly collectedModules: Schema.optional<Schema.Number>;
|
|
1156
|
+
/**
|
|
1157
|
+
* Process-level errors with no owning module (an unhandled
|
|
1158
|
+
* rejection, a worker crash) — Vitest's `unhandledErrors`
|
|
1159
|
+
* argument to `onTestRunEnd`. Optional so hand-built fixtures
|
|
1160
|
+
* and older replay data keep decoding. See issue #240.
|
|
1161
|
+
*/
|
|
1162
|
+
readonly unhandledErrors: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
1163
|
+
readonly message: Schema.String;
|
|
1164
|
+
readonly stack: Schema.optional<Schema.String>;
|
|
1165
|
+
readonly diff: Schema.optional<Schema.String>;
|
|
1166
|
+
readonly expected: Schema.optional<Schema.String>;
|
|
1167
|
+
readonly received: Schema.optional<Schema.String>;
|
|
1168
|
+
}>>>;
|
|
1127
1169
|
}>]>;
|
|
1128
1170
|
/** @public */
|
|
1129
1171
|
type RunEvent = typeof RunEvent.Type;
|
|
@@ -2102,9 +2144,28 @@ type TrendRecord = typeof TrendRecord.Type;
|
|
|
2102
2144
|
type Phase = "spike" | "red" | "red.triangulate" | "green" | "green.fake-it" | "refactor" | "extended-red" | "green-without-red";
|
|
2103
2145
|
/** @public */
|
|
2104
2146
|
type ArtifactKind = "test_written" | "test_failed_run" | "code_written" | "test_passed_run" | "refactor" | "test_weakened";
|
|
2147
|
+
/**
|
|
2148
|
+
* Explicit test-runner marker on a `tdd_artifacts` row (issue #363). `vitest`
|
|
2149
|
+
* artifacts always carry a `test_case_id` when they anchor a specific test;
|
|
2150
|
+
* `bats` artifacts never do (there is no `test_cases` row for a bats test),
|
|
2151
|
+
* so the D2 binding-rule validator branches on this to accept a bats
|
|
2152
|
+
* run-level artifact without weakening the vitest guard.
|
|
2153
|
+
* @public
|
|
2154
|
+
*/
|
|
2155
|
+
type ArtifactSuite = "vitest" | "bats";
|
|
2105
2156
|
/** @public */
|
|
2106
2157
|
interface CitedArtifact {
|
|
2107
2158
|
readonly id: number;
|
|
2159
|
+
/**
|
|
2160
|
+
* `tdd_phases.id` of the phase this artifact was actually recorded in — the
|
|
2161
|
+
* artifact's own phase binding. This is the honest anchor for D2 binding
|
|
2162
|
+
* rule 1's window check (issue #245): a test_case's first-ever creation
|
|
2163
|
+
* turn can predate the current phase (e.g. authored during spike, then
|
|
2164
|
+
* re-run inside red) without the evidence itself being stale, so the
|
|
2165
|
+
* window check compares this against `PhaseTransitionContext.current_phase_id`
|
|
2166
|
+
* rather than `test_case_created_turn_at`.
|
|
2167
|
+
*/
|
|
2168
|
+
readonly phase_id: number;
|
|
2108
2169
|
readonly artifact_kind: ArtifactKind;
|
|
2109
2170
|
readonly test_case_id: number | null;
|
|
2110
2171
|
readonly test_case_created_turn_at: string | null;
|
|
@@ -2112,11 +2173,24 @@ interface CitedArtifact {
|
|
|
2112
2173
|
readonly test_run_id: number | null;
|
|
2113
2174
|
readonly test_first_failure_run_id: number | null;
|
|
2114
2175
|
readonly behavior_id: number | null;
|
|
2176
|
+
/**
|
|
2177
|
+
* Issue #363: explicit suite marker distinguishing vitest from bats runs.
|
|
2178
|
+
* Optional on the pure type so hand-built contexts default to `vitest`;
|
|
2179
|
+
* the DB row always carries the persisted value.
|
|
2180
|
+
*/
|
|
2181
|
+
readonly suite?: ArtifactSuite;
|
|
2115
2182
|
}
|
|
2116
2183
|
/** @public */
|
|
2117
2184
|
interface PhaseTransitionContext {
|
|
2118
2185
|
readonly tdd_task_id: number;
|
|
2119
2186
|
readonly current_phase: Phase;
|
|
2187
|
+
/**
|
|
2188
|
+
* `tdd_phases.id` of the currently open phase row, or `null` when no phase
|
|
2189
|
+
* has been opened yet (the implicit "spike" default before the first
|
|
2190
|
+
* `tdd_phases` row exists). Compared against `cited_artifact.phase_id` for
|
|
2191
|
+
* D2 binding rule 1 (issue #245).
|
|
2192
|
+
*/
|
|
2193
|
+
readonly current_phase_id: number | null;
|
|
2120
2194
|
readonly phase_started_at: string;
|
|
2121
2195
|
readonly now: string;
|
|
2122
2196
|
readonly requested_phase: Phase;
|
|
@@ -2455,6 +2529,13 @@ interface SessionInput {
|
|
|
2455
2529
|
readonly parentSessionId?: number;
|
|
2456
2530
|
readonly triageWasNonEmpty?: boolean;
|
|
2457
2531
|
readonly startedAt: string;
|
|
2532
|
+
/**
|
|
2533
|
+
* Canonical conversation UUID this session belongs to (issue #144).
|
|
2534
|
+
* Set once at INSERT time — `sessions.conversation_id` is immutable
|
|
2535
|
+
* thereafter (see the `trg_sessions_conv_id_immutable` trigger), so
|
|
2536
|
+
* omit it here rather than trying to backfill via an update.
|
|
2537
|
+
*/
|
|
2538
|
+
readonly conversationId?: string;
|
|
2458
2539
|
}
|
|
2459
2540
|
/** @public */
|
|
2460
2541
|
interface TurnInput {
|
|
@@ -2532,6 +2613,8 @@ interface WriteTddArtifactInput {
|
|
|
2532
2613
|
readonly testFirstFailureRunId?: number;
|
|
2533
2614
|
readonly diffExcerpt?: string;
|
|
2534
2615
|
readonly recordedAt: string;
|
|
2616
|
+
/** Issue #363: explicit suite marker. Defaults to `"vitest"` when omitted. */
|
|
2617
|
+
readonly suite?: ArtifactSuite;
|
|
2535
2618
|
}
|
|
2536
2619
|
/** @public */
|
|
2537
2620
|
interface WriteCommitInput {
|
|
@@ -2606,6 +2689,18 @@ declare const DataStore_base: Context.ServiceClass<DataStore, "vitest-agent/Data
|
|
|
2606
2689
|
readonly writeCoverage: (runId: number, coverage: ReadonlyArray<FileCoverageInput>) => Effect.Effect<void, DataStoreError>;
|
|
2607
2690
|
readonly writeHistory: (project: string, fullName: string, modulePath: string, runId: number, timestamp: string, state: string, duration: number | null, flaky: boolean, retryCount: number, errorMessage: string | null) => Effect.Effect<void, DataStoreError>;
|
|
2608
2691
|
readonly writeBaselines: (baselines: CoverageBaselines) => Effect.Effect<void, DataStoreError>;
|
|
2692
|
+
/**
|
|
2693
|
+
* Persist the resolved (enforced) Vitest `coverage.thresholds` for the
|
|
2694
|
+
* current run, distinct from the ratcheted `coverage_baselines` rows.
|
|
2695
|
+
* Stored under `kind='threshold'`. See issue #237.
|
|
2696
|
+
*/
|
|
2697
|
+
readonly writeThresholds: (thresholds: ResolvedThresholds) => Effect.Effect<void, DataStoreError>;
|
|
2698
|
+
/**
|
|
2699
|
+
* Persist the resolved aspirational `coverageTargets` for the current
|
|
2700
|
+
* run, distinct from the ratcheted `coverage_baselines` rows. Stored
|
|
2701
|
+
* under `kind='target'`. See issue #237.
|
|
2702
|
+
*/
|
|
2703
|
+
readonly writeTargets: (targets: ResolvedThresholds) => Effect.Effect<void, DataStoreError>;
|
|
2609
2704
|
readonly writeTrends: (project: string, runId: number, entry: TrendEntry) => Effect.Effect<void, DataStoreError>;
|
|
2610
2705
|
readonly writeSourceMap: (sourceFilePath: string, testModuleId: number, mappingType: string) => Effect.Effect<void, DataStoreError>;
|
|
2611
2706
|
readonly ensureFile: (filePath: string) => Effect.Effect<number, DataStoreError>;
|
|
@@ -2624,6 +2719,20 @@ declare const DataStore_base: Context.ServiceClass<DataStore, "vitest-agent/Data
|
|
|
2624
2719
|
* `INSERT ... ON CONFLICT DO NOTHING`.
|
|
2625
2720
|
*/
|
|
2626
2721
|
readonly upsertSession: (input: SessionInput) => Effect.Effect<number, DataStoreError>;
|
|
2722
|
+
/**
|
|
2723
|
+
* Backfill `sessions.conversation_id` for a row that was inserted
|
|
2724
|
+
* before the canonical conversation id was known (issue #144) —
|
|
2725
|
+
* `record session-start` always precedes `register-agent`, so the
|
|
2726
|
+
* session row exists first. Race-safe and idempotent: the UPDATE's
|
|
2727
|
+
* `WHERE conversation_id IS NULL` guard means a session that
|
|
2728
|
+
* already carries a value is left untouched (zero rows affected),
|
|
2729
|
+
* matching the trigger's null→value-only relaxation rather than
|
|
2730
|
+
* risking an immutability-violation error on a redundant call.
|
|
2731
|
+
*/
|
|
2732
|
+
readonly setSessionConversationIdIfNull: (input: {
|
|
2733
|
+
readonly sessionId: number;
|
|
2734
|
+
readonly conversationId: string;
|
|
2735
|
+
}) => Effect.Effect<void, DataStoreError>;
|
|
2627
2736
|
readonly writeTurn: (input: TurnInput) => Effect.Effect<number, DataStoreError>;
|
|
2628
2737
|
readonly writeFailureSignature: (input: FailureSignatureWriteInput) => Effect.Effect<void, DataStoreError>;
|
|
2629
2738
|
readonly endSession: (chatId: string, endedAt: string, endReason: string | null) => Effect.Effect<void, DataStoreError>;
|
|
@@ -2801,6 +2910,8 @@ interface SessionDetail {
|
|
|
2801
2910
|
readonly startedAt: string;
|
|
2802
2911
|
readonly endedAt: string | null;
|
|
2803
2912
|
readonly endReason: string | null;
|
|
2913
|
+
/** Canonical conversation UUID this session belongs to (issue #144), null when unset. */
|
|
2914
|
+
readonly conversationId: string | null;
|
|
2804
2915
|
}
|
|
2805
2916
|
/** @public */
|
|
2806
2917
|
interface TurnSummary {
|
|
@@ -2982,6 +3093,7 @@ interface TddArtifactRow {
|
|
|
2982
3093
|
readonly testRunId: number | null;
|
|
2983
3094
|
readonly testFirstFailureRunId: number | null;
|
|
2984
3095
|
readonly recordedAt: string;
|
|
3096
|
+
readonly suite: ArtifactSuite;
|
|
2985
3097
|
}
|
|
2986
3098
|
/** @public */
|
|
2987
3099
|
interface TagInventoryRow {
|
|
@@ -3095,7 +3207,32 @@ declare const DataReader_base: Context.ServiceClass<DataReader, "vitest-agent/Da
|
|
|
3095
3207
|
* preserves the prior single-session contract.
|
|
3096
3208
|
*/
|
|
3097
3209
|
readonly walkParents?: boolean;
|
|
3210
|
+
/**
|
|
3211
|
+
* When true AND `sessionId`'s session has a non-null
|
|
3212
|
+
* `conversation_id`, also return tdd_tasks belonging to
|
|
3213
|
+
* any OTHER session sharing that `conversation_id` — the
|
|
3214
|
+
* detached-session fallback (issue #144). A session with
|
|
3215
|
+
* a null `conversation_id` never triggers this fallback.
|
|
3216
|
+
* Rows are ordered so a task owned by an `agent_kind =
|
|
3217
|
+
* 'main'` session sorts first, then by `started_at DESC`.
|
|
3218
|
+
* Default `false` preserves the prior contract.
|
|
3219
|
+
*/
|
|
3220
|
+
readonly walkConversation?: boolean;
|
|
3098
3221
|
}) => Effect.Effect<ReadonlyArray<TddTaskSummary>, DataStoreError>;
|
|
3222
|
+
/**
|
|
3223
|
+
* Diagnostic for the `missing_artifact_evidence` phase-transition
|
|
3224
|
+
* denial (issue #144): counts `tdd_artifacts` rows recorded at or
|
|
3225
|
+
* after `sinceIso` under sessions OTHER than the one that opened
|
|
3226
|
+
* `tddTaskId`, but sharing that session's `conversation_id`. Used
|
|
3227
|
+
* to tell an agent "your hooks may be attributing to a detached
|
|
3228
|
+
* session" rather than a bare "no artifact found". Returns 0 when
|
|
3229
|
+
* `tddTaskId` is unknown or its session's `conversation_id` is
|
|
3230
|
+
* null — the diagnostic never fabricates a signal it cannot back.
|
|
3231
|
+
*/
|
|
3232
|
+
readonly countRecentArtifactsInOtherSessionsOfConversation: (input: {
|
|
3233
|
+
readonly tddTaskId: number;
|
|
3234
|
+
readonly sinceIso: string;
|
|
3235
|
+
}) => Effect.Effect<number, DataStoreError>;
|
|
3099
3236
|
/**
|
|
3100
3237
|
* List artifacts recorded for a TDD task, optionally filtered
|
|
3101
3238
|
* by `artifactKind`, `phaseId`, or `behaviorId`. Returns rows in
|
|
@@ -3981,9 +4118,27 @@ declare const ConsoleLeakFile: Schema.Struct<{
|
|
|
3981
4118
|
}>;
|
|
3982
4119
|
/** @public */
|
|
3983
4120
|
type ConsoleLeakFile = typeof ConsoleLeakFile.Type;
|
|
4121
|
+
/**
|
|
4122
|
+
* Summary of console output logged inside tests that did NOT pass. Kept
|
|
4123
|
+
* separate from `total`/`byFile` so it can never be mistaken for a leak in a
|
|
4124
|
+
* passing test — assertion-failure logging that routes through `console.*`
|
|
4125
|
+
* (common with logger-backed assertion libraries) would otherwise camouflage
|
|
4126
|
+
* genuine leaks on every red run.
|
|
4127
|
+
* @public
|
|
4128
|
+
*/
|
|
4129
|
+
declare const ConsoleLeaksFromFailingTests: Schema.Struct<{
|
|
4130
|
+
readonly total: Schema.Number;
|
|
4131
|
+
readonly files: Schema.Number;
|
|
4132
|
+
}>;
|
|
4133
|
+
/** @public */
|
|
4134
|
+
type ConsoleLeaksFromFailingTests = typeof ConsoleLeaksFromFailingTests.Type;
|
|
3984
4135
|
/**
|
|
3985
4136
|
* Aggregate stray-console-output signal for a single test run. Omitted from
|
|
3986
|
-
* a report entirely when the run produced no user console output
|
|
4137
|
+
* a report entirely when the run produced no user console output at all
|
|
4138
|
+
* (neither non-failing nor failing-test writes). `total`/`byFile` count only
|
|
4139
|
+
* output from tests that did not fail; `fromFailingTests`, when present,
|
|
4140
|
+
* summarizes the output Vitest captured from failing tests so it stays
|
|
4141
|
+
* visible without polluting the actionable leak signal (issue #263).
|
|
3987
4142
|
* @public
|
|
3988
4143
|
*/
|
|
3989
4144
|
declare const ConsoleLeaks: Schema.Struct<{
|
|
@@ -3996,6 +4151,10 @@ declare const ConsoleLeaks: Schema.Struct<{
|
|
|
3996
4151
|
readonly sample: Schema.optional<Schema.String>;
|
|
3997
4152
|
}>>;
|
|
3998
4153
|
readonly truncated: Schema.optional<Schema.Boolean>;
|
|
4154
|
+
readonly fromFailingTests: Schema.optional<Schema.Struct<{
|
|
4155
|
+
readonly total: Schema.Number;
|
|
4156
|
+
readonly files: Schema.Number;
|
|
4157
|
+
}>>;
|
|
3999
4158
|
}>;
|
|
4000
4159
|
/** @public */
|
|
4001
4160
|
type ConsoleLeaks = typeof ConsoleLeaks.Type;
|
|
@@ -4753,13 +4912,23 @@ interface ConsoleLeakEntry {
|
|
|
4753
4912
|
readonly test?: string;
|
|
4754
4913
|
readonly type: "stdout" | "stderr";
|
|
4755
4914
|
readonly content: string;
|
|
4915
|
+
/**
|
|
4916
|
+
* True when this write happened inside a test (or a suite/module) that did
|
|
4917
|
+
* not end in a passing state. Assertion-failure logging that routes through
|
|
4918
|
+
* `console.*` (common with logger-backed assertion libraries) sets this so
|
|
4919
|
+
* buildConsoleLeaks can keep it out of the actionable leak signal.
|
|
4920
|
+
*/
|
|
4921
|
+
readonly failed?: boolean;
|
|
4756
4922
|
}
|
|
4757
4923
|
/**
|
|
4758
4924
|
* Aggregate raw console-leak entries into a ConsoleLeaks signal:
|
|
4759
4925
|
* bucket by file, split stdout/stderr, collect attributable test names,
|
|
4760
4926
|
* capture one truncated sample per file, sort by total writes descending,
|
|
4761
|
-
* and cap the file list.
|
|
4762
|
-
*
|
|
4927
|
+
* and cap the file list. Entries logged inside a failing test (with
|
|
4928
|
+
* `failed` set) are excluded from `total`/`byFile` — the actionable leak signal —
|
|
4929
|
+
* and summarized instead in `fromFailingTests` (issue #263: a logger-backed
|
|
4930
|
+
* assertion failure otherwise makes every red run look like a leak). Returns
|
|
4931
|
+
* `undefined` only when there is no output at all, non-failing or failing.
|
|
4763
4932
|
* @public
|
|
4764
4933
|
*/
|
|
4765
4934
|
declare function buildConsoleLeaks(entries: ReadonlyArray<ConsoleLeakEntry>): ConsoleLeaks | undefined;
|
|
@@ -4780,15 +4949,43 @@ interface ConsoleLeakTask {
|
|
|
4780
4949
|
readonly content: string;
|
|
4781
4950
|
}>;
|
|
4782
4951
|
readonly tasks?: ReadonlyArray<ConsoleLeakTask>;
|
|
4952
|
+
/**
|
|
4953
|
+
* Vitest's own `TaskResult`, structurally narrowed to the one field this
|
|
4954
|
+
* util reads. `state` is `"pass" | "fail"` once the task has finished
|
|
4955
|
+
* running (still a `RunMode` value like `"run"`/`"skip"` beforehand).
|
|
4956
|
+
*/
|
|
4957
|
+
readonly result?: {
|
|
4958
|
+
readonly state?: string;
|
|
4959
|
+
};
|
|
4783
4960
|
}
|
|
4784
4961
|
/**
|
|
4785
4962
|
* Walk a Vitest `File[]` task tree (from `vitest.state.getFiles()`) into flat
|
|
4786
4963
|
* {@link ConsoleLeakEntry} values. Each task `log` becomes one entry attributed
|
|
4787
4964
|
* to its enclosing file and, when the log sits on a test task, that test's name.
|
|
4965
|
+
* An entry is marked `failed: true` when it was logged inside a test whose own
|
|
4966
|
+
* `result.state` is `"fail"`, or — for output with no owning test — when the
|
|
4967
|
+
* enclosing file itself failed (e.g. a collection/load error).
|
|
4788
4968
|
* @public
|
|
4789
4969
|
*/
|
|
4790
4970
|
declare function collectConsoleLeakEntries(files: ReadonlyArray<ConsoleLeakTask>): ConsoleLeakEntry[];
|
|
4791
4971
|
//#endregion
|
|
4972
|
+
//#region src/utils/detect-non-default-discover-strategy.d.ts
|
|
4973
|
+
/**
|
|
4974
|
+
* Lexically detects whether a Vitest/Vite config source text appears to
|
|
4975
|
+
* configure a non-default `DiscoverStrategy` — a custom `discoverStrategy`
|
|
4976
|
+
* option (including `discoverStrategy: false`), an `AgentPlugin.discover()`
|
|
4977
|
+
* `.addProject(...)` chain, or a class extending `DefaultDiscoverStrategy` /
|
|
4978
|
+
* implementing `DiscoverStrategy`.
|
|
4979
|
+
*
|
|
4980
|
+
* Pure and comment-tolerant (best-effort): a marker mentioned only inside a
|
|
4981
|
+
* comment may still register as a false positive if it isn't caught by the
|
|
4982
|
+
* comment-stripping pass. That is intentional — this function only ever
|
|
4983
|
+
* decides whether to fail open, so a false positive is harmless while a
|
|
4984
|
+
* false negative would produce a confidently wrong deny.
|
|
4985
|
+
* @public
|
|
4986
|
+
*/
|
|
4987
|
+
declare function detectNonDefaultDiscoverStrategy(source: string): boolean;
|
|
4988
|
+
//#endregion
|
|
4792
4989
|
//#region src/utils/detect-pm.d.ts
|
|
4793
4990
|
/**
|
|
4794
4991
|
* Filesystem abstraction for package manager detection.
|
|
@@ -5023,6 +5220,27 @@ declare function formatFatalError(err: unknown): string;
|
|
|
5023
5220
|
*/
|
|
5024
5221
|
declare function formatGfm(reports: AgentReport[]): string;
|
|
5025
5222
|
//#endregion
|
|
5223
|
+
//#region src/utils/format-scoped-coverage-note.d.ts
|
|
5224
|
+
/**
|
|
5225
|
+
* Format the informational note shown when coverage thresholds were
|
|
5226
|
+
* skipped because a run only exercised a subset of the project's test
|
|
5227
|
+
* files (issue #160). Vitest's coverage provider enforces
|
|
5228
|
+
* `coverage.thresholds` against the whole-project denominator
|
|
5229
|
+
* regardless of how many files actually ran, so callers that detect a
|
|
5230
|
+
* scoped/partial run suppress the native threshold check and surface
|
|
5231
|
+
* this note instead so the agent understands why no pass/fail verdict
|
|
5232
|
+
* was rendered for coverage.
|
|
5233
|
+
*
|
|
5234
|
+
* @param testedFileCount - number of test files that actually ran
|
|
5235
|
+
* @param totalFileCount - total number of test files in the project, when
|
|
5236
|
+
* known. Some callers (formatters working from a persisted
|
|
5237
|
+
* `CoverageReport`, which tracks only the tested-file list) cannot supply
|
|
5238
|
+
* this; the note degrades to `"(N test files)"` when omitted.
|
|
5239
|
+
* @returns the note text, e.g. `"Coverage thresholds skipped: partial run (2 of 47 test files)"`
|
|
5240
|
+
* @public
|
|
5241
|
+
*/
|
|
5242
|
+
declare function formatScopedCoverageNote(testedFileCount: number, totalFileCount?: number): string;
|
|
5243
|
+
//#endregion
|
|
5026
5244
|
//#region src/utils/function-boundary.d.ts
|
|
5027
5245
|
/** @public */
|
|
5028
5246
|
interface FunctionBoundary {
|
|
@@ -5412,5 +5630,5 @@ declare function validateCoverageTargetsShape(input: unknown): CoverageTargetsSh
|
|
|
5412
5630
|
*/
|
|
5413
5631
|
declare const CURRENT_SDK_VERSION: string;
|
|
5414
5632
|
//#endregion
|
|
5415
|
-
export { AcceptanceMetrics, ActionSeverity, ActorType, Agent, AgentConsoleMode, AgentContext, AgentId, AgentNotFoundError, AgentPluginOptions, AgentReport, AgentReporterOptions, AgentTreeNode, AnsiOptions, ArtifactKind, AssembledHistoryRecord, AssociateRunSessionInput, BehaviorAbandonedEvent, BehaviorAddedEvent, BehaviorCompletedEvent, BehaviorDetail, BehaviorNotFoundError, BehaviorRow, BehaviorScopedEventType, BehaviorScopedEventTypes, BehaviorStartedEvent, BehaviorStatus, BehaviorsReadyEvent, BlockedEvent, CURRENT_SDK_VERSION, CacheManifest, CacheManifestEntry, CandidateContext, CellOptions, ChangeKind, ChannelEvent, ChatId, CiConsoleMode, CitedArtifact, CitedArtifactRow, ClassificationQueryOptions, CommitChangesEntry, ConfigLive, ConsoleFormatOptions, ConsoleLeakEntry, ConsoleLeakFile, ConsoleLeakTask, ConsoleLeaks, ConsoleLogLevel, ConsoleMode, ConsoleOutputMode, ConsoleOutputs, ConversationId, ConversationNotFoundError, CoverageBaselines, FileCoverageReport as CoverageFile, FileCoverageReport, CoverageGap, CoverageInput, CoverageLevel, CoverageLevelName, CoverageMetric, CoverageRenderState, CoverageReport, CoverageTargets, CoverageTargetsMetrics, CoverageTargetsShapeError, CoverageTargetsShapeInfo, CoverageTargetsShapeResult, CoverageTargetsShapeWarning, CoverageTotals, CreateBehaviorInput, CreateGoalInput, CurrentTddPhase, DATABASE_FILENAME, DataReader, DataReaderLive, DataStore, DataStoreError, DataStoreLive, DenialReason, DetailLevel, DetailResolver, DetailResolverLive, DiscoveryError, DiscoveryRegistry, DiscoveryRegistryLive, DispatchInputs, EndTddTaskInput, Environment, EnvironmentDetector, EnvironmentDetectorLive, EnvironmentDetectorTest, Executor, ExecutorResolver, ExecutorResolverLive, FailureRecord, FailureSignatureDetail, FailureSignatureInput, FailureSignatureWriteInput, FileCoverageInput, FileEditPayload, FileSystemAdapter, FlakyTest, FormatSelector, FormatSelectorLive, type FormatTriageOptions, type FormatWrapupOptions, Formatter, FormatterContext, FunctionBoundary, GfmFormatter, GitCommandError, GoalAbandonedEvent, GoalAddedEvent, GoalCompletedEvent, GoalDetail, GoalNotFoundError, GoalRow, GoalStartedEvent, GoalStatus, GoalsReadyEvent, HistoryQueryOptions, HistoryRecord, HistoryRow, HistoryTracker, HistoryTrackerLive, HistoryTrackerTest, HistoryTrackerTestState, HookFirePayload, HookStatus, HookType, HostKind, HostMetadataParseError, HostMetadataResult, HumanConsoleMode, HypothesisDetail, HypothesisInput, HypothesisPayload, IDEMPOTENCY_ROOT_SENTINEL, IdempotencyHit, IdempotencyInput, IdempotentResponseInput, IllegalStatusTransitionEntity, IllegalStatusTransitionError, JsonFormatter, KnownProject, KnownProjectInput, LoggerLive, ManifestRow, MapSessionInput, MapSessionOutput, MarkdownFormatter, MetricThresholds, ModuleInput, ModuleListEntry, ModuleRecord, ModuleReport, NON_DISCOVERABLE_DIRS, NoteInput, NotePayload, NoteRow, Osc8Options, OutputFormat, OutputPipelineLive, OutputRenderer, OutputRendererLive, PackageManager, PathResolutionError, PathResolutionLive, PatternThresholds, PerClientSessionMapReader, PerClientSessionMapReaderLive, PerClientSessionMapWriter, PerClientSessionMapWriterLive, PersistentFailure, Phase, PhaseTransitionContext, PhaseTransitionEvent, PhaseTransitionResult, ProbeMissError, ProjectDiscovery, ProjectDiscoveryLive, ProjectDiscoveryTest, ProjectIdentity, ProjectIdentityCandidate, ProjectIdentityCandidates, ProjectIdentityLive, ProjectIdentityNotResolvableError, ProjectIdentitySource, ProjectIdentityTest, ProjectKey, ProjectRunSummary, ProjectSummary, RegisterAgentInput, RegisterAgentResult, RegistrationConflictError, Remediation, RenderState, RenderTotals, RenderedOutput, ReportError, ReportSummary, ReporterKit, ReporterRenderInput, ResolveDataPathOptions, ResolveProjectIdentityOptions, ResolvedIdentity, ResolvedReporterConfig, ResolvedThresholds, RunChangedFile, RunContext, RunContext$, RunContextLive, RunContextService, RunContextTest, RunEvent, RunEventByTag, RunHealth, RunInvocationMethod, RunOutcome, RunShape, SRC_DIR, SessionCompleteEvent, SessionContextRow, SessionDetail, SessionInput, SessionNotFoundError, SessionOutcome, SettingsInput, SettingsListEntry, SettingsRow, SidecarTimeoutError, SilentFormatter, StackFrameInput, SuggestedActionRecord, SuiteInput, SuiteListEntry, TEST_DIR, TEST_FILE_GLOB_SUFFIX, TEST_HELPER_DIRS, TagCountEntry, TagInventoryRow, TddArtifactDetail, TddArtifactRow, TddPhaseDetail, TddTaskAlreadyEndedError, TddTaskDetail, TddTaskEndOutcome, TddTaskId, TddTaskInput, TddTaskNotFoundError, TddTaskSummary, TerminalFormatter, TestCaseInput, TestClassification, TestError, TestErrorInput, TestFileEntry, TestHistory, TestListEntry, TestLookupOptions, TestOutcome, TestPathClassification, TestPathVerdict, TestRecord, TestReport, TestRun, TestRunInput, TestRunReason, TestState, ToolCallPayload, ToolResultPayload, Transport, TrendEntry, TrendRecord, TrendSummary, TurnInput, TurnPayload, TurnSearchOptions, TurnSummary, UpdateBehaviorInput, UpdateGoalInput, UserPromptPayload, ValidateHypothesisInput, VitestAgentConfig, VitestAgentConfigFile, VitestAgentConfigFileService, VitestAgentReporter, VitestAgentReporterFactory, VitestModuleDiagnostic, VitestModuleError, VitestParsedStack, VitestTestCase, VitestTestDiagnostic, VitestTestError, VitestTestModule, VitestTestResult, VitestTestSuite, WorkspaceLike, type WrapupKind, WriteCommitInput, WriteRunChangedFilesInput, WriteTddArtifactInput, WriteTddPhaseInput, WriteTddPhaseOutput, _resetMigrationCacheForTesting, ansi, assembleHistoryRecord, assembleManifest, buildAgentReport, buildConsoleLeaks, buildEnvPrefix, canonicalizeGitUrl, ciAnnotationsFormatter, classifyTest, classifyTestPath, coerceErrorField, coerceErrorText, collectConsoleLeakEntries, compressLines, computeFailureSignature, computeTrend, countSuiteFailures, deriveIdempotencyKey, detectPackageManager, detectVitestScripts, determineTier, ensureMigrated, extractSqlReason, findFunctionBoundary, findOwningWorkspace, formatConsoleMarkdown, formatFatalError, formatGfm, formatTriageEffect, formatWrapupEffect, getRecentDirection, getRunCommand, getWorstMetric, gitUrlToProjectKey, hashTargets, historyKey, initialRenderState, isTestFileName, isTimeoutError, isVitestInvocation, migration as migration0001, normalizeAssertionShape, normalizeWorkspaceKey, osc8, probeHostMetadataFromEnv, migration$1 as registryMigration0001, relativePath, requiredArtifactForTransition, resolveCoverageInput, resolveDataPath, resolveLogFile, resolveLogLevel, resolveProjectIdentityFromCandidates, resolveProjectKeyFromCwd, resolveWorkspaceKey, rewriteBashCommand, safeFilename, migration$2 as sessionMapMigration0001, stripAnsi, transitionEnforcesBehaviorMatch, validateCoverageConfig, validateCoverageTargetsShape, validatePhaseTransition };
|
|
5633
|
+
export { AcceptanceMetrics, ActionSeverity, ActorType, Agent, AgentConsoleMode, AgentContext, AgentId, AgentNotFoundError, AgentPluginOptions, AgentReport, AgentReporterOptions, AgentTreeNode, AnsiOptions, ArtifactKind, ArtifactSuite, AssembledHistoryRecord, AssociateRunSessionInput, BehaviorAbandonedEvent, BehaviorAddedEvent, BehaviorCompletedEvent, BehaviorDetail, BehaviorNotFoundError, BehaviorRow, BehaviorScopedEventType, BehaviorScopedEventTypes, BehaviorStartedEvent, BehaviorStatus, BehaviorsReadyEvent, BlockedEvent, CURRENT_SDK_VERSION, CacheManifest, CacheManifestEntry, CandidateContext, CellOptions, ChangeKind, ChannelEvent, ChatId, CiConsoleMode, CitedArtifact, CitedArtifactRow, ClassificationQueryOptions, CommitChangesEntry, ConfigLive, ConsoleFormatOptions, ConsoleLeakEntry, ConsoleLeakFile, ConsoleLeakTask, ConsoleLeaks, ConsoleLeaksFromFailingTests, ConsoleLogLevel, ConsoleMode, ConsoleOutputMode, ConsoleOutputs, ConversationId, ConversationNotFoundError, CoverageBaselines, FileCoverageReport as CoverageFile, FileCoverageReport, CoverageGap, CoverageInput, CoverageLevel, CoverageLevelName, CoverageMetric, CoverageRenderState, CoverageReport, CoverageTargets, CoverageTargetsMetrics, CoverageTargetsShapeError, CoverageTargetsShapeInfo, CoverageTargetsShapeResult, CoverageTargetsShapeWarning, CoverageTotals, CreateBehaviorInput, CreateGoalInput, CurrentTddPhase, DATABASE_FILENAME, DataReader, DataReaderLive, DataStore, DataStoreError, DataStoreLive, DenialReason, DetailLevel, DetailResolver, DetailResolverLive, DiscoveryError, DiscoveryRegistry, DiscoveryRegistryLive, DispatchInputs, EndTddTaskInput, Environment, EnvironmentDetector, EnvironmentDetectorLive, EnvironmentDetectorTest, Executor, ExecutorResolver, ExecutorResolverLive, FailureRecord, FailureSignatureDetail, FailureSignatureInput, FailureSignatureWriteInput, FileCoverageInput, FileEditPayload, FileSystemAdapter, FlakyTest, FormatSelector, FormatSelectorLive, type FormatTriageOptions, type FormatWrapupOptions, Formatter, FormatterContext, FunctionBoundary, GfmFormatter, GitCommandError, GoalAbandonedEvent, GoalAddedEvent, GoalCompletedEvent, GoalDetail, GoalNotFoundError, GoalRow, GoalStartedEvent, GoalStatus, GoalsReadyEvent, HistoryQueryOptions, HistoryRecord, HistoryRow, HistoryTracker, HistoryTrackerLive, HistoryTrackerTest, HistoryTrackerTestState, HookFirePayload, HookStatus, HookType, HostKind, HostMetadataParseError, HostMetadataResult, HumanConsoleMode, HypothesisDetail, HypothesisInput, HypothesisPayload, IDEMPOTENCY_ROOT_SENTINEL, IdempotencyHit, IdempotencyInput, IdempotentResponseInput, IllegalStatusTransitionEntity, IllegalStatusTransitionError, JsonFormatter, KnownProject, KnownProjectInput, LoggerLive, ManifestRow, MapSessionInput, MapSessionOutput, MarkdownFormatter, MetricThresholds, ModuleInput, ModuleListEntry, ModuleRecord, ModuleReport, NON_DISCOVERABLE_DIRS, NoteInput, NotePayload, NoteRow, Osc8Options, OutputFormat, OutputPipelineLive, OutputRenderer, OutputRendererLive, PackageManager, PathResolutionError, PathResolutionLive, PatternThresholds, PerClientSessionMapReader, PerClientSessionMapReaderLive, PerClientSessionMapWriter, PerClientSessionMapWriterLive, PersistentFailure, Phase, PhaseTransitionContext, PhaseTransitionEvent, PhaseTransitionResult, ProbeMissError, ProjectDiscovery, ProjectDiscoveryLive, ProjectDiscoveryTest, ProjectIdentity, ProjectIdentityCandidate, ProjectIdentityCandidates, ProjectIdentityLive, ProjectIdentityNotResolvableError, ProjectIdentitySource, ProjectIdentityTest, ProjectKey, ProjectRunSummary, ProjectSummary, RegisterAgentInput, RegisterAgentResult, RegistrationConflictError, Remediation, RenderState, RenderTotals, RenderedOutput, ReportError, ReportSummary, ReporterKit, ReporterRenderInput, ResolveDataPathOptions, ResolveProjectIdentityOptions, ResolvedIdentity, ResolvedReporterConfig, ResolvedThresholds, RunChangedFile, RunContext, RunContext$, RunContextLive, RunContextService, RunContextTest, RunEvent, RunEventByTag, RunHealth, RunInvocationMethod, RunOutcome, RunShape, SRC_DIR, SessionCompleteEvent, SessionContextRow, SessionDetail, SessionInput, SessionNotFoundError, SessionOutcome, SettingsInput, SettingsListEntry, SettingsRow, SidecarTimeoutError, SilentFormatter, StackFrameInput, SuggestedActionRecord, SuiteInput, SuiteListEntry, TEST_DIR, TEST_FILE_GLOB_SUFFIX, TEST_HELPER_DIRS, TagCountEntry, TagInventoryRow, TddArtifactDetail, TddArtifactRow, TddPhaseDetail, TddTaskAlreadyEndedError, TddTaskDetail, TddTaskEndOutcome, TddTaskId, TddTaskInput, TddTaskNotFoundError, TddTaskSummary, TerminalFormatter, TestCaseInput, TestClassification, TestError, TestErrorInput, TestFileEntry, TestHistory, TestListEntry, TestLookupOptions, TestOutcome, TestPathClassification, TestPathVerdict, TestRecord, TestReport, TestRun, TestRunInput, TestRunReason, TestState, ToolCallPayload, ToolResultPayload, Transport, TrendEntry, TrendRecord, TrendSummary, TurnInput, TurnPayload, TurnSearchOptions, TurnSummary, UpdateBehaviorInput, UpdateGoalInput, UserPromptPayload, ValidateHypothesisInput, VitestAgentConfig, VitestAgentConfigFile, VitestAgentConfigFileService, VitestAgentReporter, VitestAgentReporterFactory, VitestModuleDiagnostic, VitestModuleError, VitestParsedStack, VitestTestCase, VitestTestDiagnostic, VitestTestError, VitestTestModule, VitestTestResult, VitestTestSuite, WorkspaceLike, type WrapupKind, WriteCommitInput, WriteRunChangedFilesInput, WriteTddArtifactInput, WriteTddPhaseInput, WriteTddPhaseOutput, _resetMigrationCacheForTesting, ansi, assembleHistoryRecord, assembleManifest, buildAgentReport, buildConsoleLeaks, buildEnvPrefix, canonicalizeGitUrl, ciAnnotationsFormatter, classifyTest, classifyTestPath, coerceErrorField, coerceErrorText, collectConsoleLeakEntries, compressLines, computeFailureSignature, computeTrend, countSuiteFailures, deriveIdempotencyKey, detectNonDefaultDiscoverStrategy, detectPackageManager, detectVitestScripts, determineTier, ensureMigrated, extractSqlReason, findFunctionBoundary, findOwningWorkspace, formatConsoleMarkdown, formatFatalError, formatGfm, formatScopedCoverageNote, formatTriageEffect, formatWrapupEffect, getRecentDirection, getRunCommand, getWorstMetric, gitUrlToProjectKey, hashTargets, historyKey, initialRenderState, isTestFileName, isTimeoutError, isVitestInvocation, migration as migration0001, normalizeAssertionShape, normalizeWorkspaceKey, osc8, probeHostMetadataFromEnv, migration$1 as registryMigration0001, relativePath, requiredArtifactForTransition, resolveCoverageInput, resolveDataPath, resolveLogFile, resolveLogLevel, resolveProjectIdentityFromCandidates, resolveProjectKeyFromCwd, resolveWorkspaceKey, rewriteBashCommand, safeFilename, migration$2 as sessionMapMigration0001, stripAnsi, transitionEnforcesBehaviorMatch, validateCoverageConfig, validateCoverageTargetsShape, validatePhaseTransition };
|
|
5416
5634
|
//# sourceMappingURL=index.d.ts.map
|
package/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { formatGfm } from "./utils/format-gfm.js";
|
|
|
10
10
|
import { GfmFormatter } from "./formatters/gfm.js";
|
|
11
11
|
import { JsonFormatter } from "./formatters/json.js";
|
|
12
12
|
import { ansi, stripAnsi } from "./utils/ansi.js";
|
|
13
|
+
import { formatScopedCoverageNote } from "./utils/format-scoped-coverage-note.js";
|
|
13
14
|
import { determineTier, formatConsoleMarkdown, getWorstMetric, relativePath } from "./utils/format-console.js";
|
|
14
15
|
import { MarkdownFormatter } from "./formatters/markdown.js";
|
|
15
16
|
import { SilentFormatter } from "./formatters/silent.js";
|
|
@@ -65,7 +66,7 @@ import migration from "./migrations/0001_initial.js";
|
|
|
65
66
|
import migration$1 from "./migrations/registry_0001_initial.js";
|
|
66
67
|
import migration$2 from "./migrations/session_map_0001_initial.js";
|
|
67
68
|
import { AgentConsoleMode, CiConsoleMode, ConsoleMode, ConsoleOutputMode, DetailLevel, Environment, Executor, HumanConsoleMode, OutputFormat, PackageManager, ReportError, TestClassification, TestRunReason, TestState } from "./schemas/Common.js";
|
|
68
|
-
import { ConsoleLeakFile, ConsoleLeaks } from "./schemas/ConsoleLeaks.js";
|
|
69
|
+
import { ConsoleLeakFile, ConsoleLeaks, ConsoleLeaksFromFailingTests } from "./schemas/ConsoleLeaks.js";
|
|
69
70
|
import { MetricThresholds, PatternThresholds, ResolvedThresholds } from "./schemas/Thresholds.js";
|
|
70
71
|
import { CoverageReport, CoverageTotals, FileCoverageReport } from "./schemas/Coverage.js";
|
|
71
72
|
import { AgentReport, ModuleReport, ReportSummary, TagCountEntry, TestReport } from "./schemas/AgentReport.js";
|
|
@@ -94,6 +95,7 @@ import { assembleHistoryRecord, assembleManifest } from "./sql/assemblers.js";
|
|
|
94
95
|
import { buildAgentReport, countSuiteFailures } from "./utils/build-report.js";
|
|
95
96
|
import { computeTrend, getRecentDirection, hashTargets } from "./utils/compute-trend.js";
|
|
96
97
|
import { buildConsoleLeaks, collectConsoleLeakEntries } from "./utils/console-leaks.js";
|
|
98
|
+
import { detectNonDefaultDiscoverStrategy } from "./utils/detect-non-default-discover-strategy.js";
|
|
97
99
|
import { detectPackageManager, getRunCommand } from "./utils/detect-pm.js";
|
|
98
100
|
import { isTimeoutError } from "./utils/detect-timeout.js";
|
|
99
101
|
import { _resetMigrationCacheForTesting, ensureMigrated } from "./utils/ensure-migrated.js";
|
|
@@ -117,7 +119,7 @@ import { requiredArtifactForTransition, transitionEnforcesBehaviorMatch, validat
|
|
|
117
119
|
* substituted yet. Exported for version introspection by downstream tooling.
|
|
118
120
|
* @public
|
|
119
121
|
*/
|
|
120
|
-
const CURRENT_SDK_VERSION = "2.
|
|
122
|
+
const CURRENT_SDK_VERSION = "2.5.0";
|
|
121
123
|
|
|
122
124
|
//#endregion
|
|
123
|
-
export { ActionSeverity, ActorType, Agent, AgentConsoleMode, AgentContext, AgentId, AgentNotFoundError, AgentPluginOptions, AgentReport, AgentReporterOptions, BehaviorAbandonedEvent, BehaviorAddedEvent, BehaviorCompletedEvent, BehaviorDetail, BehaviorNotFoundError, BehaviorRow, BehaviorScopedEventTypes, BehaviorStartedEvent, BehaviorStatus, BehaviorsReadyEvent, BlockedEvent, CURRENT_SDK_VERSION, CacheManifest, CacheManifestEntry, ChannelEvent, ChatId, CiConsoleMode, ConfigLive, ConsoleLeakFile, ConsoleLeaks, ConsoleLogLevel, ConsoleMode, ConsoleOutputMode, ConsoleOutputs, ConversationId, ConversationNotFoundError, CoverageBaselines, FileCoverageReport as CoverageFile, CoverageGap, CoverageLevel, CoverageMetric, CoverageRenderState, CoverageReport, CoverageTargets, CoverageTargetsMetrics, CoverageTotals, DATABASE_FILENAME, DataReader, DataReaderLive, DataStore, DataStoreError, DataStoreLive, DetailLevel, DetailResolver, DetailResolverLive, DiscoveryError, DiscoveryRegistry, DiscoveryRegistryLive, Environment, EnvironmentDetector, EnvironmentDetectorLive, EnvironmentDetectorTest, Executor, ExecutorResolver, ExecutorResolverLive, FailureRecord, FileCoverageReport, FileEditPayload, FormatSelector, FormatSelectorLive, GfmFormatter, GitCommandError, GoalAbandonedEvent, GoalAddedEvent, GoalCompletedEvent, GoalDetail, GoalNotFoundError, GoalRow, GoalStartedEvent, GoalStatus, GoalsReadyEvent, HistoryRecord, HistoryTracker, HistoryTrackerLive, HistoryTrackerTest, HookFirePayload, HookStatus, HookType, HostKind, HostMetadataParseError, HumanConsoleMode, HypothesisPayload, IDEMPOTENCY_ROOT_SENTINEL, IdempotencyHit, IllegalStatusTransitionError, JsonFormatter, LoggerLive, MarkdownFormatter, MetricThresholds, ModuleRecord, ModuleReport, NON_DISCOVERABLE_DIRS, NotePayload, OutputFormat, OutputPipelineLive, OutputRenderer, OutputRendererLive, PackageManager, PathResolutionError, PathResolutionLive, PatternThresholds, PerClientSessionMapReader, PerClientSessionMapReaderLive, PerClientSessionMapWriter, PerClientSessionMapWriterLive, PhaseTransitionEvent, ProbeMissError, ProjectDiscovery, ProjectDiscoveryLive, ProjectDiscoveryTest, ProjectIdentity, ProjectIdentityLive, ProjectIdentityNotResolvableError, ProjectIdentityTest, ProjectKey, RegistrationConflictError, RenderState, RenderTotals, ReportError, ReportSummary, ResolvedThresholds, RunContext, RunContext$, RunContextLive, RunContextService, RunContextTest, RunEvent, SRC_DIR, SessionCompleteEvent, SessionNotFoundError, SessionOutcome, SidecarTimeoutError, SilentFormatter, SuggestedActionRecord, TEST_DIR, TEST_FILE_GLOB_SUFFIX, TEST_HELPER_DIRS, TagCountEntry, TddTaskAlreadyEndedError, TddTaskId, TddTaskNotFoundError, TerminalFormatter, TestClassification, TestHistory, TestRecord, TestReport, TestRun, TestRunReason, TestState, ToolCallPayload, ToolResultPayload, Transport, TrendEntry, TrendRecord, TurnPayload, UserPromptPayload, VitestAgentConfig, VitestAgentConfigFile, _resetMigrationCacheForTesting, ansi, assembleHistoryRecord, assembleManifest, buildAgentReport, buildConsoleLeaks, buildEnvPrefix, canonicalizeGitUrl, ciAnnotationsFormatter, classifyTest, classifyTestPath, coerceErrorField, coerceErrorText, collectConsoleLeakEntries, compressLines, computeFailureSignature, computeTrend, countSuiteFailures, deriveIdempotencyKey, detectPackageManager, detectVitestScripts, determineTier, ensureMigrated, extractSqlReason, findFunctionBoundary, findOwningWorkspace, formatConsoleMarkdown, formatFatalError, formatGfm, formatTriageEffect, formatWrapupEffect, getRecentDirection, getRunCommand, getWorstMetric, gitUrlToProjectKey, hashTargets, historyKey, initialRenderState, isTestFileName, isTimeoutError, isVitestInvocation, migration as migration0001, normalizeAssertionShape, normalizeWorkspaceKey, osc8, probeHostMetadataFromEnv, migration$1 as registryMigration0001, relativePath, requiredArtifactForTransition, resolveCoverageInput, resolveDataPath, resolveLogFile, resolveLogLevel, resolveProjectIdentityFromCandidates, resolveProjectKeyFromCwd, resolveWorkspaceKey, rewriteBashCommand, safeFilename, migration$2 as sessionMapMigration0001, stripAnsi, transitionEnforcesBehaviorMatch, validateCoverageConfig, validateCoverageTargetsShape, validatePhaseTransition };
|
|
125
|
+
export { ActionSeverity, ActorType, Agent, AgentConsoleMode, AgentContext, AgentId, AgentNotFoundError, AgentPluginOptions, AgentReport, AgentReporterOptions, BehaviorAbandonedEvent, BehaviorAddedEvent, BehaviorCompletedEvent, BehaviorDetail, BehaviorNotFoundError, BehaviorRow, BehaviorScopedEventTypes, BehaviorStartedEvent, BehaviorStatus, BehaviorsReadyEvent, BlockedEvent, CURRENT_SDK_VERSION, CacheManifest, CacheManifestEntry, ChannelEvent, ChatId, CiConsoleMode, ConfigLive, ConsoleLeakFile, ConsoleLeaks, ConsoleLeaksFromFailingTests, ConsoleLogLevel, ConsoleMode, ConsoleOutputMode, ConsoleOutputs, ConversationId, ConversationNotFoundError, CoverageBaselines, FileCoverageReport as CoverageFile, CoverageGap, CoverageLevel, CoverageMetric, CoverageRenderState, CoverageReport, CoverageTargets, CoverageTargetsMetrics, CoverageTotals, DATABASE_FILENAME, DataReader, DataReaderLive, DataStore, DataStoreError, DataStoreLive, DetailLevel, DetailResolver, DetailResolverLive, DiscoveryError, DiscoveryRegistry, DiscoveryRegistryLive, Environment, EnvironmentDetector, EnvironmentDetectorLive, EnvironmentDetectorTest, Executor, ExecutorResolver, ExecutorResolverLive, FailureRecord, FileCoverageReport, FileEditPayload, FormatSelector, FormatSelectorLive, GfmFormatter, GitCommandError, GoalAbandonedEvent, GoalAddedEvent, GoalCompletedEvent, GoalDetail, GoalNotFoundError, GoalRow, GoalStartedEvent, GoalStatus, GoalsReadyEvent, HistoryRecord, HistoryTracker, HistoryTrackerLive, HistoryTrackerTest, HookFirePayload, HookStatus, HookType, HostKind, HostMetadataParseError, HumanConsoleMode, HypothesisPayload, IDEMPOTENCY_ROOT_SENTINEL, IdempotencyHit, IllegalStatusTransitionError, JsonFormatter, LoggerLive, MarkdownFormatter, MetricThresholds, ModuleRecord, ModuleReport, NON_DISCOVERABLE_DIRS, NotePayload, OutputFormat, OutputPipelineLive, OutputRenderer, OutputRendererLive, PackageManager, PathResolutionError, PathResolutionLive, PatternThresholds, PerClientSessionMapReader, PerClientSessionMapReaderLive, PerClientSessionMapWriter, PerClientSessionMapWriterLive, PhaseTransitionEvent, ProbeMissError, ProjectDiscovery, ProjectDiscoveryLive, ProjectDiscoveryTest, ProjectIdentity, ProjectIdentityLive, ProjectIdentityNotResolvableError, ProjectIdentityTest, ProjectKey, RegistrationConflictError, RenderState, RenderTotals, ReportError, ReportSummary, ResolvedThresholds, RunContext, RunContext$, RunContextLive, RunContextService, RunContextTest, RunEvent, SRC_DIR, SessionCompleteEvent, SessionNotFoundError, SessionOutcome, SidecarTimeoutError, SilentFormatter, SuggestedActionRecord, TEST_DIR, TEST_FILE_GLOB_SUFFIX, TEST_HELPER_DIRS, TagCountEntry, TddTaskAlreadyEndedError, TddTaskId, TddTaskNotFoundError, TerminalFormatter, TestClassification, TestHistory, TestRecord, TestReport, TestRun, TestRunReason, TestState, ToolCallPayload, ToolResultPayload, Transport, TrendEntry, TrendRecord, TurnPayload, UserPromptPayload, VitestAgentConfig, VitestAgentConfigFile, _resetMigrationCacheForTesting, ansi, assembleHistoryRecord, assembleManifest, buildAgentReport, buildConsoleLeaks, buildEnvPrefix, canonicalizeGitUrl, ciAnnotationsFormatter, classifyTest, classifyTestPath, coerceErrorField, coerceErrorText, collectConsoleLeakEntries, compressLines, computeFailureSignature, computeTrend, countSuiteFailures, deriveIdempotencyKey, detectNonDefaultDiscoverStrategy, detectPackageManager, detectVitestScripts, determineTier, ensureMigrated, extractSqlReason, findFunctionBoundary, findOwningWorkspace, formatConsoleMarkdown, formatFatalError, formatGfm, formatScopedCoverageNote, formatTriageEffect, formatWrapupEffect, getRecentDirection, getRunCommand, getWorstMetric, gitUrlToProjectKey, hashTargets, historyKey, initialRenderState, isTestFileName, isTimeoutError, isVitestInvocation, migration as migration0001, normalizeAssertionShape, normalizeWorkspaceKey, osc8, probeHostMetadataFromEnv, migration$1 as registryMigration0001, relativePath, requiredArtifactForTransition, resolveCoverageInput, resolveDataPath, resolveLogFile, resolveLogLevel, resolveProjectIdentityFromCandidates, resolveProjectKeyFromCwd, resolveWorkspaceKey, rewriteBashCommand, safeFilename, migration$2 as sessionMapMigration0001, stripAnsi, transitionEnforcesBehaviorMatch, validateCoverageConfig, validateCoverageTargetsShape, validatePhaseTransition };
|