@vitest-agent/sdk 1.0.0 → 1.1.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 CHANGED
@@ -1,4 +1,3 @@
1
- import { $ as ValidateHypothesisInput, $t as TddTaskId, A as CreateGoalInput, At as CacheManifestEntry, B as RunChangedFile, Bt as extractSqlReason, C as TestError, Ct as GoalDetail, D as AssociateRunSessionInput, Dt as TestHistory, E as TurnSummary, Et as HistoryRecord, F as HypothesisInput, Ft as IllegalStatusTransitionError, G as SuiteInput, Gt as SessionNotFoundError, H as SessionInput, Ht as ConversationNotFoundError, I as IdempotentResponseInput, It as TddTaskAlreadyEndedError, J as TestErrorInput, Jt as AgentId, K as TddTaskInput, Kt as SidecarTimeoutError, L as ModuleInput, Lt as TddTaskEndOutcome, M as EndTddTaskInput, Mt as BehaviorNotFoundError, N as FailureSignatureWriteInput, Nt as GoalNotFoundError, O as ChangeKind, Ot as TestRun, P as FileCoverageInput, Pt as IllegalStatusTransitionEntity, Q as UpdateGoalInput, Qt as ProjectKey, R as NoteInput, Rt as TddTaskNotFoundError, S as TddTaskSummary, St as BehaviorStatus, T as TurnSearchOptions, Tt as GoalStatus, U as SettingsInput, Ut as HostMetadataParseError, V as RunInvocationMethod, Vt as AgentNotFoundError, W as StackFrameInput, Wt as RegistrationConflictError, X as TurnInput, Xt as ConversationId, Y as TestRunInput, Yt as ChatId, Z as UpdateBehaviorInput, Zt as HostKind, _ as TagInventoryRow, _t as validatePhaseTransition, a as DataReader, an as CoverageReport, at as Agent, b as TddPhaseDetail, bt as BehaviorDetail, c as HypothesisDetail, ct as RegisterAgentResult, d as PersistentFailure, dt as DenialReason, en as AgentReport, et as WriteCommitInput, f as ProjectRunSummary, ft as Phase, g as SuiteListEntry, gt as requiredArtifactForTransition, h as SettingsRow, ht as Remediation, i as CurrentTddPhase, in as TestReport, it as WriteTddPhaseOutput, j as DataStore, jt as CoverageBaselines, k as CreateBehaviorInput, kt as CacheManifest, l as ModuleListEntry, lt as ArtifactKind, m as SettingsListEntry, mt as PhaseTransitionResult, n as CitedArtifactRow, nn as ReportSummary, nt as WriteTddArtifactInput, o as FailureSignatureDetail, on as CoverageTotals, ot as AgentTreeNode, p as SessionDetail, pt as PhaseTransitionContext, q as TestCaseInput, qt as ActorType, r as CommitChangesEntry, rn as TagCountEntry, rt as WriteTddPhaseInput, s as FlakyTest, sn as FileCoverageReport, st as IdempotencyHit, t as AcceptanceMetrics, tn as ModuleReport, tt as WriteRunChangedFilesInput, u as NoteRow, ut as CitedArtifact, v as TddArtifactDetail, vt as TrendEntry, w as TestListEntry, wt as GoalRow, x as TddTaskDetail, xt as BehaviorRow, y as TddArtifactRow, yt as TrendRecord, z as RegisterAgentInput, zt as DataStoreError } from "./DataReader-2kJ9I9Hh.js";
2
1
  import { Context, Effect, Layer, LogLevel, Option, PubSub, Schema } from "effect";
3
2
  import { CommandExecutor, FileSystem } from "@effect/platform";
4
3
  import { ConfigFileService } from "config-file-effect";
@@ -6,6 +5,124 @@ import { SqlClient } from "@effect/sql/SqlClient";
6
5
  import { WorkspaceDiscovery, WorkspaceDiscoveryError, WorkspaceRootNotFoundError } from "workspaces-effect";
7
6
  import { AppDirs } from "xdg-effect";
8
7
 
8
+ //#region src/schemas/Coverage.d.ts
9
+ /**
10
+ * Aggregate coverage percentages across four istanbul metrics.
11
+ * @public
12
+ */
13
+ declare const CoverageTotals: Schema.Struct<{
14
+ statements: typeof Schema.Number;
15
+ branches: typeof Schema.Number;
16
+ functions: typeof Schema.Number;
17
+ lines: typeof Schema.Number;
18
+ }>;
19
+ /** @public */
20
+ type CoverageTotals = typeof CoverageTotals.Type;
21
+ /**
22
+ * Per-file coverage data including uncovered line ranges.
23
+ * @public
24
+ */
25
+ declare const FileCoverageReport: Schema.Struct<{
26
+ file: typeof Schema.String;
27
+ summary: Schema.Struct<{
28
+ statements: typeof Schema.Number;
29
+ branches: typeof Schema.Number;
30
+ functions: typeof Schema.Number;
31
+ lines: typeof Schema.Number;
32
+ }>;
33
+ uncoveredLines: typeof Schema.String;
34
+ }>;
35
+ /** @public */
36
+ type FileCoverageReport = typeof FileCoverageReport.Type;
37
+ /**
38
+ * Complete coverage report attached to an AgentReport.
39
+ * @public
40
+ */
41
+ declare const CoverageReport: Schema.Struct<{
42
+ totals: Schema.Struct<{
43
+ statements: typeof Schema.Number;
44
+ branches: typeof Schema.Number;
45
+ functions: typeof Schema.Number;
46
+ lines: typeof Schema.Number;
47
+ }>;
48
+ thresholds: Schema.Struct<{
49
+ global: Schema.Struct<{
50
+ lines: Schema.optional<typeof Schema.Number>;
51
+ functions: Schema.optional<typeof Schema.Number>;
52
+ branches: Schema.optional<typeof Schema.Number>;
53
+ statements: Schema.optional<typeof Schema.Number>;
54
+ }>;
55
+ patterns: Schema.optionalWith<Schema.Array$<Schema.Tuple2<typeof Schema.String, Schema.Struct<{
56
+ lines: Schema.optional<typeof Schema.Number>;
57
+ functions: Schema.optional<typeof Schema.Number>;
58
+ branches: Schema.optional<typeof Schema.Number>;
59
+ statements: Schema.optional<typeof Schema.Number>;
60
+ }>>>, {
61
+ default: () => never[];
62
+ }>;
63
+ }>;
64
+ targets: Schema.optional<Schema.Struct<{
65
+ global: Schema.Struct<{
66
+ lines: Schema.optional<typeof Schema.Number>;
67
+ functions: Schema.optional<typeof Schema.Number>;
68
+ branches: Schema.optional<typeof Schema.Number>;
69
+ statements: Schema.optional<typeof Schema.Number>;
70
+ }>;
71
+ patterns: Schema.optionalWith<Schema.Array$<Schema.Tuple2<typeof Schema.String, Schema.Struct<{
72
+ lines: Schema.optional<typeof Schema.Number>;
73
+ functions: Schema.optional<typeof Schema.Number>;
74
+ branches: Schema.optional<typeof Schema.Number>;
75
+ statements: Schema.optional<typeof Schema.Number>;
76
+ }>>>, {
77
+ default: () => never[];
78
+ }>;
79
+ }>>;
80
+ baselines: Schema.optional<Schema.Struct<{
81
+ global: Schema.Struct<{
82
+ lines: Schema.optional<typeof Schema.Number>;
83
+ functions: Schema.optional<typeof Schema.Number>;
84
+ branches: Schema.optional<typeof Schema.Number>;
85
+ statements: Schema.optional<typeof Schema.Number>;
86
+ }>;
87
+ patterns: Schema.optionalWith<Schema.Array$<Schema.Tuple2<typeof Schema.String, Schema.Struct<{
88
+ lines: Schema.optional<typeof Schema.Number>;
89
+ functions: Schema.optional<typeof Schema.Number>;
90
+ branches: Schema.optional<typeof Schema.Number>;
91
+ statements: Schema.optional<typeof Schema.Number>;
92
+ }>>>, {
93
+ default: () => never[];
94
+ }>;
95
+ }>>;
96
+ scoped: Schema.optionalWith<typeof Schema.Boolean, {
97
+ default: () => false;
98
+ }>;
99
+ scopedFiles: Schema.optional<Schema.Array$<typeof Schema.String>>;
100
+ lowCoverage: Schema.Array$<Schema.Struct<{
101
+ file: typeof Schema.String;
102
+ summary: Schema.Struct<{
103
+ statements: typeof Schema.Number;
104
+ branches: typeof Schema.Number;
105
+ functions: typeof Schema.Number;
106
+ lines: typeof Schema.Number;
107
+ }>;
108
+ uncoveredLines: typeof Schema.String;
109
+ }>>;
110
+ lowCoverageFiles: Schema.Array$<typeof Schema.String>;
111
+ belowTarget: Schema.optional<Schema.Array$<Schema.Struct<{
112
+ file: typeof Schema.String;
113
+ summary: Schema.Struct<{
114
+ statements: typeof Schema.Number;
115
+ branches: typeof Schema.Number;
116
+ functions: typeof Schema.Number;
117
+ lines: typeof Schema.Number;
118
+ }>;
119
+ uncoveredLines: typeof Schema.String;
120
+ }>>>;
121
+ belowTargetFiles: Schema.optional<Schema.Array$<typeof Schema.String>>;
122
+ }>;
123
+ /** @public */
124
+ type CoverageReport = typeof CoverageReport.Type;
125
+ //#endregion
9
126
  //#region src/schemas/RenderState.d.ts
10
127
  /**
11
128
  * Per-test record accumulated as `TestStarted` / `TestFinished` events arrive.
@@ -400,6 +517,240 @@ interface CellOptions {
400
517
  readonly osc8: (url: string, label: string) => string;
401
518
  }
402
519
  //#endregion
520
+ //#region src/schemas/AgentReport.d.ts
521
+ /**
522
+ * Aggregate test run statistics.
523
+ * @public
524
+ */
525
+ declare const ReportSummary: Schema.Struct<{
526
+ total: typeof Schema.Number;
527
+ passed: typeof Schema.Number;
528
+ failed: typeof Schema.Number;
529
+ skipped: typeof Schema.Number;
530
+ duration: typeof Schema.Number;
531
+ }>;
532
+ /** @public */
533
+ type ReportSummary = typeof ReportSummary.Type;
534
+ /**
535
+ * An individual test case result.
536
+ * @public
537
+ */
538
+ declare const TestReport: Schema.Struct<{
539
+ name: typeof Schema.String;
540
+ fullName: typeof Schema.String;
541
+ state: Schema.Literal<["passed", "failed", "skipped", "pending"]>;
542
+ duration: Schema.optional<typeof Schema.Number>;
543
+ flaky: Schema.optional<typeof Schema.Boolean>;
544
+ slow: Schema.optional<typeof Schema.Boolean>;
545
+ errors: Schema.optional<Schema.Array$<Schema.Struct<{
546
+ message: typeof Schema.String;
547
+ stack: Schema.optional<typeof Schema.String>;
548
+ diff: Schema.optional<typeof Schema.String>;
549
+ expected: Schema.optional<typeof Schema.String>;
550
+ received: Schema.optional<typeof Schema.String>;
551
+ }>>>;
552
+ classification: Schema.optional<Schema.Literal<["stable", "new-failure", "persistent", "flaky", "recovered"]>>;
553
+ }>;
554
+ /** @public */
555
+ type TestReport = typeof TestReport.Type;
556
+ /**
557
+ * A test module (file) and its contained test cases.
558
+ * @public
559
+ */
560
+ declare const ModuleReport: Schema.Struct<{
561
+ file: typeof Schema.String;
562
+ state: Schema.Literal<["passed", "failed", "skipped", "pending"]>;
563
+ duration: Schema.optional<typeof Schema.Number>;
564
+ errors: Schema.optional<Schema.Array$<Schema.Struct<{
565
+ message: typeof Schema.String;
566
+ stack: Schema.optional<typeof Schema.String>;
567
+ diff: Schema.optional<typeof Schema.String>;
568
+ expected: Schema.optional<typeof Schema.String>;
569
+ received: Schema.optional<typeof Schema.String>;
570
+ }>>>;
571
+ tests: Schema.Array$<Schema.Struct<{
572
+ name: typeof Schema.String;
573
+ fullName: typeof Schema.String;
574
+ state: Schema.Literal<["passed", "failed", "skipped", "pending"]>;
575
+ duration: Schema.optional<typeof Schema.Number>;
576
+ flaky: Schema.optional<typeof Schema.Boolean>;
577
+ slow: Schema.optional<typeof Schema.Boolean>;
578
+ errors: Schema.optional<Schema.Array$<Schema.Struct<{
579
+ message: typeof Schema.String;
580
+ stack: Schema.optional<typeof Schema.String>;
581
+ diff: Schema.optional<typeof Schema.String>;
582
+ expected: Schema.optional<typeof Schema.String>;
583
+ received: Schema.optional<typeof Schema.String>;
584
+ }>>>;
585
+ classification: Schema.optional<Schema.Literal<["stable", "new-failure", "persistent", "flaky", "recovered"]>>;
586
+ }>>;
587
+ }>;
588
+ /** @public */
589
+ type ModuleReport = typeof ModuleReport.Type;
590
+ /**
591
+ * Per-tag pass/fail/skip aggregates for a single project run.
592
+ * @public
593
+ */
594
+ declare const TagCountEntry: Schema.Struct<{
595
+ passed: Schema.optional<typeof Schema.Number>;
596
+ failed: Schema.optional<typeof Schema.Number>;
597
+ skipped: Schema.optional<typeof Schema.Number>;
598
+ }>;
599
+ /** @public */
600
+ type TagCountEntry = typeof TagCountEntry.Type;
601
+ /**
602
+ * Complete per-project test report written to disk as JSON.
603
+ * @public
604
+ */
605
+ declare const AgentReport: Schema.Struct<{
606
+ timestamp: typeof Schema.String;
607
+ project: Schema.optional<typeof Schema.String>;
608
+ reason: Schema.Literal<["passed", "failed", "interrupted"]>;
609
+ summary: Schema.Struct<{
610
+ total: typeof Schema.Number;
611
+ passed: typeof Schema.Number;
612
+ failed: typeof Schema.Number;
613
+ skipped: typeof Schema.Number;
614
+ duration: typeof Schema.Number;
615
+ }>;
616
+ failed: Schema.Array$<Schema.Struct<{
617
+ file: typeof Schema.String;
618
+ state: Schema.Literal<["passed", "failed", "skipped", "pending"]>;
619
+ duration: Schema.optional<typeof Schema.Number>;
620
+ errors: Schema.optional<Schema.Array$<Schema.Struct<{
621
+ message: typeof Schema.String;
622
+ stack: Schema.optional<typeof Schema.String>;
623
+ diff: Schema.optional<typeof Schema.String>;
624
+ expected: Schema.optional<typeof Schema.String>;
625
+ received: Schema.optional<typeof Schema.String>;
626
+ }>>>;
627
+ tests: Schema.Array$<Schema.Struct<{
628
+ name: typeof Schema.String;
629
+ fullName: typeof Schema.String;
630
+ state: Schema.Literal<["passed", "failed", "skipped", "pending"]>;
631
+ duration: Schema.optional<typeof Schema.Number>;
632
+ flaky: Schema.optional<typeof Schema.Boolean>;
633
+ slow: Schema.optional<typeof Schema.Boolean>;
634
+ errors: Schema.optional<Schema.Array$<Schema.Struct<{
635
+ message: typeof Schema.String;
636
+ stack: Schema.optional<typeof Schema.String>;
637
+ diff: Schema.optional<typeof Schema.String>;
638
+ expected: Schema.optional<typeof Schema.String>;
639
+ received: Schema.optional<typeof Schema.String>;
640
+ }>>>;
641
+ classification: Schema.optional<Schema.Literal<["stable", "new-failure", "persistent", "flaky", "recovered"]>>;
642
+ }>>;
643
+ }>>;
644
+ unhandledErrors: Schema.Array$<Schema.Struct<{
645
+ message: typeof Schema.String;
646
+ stack: Schema.optional<typeof Schema.String>;
647
+ diff: Schema.optional<typeof Schema.String>;
648
+ expected: Schema.optional<typeof Schema.String>;
649
+ received: Schema.optional<typeof Schema.String>;
650
+ }>>;
651
+ failedFiles: Schema.Array$<typeof Schema.String>;
652
+ coverage: Schema.optional<Schema.Struct<{
653
+ totals: Schema.Struct<{
654
+ statements: typeof Schema.Number;
655
+ branches: typeof Schema.Number;
656
+ functions: typeof Schema.Number;
657
+ lines: typeof Schema.Number;
658
+ }>;
659
+ thresholds: Schema.Struct<{
660
+ global: Schema.Struct<{
661
+ lines: Schema.optional<typeof Schema.Number>;
662
+ functions: Schema.optional<typeof Schema.Number>;
663
+ branches: Schema.optional<typeof Schema.Number>;
664
+ statements: Schema.optional<typeof Schema.Number>;
665
+ }>;
666
+ patterns: Schema.optionalWith<Schema.Array$<Schema.Tuple2<typeof Schema.String, Schema.Struct<{
667
+ lines: Schema.optional<typeof Schema.Number>;
668
+ functions: Schema.optional<typeof Schema.Number>;
669
+ branches: Schema.optional<typeof Schema.Number>;
670
+ statements: Schema.optional<typeof Schema.Number>;
671
+ }>>>, {
672
+ default: () => never[];
673
+ }>;
674
+ }>;
675
+ targets: Schema.optional<Schema.Struct<{
676
+ global: Schema.Struct<{
677
+ lines: Schema.optional<typeof Schema.Number>;
678
+ functions: Schema.optional<typeof Schema.Number>;
679
+ branches: Schema.optional<typeof Schema.Number>;
680
+ statements: Schema.optional<typeof Schema.Number>;
681
+ }>;
682
+ patterns: Schema.optionalWith<Schema.Array$<Schema.Tuple2<typeof Schema.String, Schema.Struct<{
683
+ lines: Schema.optional<typeof Schema.Number>;
684
+ functions: Schema.optional<typeof Schema.Number>;
685
+ branches: Schema.optional<typeof Schema.Number>;
686
+ statements: Schema.optional<typeof Schema.Number>;
687
+ }>>>, {
688
+ default: () => never[];
689
+ }>;
690
+ }>>;
691
+ baselines: Schema.optional<Schema.Struct<{
692
+ global: Schema.Struct<{
693
+ lines: Schema.optional<typeof Schema.Number>;
694
+ functions: Schema.optional<typeof Schema.Number>;
695
+ branches: Schema.optional<typeof Schema.Number>;
696
+ statements: Schema.optional<typeof Schema.Number>;
697
+ }>;
698
+ patterns: Schema.optionalWith<Schema.Array$<Schema.Tuple2<typeof Schema.String, Schema.Struct<{
699
+ lines: Schema.optional<typeof Schema.Number>;
700
+ functions: Schema.optional<typeof Schema.Number>;
701
+ branches: Schema.optional<typeof Schema.Number>;
702
+ statements: Schema.optional<typeof Schema.Number>;
703
+ }>>>, {
704
+ default: () => never[];
705
+ }>;
706
+ }>>;
707
+ scoped: Schema.optionalWith<typeof Schema.Boolean, {
708
+ default: () => false;
709
+ }>;
710
+ scopedFiles: Schema.optional<Schema.Array$<typeof Schema.String>>;
711
+ lowCoverage: Schema.Array$<Schema.Struct<{
712
+ file: typeof Schema.String;
713
+ summary: Schema.Struct<{
714
+ statements: typeof Schema.Number;
715
+ branches: typeof Schema.Number;
716
+ functions: typeof Schema.Number;
717
+ lines: typeof Schema.Number;
718
+ }>;
719
+ uncoveredLines: typeof Schema.String;
720
+ }>>;
721
+ lowCoverageFiles: Schema.Array$<typeof Schema.String>;
722
+ belowTarget: Schema.optional<Schema.Array$<Schema.Struct<{
723
+ file: typeof Schema.String;
724
+ summary: Schema.Struct<{
725
+ statements: typeof Schema.Number;
726
+ branches: typeof Schema.Number;
727
+ functions: typeof Schema.Number;
728
+ lines: typeof Schema.Number;
729
+ }>;
730
+ uncoveredLines: typeof Schema.String;
731
+ }>>>;
732
+ belowTargetFiles: Schema.optional<Schema.Array$<typeof Schema.String>>;
733
+ }>>;
734
+ tagCounts: Schema.optional<Schema.Record$<typeof Schema.String, Schema.Struct<{
735
+ passed: Schema.optional<typeof Schema.Number>;
736
+ failed: Schema.optional<typeof Schema.Number>;
737
+ skipped: Schema.optional<typeof Schema.Number>;
738
+ }>>>;
739
+ consoleLeaks: Schema.optional<Schema.Struct<{
740
+ total: typeof Schema.Number;
741
+ byFile: Schema.Array$<Schema.Struct<{
742
+ file: typeof Schema.String;
743
+ stdout: typeof Schema.Number;
744
+ stderr: typeof Schema.Number;
745
+ tests: Schema.optional<Schema.Array$<typeof Schema.String>>;
746
+ sample: Schema.optional<typeof Schema.String>;
747
+ }>>;
748
+ truncated: Schema.optional<typeof Schema.Boolean>;
749
+ }>>;
750
+ }>;
751
+ /** @public */
752
+ type AgentReport = typeof AgentReport.Type;
753
+ //#endregion
403
754
  //#region src/schemas/Common.d.ts
404
755
  /**
405
756
  * Possible states for an individual test case.
@@ -1021,52 +1372,239 @@ interface VitestAgentReporter {
1021
1372
  */
1022
1373
  type VitestAgentReporterFactory = (kit: ReporterKit) => VitestAgentReporter | ReadonlyArray<VitestAgentReporter>;
1023
1374
  //#endregion
1024
- //#region src/errors/DiscoveryError.d.ts
1025
- declare const DiscoveryError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1026
- readonly _tag: "DiscoveryError";
1375
+ //#region src/schemas/Identity.d.ts
1376
+ /**
1377
+ * Canonical UUID for an LLM agent invocation. Generated server-side at
1378
+ * `register_agent` time. Stable across transport reconnects within an
1379
+ * agent's lifetime.
1380
+ * @public
1381
+ */
1382
+ declare const AgentId: Schema.brand<typeof Schema.UUID, "AgentId">;
1383
+ /** @public */
1384
+ type AgentId = Schema.Schema.Type<typeof AgentId>;
1385
+ /**
1386
+ * The unit "all work on this feature" rolls up to. Survives
1387
+ * `claude --resume` and parallel windows; lives in the host's
1388
+ * transcript filename for Claude Code.
1389
+ * @public
1390
+ */
1391
+ declare const ConversationId: Schema.brand<typeof Schema.UUID, "ConversationId">;
1392
+ /** @public */
1393
+ type ConversationId = Schema.Schema.Type<typeof ConversationId>;
1394
+ /**
1395
+ * The agent host process's chat id (Claude Code's per-process chat
1396
+ * UUID, etc.). Shorter-lived than a conversation; one conversation can
1397
+ * have multiple chats across `--resume` invocations. Distinct from
1398
+ * `sessions.id` (the SQLite agent-run PK).
1399
+ * @public
1400
+ */
1401
+ declare const ChatId: Schema.brand<typeof Schema.UUID, "ChatId">;
1402
+ /** @public */
1403
+ type ChatId = Schema.Schema.Type<typeof ChatId>;
1404
+ /**
1405
+ * One TDD orchestration task. Replaces the legacy `tdd_session_id`
1406
+ * vocabulary so "session" is unambiguous in the codebase.
1407
+ * @public
1408
+ */
1409
+ declare const TddTaskId: Schema.brand<typeof Schema.UUID, "TddTaskId">;
1410
+ /** @public */
1411
+ type TddTaskId = Schema.Schema.Type<typeof TddTaskId>;
1412
+ /**
1413
+ * Filesystem-safe key for the per-project data store directory under
1414
+ * `$XDG_DATA_HOME/vitest-agent/<projectKey>/`. Resolved by the
1415
+ * `ProjectIdentity` service from the explicit option / TOML config /
1416
+ * git remote / package.json fallback chain. Always non-empty (a missing
1417
+ * value is `ProjectIdentityNotResolvableError`, not an empty string).
1418
+ * @public
1419
+ */
1420
+ declare const ProjectKey: Schema.brand<Schema.filter<typeof Schema.String>, "ProjectKey">;
1421
+ /** @public */
1422
+ type ProjectKey = Schema.Schema.Type<typeof ProjectKey>;
1423
+ /**
1424
+ * Who initiated the action (test run, hypothesis, note, TDD phase, …).
1425
+ * Recorded on every action row alongside `agent_id`.
1426
+ *
1427
+ * - `agent` — an LLM agent (`agent_id` is set, `conversation_id` is set)
1428
+ * - `user` — a human at a terminal (`agent_id` and `conversation_id` are NULL)
1429
+ * - `system` — a CI run, scheduler, or other non-human/non-agent actor
1430
+ * @public
1431
+ */
1432
+ declare const ActorType: Schema.Literal<["agent", "user", "system"]>;
1433
+ /** @public */
1434
+ type ActorType = typeof ActorType.Type;
1435
+ /**
1436
+ * Recommended canonical host identifiers. Open enum at the SDK level so
1437
+ * a new client doesn't require an SDK release; the MCP server defaults
1438
+ * `agentType` validation against the `${hostKind}-` prefix using this
1439
+ * value.
1440
+ *
1441
+ * `unknown` is the explicit fallback when `clientInfo.name` doesn't
1442
+ * match a known pattern — preferred over guessing.
1443
+ * @public
1444
+ */
1445
+ declare const HostKind: Schema.Literal<["claude-code", "claude-desktop", "cursor", "goose", "chatgpt", "mcp-inspector", "unknown"]>;
1446
+ /** @public */
1447
+ type HostKind = typeof HostKind.Type;
1448
+ //#endregion
1449
+ //#region src/errors/AgentErrors.d.ts
1450
+ declare const AgentNotFoundError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1451
+ readonly _tag: "AgentNotFoundError";
1027
1452
  } & Readonly<A>;
1028
1453
  /**
1029
- * Error raised when project discovery (glob, file read, or stat) fails.
1454
+ * `agent_id` does not exist for the given chat. Surface to the
1455
+ * caller; the typical resolution is to call `register_agent` for
1456
+ * this agent first.
1030
1457
  * @public
1031
1458
  */
1032
- declare class DiscoveryError extends DiscoveryError_base<{
1033
- readonly operation: "glob" | "read" | "stat";
1034
- readonly path: string;
1459
+ declare class AgentNotFoundError extends AgentNotFoundError_base<{
1460
+ readonly agentId: AgentId;
1461
+ readonly chatId?: ChatId;
1462
+ }> {}
1463
+ declare const SessionNotFoundError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1464
+ readonly _tag: "SessionNotFoundError";
1465
+ } & Readonly<A>;
1466
+ /**
1467
+ * Session row for the given `chat_id` does not exist. The host
1468
+ * probably hasn't fired the SessionStart equivalent for this chat yet.
1469
+ * @public
1470
+ */
1471
+ declare class SessionNotFoundError extends SessionNotFoundError_base<{
1472
+ readonly chatId: ChatId;
1473
+ }> {}
1474
+ declare const ConversationNotFoundError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1475
+ readonly _tag: "ConversationNotFoundError";
1476
+ } & Readonly<A>;
1477
+ /**
1478
+ * `conversation_id` does not exist. Used by rollup queries that
1479
+ * require a conversation row.
1480
+ * @public
1481
+ */
1482
+ declare class ConversationNotFoundError extends ConversationNotFoundError_base<{
1483
+ readonly conversationId: ConversationId;
1484
+ }> {}
1485
+ declare const RegistrationConflictError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1486
+ readonly _tag: "RegistrationConflictError";
1487
+ } & Readonly<A>;
1488
+ /**
1489
+ * True conflict — e.g., the `parentAgentId` supplied to
1490
+ * `register_agent` refers to a different session than the one the
1491
+ * caller named. Distinct from `IdempotencyHit`, which is a success.
1492
+ * @public
1493
+ */
1494
+ declare class RegistrationConflictError extends RegistrationConflictError_base<{
1035
1495
  readonly reason: string;
1036
1496
  }> {
1037
1497
  constructor(args: {
1038
- readonly operation: "glob" | "read" | "stat";
1039
- readonly path: string;
1040
1498
  readonly reason: string;
1041
1499
  });
1042
1500
  }
1043
- //#endregion
1044
- //#region src/errors/PathResolutionError.d.ts
1045
- declare const PathResolutionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1046
- readonly _tag: "PathResolutionError";
1501
+ declare const HostMetadataParseError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1502
+ readonly _tag: "HostMetadataParseError";
1047
1503
  } & Readonly<A>;
1048
1504
  /**
1049
- * Error raised when the data directory path cannot be resolved.
1050
- *
1051
- * The most common case is missing workspace identity: no `projectKey`
1052
- * override in `vitest-agent.config.toml` and no `name` field in
1053
- * the root workspace's `package.json`. The path is a function of the
1054
- * workspace's identity, so without one we have no canonical location to
1055
- * write to.
1505
+ * `host_metadata` JSON column failed to parse on read. Usually mapped
1506
+ * to `DataStoreError` at the row-read boundary; surfaces alone in
1507
+ * paths that explicitly carry through `Schema.parseJson` errors.
1056
1508
  * @public
1057
1509
  */
1058
- declare class PathResolutionError extends PathResolutionError_base<{
1510
+ declare class HostMetadataParseError extends HostMetadataParseError_base<{
1511
+ readonly raw: string;
1059
1512
  readonly reason: string;
1513
+ }> {}
1514
+ declare const SidecarTimeoutError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1515
+ readonly _tag: "SidecarTimeoutError";
1516
+ } & Readonly<A>;
1517
+ /**
1518
+ * Sidecar exceeded its timeout. Surfaces from the sidecar CLI's
1519
+ * `Effect.timeout`; the top-level wrapper maps it to exit code 2.
1520
+ * @public
1521
+ */
1522
+ declare class SidecarTimeoutError extends SidecarTimeoutError_base<{
1523
+ readonly operation: string;
1524
+ readonly timeoutMs: number;
1060
1525
  }> {
1061
1526
  constructor(args: {
1062
- readonly reason: string;
1527
+ readonly operation: string;
1528
+ readonly timeoutMs: number;
1063
1529
  });
1064
1530
  }
1065
1531
  //#endregion
1066
- //#region src/errors/ProjectIdentityError.d.ts
1532
+ //#region src/errors/DataStoreError.d.ts
1533
+ declare const DataStoreError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1534
+ readonly _tag: "DataStoreError";
1535
+ } & Readonly<A>;
1067
1536
  /**
1068
- * One source the resolver tried while looking for project identity.
1069
- *
1537
+ * Error raised when a SQLite operation fails at read, write, or migration time.
1538
+ * @public
1539
+ */
1540
+ declare class DataStoreError extends DataStoreError_base<{
1541
+ readonly operation: "read" | "write" | "migrate";
1542
+ readonly table: string;
1543
+ readonly reason: string;
1544
+ }> {
1545
+ constructor(args: {
1546
+ readonly operation: "read" | "write" | "migrate";
1547
+ readonly table: string;
1548
+ readonly reason: string;
1549
+ });
1550
+ }
1551
+ /**
1552
+ * Extract a human-readable reason string from an Effect SqlError or unknown error.
1553
+ *
1554
+ * SqlError wraps the underlying better-sqlite3 error in `cause`. The actual SQLite
1555
+ * message (e.g. "SQLITE_BUSY: database is locked", "UNIQUE constraint failed: ...")
1556
+ * lives on `cause.message`, while the SqlError's own `message` is generic
1557
+ * ("Failed to execute statement"). Prefer the cause's message when available.
1558
+ * @public
1559
+ */
1560
+ declare const extractSqlReason: (e: unknown) => string;
1561
+ //#endregion
1562
+ //#region src/errors/DiscoveryError.d.ts
1563
+ declare const DiscoveryError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1564
+ readonly _tag: "DiscoveryError";
1565
+ } & Readonly<A>;
1566
+ /**
1567
+ * Error raised when project discovery (glob, file read, or stat) fails.
1568
+ * @public
1569
+ */
1570
+ declare class DiscoveryError extends DiscoveryError_base<{
1571
+ readonly operation: "glob" | "read" | "stat";
1572
+ readonly path: string;
1573
+ readonly reason: string;
1574
+ }> {
1575
+ constructor(args: {
1576
+ readonly operation: "glob" | "read" | "stat";
1577
+ readonly path: string;
1578
+ readonly reason: string;
1579
+ });
1580
+ }
1581
+ //#endregion
1582
+ //#region src/errors/PathResolutionError.d.ts
1583
+ declare const PathResolutionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1584
+ readonly _tag: "PathResolutionError";
1585
+ } & Readonly<A>;
1586
+ /**
1587
+ * Error raised when the data directory path cannot be resolved.
1588
+ *
1589
+ * The most common case is missing workspace identity: no `projectKey`
1590
+ * override in `vitest-agent.config.toml` and no `name` field in
1591
+ * the root workspace's `package.json`. The path is a function of the
1592
+ * workspace's identity, so without one we have no canonical location to
1593
+ * write to.
1594
+ * @public
1595
+ */
1596
+ declare class PathResolutionError extends PathResolutionError_base<{
1597
+ readonly reason: string;
1598
+ }> {
1599
+ constructor(args: {
1600
+ readonly reason: string;
1601
+ });
1602
+ }
1603
+ //#endregion
1604
+ //#region src/errors/ProjectIdentityError.d.ts
1605
+ /**
1606
+ * One source the resolver tried while looking for project identity.
1607
+ *
1070
1608
  * `source` is a stable label (`"explicit"`, `"toml"`, `"git-remote"`,
1071
1609
  * `"package-repository"`, `"package-name"`) the error message and
1072
1610
  * downstream tooling can switch on. `reason` explains why the source
@@ -1122,125 +1660,1402 @@ declare class GitCommandError extends GitCommandError_base<{
1122
1660
  readonly reason: string;
1123
1661
  });
1124
1662
  }
1125
- declare const ProbeMissError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1126
- readonly _tag: "ProbeMissError";
1127
- } & Readonly<A>;
1128
- /**
1129
- * Internal probe miss — consumed by `Effect.firstSuccessOf` /
1130
- * `Effect.orElse` inside the host-metadata probe chain. Never surfaces
1131
- * to the caller of `RunContext.captureRunContext`; the public API
1132
- * always returns a complete `RunContext` (with NULLs for missed
1133
- * probes).
1134
- * @internal
1135
- */
1136
- declare class ProbeMissError extends ProbeMissError_base<{
1137
- readonly probe: string;
1138
- }> {}
1139
- //#endregion
1140
- //#region src/formatters/ci-annotations.d.ts
1663
+ declare const ProbeMissError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1664
+ readonly _tag: "ProbeMissError";
1665
+ } & Readonly<A>;
1666
+ /**
1667
+ * Internal probe miss — consumed by `Effect.firstSuccessOf` /
1668
+ * `Effect.orElse` inside the host-metadata probe chain. Never surfaces
1669
+ * to the caller of `RunContext.captureRunContext`; the public API
1670
+ * always returns a complete `RunContext` (with NULLs for missed
1671
+ * probes).
1672
+ * @internal
1673
+ */
1674
+ declare class ProbeMissError extends ProbeMissError_base<{
1675
+ readonly probe: string;
1676
+ }> {}
1677
+ //#endregion
1678
+ //#region src/errors/TddErrors.d.ts
1679
+ declare const GoalNotFoundError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1680
+ readonly _tag: "GoalNotFoundError";
1681
+ } & Readonly<A>;
1682
+ /** @public */
1683
+ declare class GoalNotFoundError extends GoalNotFoundError_base<{
1684
+ readonly id: number;
1685
+ readonly reason: string;
1686
+ }> {
1687
+ constructor(args: {
1688
+ readonly id: number;
1689
+ readonly reason: string;
1690
+ });
1691
+ }
1692
+ declare const BehaviorNotFoundError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1693
+ readonly _tag: "BehaviorNotFoundError";
1694
+ } & Readonly<A>;
1695
+ /** @public */
1696
+ declare class BehaviorNotFoundError extends BehaviorNotFoundError_base<{
1697
+ readonly id: number;
1698
+ readonly reason: string;
1699
+ }> {
1700
+ constructor(args: {
1701
+ readonly id: number;
1702
+ readonly reason: string;
1703
+ });
1704
+ }
1705
+ declare const TddTaskNotFoundError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1706
+ readonly _tag: "TddTaskNotFoundError";
1707
+ } & Readonly<A>;
1708
+ /** @public */
1709
+ declare class TddTaskNotFoundError extends TddTaskNotFoundError_base<{
1710
+ readonly id: number;
1711
+ readonly reason: string;
1712
+ }> {
1713
+ constructor(args: {
1714
+ readonly id: number;
1715
+ readonly reason: string;
1716
+ });
1717
+ }
1718
+ /** @public */
1719
+ type TddTaskEndOutcome = "succeeded" | "blocked" | "abandoned";
1720
+ declare const TddTaskAlreadyEndedError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1721
+ readonly _tag: "TddTaskAlreadyEndedError";
1722
+ } & Readonly<A>;
1723
+ /** @public */
1724
+ declare class TddTaskAlreadyEndedError extends TddTaskAlreadyEndedError_base<{
1725
+ readonly id: number;
1726
+ readonly endedAt: string;
1727
+ readonly outcome: TddTaskEndOutcome;
1728
+ }> {
1729
+ constructor(args: {
1730
+ readonly id: number;
1731
+ readonly endedAt: string;
1732
+ readonly outcome: TddTaskEndOutcome;
1733
+ });
1734
+ }
1735
+ /** @public */
1736
+ type IllegalStatusTransitionEntity = "goal" | "behavior" | "task";
1737
+ declare const IllegalStatusTransitionError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => import("effect/Cause").YieldableError & {
1738
+ readonly _tag: "IllegalStatusTransitionError";
1739
+ } & Readonly<A>;
1740
+ /** @public */
1741
+ declare class IllegalStatusTransitionError extends IllegalStatusTransitionError_base<{
1742
+ readonly entity: IllegalStatusTransitionEntity;
1743
+ readonly id: number;
1744
+ readonly from: string;
1745
+ readonly to: string;
1746
+ readonly reason: string;
1747
+ }> {
1748
+ constructor(args: {
1749
+ readonly entity: IllegalStatusTransitionEntity;
1750
+ readonly id: number;
1751
+ readonly from: string;
1752
+ readonly to: string;
1753
+ readonly reason: string;
1754
+ });
1755
+ }
1756
+ //#endregion
1757
+ //#region src/formatters/ci-annotations.d.ts
1758
+ /** @public */
1759
+ declare const ciAnnotationsFormatter: Formatter;
1760
+ //#endregion
1761
+ //#region src/formatters/gfm.d.ts
1762
+ /** @public */
1763
+ declare const GfmFormatter: Formatter;
1764
+ //#endregion
1765
+ //#region src/formatters/json.d.ts
1766
+ /** @public */
1767
+ declare const JsonFormatter: Formatter;
1768
+ //#endregion
1769
+ //#region src/formatters/markdown.d.ts
1770
+ /**
1771
+ * Markdown formatter for surfaces that *render* markdown.
1772
+ *
1773
+ * Stdout output goes through {@link TerminalFormatter} (plain text +
1774
+ * ANSI), not this formatter — markdown syntax (e.g. heading prefixes,
1775
+ * backticks, list dashes) is visual noise in a terminal that doesn't
1776
+ * render it. This formatter remains for callers that explicitly request
1777
+ * `format: "markdown"`, e.g. when piping the rendered output into a
1778
+ * Markdown-aware sink.
1779
+ * @public
1780
+ */
1781
+ declare const MarkdownFormatter: Formatter;
1782
+ //#endregion
1783
+ //#region src/formatters/silent.d.ts
1784
+ /** @public */
1785
+ declare const SilentFormatter: Formatter;
1786
+ //#endregion
1787
+ //#region src/formatters/terminal.d.ts
1788
+ /** @public */
1789
+ declare const TerminalFormatter: Formatter;
1790
+ //#endregion
1791
+ //#region src/schemas/Config.d.ts
1792
+ declare const VitestAgentConfig_base: Schema.Class<VitestAgentConfig, {
1793
+ cacheDir: Schema.optional<typeof Schema.String>;
1794
+ projectKey: Schema.optional<typeof Schema.String>;
1795
+ }, Schema.Struct.Encoded<{
1796
+ cacheDir: Schema.optional<typeof Schema.String>;
1797
+ projectKey: Schema.optional<typeof Schema.String>;
1798
+ }>, never, {
1799
+ readonly cacheDir?: string | undefined;
1800
+ } & {
1801
+ readonly projectKey?: string | undefined;
1802
+ }, {}, {}>;
1803
+ /**
1804
+ * Schema for the optional `vitest-agent.config.toml` file.
1805
+ *
1806
+ * Both fields are optional. When the file is absent or these fields are
1807
+ * unset, `resolveDataPath` falls back to deriving the path from the
1808
+ * workspace's `package.json` `name` under the XDG data directory.
1809
+ *
1810
+ * Fields:
1811
+ * - `cacheDir` — absolute path overriding the entire data directory. Highest
1812
+ * precedence after the programmatic option. Use this to relocate the SQLite
1813
+ * database (e.g. project-local `.vitest-agent/`) instead of the
1814
+ * default XDG location.
1815
+ * - `projectKey` — overrides the workspace key segment under the XDG data
1816
+ * directory. Use this when two unrelated projects on the same machine
1817
+ * share a `package.json` `name` (the collision case for workspace-name
1818
+ * keying), or when you want a stable key independent of `name` changes.
1819
+ * @public
1820
+ */
1821
+ declare class VitestAgentConfig extends VitestAgentConfig_base {}
1822
+ //#endregion
1823
+ //#region src/services/Config.d.ts
1824
+ /**
1825
+ * Service shape that `ConfigLive(projectDir)` provides to downstream
1826
+ * consumers. Re-exported so callers can spell out the concrete service
1827
+ * type without referencing the `ConfigFileService<A>` generic directly.
1828
+ * @public
1829
+ */
1830
+ type VitestAgentConfigFileService = ConfigFileService<VitestAgentConfig>;
1831
+ /**
1832
+ * Typed `Context.Tag` for the vitest-agent config file service.
1833
+ *
1834
+ * Both runtime packages (reporter, MCP) yield this tag to access the loaded
1835
+ * `VitestAgentConfig`. The live layer is built per `projectDir` via
1836
+ * `ConfigLive(projectDir)`.
1837
+ * @public
1838
+ */
1839
+ declare const VitestAgentConfigFile: import("effect/Context").Tag<ConfigFileService<VitestAgentConfig>, ConfigFileService<VitestAgentConfig>>;
1840
+ //#endregion
1841
+ //#region src/layers/ConfigLive.d.ts
1842
+ /**
1843
+ * Build the live `ConfigFile` layer for a given project directory.
1844
+ *
1845
+ * Resolves the optional `vitest-agent.config.toml` from (in order):
1846
+ *
1847
+ * 1. The workspace root (when `projectDir` is inside a pnpm/npm/yarn workspace).
1848
+ * 2. The git repository root (when `projectDir` is inside a git repo).
1849
+ * 3. Walking upward from `projectDir`.
1850
+ *
1851
+ * The first found file wins (`FirstMatch` strategy). If no file is present,
1852
+ * downstream callers use `loadOrDefault(new VitestAgentConfig({}))`
1853
+ * to get an empty config.
1854
+ *
1855
+ * @param projectDir - Absolute path inside the user's workspace. Resolvers
1856
+ * anchor here rather than `process.cwd()` so the plugin-spawned MCP server
1857
+ * sees the right config even when invoked from elsewhere.
1858
+ * @public
1859
+ */
1860
+ declare const ConfigLive: (projectDir: string) => Layer.Layer<VitestAgentConfigFileService, never, FileSystem.FileSystem>;
1861
+ //#endregion
1862
+ //#region src/schemas/Baselines.d.ts
1863
+ /**
1864
+ * Coverage baselines -- the auto-ratcheting high-water mark.
1865
+ * @public
1866
+ */
1867
+ declare const CoverageBaselines: Schema.Struct<{
1868
+ updatedAt: typeof Schema.String;
1869
+ global: Schema.Struct<{
1870
+ lines: Schema.optional<typeof Schema.Number>;
1871
+ functions: Schema.optional<typeof Schema.Number>;
1872
+ branches: Schema.optional<typeof Schema.Number>;
1873
+ statements: Schema.optional<typeof Schema.Number>;
1874
+ }>;
1875
+ patterns: Schema.optionalWith<Schema.Array$<Schema.Tuple2<typeof Schema.String, Schema.Struct<{
1876
+ lines: Schema.optional<typeof Schema.Number>;
1877
+ functions: Schema.optional<typeof Schema.Number>;
1878
+ branches: Schema.optional<typeof Schema.Number>;
1879
+ statements: Schema.optional<typeof Schema.Number>;
1880
+ }>>>, {
1881
+ default: () => never[];
1882
+ }>;
1883
+ }>;
1884
+ /** @public */
1885
+ type CoverageBaselines = typeof CoverageBaselines.Type;
1886
+ //#endregion
1887
+ //#region src/schemas/CacheManifest.d.ts
1888
+ /**
1889
+ * A single project entry in the cache manifest.
1890
+ * @public
1891
+ */
1892
+ declare const CacheManifestEntry: Schema.Struct<{
1893
+ project: typeof Schema.String;
1894
+ reportFile: typeof Schema.String;
1895
+ historyFile: Schema.optional<typeof Schema.String>;
1896
+ lastRun: Schema.NullOr<typeof Schema.String>;
1897
+ lastResult: Schema.NullOr<Schema.Literal<["passed", "failed", "interrupted"]>>;
1898
+ }>;
1899
+ /** @public */
1900
+ type CacheManifestEntry = typeof CacheManifestEntry.Type;
1901
+ /**
1902
+ * Root manifest file that indexes all project reports.
1903
+ * @public
1904
+ */
1905
+ declare const CacheManifest: Schema.Struct<{
1906
+ updatedAt: typeof Schema.String;
1907
+ cacheDir: typeof Schema.String;
1908
+ projects: Schema.Array$<Schema.Struct<{
1909
+ project: typeof Schema.String;
1910
+ reportFile: typeof Schema.String;
1911
+ historyFile: Schema.optional<typeof Schema.String>;
1912
+ lastRun: Schema.NullOr<typeof Schema.String>;
1913
+ lastResult: Schema.NullOr<Schema.Literal<["passed", "failed", "interrupted"]>>;
1914
+ }>>;
1915
+ }>;
1916
+ /** @public */
1917
+ type CacheManifest = typeof CacheManifest.Type;
1918
+ //#endregion
1919
+ //#region src/schemas/History.d.ts
1920
+ /**
1921
+ * A single test run outcome (pass or fail only).
1922
+ * @public
1923
+ */
1924
+ declare const TestRun: Schema.Struct<{
1925
+ timestamp: typeof Schema.String;
1926
+ state: Schema.Literal<["passed", "failed"]>;
1927
+ }>;
1928
+ /** @public */
1929
+ type TestRun = typeof TestRun.Type;
1930
+ /**
1931
+ * History for a single test across multiple runs.
1932
+ * @public
1933
+ */
1934
+ declare const TestHistory: Schema.Struct<{
1935
+ fullName: typeof Schema.String;
1936
+ runs: Schema.Array$<Schema.Struct<{
1937
+ timestamp: typeof Schema.String;
1938
+ state: Schema.Literal<["passed", "failed"]>;
1939
+ }>>;
1940
+ }>;
1941
+ /** @public */
1942
+ type TestHistory = typeof TestHistory.Type;
1943
+ /**
1944
+ * Per-project history record containing all tracked tests.
1945
+ * @public
1946
+ */
1947
+ declare const HistoryRecord: Schema.Struct<{
1948
+ project: typeof Schema.String;
1949
+ updatedAt: typeof Schema.String;
1950
+ tests: Schema.Array$<Schema.Struct<{
1951
+ fullName: typeof Schema.String;
1952
+ runs: Schema.Array$<Schema.Struct<{
1953
+ timestamp: typeof Schema.String;
1954
+ state: Schema.Literal<["passed", "failed"]>;
1955
+ }>>;
1956
+ }>>;
1957
+ }>;
1958
+ /** @public */
1959
+ type HistoryRecord = typeof HistoryRecord.Type;
1960
+ //#endregion
1961
+ //#region src/schemas/Tdd.d.ts
1962
+ /** @public */
1963
+ declare const GoalStatus: Schema.Literal<["pending", "in_progress", "done", "abandoned"]>;
1964
+ /** @public */
1965
+ type GoalStatus = typeof GoalStatus.Type;
1966
+ /** @public */
1967
+ declare const BehaviorStatus: Schema.Literal<["pending", "in_progress", "done", "abandoned"]>;
1968
+ /** @public */
1969
+ type BehaviorStatus = typeof BehaviorStatus.Type;
1970
+ /** @public */
1971
+ declare const GoalRow: Schema.Struct<{
1972
+ id: typeof Schema.Number;
1973
+ sessionId: typeof Schema.Number;
1974
+ ordinal: typeof Schema.Number;
1975
+ goal: typeof Schema.String;
1976
+ status: Schema.Literal<["pending", "in_progress", "done", "abandoned"]>;
1977
+ createdAt: typeof Schema.String;
1978
+ }>;
1979
+ /** @public */
1980
+ type GoalRow = typeof GoalRow.Type;
1981
+ /** @public */
1982
+ declare const BehaviorRow: Schema.Struct<{
1983
+ id: typeof Schema.Number;
1984
+ goalId: typeof Schema.Number;
1985
+ ordinal: typeof Schema.Number;
1986
+ behavior: typeof Schema.String;
1987
+ suggestedTestName: Schema.NullOr<typeof Schema.String>;
1988
+ status: Schema.Literal<["pending", "in_progress", "done", "abandoned"]>;
1989
+ createdAt: typeof Schema.String;
1990
+ }>;
1991
+ /** @public */
1992
+ type BehaviorRow = typeof BehaviorRow.Type;
1993
+ /** @public */
1994
+ declare const GoalDetail: Schema.Struct<{
1995
+ id: typeof Schema.Number;
1996
+ sessionId: typeof Schema.Number;
1997
+ ordinal: typeof Schema.Number;
1998
+ goal: typeof Schema.String;
1999
+ status: Schema.Literal<["pending", "in_progress", "done", "abandoned"]>;
2000
+ createdAt: typeof Schema.String;
2001
+ behaviors: Schema.Array$<Schema.Struct<{
2002
+ id: typeof Schema.Number;
2003
+ goalId: typeof Schema.Number;
2004
+ ordinal: typeof Schema.Number;
2005
+ behavior: typeof Schema.String;
2006
+ suggestedTestName: Schema.NullOr<typeof Schema.String>;
2007
+ status: Schema.Literal<["pending", "in_progress", "done", "abandoned"]>;
2008
+ createdAt: typeof Schema.String;
2009
+ }>>;
2010
+ }>;
2011
+ /** @public */
2012
+ type GoalDetail = typeof GoalDetail.Type;
2013
+ /** @public */
2014
+ declare const BehaviorDetail: Schema.Struct<{
2015
+ id: typeof Schema.Number;
2016
+ goalId: typeof Schema.Number;
2017
+ ordinal: typeof Schema.Number;
2018
+ behavior: typeof Schema.String;
2019
+ suggestedTestName: Schema.NullOr<typeof Schema.String>;
2020
+ status: Schema.Literal<["pending", "in_progress", "done", "abandoned"]>;
2021
+ createdAt: typeof Schema.String;
2022
+ parentGoal: Schema.Struct<{
2023
+ id: typeof Schema.Number;
2024
+ goal: typeof Schema.String;
2025
+ status: Schema.Literal<["pending", "in_progress", "done", "abandoned"]>;
2026
+ }>;
2027
+ dependencies: Schema.Array$<Schema.Struct<{
2028
+ id: typeof Schema.Number;
2029
+ goalId: typeof Schema.Number;
2030
+ ordinal: typeof Schema.Number;
2031
+ behavior: typeof Schema.String;
2032
+ suggestedTestName: Schema.NullOr<typeof Schema.String>;
2033
+ status: Schema.Literal<["pending", "in_progress", "done", "abandoned"]>;
2034
+ createdAt: typeof Schema.String;
2035
+ }>>;
2036
+ }>;
2037
+ /** @public */
2038
+ type BehaviorDetail = typeof BehaviorDetail.Type;
2039
+ //#endregion
2040
+ //#region src/schemas/Trends.d.ts
2041
+ /**
2042
+ * A single coverage trend data point recorded on a full test run.
2043
+ * @public
2044
+ */
2045
+ declare const TrendEntry: Schema.Struct<{
2046
+ timestamp: typeof Schema.String;
2047
+ coverage: Schema.Struct<{
2048
+ statements: typeof Schema.Number;
2049
+ branches: typeof Schema.Number;
2050
+ functions: typeof Schema.Number;
2051
+ lines: typeof Schema.Number;
2052
+ }>;
2053
+ delta: Schema.Struct<{
2054
+ statements: typeof Schema.Number;
2055
+ branches: typeof Schema.Number;
2056
+ functions: typeof Schema.Number;
2057
+ lines: typeof Schema.Number;
2058
+ }>;
2059
+ direction: Schema.Literal<["improving", "regressing", "stable"]>;
2060
+ targetsHash: Schema.optional<typeof Schema.String>;
2061
+ }>;
2062
+ /** @public */
2063
+ type TrendEntry = typeof TrendEntry.Type;
2064
+ /**
2065
+ * Per-project trend record with sliding window of entries.
2066
+ * @public
2067
+ */
2068
+ declare const TrendRecord: Schema.Struct<{
2069
+ entries: Schema.Array$<Schema.Struct<{
2070
+ timestamp: typeof Schema.String;
2071
+ coverage: Schema.Struct<{
2072
+ statements: typeof Schema.Number;
2073
+ branches: typeof Schema.Number;
2074
+ functions: typeof Schema.Number;
2075
+ lines: typeof Schema.Number;
2076
+ }>;
2077
+ delta: Schema.Struct<{
2078
+ statements: typeof Schema.Number;
2079
+ branches: typeof Schema.Number;
2080
+ functions: typeof Schema.Number;
2081
+ lines: typeof Schema.Number;
2082
+ }>;
2083
+ direction: Schema.Literal<["improving", "regressing", "stable"]>;
2084
+ targetsHash: Schema.optional<typeof Schema.String>;
2085
+ }>>;
2086
+ }>;
2087
+ /** @public */
2088
+ type TrendRecord = typeof TrendRecord.Type;
2089
+ //#endregion
2090
+ //#region src/utils/validate-phase-transition.d.ts
2091
+ /** @public */
2092
+ type Phase = "spike" | "red" | "red.triangulate" | "green" | "green.fake-it" | "refactor" | "extended-red" | "green-without-red";
2093
+ /** @public */
2094
+ type ArtifactKind = "test_written" | "test_failed_run" | "code_written" | "test_passed_run" | "refactor" | "test_weakened";
2095
+ /** @public */
2096
+ interface CitedArtifact {
2097
+ readonly id: number;
2098
+ readonly artifact_kind: ArtifactKind;
2099
+ readonly test_case_id: number | null;
2100
+ readonly test_case_created_turn_at: string | null;
2101
+ readonly test_case_authored_in_session: boolean;
2102
+ readonly test_run_id: number | null;
2103
+ readonly test_first_failure_run_id: number | null;
2104
+ readonly behavior_id: number | null;
2105
+ }
2106
+ /** @public */
2107
+ interface PhaseTransitionContext {
2108
+ readonly tdd_task_id: number;
2109
+ readonly current_phase: Phase;
2110
+ readonly phase_started_at: string;
2111
+ readonly now: string;
2112
+ readonly requested_phase: Phase;
2113
+ readonly cited_artifact: CitedArtifact;
2114
+ readonly requested_behavior_id: number | null;
2115
+ }
2116
+ /** @public */
2117
+ type DenialReason = "missing_artifact_evidence" | "wrong_artifact_kind" | "wrong_source_phase" | "unknown_tdd_task" | "tdd_task_already_ended" | "goal_not_started" | "goal_not_found" | "goal_not_in_progress" | "goal_not_in_tdd_task" | "behavior_not_found" | "behavior_not_in_goal" | "refactor_without_passing_run" | "evidence_not_in_phase_window" | "evidence_not_for_behavior" | "evidence_test_was_already_failing";
2118
+ /** @public */
2119
+ interface Remediation {
2120
+ readonly suggestedTool: string;
2121
+ readonly suggestedArgs: Record<string, unknown>;
2122
+ readonly humanHint: string;
2123
+ }
2124
+ /** @public */
2125
+ type PhaseTransitionResult = {
2126
+ readonly accepted: true;
2127
+ readonly phase: Phase;
2128
+ } | {
2129
+ readonly accepted: false;
2130
+ readonly phase: Phase;
2131
+ readonly denialReason: DenialReason;
2132
+ readonly remediation: Remediation;
2133
+ };
2134
+ /**
2135
+ * Return the artifact kind a phase transition requires, plus a
2136
+ * human-readable hint for surfacing in remediations.
2137
+ *
2138
+ * Exported so the MCP `tdd_phase_transition_request` tool can pre-compute
2139
+ * the expected kind when the agent omits `citedArtifactId` (auto-resolve
2140
+ * to the most recent matching artifact). The transitions without a
2141
+ * required artifact (`spike→red`, `*→red`, etc.) return `null`.
2142
+ * @public
2143
+ */
2144
+ declare const requiredArtifactForTransition: (from: Phase, to: Phase) => {
2145
+ kind: ArtifactKind;
2146
+ humanHint: string;
2147
+ } | null;
2148
+ /** @public */
2149
+ declare const validatePhaseTransition: (ctx: PhaseTransitionContext) => PhaseTransitionResult;
2150
+ //#endregion
2151
+ //#region src/schemas/Agent.d.ts
2152
+ declare const Agent_base: Schema.TaggedClass<Agent, "Agent", {
2153
+ readonly _tag: Schema.tag<"Agent">;
2154
+ } & {
2155
+ agentId: Schema.brand<typeof Schema.UUID, "AgentId">;
2156
+ sessionId: typeof Schema.Number;
2157
+ parentAgentId: Schema.NullOr<Schema.brand<typeof Schema.UUID, "AgentId">>;
2158
+ conversationId: Schema.NullOr<Schema.brand<typeof Schema.UUID, "ConversationId">>;
2159
+ agentType: typeof Schema.String;
2160
+ startedAt: typeof Schema.Number;
2161
+ endedAt: Schema.NullOr<typeof Schema.Number>;
2162
+ startGitBranch: Schema.NullOr<typeof Schema.String>;
2163
+ startGitCommitSha: Schema.NullOr<typeof Schema.String>;
2164
+ startWorktreeDir: Schema.NullOr<typeof Schema.String>;
2165
+ idempotencyKey: typeof Schema.String;
2166
+ }>;
2167
+ /**
2168
+ * Successful registration row. The fields mirror the `agents` SQLite
2169
+ * table 1:1 in camelCase.
2170
+ *
2171
+ * `startGitBranch`, `startGitCommitSha`, `startWorktreeDir` capture
2172
+ * *what the agent inherited at registration time* — distinct from the
2173
+ * per-run git context recorded on `runs`. A divergence between the
2174
+ * two reveals a mid-session branch switch, which is itself signal.
2175
+ * @public
2176
+ */
2177
+ declare class Agent extends Agent_base {}
2178
+ declare const IdempotencyHit_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }>) => Readonly<A> & {
2179
+ readonly _tag: "IdempotencyHit";
2180
+ };
2181
+ /**
2182
+ * Returned by `DataStore.registerAgent` when the
2183
+ * `(session_id, idempotency_key)` UNIQUE constraint already has a
2184
+ * row. Not an error — the caller treats it as a successful recovery
2185
+ * of the existing `agentId`.
2186
+ *
2187
+ * Modeled as a `Data.TaggedClass` so the success channel of
2188
+ * `registerAgent` is `Effect<Agent | IdempotencyHit, ...>` and
2189
+ * downstream code uses `Match.tag` to branch.
2190
+ * @public
2191
+ */
2192
+ declare class IdempotencyHit extends IdempotencyHit_base<{
2193
+ readonly existingAgentId: typeof AgentId.Type;
2194
+ }> {}
2195
+ /**
2196
+ * Sum type of the two possible outcomes of `registerAgent`.
2197
+ * @public
2198
+ */
2199
+ type RegisterAgentResult = Agent | IdempotencyHit;
2200
+ /**
2201
+ * Agent tree — root agent with all descendants nested under
2202
+ * `children`. Returned by `DataStore.getAgentTree` for forensics and
2203
+ * the `vitest-agent agent list` CLI subcommand.
2204
+ * @public
2205
+ */
2206
+ interface AgentTreeNode {
2207
+ readonly agent: Agent;
2208
+ readonly children: ReadonlyArray<AgentTreeNode>;
2209
+ }
2210
+ //#endregion
2211
+ //#region src/services/DataStore.d.ts
2212
+ /** @public */
2213
+ interface CreateGoalInput {
2214
+ readonly tddTaskId: number;
2215
+ readonly goal: string;
2216
+ }
2217
+ /** @public */
2218
+ interface UpdateGoalInput {
2219
+ readonly id: number;
2220
+ readonly goal?: string;
2221
+ readonly status?: GoalStatus;
2222
+ }
2223
+ /** @public */
2224
+ interface CreateBehaviorInput {
2225
+ readonly goalId: number;
2226
+ readonly behavior: string;
2227
+ readonly suggestedTestName?: string;
2228
+ readonly dependsOnBehaviorIds?: ReadonlyArray<number>;
2229
+ }
2230
+ /** @public */
2231
+ interface UpdateBehaviorInput {
2232
+ readonly id: number;
2233
+ readonly behavior?: string;
2234
+ readonly suggestedTestName?: string | null;
2235
+ readonly status?: BehaviorStatus;
2236
+ readonly dependsOnBehaviorIds?: ReadonlyArray<number>;
2237
+ }
2238
+ /** @public */
2239
+ interface SettingsInput {
2240
+ readonly vitestVersion: string;
2241
+ readonly pool?: string;
2242
+ readonly environment?: string;
2243
+ readonly testTimeout?: number;
2244
+ readonly hookTimeout?: number;
2245
+ readonly slowTestThreshold?: number;
2246
+ readonly maxConcurrency?: number;
2247
+ readonly maxWorkers?: number;
2248
+ readonly isolate?: boolean;
2249
+ readonly bail?: number;
2250
+ readonly globals?: boolean;
2251
+ readonly fileParallelism?: boolean;
2252
+ readonly sequenceSeed?: number;
2253
+ readonly coverageProvider?: string;
2254
+ }
2255
+ /** @public */
2256
+ interface TestRunInput {
2257
+ readonly invocationId: string;
2258
+ readonly project: string;
2259
+ readonly settingsHash: string;
2260
+ readonly timestamp: string;
2261
+ readonly commitSha: string | null;
2262
+ readonly branch: string | null;
2263
+ readonly reason: "passed" | "failed" | "interrupted";
2264
+ readonly duration: number;
2265
+ readonly total: number;
2266
+ readonly passed: number;
2267
+ readonly failed: number;
2268
+ readonly skipped: number;
2269
+ readonly scoped: boolean;
2270
+ readonly snapshotAdded?: number;
2271
+ readonly snapshotMatched?: number;
2272
+ readonly snapshotUnmatched?: number;
2273
+ readonly snapshotUpdated?: number;
2274
+ readonly snapshotUnchecked?: number;
2275
+ readonly snapshotTotal?: number;
2276
+ readonly snapshotFailure?: boolean;
2277
+ readonly snapshotDidUpdate?: boolean;
2278
+ readonly snapshotFilesAdded?: number;
2279
+ readonly snapshotFilesRemoved?: number;
2280
+ readonly snapshotFilesUnmatched?: number;
2281
+ readonly snapshotFilesUpdated?: number;
2282
+ /**
2283
+ * Attribution columns added by the agent-agnostic taxonomy work. The
2284
+ * reporter walks env vars / session map to populate these; un-attributed
2285
+ * runs default to actor_type='system' and NULL agent/conversation ids.
2286
+ */
2287
+ readonly actorType?: "agent" | "user" | "system";
2288
+ readonly agentId?: string | null;
2289
+ readonly conversationId?: string | null;
2290
+ /**
2291
+ * Git context the run executed against. NULL for non-git workspaces.
2292
+ */
2293
+ readonly gitBranch?: string | null;
2294
+ readonly gitCommitSha?: string | null;
2295
+ readonly gitDirty?: boolean | null;
2296
+ readonly gitUpstream?: string | null;
2297
+ readonly gitWorktreeDir?: string | null;
2298
+ /**
2299
+ * Host metadata probe result (terminal pane, CI runner). NULL when no
2300
+ * probe in the priority chain matched.
2301
+ * @public
2302
+ */
2303
+ readonly hostSource?: string | null;
2304
+ readonly hostValue?: string | null;
2305
+ readonly hostMetadata?: Record<string, unknown> | null;
2306
+ }
2307
+ /** @public */
2308
+ interface ModuleInput {
2309
+ readonly fileId: number;
2310
+ readonly relativeModuleId: string;
2311
+ readonly state: string;
2312
+ readonly duration?: number;
2313
+ readonly environmentSetupDuration?: number;
2314
+ readonly prepareDuration?: number;
2315
+ readonly collectDuration?: number;
2316
+ readonly setupDuration?: number;
2317
+ readonly heap?: number;
2318
+ }
2319
+ /** @public */
2320
+ interface TestCaseInput {
2321
+ readonly suiteId?: number;
2322
+ readonly vitestId?: string;
2323
+ readonly name: string;
2324
+ readonly fullName: string;
2325
+ readonly state: string;
2326
+ readonly classification?: string;
2327
+ readonly duration?: number;
2328
+ readonly startTime?: number;
2329
+ readonly flaky?: boolean;
2330
+ readonly slow?: boolean;
2331
+ readonly retryCount?: number;
2332
+ readonly repeatCount?: number;
2333
+ readonly heap?: number;
2334
+ readonly mode?: string;
2335
+ readonly each?: boolean;
2336
+ readonly fails?: boolean;
2337
+ readonly concurrent?: boolean;
2338
+ readonly shuffle?: boolean;
2339
+ readonly timeout?: number;
2340
+ readonly skipNote?: string;
2341
+ readonly locationLine?: number;
2342
+ readonly locationColumn?: number;
2343
+ readonly tags?: readonly string[];
2344
+ /**
2345
+ * FK to `turns(id)`. Set by the reporter when the test case row was
2346
+ * authored within a recorded turn (D2 binding rule 1).
2347
+ * @public
2348
+ */
2349
+ readonly createdTurnId?: number;
2350
+ }
2351
+ /** @public */
2352
+ interface StackFrameInput {
2353
+ readonly ordinal: number;
2354
+ readonly method: string | null;
2355
+ readonly filePath: string;
2356
+ readonly line: number;
2357
+ readonly col: number;
2358
+ readonly sourceMappedLine?: number;
2359
+ readonly functionBoundaryLine?: number;
2360
+ }
2361
+ /** @public */
2362
+ interface TestErrorInput {
2363
+ readonly testCaseId?: number;
2364
+ readonly testSuiteId?: number;
2365
+ readonly moduleId?: number;
2366
+ readonly scope: "test" | "suite" | "module" | "unhandled";
2367
+ readonly name?: string;
2368
+ readonly message: string;
2369
+ readonly diff?: string;
2370
+ readonly actual?: string;
2371
+ readonly expected?: string;
2372
+ readonly stack?: string;
2373
+ readonly causeErrorId?: number;
2374
+ readonly signatureHash?: string;
2375
+ readonly frames?: ReadonlyArray<StackFrameInput>;
2376
+ readonly ordinal?: number;
2377
+ }
2378
+ /** @public */
2379
+ interface FileCoverageInput {
2380
+ readonly fileId: number;
2381
+ readonly statements: number;
2382
+ readonly branches: number;
2383
+ readonly functions: number;
2384
+ readonly lines: number;
2385
+ readonly uncoveredLines?: string;
2386
+ /**
2387
+ * Coverage tier this row represents. `'below_threshold'` is the
2388
+ * build-failing tier (file falls below the configured minimum
2389
+ * coverage thresholds). `'below_target'` is the warning tier (file
2390
+ * is above thresholds but below the aspirational target).
2391
+ *
2392
+ * Defaults to `'below_threshold'` when omitted, matching the only
2393
+ * tier that existed before migration 0005.
2394
+ * @public
2395
+ */
2396
+ readonly tier?: "below_threshold" | "below_target";
2397
+ }
2398
+ /** @public */
2399
+ interface SuiteInput {
2400
+ readonly parentSuiteId?: number;
2401
+ readonly name: string;
2402
+ readonly fullName: string;
2403
+ readonly state: "pending" | "passed" | "failed" | "skipped";
2404
+ readonly mode?: "run" | "only" | "skip" | "todo";
2405
+ readonly concurrent?: boolean;
2406
+ readonly shuffle?: boolean;
2407
+ readonly retry?: number;
2408
+ readonly repeats?: number;
2409
+ readonly locationLine?: number;
2410
+ readonly locationColumn?: number;
2411
+ }
2412
+ /** @public */
2413
+ interface NoteInput {
2414
+ readonly title: string;
2415
+ readonly content: string;
2416
+ readonly scope: "global" | "project" | "module" | "suite" | "test" | "note";
2417
+ readonly project?: string;
2418
+ readonly testFullName?: string;
2419
+ readonly modulePath?: string;
2420
+ readonly parentNoteId?: number;
2421
+ readonly createdBy?: string;
2422
+ readonly expiresAt?: string;
2423
+ readonly pinned?: boolean;
2424
+ }
2425
+ /** @public */
2426
+ interface SessionInput {
2427
+ readonly chatId: string;
2428
+ readonly project: string;
2429
+ readonly cwd: string;
2430
+ readonly agentKind: "main" | "subagent";
2431
+ readonly agentType?: string;
2432
+ readonly parentSessionId?: number;
2433
+ readonly triageWasNonEmpty?: boolean;
2434
+ readonly startedAt: string;
2435
+ }
2436
+ /** @public */
2437
+ interface TurnInput {
2438
+ readonly sessionId: number;
2439
+ /** When omitted, writeTurn computes MAX(turnNo) + 1 for the session. */
2440
+ readonly turnNo?: number;
2441
+ readonly type: "user_prompt" | "tool_call" | "tool_result" | "file_edit" | "hook_fire" | "note" | "hypothesis";
2442
+ readonly payload: string;
2443
+ readonly occurredAt: string;
2444
+ }
2445
+ /** @public */
2446
+ interface FailureSignatureWriteInput {
2447
+ readonly signatureHash: string;
2448
+ readonly runId: number;
2449
+ readonly seenAt: string;
2450
+ }
2451
+ /** @public */
2452
+ interface HypothesisInput {
2453
+ readonly sessionId: number;
2454
+ readonly content: string;
2455
+ readonly createdTurnId?: number;
2456
+ readonly citedTestErrorId?: number;
2457
+ readonly citedStackFrameId?: number;
2458
+ }
2459
+ /** @public */
2460
+ interface ValidateHypothesisInput {
2461
+ readonly id: number;
2462
+ readonly outcome: "confirmed" | "refuted" | "abandoned";
2463
+ readonly validatedTurnId?: number;
2464
+ readonly validatedAt: string;
2465
+ }
2466
+ /** @public */
2467
+ interface IdempotentResponseInput {
2468
+ readonly procedurePath: string;
2469
+ readonly key: string;
2470
+ readonly resultJson: string;
2471
+ readonly createdAt: string;
2472
+ }
2473
+ /** @public */
2474
+ interface TddTaskInput {
2475
+ readonly sessionId: number;
2476
+ readonly goal: string;
2477
+ readonly startedAt: string;
2478
+ readonly parentTddTaskId?: number;
2479
+ readonly runId?: string;
2480
+ }
2481
+ /** @public */
2482
+ interface EndTddTaskInput {
2483
+ readonly id: number;
2484
+ readonly endedAt: string;
2485
+ readonly outcome: "succeeded" | "blocked" | "abandoned";
2486
+ readonly summaryNoteId?: number;
2487
+ }
2488
+ /** @public */
2489
+ interface WriteTddPhaseInput {
2490
+ readonly tddTaskId: number;
2491
+ readonly behaviorId?: number;
2492
+ readonly phase: Phase;
2493
+ readonly startedAt: string;
2494
+ readonly transitionReason?: string;
2495
+ readonly parentPhaseId?: number;
2496
+ }
2497
+ /** @public */
2498
+ interface WriteTddPhaseOutput {
2499
+ readonly id: number;
2500
+ readonly previousPhaseId: number | null;
2501
+ }
1141
2502
  /** @public */
1142
- declare const ciAnnotationsFormatter: Formatter;
1143
- //#endregion
1144
- //#region src/formatters/gfm.d.ts
2503
+ interface WriteTddArtifactInput {
2504
+ readonly phaseId: number;
2505
+ readonly artifactKind: ArtifactKind;
2506
+ readonly fileId?: number;
2507
+ readonly testCaseId?: number;
2508
+ readonly testRunId?: number;
2509
+ readonly testFirstFailureRunId?: number;
2510
+ readonly diffExcerpt?: string;
2511
+ readonly recordedAt: string;
2512
+ }
1145
2513
  /** @public */
1146
- declare const GfmFormatter: Formatter;
1147
- //#endregion
1148
- //#region src/formatters/json.d.ts
2514
+ interface WriteCommitInput {
2515
+ readonly sha: string;
2516
+ readonly parentSha?: string;
2517
+ readonly message?: string;
2518
+ readonly author?: string;
2519
+ readonly committedAt?: string;
2520
+ readonly branch?: string;
2521
+ }
1149
2522
  /** @public */
1150
- declare const JsonFormatter: Formatter;
1151
- //#endregion
1152
- //#region src/formatters/markdown.d.ts
1153
- /**
1154
- * Markdown formatter for surfaces that *render* markdown.
1155
- *
1156
- * Stdout output goes through {@link TerminalFormatter} (plain text +
1157
- * ANSI), not this formatter — markdown syntax (e.g. heading prefixes,
1158
- * backticks, list dashes) is visual noise in a terminal that doesn't
1159
- * render it. This formatter remains for callers that explicitly request
1160
- * `format: "markdown"`, e.g. when piping the rendered output into a
1161
- * Markdown-aware sink.
1162
- * @public
1163
- */
1164
- declare const MarkdownFormatter: Formatter;
1165
- //#endregion
1166
- //#region src/formatters/silent.d.ts
2523
+ type ChangeKind = "added" | "modified" | "deleted" | "renamed" | "untracked-modified";
1167
2524
  /** @public */
1168
- declare const SilentFormatter: Formatter;
1169
- //#endregion
1170
- //#region src/formatters/terminal.d.ts
2525
+ interface RunChangedFile {
2526
+ readonly filePath: string;
2527
+ readonly changeKind: ChangeKind;
2528
+ readonly commitSha?: string;
2529
+ }
1171
2530
  /** @public */
1172
- declare const TerminalFormatter: Formatter;
1173
- //#endregion
1174
- //#region src/schemas/Config.d.ts
1175
- declare const VitestAgentConfig_base: Schema.Class<VitestAgentConfig, {
1176
- cacheDir: Schema.optional<typeof Schema.String>;
1177
- projectKey: Schema.optional<typeof Schema.String>;
1178
- }, Schema.Struct.Encoded<{
1179
- cacheDir: Schema.optional<typeof Schema.String>;
1180
- projectKey: Schema.optional<typeof Schema.String>;
1181
- }>, never, {
1182
- readonly cacheDir?: string | undefined;
1183
- } & {
1184
- readonly projectKey?: string | undefined;
1185
- }, {}, {}>;
2531
+ interface WriteRunChangedFilesInput {
2532
+ readonly runId: number;
2533
+ readonly files: ReadonlyArray<RunChangedFile>;
2534
+ }
2535
+ /** @public */
2536
+ type RunInvocationMethod = "bash" | "mcp" | "cli";
1186
2537
  /**
1187
- * Schema for the optional `vitest-agent.config.toml` file.
1188
- *
1189
- * Both fields are optional. When the file is absent or these fields are
1190
- * unset, `resolveDataPath` falls back to deriving the path from the
1191
- * workspace's `package.json` `name` under the XDG data directory.
2538
+ * Input to `DataStore.registerAgent`.
1192
2539
  *
1193
- * Fields:
1194
- * - `cacheDir` — absolute path overriding the entire data directory. Highest
1195
- * precedence after the programmatic option. Use this to relocate the SQLite
1196
- * database (e.g. project-local `.vitest-agent/`) instead of the
1197
- * default XDG location.
1198
- * - `projectKey` — overrides the workspace key segment under the XDG data
1199
- * directory. Use this when two unrelated projects on the same machine
1200
- * share a `package.json` `name` (the collision case for workspace-name
1201
- * keying), or when you want a stable key independent of `name` changes.
1202
- * @public
1203
- */
1204
- declare class VitestAgentConfig extends VitestAgentConfig_base {}
1205
- //#endregion
1206
- //#region src/services/Config.d.ts
1207
- /**
1208
- * Service shape that `ConfigLive(projectDir)` provides to downstream
1209
- * consumers. Re-exported so callers can spell out the concrete service
1210
- * type without referencing the `ConfigFileService<A>` generic directly.
1211
- * @public
1212
- */
1213
- type VitestAgentConfigFileService = ConfigFileService<VitestAgentConfig>;
1214
- /**
1215
- * Typed `Context.Tag` for the vitest-agent config file service.
2540
+ * `sessionId` is the FK to `sessions.id` (integer PK), NOT the host's
2541
+ * chat UUID string. Callers that hold only the chat UUID must resolve
2542
+ * it through `getSessionByChatId` first.
1216
2543
  *
1217
- * Both runtime packages (reporter, MCP) yield this tag to access the loaded
1218
- * `VitestAgentConfig`. The live layer is built per `projectDir` via
1219
- * `ConfigLive(projectDir)`.
2544
+ * `idempotencyKey` is pre-derived by the caller via
2545
+ * `deriveIdempotencyKey(...)` — both the sidecar CLI and the MCP
2546
+ * server compute it the same way so a hook retry collapses to the
2547
+ * same row.
1220
2548
  * @public
1221
2549
  */
1222
- declare const VitestAgentConfigFile: import("effect/Context").Tag<ConfigFileService<VitestAgentConfig>, ConfigFileService<VitestAgentConfig>>;
2550
+ interface RegisterAgentInput {
2551
+ readonly sessionId: number;
2552
+ readonly agentType: string;
2553
+ readonly parentAgentId: string | null;
2554
+ readonly conversationId: string | null;
2555
+ readonly startedAt: number;
2556
+ readonly startGitBranch?: string;
2557
+ readonly startGitCommitSha?: string;
2558
+ readonly startWorktreeDir?: string;
2559
+ readonly idempotencyKey: string;
2560
+ /**
2561
+ * Pre-allocated `agents.agent_id` UUID. The sidecar passes
2562
+ * `PerClientSessionMapWriter.mapSession()`'s `main_agent_id` here so
2563
+ * the per-project `agents` row and the per-client session_map row
2564
+ * agree on a single canonical id — the same value the SessionStart
2565
+ * hook exports as `VITEST_AGENT_MAIN_AGENT_ID` / `_AGENT_ID`. When
2566
+ * omitted, the implementation generates a fresh UUID (used by tests
2567
+ * and any caller without a session map).
2568
+ */
2569
+ readonly agentId?: string;
2570
+ }
2571
+ /** @public */
2572
+ interface AssociateRunSessionInput {
2573
+ readonly chatId: string;
2574
+ readonly invocationMethod: RunInvocationMethod;
2575
+ }
2576
+ declare const DataStore_base: Context.TagClass<DataStore, "vitest-agent/DataStore", {
2577
+ readonly writeSettings: (hash: string, settings: SettingsInput, envVars: Record<string, string>) => Effect.Effect<void, DataStoreError>;
2578
+ readonly writeRun: (input: TestRunInput) => Effect.Effect<number, DataStoreError>;
2579
+ readonly writeModules: (runId: number, modules: ReadonlyArray<ModuleInput>) => Effect.Effect<ReadonlyArray<number>, DataStoreError>;
2580
+ readonly writeSuites: (moduleId: number, suites: ReadonlyArray<SuiteInput>) => Effect.Effect<ReadonlyArray<number>, DataStoreError>;
2581
+ readonly writeTestCases: (moduleId: number, tests: ReadonlyArray<TestCaseInput>) => Effect.Effect<ReadonlyArray<number>, DataStoreError>;
2582
+ readonly writeErrors: (runId: number, errors: ReadonlyArray<TestErrorInput>) => Effect.Effect<void, DataStoreError>;
2583
+ readonly writeCoverage: (runId: number, coverage: ReadonlyArray<FileCoverageInput>) => Effect.Effect<void, DataStoreError>;
2584
+ readonly writeHistory: (project: string, fullName: string, runId: number, timestamp: string, state: string, duration: number | null, flaky: boolean, retryCount: number, errorMessage: string | null) => Effect.Effect<void, DataStoreError>;
2585
+ readonly writeBaselines: (baselines: CoverageBaselines) => Effect.Effect<void, DataStoreError>;
2586
+ readonly writeTrends: (project: string, runId: number, entry: TrendEntry) => Effect.Effect<void, DataStoreError>;
2587
+ readonly writeSourceMap: (sourceFilePath: string, testModuleId: number, mappingType: string) => Effect.Effect<void, DataStoreError>;
2588
+ readonly ensureFile: (filePath: string) => Effect.Effect<number, DataStoreError>;
2589
+ readonly writeNote: (note: NoteInput) => Effect.Effect<number, DataStoreError>;
2590
+ readonly updateNote: (id: number, fields: Partial<NoteInput>) => Effect.Effect<void, DataStoreError>;
2591
+ readonly deleteNote: (id: number) => Effect.Effect<void, DataStoreError>;
2592
+ readonly writeSession: (input: SessionInput) => Effect.Effect<number, DataStoreError>;
2593
+ /**
2594
+ * Idempotent variant of `writeSession`: if a row with this
2595
+ * `chat_id` already exists, return its id and leave the stored
2596
+ * fields untouched; otherwise insert a new row. Used by
2597
+ * hook-triggered recording paths (artifacts, turns) that fire
2598
+ * for sessions whose original `SessionStart` may have missed —
2599
+ * e.g. when Claude Code rotates `chat_id` mid-window after a
2600
+ * continuation or compaction. Race-safe via
2601
+ * `INSERT ... ON CONFLICT DO NOTHING`.
2602
+ */
2603
+ readonly upsertSession: (input: SessionInput) => Effect.Effect<number, DataStoreError>;
2604
+ readonly writeTurn: (input: TurnInput) => Effect.Effect<number, DataStoreError>;
2605
+ readonly writeFailureSignature: (input: FailureSignatureWriteInput) => Effect.Effect<void, DataStoreError>;
2606
+ readonly endSession: (chatId: string, endedAt: string, endReason: string | null) => Effect.Effect<void, DataStoreError>;
2607
+ readonly writeHypothesis: (input: HypothesisInput) => Effect.Effect<number, DataStoreError>;
2608
+ readonly validateHypothesis: (input: ValidateHypothesisInput) => Effect.Effect<void, DataStoreError>;
2609
+ readonly writeTddTask: (input: TddTaskInput) => Effect.Effect<number, DataStoreError>;
2610
+ readonly endTddTask: (input: EndTddTaskInput) => Effect.Effect<void, DataStoreError>;
2611
+ readonly createGoal: (input: CreateGoalInput) => Effect.Effect<GoalRow, DataStoreError | TddTaskNotFoundError | TddTaskAlreadyEndedError>;
2612
+ readonly getGoal: (id: number) => Effect.Effect<Option.Option<GoalRow>, DataStoreError>;
2613
+ readonly updateGoal: (input: UpdateGoalInput) => Effect.Effect<GoalRow, DataStoreError | GoalNotFoundError | TddTaskAlreadyEndedError | IllegalStatusTransitionError>;
2614
+ readonly deleteGoal: (id: number) => Effect.Effect<void, DataStoreError | GoalNotFoundError>;
2615
+ readonly listGoalsByTddTask: (tddTaskId: number) => Effect.Effect<ReadonlyArray<GoalRow>, DataStoreError | TddTaskNotFoundError>;
2616
+ readonly createBehavior: (input: CreateBehaviorInput) => Effect.Effect<BehaviorRow, DataStoreError | GoalNotFoundError | BehaviorNotFoundError | TddTaskAlreadyEndedError | IllegalStatusTransitionError>;
2617
+ readonly getBehavior: (id: number) => Effect.Effect<Option.Option<BehaviorRow>, DataStoreError>;
2618
+ readonly updateBehavior: (input: UpdateBehaviorInput) => Effect.Effect<BehaviorRow, DataStoreError | BehaviorNotFoundError | TddTaskAlreadyEndedError | IllegalStatusTransitionError>;
2619
+ readonly deleteBehavior: (id: number) => Effect.Effect<void, DataStoreError | BehaviorNotFoundError>;
2620
+ readonly listBehaviorsByGoal: (goalId: number) => Effect.Effect<ReadonlyArray<BehaviorRow>, DataStoreError | GoalNotFoundError>;
2621
+ readonly listBehaviorsByTddTask: (tddTaskId: number) => Effect.Effect<ReadonlyArray<BehaviorRow>, DataStoreError | TddTaskNotFoundError>;
2622
+ readonly writeTddPhase: (input: WriteTddPhaseInput) => Effect.Effect<WriteTddPhaseOutput, DataStoreError>;
2623
+ readonly writeTddArtifact: (input: WriteTddArtifactInput) => Effect.Effect<number, DataStoreError>;
2624
+ readonly writeCommit: (input: WriteCommitInput) => Effect.Effect<void, DataStoreError>;
2625
+ readonly writeRunChangedFiles: (input: WriteRunChangedFilesInput) => Effect.Effect<void, DataStoreError>;
2626
+ readonly recordIdempotentResponse: (input: IdempotentResponseInput) => Effect.Effect<void, DataStoreError>;
2627
+ readonly pruneSessions: (keepRecent: number) => Effect.Effect<{
2628
+ readonly affectedSessions: number;
2629
+ readonly prunedTurns: number;
2630
+ }, DataStoreError>;
2631
+ readonly associateLatestRunWithSession: (input: AssociateRunSessionInput) => Effect.Effect<void, DataStoreError>;
2632
+ readonly backfillTestCaseTurns: (chatId: string) => Effect.Effect<number, DataStoreError>;
2633
+ /**
2634
+ * Idempotently insert an `agents` row.
2635
+ *
2636
+ * Returns `Agent` on a fresh insert, or `IdempotencyHit` carrying
2637
+ * the existing `agentId` when the `(session_id, idempotency_key)`
2638
+ * UNIQUE constraint already has a row. The caller treats the latter
2639
+ * as a successful recovery (same logical agent), not an error.
2640
+ *
2641
+ * Fails with `RegistrationConflictError` when the supplied
2642
+ * `parentAgentId` references an agent in a different session, or
2643
+ * when no such agent exists. Surface to the caller for true
2644
+ * mis-configuration cases; idempotency hits never produce this.
2645
+ */
2646
+ readonly registerAgent: (input: RegisterAgentInput) => Effect.Effect<Agent | IdempotencyHit, RegistrationConflictError | DataStoreError>;
2647
+ /**
2648
+ * Mark an agent as ended. Sets `agents.ended_at` to the supplied
2649
+ * timestamp. Fails with `AgentNotFoundError` when no row exists.
2650
+ */
2651
+ readonly endAgent: (agentId: string, endedAt: number) => Effect.Effect<void, AgentNotFoundError | DataStoreError>;
2652
+ }>;
2653
+ /** @public */
2654
+ declare class DataStore extends DataStore_base {}
1223
2655
  //#endregion
1224
- //#region src/layers/ConfigLive.d.ts
2656
+ //#region src/services/DataReader.d.ts
2657
+ /** @public */
2658
+ interface ProjectRunSummary {
2659
+ readonly project: string;
2660
+ readonly lastRun: string | null;
2661
+ readonly lastResult: "passed" | "failed" | "interrupted" | null;
2662
+ readonly total: number;
2663
+ readonly passed: number;
2664
+ readonly failed: number;
2665
+ readonly skipped: number;
2666
+ }
2667
+ /** @public */
2668
+ interface FlakyTest {
2669
+ readonly fullName: string;
2670
+ readonly project: string;
2671
+ readonly passCount: number;
2672
+ readonly failCount: number;
2673
+ readonly lastState: "passed" | "failed";
2674
+ readonly lastTimestamp: string;
2675
+ }
2676
+ /** @public */
2677
+ interface PersistentFailure {
2678
+ readonly fullName: string;
2679
+ readonly project: string;
2680
+ readonly consecutiveFailures: number;
2681
+ readonly firstFailedAt: string;
2682
+ readonly lastFailedAt: string;
2683
+ readonly lastErrorMessage: string | null;
2684
+ }
2685
+ /** @public */
2686
+ interface TestError {
2687
+ /** `test_errors.id` — required by `hypothesis (action: record).citedTestErrorId`. */
2688
+ readonly id: number;
2689
+ /**
2690
+ * `stack_frames.id` for the top frame of this error (ordinal 0), or
2691
+ * `null` if no frames were captured. Required by
2692
+ * `hypothesis (action: record).citedStackFrameId`.
2693
+ */
2694
+ readonly topStackFrameId: number | null;
2695
+ readonly name: string | null;
2696
+ readonly message: string;
2697
+ readonly diff: string | null;
2698
+ readonly actual: string | null;
2699
+ readonly expected: string | null;
2700
+ readonly stack: string | null;
2701
+ readonly scope: "test" | "suite" | "module" | "unhandled";
2702
+ readonly testFullName: string | null;
2703
+ readonly moduleFile: string | null;
2704
+ }
2705
+ /** @public */
2706
+ interface NoteRow {
2707
+ readonly id: number;
2708
+ readonly title: string;
2709
+ readonly content: string;
2710
+ readonly scope: "global" | "project" | "module" | "suite" | "test" | "note";
2711
+ readonly project: string | null;
2712
+ readonly testFullName: string | null;
2713
+ readonly modulePath: string | null;
2714
+ readonly parentNoteId: number | null;
2715
+ readonly createdBy: string | null;
2716
+ readonly expiresAt: string | null;
2717
+ readonly pinned: boolean;
2718
+ readonly createdAt: string;
2719
+ readonly updatedAt: string;
2720
+ }
2721
+ /** @public */
2722
+ interface SettingsRow {
2723
+ readonly hash: string;
2724
+ readonly reporters: string | null;
2725
+ readonly coverageEnabled: boolean;
2726
+ readonly coverageProvider: string | null;
2727
+ readonly coverageThresholds: string | null;
2728
+ readonly coverageTargets: string | null;
2729
+ readonly pool: string | null;
2730
+ readonly shard: string | null;
2731
+ readonly project: string | null;
2732
+ readonly environment: string | null;
2733
+ readonly envVars: Record<string, string>;
2734
+ readonly capturedAt: string;
2735
+ }
2736
+ /** @public */
2737
+ interface TestListEntry {
2738
+ readonly id: number;
2739
+ readonly fullName: string;
2740
+ readonly state: string;
2741
+ readonly duration: number | null;
2742
+ readonly module: string;
2743
+ readonly classification: string | null;
2744
+ }
2745
+ /** @public */
2746
+ interface ModuleListEntry {
2747
+ readonly id: number;
2748
+ readonly file: string;
2749
+ readonly state: string;
2750
+ readonly testCount: number;
2751
+ readonly duration: number | null;
2752
+ }
2753
+ /** @public */
2754
+ interface SuiteListEntry {
2755
+ readonly id: number;
2756
+ readonly name: string;
2757
+ readonly module: string;
2758
+ readonly state: string;
2759
+ readonly testCount: number;
2760
+ }
2761
+ /** @public */
2762
+ interface SettingsListEntry {
2763
+ readonly hash: string;
2764
+ readonly capturedAt: string;
2765
+ }
2766
+ /** @public */
2767
+ interface SessionDetail {
2768
+ readonly id: number;
2769
+ readonly chatId: string;
2770
+ readonly project: string;
2771
+ readonly cwd: string;
2772
+ readonly agentKind: "main" | "subagent";
2773
+ readonly agentType: string | null;
2774
+ readonly parentSessionId: number | null;
2775
+ readonly triageWasNonEmpty: boolean;
2776
+ readonly startedAt: string;
2777
+ readonly endedAt: string | null;
2778
+ readonly endReason: string | null;
2779
+ }
2780
+ /** @public */
2781
+ interface TurnSummary {
2782
+ readonly id: number;
2783
+ readonly sessionId: number;
2784
+ readonly turnNo: number;
2785
+ readonly type: string;
2786
+ readonly payload: string;
2787
+ readonly occurredAt: string;
2788
+ }
2789
+ /** @public */
2790
+ interface TurnSearchOptions {
2791
+ readonly sessionId?: number;
2792
+ readonly type?: string;
2793
+ readonly since?: string;
2794
+ readonly limit?: number;
2795
+ }
2796
+ /** @public */
2797
+ interface AcceptanceMetrics {
2798
+ readonly phaseEvidenceIntegrity: {
2799
+ total: number;
2800
+ compliant: number;
2801
+ ratio: number;
2802
+ };
2803
+ readonly complianceHookResponsiveness: {
2804
+ total: number;
2805
+ withFollowup: number;
2806
+ ratio: number;
2807
+ };
2808
+ readonly orientationUsefulness: {
2809
+ total: number;
2810
+ referencedCount: number;
2811
+ ratio: number;
2812
+ };
2813
+ readonly antiPatternDetectionRate: {
2814
+ total: number;
2815
+ cleanSessions: number;
2816
+ ratio: number;
2817
+ };
2818
+ }
2819
+ /** @public */
2820
+ interface FailureSignatureDetail {
2821
+ readonly signatureHash: string;
2822
+ readonly firstSeenRunId: number | null;
2823
+ readonly firstSeenAt: string;
2824
+ readonly lastSeenAt: string | null;
2825
+ readonly occurrenceCount: number;
2826
+ readonly recentErrors: ReadonlyArray<{
2827
+ readonly runId: number;
2828
+ readonly message: string;
2829
+ readonly errorName: string | null;
2830
+ }>;
2831
+ }
2832
+ /** @public */
2833
+ interface TddPhaseDetail {
2834
+ readonly id: number;
2835
+ readonly behaviorId: number | null;
2836
+ readonly phase: string;
2837
+ readonly startedAt: string;
2838
+ readonly endedAt: string | null;
2839
+ readonly transitionReason: string | null;
2840
+ }
2841
+ /** @public */
2842
+ interface TddArtifactDetail {
2843
+ readonly id: number;
2844
+ readonly phaseId: number;
2845
+ readonly artifactKind: string;
2846
+ readonly testCaseId: number | null;
2847
+ readonly testRunId: number | null;
2848
+ readonly recordedAt: string;
2849
+ }
2850
+ /** @public */
2851
+ interface TddTaskDetail {
2852
+ readonly id: number;
2853
+ readonly sessionId: number;
2854
+ readonly goal: string;
2855
+ readonly startedAt: string;
2856
+ readonly endedAt: string | null;
2857
+ readonly outcome: string | null;
2858
+ readonly runId: string | null;
2859
+ readonly goals: ReadonlyArray<GoalDetail>;
2860
+ readonly phases: ReadonlyArray<TddPhaseDetail>;
2861
+ readonly artifacts: ReadonlyArray<TddArtifactDetail>;
2862
+ }
2863
+ /** @public */
2864
+ interface CurrentTddPhase {
2865
+ readonly id: number;
2866
+ readonly phase: Phase;
2867
+ readonly startedAt: string;
2868
+ readonly behaviorId: number | null;
2869
+ }
2870
+ /** @public */
2871
+ interface CitedArtifactRow extends CitedArtifact {
2872
+ readonly phase_id: number;
2873
+ }
2874
+ /** @public */
2875
+ interface CommitChangesEntry {
2876
+ readonly sha: string;
2877
+ readonly parentSha: string | null;
2878
+ readonly message: string | null;
2879
+ readonly author: string | null;
2880
+ readonly committedAt: string | null;
2881
+ readonly branch: string | null;
2882
+ readonly files: ReadonlyArray<{
2883
+ readonly filePath: string;
2884
+ readonly changeKind: ChangeKind;
2885
+ }>;
2886
+ }
2887
+ /** @public */
2888
+ interface HypothesisDetail {
2889
+ readonly id: number;
2890
+ readonly sessionId: number;
2891
+ readonly content: string;
2892
+ readonly citedTestErrorId: number | null;
2893
+ readonly citedStackFrameId: number | null;
2894
+ readonly validationOutcome: "confirmed" | "refuted" | "abandoned" | null;
2895
+ readonly validatedAt: string | null;
2896
+ }
2897
+ /** @public */
2898
+ interface TddTaskSummary {
2899
+ readonly id: number;
2900
+ readonly sessionId: number;
2901
+ readonly goal: string;
2902
+ readonly startedAt: string;
2903
+ readonly endedAt: string | null;
2904
+ readonly outcome: "succeeded" | "blocked" | "abandoned" | null;
2905
+ }
1225
2906
  /**
1226
- * Build the live `ConfigFile` layer for a given project directory.
1227
- *
1228
- * Resolves the optional `vitest-agent.config.toml` from (in order):
1229
- *
1230
- * 1. The workspace root (when `projectDir` is inside a pnpm/npm/yarn workspace).
1231
- * 2. The git repository root (when `projectDir` is inside a git repo).
1232
- * 3. Walking upward from `projectDir`.
2907
+ * Row shape returned by `listTddArtifactsForTask`. Carries every
2908
+ * field an agent typically needs to cite an artifact in a subsequent
2909
+ * `tdd_phase_transition_request` call without further lookups.
1233
2910
  *
1234
- * The first found file wins (`FirstMatch` strategy). If no file is present,
1235
- * downstream callers use `loadOrDefault(new VitestAgentConfig({}))`
1236
- * to get an empty config.
1237
- *
1238
- * @param projectDir - Absolute path inside the user's workspace. Resolvers
1239
- * anchor here rather than `process.cwd()` so the plugin-spawned MCP server
1240
- * sees the right config even when invoked from elsewhere.
1241
2911
  * @public
1242
2912
  */
1243
- declare const ConfigLive: (projectDir: string) => Layer.Layer<VitestAgentConfigFileService, never, FileSystem.FileSystem>;
2913
+ interface TddArtifactRow {
2914
+ readonly id: number;
2915
+ readonly tddTaskId: number;
2916
+ readonly phaseId: number;
2917
+ readonly phaseName: Phase;
2918
+ readonly artifactKind: ArtifactKind;
2919
+ readonly behaviorId: number | null;
2920
+ readonly testCaseId: number | null;
2921
+ readonly testRunId: number | null;
2922
+ readonly testFirstFailureRunId: number | null;
2923
+ readonly recordedAt: string;
2924
+ }
2925
+ /** @public */
2926
+ interface TagInventoryRow {
2927
+ /** The tag name (e.g. `"int"`, `"e2e"`, `"unit"`). */
2928
+ readonly tag: string;
2929
+ /** The Vitest project this tag was observed in. */
2930
+ readonly project: string;
2931
+ /**
2932
+ * Number of distinct test modules in the project's latest run that contain
2933
+ * at least one test case carrying this tag.
2934
+ */
2935
+ readonly moduleCount: number;
2936
+ /**
2937
+ * Number of test cases in the project's latest run that carry this tag.
2938
+ */
2939
+ readonly testCount: number;
2940
+ }
2941
+ declare const DataReader_base: Context.TagClass<DataReader, "vitest-agent/DataReader", {
2942
+ readonly getLatestRun: (project: string) => Effect.Effect<Option.Option<AgentReport>, DataStoreError>;
2943
+ readonly getRunsByProject: () => Effect.Effect<ReadonlyArray<ProjectRunSummary>, DataStoreError>;
2944
+ readonly getHistory: (project: string) => Effect.Effect<HistoryRecord, DataStoreError>;
2945
+ readonly getBaselines: (project: string) => Effect.Effect<Option.Option<CoverageBaselines>, DataStoreError>;
2946
+ readonly getTrends: (project: string, limit?: number) => Effect.Effect<Option.Option<TrendRecord>, DataStoreError>;
2947
+ readonly getFlaky: (project: string) => Effect.Effect<ReadonlyArray<FlakyTest>, DataStoreError>;
2948
+ readonly getPersistentFailures: (project: string) => Effect.Effect<ReadonlyArray<PersistentFailure>, DataStoreError>;
2949
+ readonly getFileCoverage: (runId: number) => Effect.Effect<ReadonlyArray<FileCoverageReport>, DataStoreError>;
2950
+ readonly getCoverage: (project: string) => Effect.Effect<Option.Option<CoverageReport>, DataStoreError>;
2951
+ readonly getTestsForFile: (filePath: string) => Effect.Effect<ReadonlyArray<string>, DataStoreError>;
2952
+ readonly getErrors: (project: string, errorName?: string) => Effect.Effect<ReadonlyArray<TestError>, DataStoreError>;
2953
+ readonly getNotes: (scope?: string, project?: string, testFullName?: string) => Effect.Effect<ReadonlyArray<NoteRow>, DataStoreError>;
2954
+ readonly getNoteById: (id: number) => Effect.Effect<Option.Option<NoteRow>, DataStoreError>;
2955
+ readonly searchNotes: (query: string) => Effect.Effect<ReadonlyArray<NoteRow>, DataStoreError>;
2956
+ readonly getManifest: () => Effect.Effect<Option.Option<CacheManifest>, DataStoreError>;
2957
+ readonly getSettings: (hash: string) => Effect.Effect<Option.Option<SettingsRow>, DataStoreError>;
2958
+ readonly getLatestSettings: () => Effect.Effect<Option.Option<SettingsRow>, DataStoreError>;
2959
+ readonly getTestByFullName: (project: string, fullName: string) => Effect.Effect<Option.Option<TestListEntry>, DataStoreError>;
2960
+ readonly listTests: (project: string, options?: {
2961
+ state?: string;
2962
+ module?: string;
2963
+ limit?: number;
2964
+ }) => Effect.Effect<ReadonlyArray<TestListEntry>, DataStoreError>;
2965
+ readonly listModules: (project: string) => Effect.Effect<ReadonlyArray<ModuleListEntry>, DataStoreError>;
2966
+ readonly listSuites: (project: string, options?: {
2967
+ module?: string;
2968
+ }) => Effect.Effect<ReadonlyArray<SuiteListEntry>, DataStoreError>;
2969
+ readonly listSettings: () => Effect.Effect<ReadonlyArray<SettingsListEntry>, DataStoreError>;
2970
+ readonly getSessionById: (id: number) => Effect.Effect<Option.Option<SessionDetail>, DataStoreError>;
2971
+ readonly getSessionByChatId: (chatId: string) => Effect.Effect<Option.Option<SessionDetail>, DataStoreError>;
2972
+ /**
2973
+ * Find every session row whose `chat_id` begins with `prefix`.
2974
+ * Used to recover the synthetic subagent row created by the
2975
+ * SubagentStart hook (`<parentChatId>-subagent-<ts>-<pid>`)
2976
+ * when subsequent PostToolUse hooks fire under the bare
2977
+ * parent chat_id. Returns most recent first.
2978
+ */
2979
+ readonly findSessionsByChatPrefix: (prefix: string) => Effect.Effect<ReadonlyArray<SessionDetail>, DataStoreError>;
2980
+ /**
2981
+ * Find the most-recently-started subagent session whose
2982
+ * `parent_session_id` is `parentSessionId` and that has not ended
2983
+ * (`ended_at IS NULL`). Used to attribute orchestrator (subagent)
2984
+ * MCP writes — e.g. `hypothesis record` — to the running subagent's
2985
+ * own session row instead of the parent main session, since the MCP
2986
+ * server's recovered context only ever names the main agent.
2987
+ */
2988
+ readonly findActiveSubagentSession: (parentSessionId: number) => Effect.Effect<Option.Option<SessionDetail>, DataStoreError>;
2989
+ readonly listSessions: (options: {
2990
+ readonly project?: string;
2991
+ readonly agentKind?: "main" | "subagent";
2992
+ readonly limit?: number;
2993
+ }) => Effect.Effect<ReadonlyArray<SessionDetail>, DataStoreError>;
2994
+ readonly searchTurns: (options: TurnSearchOptions) => Effect.Effect<ReadonlyArray<TurnSummary>, DataStoreError>;
2995
+ readonly computeAcceptanceMetrics: () => Effect.Effect<AcceptanceMetrics, DataStoreError>;
2996
+ readonly getFailureSignatureByHash: (hash: string) => Effect.Effect<Option.Option<FailureSignatureDetail>, DataStoreError>;
2997
+ readonly getTddTaskById: (id: number) => Effect.Effect<Option.Option<TddTaskDetail>, DataStoreError>;
2998
+ readonly getGoalById: (id: number) => Effect.Effect<Option.Option<GoalDetail>, DataStoreError>;
2999
+ readonly getGoalsByTddTask: (tddTaskId: number) => Effect.Effect<ReadonlyArray<GoalDetail>, DataStoreError>;
3000
+ readonly getBehaviorById: (id: number) => Effect.Effect<Option.Option<BehaviorDetail>, DataStoreError>;
3001
+ readonly getBehaviorsByGoal: (goalId: number) => Effect.Effect<ReadonlyArray<BehaviorRow>, DataStoreError>;
3002
+ readonly getBehaviorsByTddTask: (tddTaskId: number) => Effect.Effect<ReadonlyArray<BehaviorRow>, DataStoreError>;
3003
+ readonly getBehaviorDependencies: (behaviorId: number) => Effect.Effect<ReadonlyArray<BehaviorRow>, DataStoreError>;
3004
+ readonly resolveGoalIdForBehavior: (behaviorId: number) => Effect.Effect<Option.Option<number>, DataStoreError>;
3005
+ readonly getCurrentTddPhase: (tddTaskId: number) => Effect.Effect<Option.Option<CurrentTddPhase>, DataStoreError>;
3006
+ readonly getTddArtifactWithContext: (artifactId: number) => Effect.Effect<Option.Option<CitedArtifactRow>, DataStoreError>;
3007
+ readonly getCommitChanges: (sha?: string) => Effect.Effect<ReadonlyArray<CommitChangesEntry>, DataStoreError>;
3008
+ readonly listTddTasksForSession: (sessionId: number, options?: {
3009
+ /**
3010
+ * When true, also return tdd_tasks belonging to any
3011
+ * ancestor of `sessionId` via `parent_session_id`. Used
3012
+ * by hook-driven artifact recording where the
3013
+ * orchestrator opened the tdd task under the parent
3014
+ * main row but the subagent's own session row is the
3015
+ * one carrying the calling chat_id. Default `false`
3016
+ * preserves the prior single-session contract.
3017
+ */
3018
+ readonly walkParents?: boolean;
3019
+ }) => Effect.Effect<ReadonlyArray<TddTaskSummary>, DataStoreError>;
3020
+ /**
3021
+ * List artifacts recorded for a TDD task, optionally filtered
3022
+ * by `artifactKind`, `phaseId`, or `behaviorId`. Returns rows in
3023
+ * recorded_at DESC order so the most recently captured artifact
3024
+ * (the typical citation target for a phase transition) appears
3025
+ * first. `limit` defaults to 50.
3026
+ */
3027
+ readonly listTddArtifactsForTask: (input: {
3028
+ readonly tddTaskId: number;
3029
+ readonly artifactKind?: ArtifactKind;
3030
+ readonly phaseId?: number;
3031
+ readonly behaviorId?: number;
3032
+ readonly limit?: number;
3033
+ }) => Effect.Effect<ReadonlyArray<TddArtifactRow>, DataStoreError>;
3034
+ readonly listHypotheses: (options: {
3035
+ readonly sessionId?: number;
3036
+ readonly outcome?: "confirmed" | "refuted" | "abandoned" | "open";
3037
+ readonly limit?: number;
3038
+ }) => Effect.Effect<ReadonlyArray<HypothesisDetail>, DataStoreError>;
3039
+ readonly findIdempotentResponse: (procedurePath: string, key: string) => Effect.Effect<Option.Option<string>, DataStoreError>;
3040
+ readonly getLatestTestCaseForSession: (chatId: string) => Effect.Effect<Option.Option<number>, DataStoreError>;
3041
+ /**
3042
+ * Returns one `TagInventoryRow` per `(tag, project)` pair observed in
3043
+ * each project's latest test run. When `project` is supplied, results
3044
+ * are restricted to that project's latest run.
3045
+ */
3046
+ readonly listTagInventory: (options?: {
3047
+ readonly project?: string;
3048
+ }) => Effect.Effect<ReadonlyArray<TagInventoryRow>, DataStoreError>;
3049
+ /**
3050
+ * Returns every `TestListEntry` from the latest run of each project
3051
+ * (or the specified project) whose test case carries `tag`.
3052
+ */
3053
+ readonly listTestsForTag: (tag: string, options?: {
3054
+ readonly project?: string;
3055
+ }) => Effect.Effect<ReadonlyArray<TestListEntry>, DataStoreError>;
3056
+ }>;
3057
+ /** @public */
3058
+ declare class DataReader extends DataReader_base {}
1244
3059
  //#endregion
1245
3060
  //#region src/layers/DataReaderLive.d.ts
1246
3061
  /** @public */
@@ -1431,7 +3246,7 @@ declare function resolveLogFile(option?: string): string | undefined;
1431
3246
  //#endregion
1432
3247
  //#region src/layers/OutputPipelineLive.d.ts
1433
3248
  /** @public */
1434
- declare const OutputPipelineLive: Layer.Layer<EnvironmentDetector | DetailResolver | ExecutorResolver | FormatSelector | OutputRenderer, never, never>;
3249
+ declare const OutputPipelineLive: Layer.Layer<DetailResolver | EnvironmentDetector | ExecutorResolver | FormatSelector | OutputRenderer, never, never>;
1435
3250
  //#endregion
1436
3251
  //#region src/services/OutputRenderer.d.ts
1437
3252
  declare const OutputRenderer_base: Context.TagClass<OutputRenderer, "vitest-agent/OutputRenderer", {
@@ -1458,7 +3273,7 @@ declare const OutputRendererLive: Layer.Layer<OutputRenderer, never, never>;
1458
3273
  * anchor the config file resolvers.
1459
3274
  * @public
1460
3275
  */
1461
- declare const PathResolutionLive: (projectDir: string) => Layer.Layer<VitestAgentConfigFileService | import("workspaces-effect").WorkspaceDiscovery | import("xdg-effect").XdgResolver | import("xdg-effect").AppDirs, never, import("@effect/platform/FileSystem").FileSystem | import("@effect/platform/Path").Path>;
3276
+ declare const PathResolutionLive: (projectDir: string) => Layer.Layer<import("xdg-effect").AppDirs | VitestAgentConfigFileService | import("workspaces-effect").WorkspaceDiscovery | import("xdg-effect").XdgResolver, never, import("@effect/platform/FileSystem").FileSystem | import("@effect/platform/Path").Path>;
1462
3277
  //#endregion
1463
3278
  //#region src/services/PerClientSessionMap.d.ts
1464
3279
  /** @public */
@@ -1710,12 +3525,12 @@ declare const RunContext_base: Schema.Class<RunContext, {
1710
3525
  readonly gitUpstream: string | null;
1711
3526
  } & {
1712
3527
  readonly gitWorktreeDir: string | null;
3528
+ } & {
3529
+ readonly hostMetadata: unknown;
1713
3530
  } & {
1714
3531
  readonly hostSource: string | null;
1715
3532
  } & {
1716
3533
  readonly hostValue: string | null;
1717
- } & {
1718
- readonly hostMetadata: unknown;
1719
3534
  }, {}, {}>;
1720
3535
  /**
1721
3536
  * Per-run snapshot of the workspace's git state and host context.
@@ -2088,6 +3903,40 @@ declare const BehaviorScopedEventTypes: readonly ["behavior_started", "phase_tra
2088
3903
  /** @public */
2089
3904
  type BehaviorScopedEventType = (typeof BehaviorScopedEventTypes)[number];
2090
3905
  //#endregion
3906
+ //#region src/schemas/ConsoleLeaks.d.ts
3907
+ /**
3908
+ * Per-file stray-console-output detail. Counts are of console writes
3909
+ * (one `console.*` call), not lines.
3910
+ * @public
3911
+ */
3912
+ declare const ConsoleLeakFile: Schema.Struct<{
3913
+ file: typeof Schema.String;
3914
+ stdout: typeof Schema.Number;
3915
+ stderr: typeof Schema.Number;
3916
+ tests: Schema.optional<Schema.Array$<typeof Schema.String>>;
3917
+ sample: Schema.optional<typeof Schema.String>;
3918
+ }>;
3919
+ /** @public */
3920
+ type ConsoleLeakFile = typeof ConsoleLeakFile.Type;
3921
+ /**
3922
+ * Aggregate stray-console-output signal for a single test run. Omitted from
3923
+ * a report entirely when the run produced no user console output.
3924
+ * @public
3925
+ */
3926
+ declare const ConsoleLeaks: Schema.Struct<{
3927
+ total: typeof Schema.Number;
3928
+ byFile: Schema.Array$<Schema.Struct<{
3929
+ file: typeof Schema.String;
3930
+ stdout: typeof Schema.Number;
3931
+ stderr: typeof Schema.Number;
3932
+ tests: Schema.optional<Schema.Array$<typeof Schema.String>>;
3933
+ sample: Schema.optional<typeof Schema.String>;
3934
+ }>>;
3935
+ truncated: Schema.optional<typeof Schema.Boolean>;
3936
+ }>;
3937
+ /** @public */
3938
+ type ConsoleLeaks = typeof ConsoleLeaks.Type;
3939
+ //#endregion
2091
3940
  //#region src/schemas/CoverageLevel.d.ts
2092
3941
  declare const CoverageLevel_base: Schema.Class<CoverageLevel, {
2093
3942
  lines: typeof Schema.Number;
@@ -2102,15 +3951,15 @@ declare const CoverageLevel_base: Schema.Class<CoverageLevel, {
2102
3951
  statements: typeof Schema.Number;
2103
3952
  perFile: Schema.optional<typeof Schema.Boolean>;
2104
3953
  }>, never, {
2105
- readonly lines: number;
3954
+ readonly perFile?: boolean | undefined;
3955
+ } & {
3956
+ readonly branches: number;
2106
3957
  } & {
2107
3958
  readonly functions: number;
2108
3959
  } & {
2109
- readonly branches: number;
3960
+ readonly lines: number;
2110
3961
  } & {
2111
3962
  readonly statements: number;
2112
- } & {
2113
- readonly perFile?: boolean | undefined;
2114
3963
  }, {}, {}>;
2115
3964
  /**
2116
3965
  * A coverage level configuration with per-metric thresholds and an optional
@@ -2796,6 +4645,53 @@ declare function getRecentDirection(record: TrendRecord, count?: number): {
2796
4645
  runCount: number;
2797
4646
  };
2798
4647
  //#endregion
4648
+ //#region src/utils/console-leaks.d.ts
4649
+ /**
4650
+ * A single captured stray console write, attributed to a file (and a test
4651
+ * when the write happened inside one). Fed to buildConsoleLeaks.
4652
+ * @public
4653
+ */
4654
+ interface ConsoleLeakEntry {
4655
+ readonly file: string;
4656
+ readonly test?: string;
4657
+ readonly type: "stdout" | "stderr";
4658
+ readonly content: string;
4659
+ }
4660
+ /**
4661
+ * Aggregate raw console-leak entries into a ConsoleLeaks signal:
4662
+ * bucket by file, split stdout/stderr, collect attributable test names,
4663
+ * capture one truncated sample per file, sort by total writes descending,
4664
+ * and cap the file list. Returns `undefined` when there are no entries so a
4665
+ * clean run attaches nothing.
4666
+ * @public
4667
+ */
4668
+ declare function buildConsoleLeaks(entries: ReadonlyArray<ConsoleLeakEntry>): ConsoleLeaks | undefined;
4669
+ /**
4670
+ * Structural subset of a Vitest runner task (File / Suite / Test) carrying
4671
+ * captured console output. Modeled locally so this util needs no `vitest`
4672
+ * dependency. `logs` is attached to tasks by Vitest's console interception
4673
+ * regardless of which reporter is active, which is why the walk survives
4674
+ * reporter stripping in agent mode.
4675
+ * @public
4676
+ */
4677
+ interface ConsoleLeakTask {
4678
+ readonly type?: string;
4679
+ readonly name?: string;
4680
+ readonly fullTestName?: string;
4681
+ readonly logs?: ReadonlyArray<{
4682
+ readonly type: "stdout" | "stderr";
4683
+ readonly content: string;
4684
+ }>;
4685
+ readonly tasks?: ReadonlyArray<ConsoleLeakTask>;
4686
+ }
4687
+ /**
4688
+ * Walk a Vitest `File[]` task tree (from `vitest.state.getFiles()`) into flat
4689
+ * {@link ConsoleLeakEntry} values. Each task `log` becomes one entry attributed
4690
+ * to its enclosing file and, when the log sits on a test task, that test's name.
4691
+ * @public
4692
+ */
4693
+ declare function collectConsoleLeakEntries(files: ReadonlyArray<ConsoleLeakTask>): ConsoleLeakEntry[];
4694
+ //#endregion
2799
4695
  //#region src/utils/detect-pm.d.ts
2800
4696
  /**
2801
4697
  * Filesystem abstraction for package manager detection.
@@ -3212,7 +5108,7 @@ interface ResolveDataPathOptions {
3212
5108
  * @param options - Optional programmatic overrides.
3213
5109
  * @public
3214
5110
  */
3215
- declare const resolveDataPath: (projectDir: string, options?: ResolveDataPathOptions) => Effect.Effect<any, import("config-file-effect").ConfigError | import("xdg-effect").AppDirsError, import("config-file-effect").ConfigFileService<VitestAgentConfig> | AppDirs>;
5111
+ declare const resolveDataPath: (projectDir: string, options?: ResolveDataPathOptions) => Effect.Effect<any, import("xdg-effect").AppDirsError | import("config-file-effect").ConfigError, AppDirs | import("config-file-effect").ConfigFileService<VitestAgentConfig>>;
3216
5112
  //#endregion
3217
5113
  //#region src/utils/resolve-project-key-from-cwd.d.ts
3218
5114
  /**
@@ -3324,11 +5220,10 @@ declare function validateCoverageTargetsShape(input: unknown): CoverageTargetsSh
3324
5220
  * package.json#version via rslib-builder's __PACKAGE_VERSION__ substitution.
3325
5221
  * Source-level reads (workspace `exports: "./src/index.ts"` during dev)
3326
5222
  * see the `"0.0.0"` fallback — a clear signal the build pipeline has not
3327
- * substituted yet. Read by the plugin / MCP / CLI init-time drift check.
3328
- * See the root CLAUDE.md "Cross-package version drift" section.
5223
+ * substituted yet. Exported for version introspection by downstream tooling.
3329
5224
  * @public
3330
5225
  */
3331
5226
  declare const CURRENT_SDK_VERSION: string;
3332
5227
  //#endregion
3333
- 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, CommitChangesEntry, ConfigLive, ConsoleFormatOptions, 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, 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, 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, SessionCompleteEvent, SessionContextRow, SessionDetail, SessionInput, SessionNotFoundError, SessionOutcome, SettingsInput, SettingsListEntry, SettingsRow, SidecarTimeoutError, SilentFormatter, StackFrameInput, SuggestedActionRecord, SuiteInput, SuiteListEntry, TagCountEntry, TagInventoryRow, TddArtifactDetail, TddArtifactRow, TddPhaseDetail, TddTaskAlreadyEndedError, TddTaskDetail, TddTaskEndOutcome, TddTaskId, TddTaskInput, TddTaskNotFoundError, TddTaskSummary, TerminalFormatter, TestCaseInput, TestClassification, TestError, TestErrorInput, TestFileEntry, TestHistory, TestListEntry, TestOutcome, 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, type WrapupKind, WriteCommitInput, WriteRunChangedFilesInput, WriteTddArtifactInput, WriteTddPhaseInput, WriteTddPhaseOutput, _resetMigrationCacheForTesting, ansi, assembleHistoryRecord, assembleManifest, buildAgentReport, buildEnvPrefix, canonicalizeGitUrl, ciAnnotationsFormatter, classifyTest, compressLines, computeFailureSignature, computeTrend, deriveIdempotencyKey, detectPackageManager, detectVitestScripts, determineTier, ensureMigrated, extractSqlReason, findFunctionBoundary, formatConsoleMarkdown, formatFatalError, formatGfm, formatTriageEffect, formatWrapupEffect, getRecentDirection, getRunCommand, getWorstMetric, gitUrlToProjectKey, hashTargets, initialRenderState, 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, validateCoverageConfig, validateCoverageTargetsShape, validatePhaseTransition };
5228
+ 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, 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, 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, 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, SessionCompleteEvent, SessionContextRow, SessionDetail, SessionInput, SessionNotFoundError, SessionOutcome, SettingsInput, SettingsListEntry, SettingsRow, SidecarTimeoutError, SilentFormatter, StackFrameInput, SuggestedActionRecord, SuiteInput, SuiteListEntry, TagCountEntry, TagInventoryRow, TddArtifactDetail, TddArtifactRow, TddPhaseDetail, TddTaskAlreadyEndedError, TddTaskDetail, TddTaskEndOutcome, TddTaskId, TddTaskInput, TddTaskNotFoundError, TddTaskSummary, TerminalFormatter, TestCaseInput, TestClassification, TestError, TestErrorInput, TestFileEntry, TestHistory, TestListEntry, TestOutcome, 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, type WrapupKind, WriteCommitInput, WriteRunChangedFilesInput, WriteTddArtifactInput, WriteTddPhaseInput, WriteTddPhaseOutput, _resetMigrationCacheForTesting, ansi, assembleHistoryRecord, assembleManifest, buildAgentReport, buildConsoleLeaks, buildEnvPrefix, canonicalizeGitUrl, ciAnnotationsFormatter, classifyTest, collectConsoleLeakEntries, compressLines, computeFailureSignature, computeTrend, deriveIdempotencyKey, detectPackageManager, detectVitestScripts, determineTier, ensureMigrated, extractSqlReason, findFunctionBoundary, formatConsoleMarkdown, formatFatalError, formatGfm, formatTriageEffect, formatWrapupEffect, getRecentDirection, getRunCommand, getWorstMetric, gitUrlToProjectKey, hashTargets, initialRenderState, 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, validateCoverageConfig, validateCoverageTargetsShape, validatePhaseTransition };
3334
5229
  //# sourceMappingURL=index.d.ts.map