@vitest-agent/sdk 1.0.1 → 1.2.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,1417 @@ 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
+ /**
2149
+ * Whether D2 binding rule 2 (behavior-match) applies to a given transition.
2150
+ *
2151
+ * Only the transitions whose cited evidence must belong to the behavior being
2152
+ * transitioned enforce behavior-match: `red→green` (the failing test for this
2153
+ * behavior) and `green→refactor` (its passing test). It deliberately excludes
2154
+ * `red.triangulate→green` (the cited failing run belongs to an earlier batch
2155
+ * behavior) and `refactor→red` (the required `test_passed_run` is the
2156
+ * just-finished behavior's, never the new target). Exported so the MCP
2157
+ * `tdd_phase_transition_request` tool scopes artifact auto-resolution by
2158
+ * behavior on exactly the same transitions the validator will accept —
2159
+ * keeping the two in lockstep (issue #115).
2160
+ * @public
2161
+ */
2162
+ declare const transitionEnforcesBehaviorMatch: (from: Phase, to: Phase) => boolean;
2163
+ /** @public */
2164
+ declare const validatePhaseTransition: (ctx: PhaseTransitionContext) => PhaseTransitionResult;
2165
+ //#endregion
2166
+ //#region src/schemas/Agent.d.ts
2167
+ declare const Agent_base: Schema.TaggedClass<Agent, "Agent", {
2168
+ readonly _tag: Schema.tag<"Agent">;
2169
+ } & {
2170
+ agentId: Schema.brand<typeof Schema.UUID, "AgentId">;
2171
+ sessionId: typeof Schema.Number;
2172
+ parentAgentId: Schema.NullOr<Schema.brand<typeof Schema.UUID, "AgentId">>;
2173
+ conversationId: Schema.NullOr<Schema.brand<typeof Schema.UUID, "ConversationId">>;
2174
+ agentType: typeof Schema.String;
2175
+ startedAt: typeof Schema.Number;
2176
+ endedAt: Schema.NullOr<typeof Schema.Number>;
2177
+ startGitBranch: Schema.NullOr<typeof Schema.String>;
2178
+ startGitCommitSha: Schema.NullOr<typeof Schema.String>;
2179
+ startWorktreeDir: Schema.NullOr<typeof Schema.String>;
2180
+ idempotencyKey: typeof Schema.String;
2181
+ }>;
2182
+ /**
2183
+ * Successful registration row. The fields mirror the `agents` SQLite
2184
+ * table 1:1 in camelCase.
2185
+ *
2186
+ * `startGitBranch`, `startGitCommitSha`, `startWorktreeDir` capture
2187
+ * *what the agent inherited at registration time* — distinct from the
2188
+ * per-run git context recorded on `runs`. A divergence between the
2189
+ * two reveals a mid-session branch switch, which is itself signal.
2190
+ * @public
2191
+ */
2192
+ declare class Agent extends Agent_base {}
2193
+ 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> & {
2194
+ readonly _tag: "IdempotencyHit";
2195
+ };
2196
+ /**
2197
+ * Returned by `DataStore.registerAgent` when the
2198
+ * `(session_id, idempotency_key)` UNIQUE constraint already has a
2199
+ * row. Not an error — the caller treats it as a successful recovery
2200
+ * of the existing `agentId`.
2201
+ *
2202
+ * Modeled as a `Data.TaggedClass` so the success channel of
2203
+ * `registerAgent` is `Effect<Agent | IdempotencyHit, ...>` and
2204
+ * downstream code uses `Match.tag` to branch.
2205
+ * @public
2206
+ */
2207
+ declare class IdempotencyHit extends IdempotencyHit_base<{
2208
+ readonly existingAgentId: typeof AgentId.Type;
2209
+ }> {}
2210
+ /**
2211
+ * Sum type of the two possible outcomes of `registerAgent`.
2212
+ * @public
2213
+ */
2214
+ type RegisterAgentResult = Agent | IdempotencyHit;
2215
+ /**
2216
+ * Agent tree — root agent with all descendants nested under
2217
+ * `children`. Returned by `DataStore.getAgentTree` for forensics and
2218
+ * the `vitest-agent agent list` CLI subcommand.
2219
+ * @public
2220
+ */
2221
+ interface AgentTreeNode {
2222
+ readonly agent: Agent;
2223
+ readonly children: ReadonlyArray<AgentTreeNode>;
2224
+ }
2225
+ //#endregion
2226
+ //#region src/services/DataStore.d.ts
2227
+ /** @public */
2228
+ interface CreateGoalInput {
2229
+ readonly tddTaskId: number;
2230
+ readonly goal: string;
2231
+ }
2232
+ /** @public */
2233
+ interface UpdateGoalInput {
2234
+ readonly id: number;
2235
+ readonly goal?: string;
2236
+ readonly status?: GoalStatus;
2237
+ }
2238
+ /** @public */
2239
+ interface CreateBehaviorInput {
2240
+ readonly goalId: number;
2241
+ readonly behavior: string;
2242
+ readonly suggestedTestName?: string;
2243
+ readonly dependsOnBehaviorIds?: ReadonlyArray<number>;
2244
+ }
2245
+ /** @public */
2246
+ interface UpdateBehaviorInput {
2247
+ readonly id: number;
2248
+ readonly behavior?: string;
2249
+ readonly suggestedTestName?: string | null;
2250
+ readonly status?: BehaviorStatus;
2251
+ readonly dependsOnBehaviorIds?: ReadonlyArray<number>;
2252
+ }
2253
+ /** @public */
2254
+ interface SettingsInput {
2255
+ readonly vitestVersion: string;
2256
+ readonly pool?: string;
2257
+ readonly environment?: string;
2258
+ readonly testTimeout?: number;
2259
+ readonly hookTimeout?: number;
2260
+ readonly slowTestThreshold?: number;
2261
+ readonly maxConcurrency?: number;
2262
+ readonly maxWorkers?: number;
2263
+ readonly isolate?: boolean;
2264
+ readonly bail?: number;
2265
+ readonly globals?: boolean;
2266
+ readonly fileParallelism?: boolean;
2267
+ readonly sequenceSeed?: number;
2268
+ readonly coverageProvider?: string;
2269
+ }
2270
+ /** @public */
2271
+ interface TestRunInput {
2272
+ readonly invocationId: string;
2273
+ readonly project: string;
2274
+ readonly settingsHash: string;
2275
+ readonly timestamp: string;
2276
+ readonly commitSha: string | null;
2277
+ readonly branch: string | null;
2278
+ readonly reason: "passed" | "failed" | "interrupted";
2279
+ readonly duration: number;
2280
+ readonly total: number;
2281
+ readonly passed: number;
2282
+ readonly failed: number;
2283
+ readonly skipped: number;
2284
+ readonly scoped: boolean;
2285
+ readonly snapshotAdded?: number;
2286
+ readonly snapshotMatched?: number;
2287
+ readonly snapshotUnmatched?: number;
2288
+ readonly snapshotUpdated?: number;
2289
+ readonly snapshotUnchecked?: number;
2290
+ readonly snapshotTotal?: number;
2291
+ readonly snapshotFailure?: boolean;
2292
+ readonly snapshotDidUpdate?: boolean;
2293
+ readonly snapshotFilesAdded?: number;
2294
+ readonly snapshotFilesRemoved?: number;
2295
+ readonly snapshotFilesUnmatched?: number;
2296
+ readonly snapshotFilesUpdated?: number;
2297
+ /**
2298
+ * Attribution columns added by the agent-agnostic taxonomy work. The
2299
+ * reporter walks env vars / session map to populate these; un-attributed
2300
+ * runs default to actor_type='system' and NULL agent/conversation ids.
2301
+ */
2302
+ readonly actorType?: "agent" | "user" | "system";
2303
+ readonly agentId?: string | null;
2304
+ readonly conversationId?: string | null;
2305
+ /**
2306
+ * Git context the run executed against. NULL for non-git workspaces.
2307
+ */
2308
+ readonly gitBranch?: string | null;
2309
+ readonly gitCommitSha?: string | null;
2310
+ readonly gitDirty?: boolean | null;
2311
+ readonly gitUpstream?: string | null;
2312
+ readonly gitWorktreeDir?: string | null;
2313
+ /**
2314
+ * Host metadata probe result (terminal pane, CI runner). NULL when no
2315
+ * probe in the priority chain matched.
2316
+ * @public
2317
+ */
2318
+ readonly hostSource?: string | null;
2319
+ readonly hostValue?: string | null;
2320
+ readonly hostMetadata?: Record<string, unknown> | null;
2321
+ }
2322
+ /** @public */
2323
+ interface ModuleInput {
2324
+ readonly fileId: number;
2325
+ readonly relativeModuleId: string;
2326
+ readonly state: string;
2327
+ readonly duration?: number;
2328
+ readonly environmentSetupDuration?: number;
2329
+ readonly prepareDuration?: number;
2330
+ readonly collectDuration?: number;
2331
+ readonly setupDuration?: number;
2332
+ readonly heap?: number;
2333
+ }
2334
+ /** @public */
2335
+ interface TestCaseInput {
2336
+ readonly suiteId?: number;
2337
+ readonly vitestId?: string;
2338
+ readonly name: string;
2339
+ readonly fullName: string;
2340
+ readonly state: string;
2341
+ readonly classification?: string;
2342
+ readonly duration?: number;
2343
+ readonly startTime?: number;
2344
+ readonly flaky?: boolean;
2345
+ readonly slow?: boolean;
2346
+ readonly retryCount?: number;
2347
+ readonly repeatCount?: number;
2348
+ readonly heap?: number;
2349
+ readonly mode?: string;
2350
+ readonly each?: boolean;
2351
+ readonly fails?: boolean;
2352
+ readonly concurrent?: boolean;
2353
+ readonly shuffle?: boolean;
2354
+ readonly timeout?: number;
2355
+ readonly skipNote?: string;
2356
+ readonly locationLine?: number;
2357
+ readonly locationColumn?: number;
2358
+ readonly tags?: readonly string[];
2359
+ /**
2360
+ * FK to `turns(id)`. Set by the reporter when the test case row was
2361
+ * authored within a recorded turn (D2 binding rule 1).
2362
+ * @public
2363
+ */
2364
+ readonly createdTurnId?: number;
2365
+ }
2366
+ /** @public */
2367
+ interface StackFrameInput {
2368
+ readonly ordinal: number;
2369
+ readonly method: string | null;
2370
+ readonly filePath: string;
2371
+ readonly line: number;
2372
+ readonly col: number;
2373
+ readonly sourceMappedLine?: number;
2374
+ readonly functionBoundaryLine?: number;
2375
+ }
2376
+ /** @public */
2377
+ interface TestErrorInput {
2378
+ readonly testCaseId?: number;
2379
+ readonly testSuiteId?: number;
2380
+ readonly moduleId?: number;
2381
+ readonly scope: "test" | "suite" | "module" | "unhandled";
2382
+ readonly name?: string;
2383
+ readonly message: string;
2384
+ readonly diff?: string;
2385
+ readonly actual?: string;
2386
+ readonly expected?: string;
2387
+ readonly stack?: string;
2388
+ readonly causeErrorId?: number;
2389
+ readonly signatureHash?: string;
2390
+ readonly frames?: ReadonlyArray<StackFrameInput>;
2391
+ readonly ordinal?: number;
2392
+ }
2393
+ /** @public */
2394
+ interface FileCoverageInput {
2395
+ readonly fileId: number;
2396
+ readonly statements: number;
2397
+ readonly branches: number;
2398
+ readonly functions: number;
2399
+ readonly lines: number;
2400
+ readonly uncoveredLines?: string;
2401
+ /**
2402
+ * Coverage tier this row represents. `'below_threshold'` is the
2403
+ * build-failing tier (file falls below the configured minimum
2404
+ * coverage thresholds). `'below_target'` is the warning tier (file
2405
+ * is above thresholds but below the aspirational target).
2406
+ *
2407
+ * Defaults to `'below_threshold'` when omitted, matching the only
2408
+ * tier that existed before migration 0005.
2409
+ * @public
2410
+ */
2411
+ readonly tier?: "below_threshold" | "below_target";
2412
+ }
2413
+ /** @public */
2414
+ interface SuiteInput {
2415
+ readonly parentSuiteId?: number;
2416
+ readonly name: string;
2417
+ readonly fullName: string;
2418
+ readonly state: "pending" | "passed" | "failed" | "skipped";
2419
+ readonly mode?: "run" | "only" | "skip" | "todo";
2420
+ readonly concurrent?: boolean;
2421
+ readonly shuffle?: boolean;
2422
+ readonly retry?: number;
2423
+ readonly repeats?: number;
2424
+ readonly locationLine?: number;
2425
+ readonly locationColumn?: number;
2426
+ }
2427
+ /** @public */
2428
+ interface NoteInput {
2429
+ readonly title: string;
2430
+ readonly content: string;
2431
+ readonly scope: "global" | "project" | "module" | "suite" | "test" | "note";
2432
+ readonly project?: string;
2433
+ readonly testFullName?: string;
2434
+ readonly modulePath?: string;
2435
+ readonly parentNoteId?: number;
2436
+ readonly createdBy?: string;
2437
+ readonly expiresAt?: string;
2438
+ readonly pinned?: boolean;
2439
+ }
2440
+ /** @public */
2441
+ interface SessionInput {
2442
+ readonly chatId: string;
2443
+ readonly project: string;
2444
+ readonly cwd: string;
2445
+ readonly agentKind: "main" | "subagent";
2446
+ readonly agentType?: string;
2447
+ readonly parentSessionId?: number;
2448
+ readonly triageWasNonEmpty?: boolean;
2449
+ readonly startedAt: string;
2450
+ }
2451
+ /** @public */
2452
+ interface TurnInput {
2453
+ readonly sessionId: number;
2454
+ /** When omitted, writeTurn computes MAX(turnNo) + 1 for the session. */
2455
+ readonly turnNo?: number;
2456
+ readonly type: "user_prompt" | "tool_call" | "tool_result" | "file_edit" | "hook_fire" | "note" | "hypothesis";
2457
+ readonly payload: string;
2458
+ readonly occurredAt: string;
2459
+ }
2460
+ /** @public */
2461
+ interface FailureSignatureWriteInput {
2462
+ readonly signatureHash: string;
2463
+ readonly runId: number;
2464
+ readonly seenAt: string;
2465
+ }
2466
+ /** @public */
2467
+ interface HypothesisInput {
2468
+ readonly sessionId: number;
2469
+ readonly content: string;
2470
+ readonly createdTurnId?: number;
2471
+ readonly citedTestErrorId?: number;
2472
+ readonly citedStackFrameId?: number;
2473
+ }
2474
+ /** @public */
2475
+ interface ValidateHypothesisInput {
2476
+ readonly id: number;
2477
+ readonly outcome: "confirmed" | "refuted" | "abandoned";
2478
+ readonly validatedTurnId?: number;
2479
+ readonly validatedAt: string;
2480
+ }
2481
+ /** @public */
2482
+ interface IdempotentResponseInput {
2483
+ readonly procedurePath: string;
2484
+ readonly key: string;
2485
+ readonly resultJson: string;
2486
+ readonly createdAt: string;
2487
+ }
2488
+ /** @public */
2489
+ interface TddTaskInput {
2490
+ readonly sessionId: number;
2491
+ readonly goal: string;
2492
+ readonly startedAt: string;
2493
+ readonly parentTddTaskId?: number;
2494
+ readonly runId?: string;
2495
+ }
2496
+ /** @public */
2497
+ interface EndTddTaskInput {
2498
+ readonly id: number;
2499
+ readonly endedAt: string;
2500
+ readonly outcome: "succeeded" | "blocked" | "abandoned";
2501
+ readonly summaryNoteId?: number;
2502
+ }
2503
+ /** @public */
2504
+ interface WriteTddPhaseInput {
2505
+ readonly tddTaskId: number;
2506
+ readonly behaviorId?: number;
2507
+ readonly phase: Phase;
2508
+ readonly startedAt: string;
2509
+ readonly transitionReason?: string;
2510
+ readonly parentPhaseId?: number;
2511
+ }
2512
+ /** @public */
2513
+ interface WriteTddPhaseOutput {
2514
+ readonly id: number;
2515
+ readonly previousPhaseId: number | null;
2516
+ }
1141
2517
  /** @public */
1142
- declare const ciAnnotationsFormatter: Formatter;
1143
- //#endregion
1144
- //#region src/formatters/gfm.d.ts
2518
+ interface WriteTddArtifactInput {
2519
+ readonly phaseId: number;
2520
+ readonly artifactKind: ArtifactKind;
2521
+ readonly fileId?: number;
2522
+ readonly testCaseId?: number;
2523
+ readonly testRunId?: number;
2524
+ readonly testFirstFailureRunId?: number;
2525
+ readonly diffExcerpt?: string;
2526
+ readonly recordedAt: string;
2527
+ }
1145
2528
  /** @public */
1146
- declare const GfmFormatter: Formatter;
1147
- //#endregion
1148
- //#region src/formatters/json.d.ts
2529
+ interface WriteCommitInput {
2530
+ readonly sha: string;
2531
+ readonly parentSha?: string;
2532
+ readonly message?: string;
2533
+ readonly author?: string;
2534
+ readonly committedAt?: string;
2535
+ readonly branch?: string;
2536
+ }
1149
2537
  /** @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
2538
+ type ChangeKind = "added" | "modified" | "deleted" | "renamed" | "untracked-modified";
1167
2539
  /** @public */
1168
- declare const SilentFormatter: Formatter;
1169
- //#endregion
1170
- //#region src/formatters/terminal.d.ts
2540
+ interface RunChangedFile {
2541
+ readonly filePath: string;
2542
+ readonly changeKind: ChangeKind;
2543
+ readonly commitSha?: string;
2544
+ }
1171
2545
  /** @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
- }, {}, {}>;
2546
+ interface WriteRunChangedFilesInput {
2547
+ readonly runId: number;
2548
+ readonly files: ReadonlyArray<RunChangedFile>;
2549
+ }
2550
+ /** @public */
2551
+ type RunInvocationMethod = "bash" | "mcp" | "cli";
1186
2552
  /**
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.
2553
+ * Input to `DataStore.registerAgent`.
1192
2554
  *
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.
2555
+ * `sessionId` is the FK to `sessions.id` (integer PK), NOT the host's
2556
+ * chat UUID string. Callers that hold only the chat UUID must resolve
2557
+ * it through `getSessionByChatId` first.
1216
2558
  *
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)`.
2559
+ * `idempotencyKey` is pre-derived by the caller via
2560
+ * `deriveIdempotencyKey(...)` — both the sidecar CLI and the MCP
2561
+ * server compute it the same way so a hook retry collapses to the
2562
+ * same row.
1220
2563
  * @public
1221
2564
  */
1222
- declare const VitestAgentConfigFile: import("effect/Context").Tag<ConfigFileService<VitestAgentConfig>, ConfigFileService<VitestAgentConfig>>;
2565
+ interface RegisterAgentInput {
2566
+ readonly sessionId: number;
2567
+ readonly agentType: string;
2568
+ readonly parentAgentId: string | null;
2569
+ readonly conversationId: string | null;
2570
+ readonly startedAt: number;
2571
+ readonly startGitBranch?: string;
2572
+ readonly startGitCommitSha?: string;
2573
+ readonly startWorktreeDir?: string;
2574
+ readonly idempotencyKey: string;
2575
+ /**
2576
+ * Pre-allocated `agents.agent_id` UUID. The sidecar passes
2577
+ * `PerClientSessionMapWriter.mapSession()`'s `main_agent_id` here so
2578
+ * the per-project `agents` row and the per-client session_map row
2579
+ * agree on a single canonical id — the same value the SessionStart
2580
+ * hook exports as `VITEST_AGENT_MAIN_AGENT_ID` / `_AGENT_ID`. When
2581
+ * omitted, the implementation generates a fresh UUID (used by tests
2582
+ * and any caller without a session map).
2583
+ */
2584
+ readonly agentId?: string;
2585
+ }
2586
+ /** @public */
2587
+ interface AssociateRunSessionInput {
2588
+ readonly chatId: string;
2589
+ readonly invocationMethod: RunInvocationMethod;
2590
+ }
2591
+ declare const DataStore_base: Context.TagClass<DataStore, "vitest-agent/DataStore", {
2592
+ readonly writeSettings: (hash: string, settings: SettingsInput, envVars: Record<string, string>) => Effect.Effect<void, DataStoreError>;
2593
+ readonly writeRun: (input: TestRunInput) => Effect.Effect<number, DataStoreError>;
2594
+ readonly writeModules: (runId: number, modules: ReadonlyArray<ModuleInput>) => Effect.Effect<ReadonlyArray<number>, DataStoreError>;
2595
+ readonly writeSuites: (moduleId: number, suites: ReadonlyArray<SuiteInput>) => Effect.Effect<ReadonlyArray<number>, DataStoreError>;
2596
+ readonly writeTestCases: (moduleId: number, tests: ReadonlyArray<TestCaseInput>) => Effect.Effect<ReadonlyArray<number>, DataStoreError>;
2597
+ readonly writeErrors: (runId: number, errors: ReadonlyArray<TestErrorInput>) => Effect.Effect<void, DataStoreError>;
2598
+ readonly writeCoverage: (runId: number, coverage: ReadonlyArray<FileCoverageInput>) => Effect.Effect<void, DataStoreError>;
2599
+ 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>;
2600
+ readonly writeBaselines: (baselines: CoverageBaselines) => Effect.Effect<void, DataStoreError>;
2601
+ readonly writeTrends: (project: string, runId: number, entry: TrendEntry) => Effect.Effect<void, DataStoreError>;
2602
+ readonly writeSourceMap: (sourceFilePath: string, testModuleId: number, mappingType: string) => Effect.Effect<void, DataStoreError>;
2603
+ readonly ensureFile: (filePath: string) => Effect.Effect<number, DataStoreError>;
2604
+ readonly writeNote: (note: NoteInput) => Effect.Effect<number, DataStoreError>;
2605
+ readonly updateNote: (id: number, fields: Partial<NoteInput>) => Effect.Effect<void, DataStoreError>;
2606
+ readonly deleteNote: (id: number) => Effect.Effect<void, DataStoreError>;
2607
+ readonly writeSession: (input: SessionInput) => Effect.Effect<number, DataStoreError>;
2608
+ /**
2609
+ * Idempotent variant of `writeSession`: if a row with this
2610
+ * `chat_id` already exists, return its id and leave the stored
2611
+ * fields untouched; otherwise insert a new row. Used by
2612
+ * hook-triggered recording paths (artifacts, turns) that fire
2613
+ * for sessions whose original `SessionStart` may have missed —
2614
+ * e.g. when Claude Code rotates `chat_id` mid-window after a
2615
+ * continuation or compaction. Race-safe via
2616
+ * `INSERT ... ON CONFLICT DO NOTHING`.
2617
+ */
2618
+ readonly upsertSession: (input: SessionInput) => Effect.Effect<number, DataStoreError>;
2619
+ readonly writeTurn: (input: TurnInput) => Effect.Effect<number, DataStoreError>;
2620
+ readonly writeFailureSignature: (input: FailureSignatureWriteInput) => Effect.Effect<void, DataStoreError>;
2621
+ readonly endSession: (chatId: string, endedAt: string, endReason: string | null) => Effect.Effect<void, DataStoreError>;
2622
+ readonly writeHypothesis: (input: HypothesisInput) => Effect.Effect<number, DataStoreError>;
2623
+ readonly validateHypothesis: (input: ValidateHypothesisInput) => Effect.Effect<void, DataStoreError>;
2624
+ readonly writeTddTask: (input: TddTaskInput) => Effect.Effect<number, DataStoreError>;
2625
+ readonly endTddTask: (input: EndTddTaskInput) => Effect.Effect<void, DataStoreError>;
2626
+ readonly createGoal: (input: CreateGoalInput) => Effect.Effect<GoalRow, DataStoreError | TddTaskNotFoundError | TddTaskAlreadyEndedError>;
2627
+ readonly getGoal: (id: number) => Effect.Effect<Option.Option<GoalRow>, DataStoreError>;
2628
+ readonly updateGoal: (input: UpdateGoalInput) => Effect.Effect<GoalRow, DataStoreError | GoalNotFoundError | TddTaskAlreadyEndedError | IllegalStatusTransitionError>;
2629
+ readonly deleteGoal: (id: number) => Effect.Effect<void, DataStoreError | GoalNotFoundError>;
2630
+ readonly listGoalsByTddTask: (tddTaskId: number) => Effect.Effect<ReadonlyArray<GoalRow>, DataStoreError | TddTaskNotFoundError>;
2631
+ readonly createBehavior: (input: CreateBehaviorInput) => Effect.Effect<BehaviorRow, DataStoreError | GoalNotFoundError | BehaviorNotFoundError | TddTaskAlreadyEndedError | IllegalStatusTransitionError>;
2632
+ readonly getBehavior: (id: number) => Effect.Effect<Option.Option<BehaviorRow>, DataStoreError>;
2633
+ readonly updateBehavior: (input: UpdateBehaviorInput) => Effect.Effect<BehaviorRow, DataStoreError | BehaviorNotFoundError | TddTaskAlreadyEndedError | IllegalStatusTransitionError>;
2634
+ readonly deleteBehavior: (id: number) => Effect.Effect<void, DataStoreError | BehaviorNotFoundError>;
2635
+ readonly listBehaviorsByGoal: (goalId: number) => Effect.Effect<ReadonlyArray<BehaviorRow>, DataStoreError | GoalNotFoundError>;
2636
+ readonly listBehaviorsByTddTask: (tddTaskId: number) => Effect.Effect<ReadonlyArray<BehaviorRow>, DataStoreError | TddTaskNotFoundError>;
2637
+ readonly writeTddPhase: (input: WriteTddPhaseInput) => Effect.Effect<WriteTddPhaseOutput, DataStoreError>;
2638
+ readonly writeTddArtifact: (input: WriteTddArtifactInput) => Effect.Effect<number, DataStoreError>;
2639
+ readonly writeCommit: (input: WriteCommitInput) => Effect.Effect<void, DataStoreError>;
2640
+ readonly writeRunChangedFiles: (input: WriteRunChangedFilesInput) => Effect.Effect<void, DataStoreError>;
2641
+ readonly recordIdempotentResponse: (input: IdempotentResponseInput) => Effect.Effect<void, DataStoreError>;
2642
+ readonly pruneSessions: (keepRecent: number) => Effect.Effect<{
2643
+ readonly affectedSessions: number;
2644
+ readonly prunedTurns: number;
2645
+ }, DataStoreError>;
2646
+ readonly associateLatestRunWithSession: (input: AssociateRunSessionInput) => Effect.Effect<void, DataStoreError>;
2647
+ readonly backfillTestCaseTurns: (chatId: string) => Effect.Effect<number, DataStoreError>;
2648
+ /**
2649
+ * Idempotently insert an `agents` row.
2650
+ *
2651
+ * Returns `Agent` on a fresh insert, or `IdempotencyHit` carrying
2652
+ * the existing `agentId` when the `(session_id, idempotency_key)`
2653
+ * UNIQUE constraint already has a row. The caller treats the latter
2654
+ * as a successful recovery (same logical agent), not an error.
2655
+ *
2656
+ * Fails with `RegistrationConflictError` when the supplied
2657
+ * `parentAgentId` references an agent in a different session, or
2658
+ * when no such agent exists. Surface to the caller for true
2659
+ * mis-configuration cases; idempotency hits never produce this.
2660
+ */
2661
+ readonly registerAgent: (input: RegisterAgentInput) => Effect.Effect<Agent | IdempotencyHit, RegistrationConflictError | DataStoreError>;
2662
+ /**
2663
+ * Mark an agent as ended. Sets `agents.ended_at` to the supplied
2664
+ * timestamp. Fails with `AgentNotFoundError` when no row exists.
2665
+ */
2666
+ readonly endAgent: (agentId: string, endedAt: number) => Effect.Effect<void, AgentNotFoundError | DataStoreError>;
2667
+ }>;
2668
+ /** @public */
2669
+ declare class DataStore extends DataStore_base {}
1223
2670
  //#endregion
1224
- //#region src/layers/ConfigLive.d.ts
2671
+ //#region src/services/DataReader.d.ts
2672
+ /** @public */
2673
+ interface ProjectRunSummary {
2674
+ readonly project: string;
2675
+ readonly lastRun: string | null;
2676
+ readonly lastResult: "passed" | "failed" | "interrupted" | null;
2677
+ readonly total: number;
2678
+ readonly passed: number;
2679
+ readonly failed: number;
2680
+ readonly skipped: number;
2681
+ }
2682
+ /** @public */
2683
+ interface FlakyTest {
2684
+ readonly fullName: string;
2685
+ readonly project: string;
2686
+ readonly passCount: number;
2687
+ readonly failCount: number;
2688
+ readonly lastState: "passed" | "failed";
2689
+ readonly lastTimestamp: string;
2690
+ }
2691
+ /** @public */
2692
+ interface PersistentFailure {
2693
+ readonly fullName: string;
2694
+ readonly project: string;
2695
+ readonly consecutiveFailures: number;
2696
+ readonly firstFailedAt: string;
2697
+ readonly lastFailedAt: string;
2698
+ readonly lastErrorMessage: string | null;
2699
+ }
2700
+ /** @public */
2701
+ interface TestError {
2702
+ /** `test_errors.id` — required by `hypothesis (action: record).citedTestErrorId`. */
2703
+ readonly id: number;
2704
+ /**
2705
+ * `stack_frames.id` for the top frame of this error (ordinal 0), or
2706
+ * `null` if no frames were captured. Required by
2707
+ * `hypothesis (action: record).citedStackFrameId`.
2708
+ */
2709
+ readonly topStackFrameId: number | null;
2710
+ readonly name: string | null;
2711
+ readonly message: string;
2712
+ readonly diff: string | null;
2713
+ readonly actual: string | null;
2714
+ readonly expected: string | null;
2715
+ readonly stack: string | null;
2716
+ readonly scope: "test" | "suite" | "module" | "unhandled";
2717
+ readonly testFullName: string | null;
2718
+ readonly moduleFile: string | null;
2719
+ }
2720
+ /** @public */
2721
+ interface NoteRow {
2722
+ readonly id: number;
2723
+ readonly title: string;
2724
+ readonly content: string;
2725
+ readonly scope: "global" | "project" | "module" | "suite" | "test" | "note";
2726
+ readonly project: string | null;
2727
+ readonly testFullName: string | null;
2728
+ readonly modulePath: string | null;
2729
+ readonly parentNoteId: number | null;
2730
+ readonly createdBy: string | null;
2731
+ readonly expiresAt: string | null;
2732
+ readonly pinned: boolean;
2733
+ readonly createdAt: string;
2734
+ readonly updatedAt: string;
2735
+ }
2736
+ /** @public */
2737
+ interface SettingsRow {
2738
+ readonly hash: string;
2739
+ readonly reporters: string | null;
2740
+ readonly coverageEnabled: boolean;
2741
+ readonly coverageProvider: string | null;
2742
+ readonly coverageThresholds: string | null;
2743
+ readonly coverageTargets: string | null;
2744
+ readonly pool: string | null;
2745
+ readonly shard: string | null;
2746
+ readonly project: string | null;
2747
+ readonly environment: string | null;
2748
+ readonly envVars: Record<string, string>;
2749
+ readonly capturedAt: string;
2750
+ }
2751
+ /** @public */
2752
+ interface TestListEntry {
2753
+ readonly id: number;
2754
+ readonly fullName: string;
2755
+ readonly state: string;
2756
+ readonly duration: number | null;
2757
+ readonly module: string;
2758
+ readonly classification: string | null;
2759
+ }
2760
+ /** @public */
2761
+ interface ModuleListEntry {
2762
+ readonly id: number;
2763
+ readonly file: string;
2764
+ readonly state: string;
2765
+ readonly testCount: number;
2766
+ readonly duration: number | null;
2767
+ }
2768
+ /** @public */
2769
+ interface SuiteListEntry {
2770
+ readonly id: number;
2771
+ readonly name: string;
2772
+ readonly module: string;
2773
+ readonly state: string;
2774
+ readonly testCount: number;
2775
+ }
2776
+ /** @public */
2777
+ interface SettingsListEntry {
2778
+ readonly hash: string;
2779
+ readonly capturedAt: string;
2780
+ }
2781
+ /** @public */
2782
+ interface SessionDetail {
2783
+ readonly id: number;
2784
+ readonly chatId: string;
2785
+ readonly project: string;
2786
+ readonly cwd: string;
2787
+ readonly agentKind: "main" | "subagent";
2788
+ readonly agentType: string | null;
2789
+ readonly parentSessionId: number | null;
2790
+ readonly triageWasNonEmpty: boolean;
2791
+ readonly startedAt: string;
2792
+ readonly endedAt: string | null;
2793
+ readonly endReason: string | null;
2794
+ }
2795
+ /** @public */
2796
+ interface TurnSummary {
2797
+ readonly id: number;
2798
+ readonly sessionId: number;
2799
+ readonly turnNo: number;
2800
+ readonly type: string;
2801
+ readonly payload: string;
2802
+ readonly occurredAt: string;
2803
+ }
2804
+ /** @public */
2805
+ interface TurnSearchOptions {
2806
+ readonly sessionId?: number;
2807
+ readonly type?: string;
2808
+ readonly since?: string;
2809
+ readonly limit?: number;
2810
+ }
2811
+ /** @public */
2812
+ interface AcceptanceMetrics {
2813
+ readonly phaseEvidenceIntegrity: {
2814
+ total: number;
2815
+ compliant: number;
2816
+ ratio: number;
2817
+ };
2818
+ readonly complianceHookResponsiveness: {
2819
+ total: number;
2820
+ withFollowup: number;
2821
+ ratio: number;
2822
+ };
2823
+ readonly orientationUsefulness: {
2824
+ total: number;
2825
+ referencedCount: number;
2826
+ ratio: number;
2827
+ };
2828
+ readonly antiPatternDetectionRate: {
2829
+ total: number;
2830
+ cleanSessions: number;
2831
+ ratio: number;
2832
+ };
2833
+ }
2834
+ /** @public */
2835
+ interface FailureSignatureDetail {
2836
+ readonly signatureHash: string;
2837
+ readonly firstSeenRunId: number | null;
2838
+ readonly firstSeenAt: string;
2839
+ readonly lastSeenAt: string | null;
2840
+ readonly occurrenceCount: number;
2841
+ readonly recentErrors: ReadonlyArray<{
2842
+ readonly runId: number;
2843
+ readonly message: string;
2844
+ readonly errorName: string | null;
2845
+ }>;
2846
+ }
2847
+ /** @public */
2848
+ interface TddPhaseDetail {
2849
+ readonly id: number;
2850
+ readonly behaviorId: number | null;
2851
+ readonly phase: string;
2852
+ readonly startedAt: string;
2853
+ readonly endedAt: string | null;
2854
+ readonly transitionReason: string | null;
2855
+ }
2856
+ /** @public */
2857
+ interface TddArtifactDetail {
2858
+ readonly id: number;
2859
+ readonly phaseId: number;
2860
+ readonly artifactKind: string;
2861
+ readonly testCaseId: number | null;
2862
+ readonly testRunId: number | null;
2863
+ readonly recordedAt: string;
2864
+ }
2865
+ /** @public */
2866
+ interface TddTaskDetail {
2867
+ readonly id: number;
2868
+ readonly sessionId: number;
2869
+ readonly goal: string;
2870
+ readonly startedAt: string;
2871
+ readonly endedAt: string | null;
2872
+ readonly outcome: string | null;
2873
+ readonly runId: string | null;
2874
+ readonly goals: ReadonlyArray<GoalDetail>;
2875
+ readonly phases: ReadonlyArray<TddPhaseDetail>;
2876
+ readonly artifacts: ReadonlyArray<TddArtifactDetail>;
2877
+ }
2878
+ /** @public */
2879
+ interface CurrentTddPhase {
2880
+ readonly id: number;
2881
+ readonly phase: Phase;
2882
+ readonly startedAt: string;
2883
+ readonly behaviorId: number | null;
2884
+ }
2885
+ /** @public */
2886
+ interface CitedArtifactRow extends CitedArtifact {
2887
+ readonly phase_id: number;
2888
+ }
2889
+ /** @public */
2890
+ interface CommitChangesEntry {
2891
+ readonly sha: string;
2892
+ readonly parentSha: string | null;
2893
+ readonly message: string | null;
2894
+ readonly author: string | null;
2895
+ readonly committedAt: string | null;
2896
+ readonly branch: string | null;
2897
+ readonly files: ReadonlyArray<{
2898
+ readonly filePath: string;
2899
+ readonly changeKind: ChangeKind;
2900
+ }>;
2901
+ }
2902
+ /** @public */
2903
+ interface HypothesisDetail {
2904
+ readonly id: number;
2905
+ readonly sessionId: number;
2906
+ readonly content: string;
2907
+ readonly citedTestErrorId: number | null;
2908
+ readonly citedStackFrameId: number | null;
2909
+ readonly validationOutcome: "confirmed" | "refuted" | "abandoned" | null;
2910
+ readonly validatedAt: string | null;
2911
+ }
2912
+ /** @public */
2913
+ interface TddTaskSummary {
2914
+ readonly id: number;
2915
+ readonly sessionId: number;
2916
+ readonly goal: string;
2917
+ readonly startedAt: string;
2918
+ readonly endedAt: string | null;
2919
+ readonly outcome: "succeeded" | "blocked" | "abandoned" | null;
2920
+ }
1225
2921
  /**
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`.
2922
+ * Row shape returned by `listTddArtifactsForTask`. Carries every
2923
+ * field an agent typically needs to cite an artifact in a subsequent
2924
+ * `tdd_phase_transition_request` call without further lookups.
1233
2925
  *
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
2926
  * @public
1242
2927
  */
1243
- declare const ConfigLive: (projectDir: string) => Layer.Layer<VitestAgentConfigFileService, never, FileSystem.FileSystem>;
2928
+ interface TddArtifactRow {
2929
+ readonly id: number;
2930
+ readonly tddTaskId: number;
2931
+ readonly phaseId: number;
2932
+ readonly phaseName: Phase;
2933
+ readonly artifactKind: ArtifactKind;
2934
+ readonly behaviorId: number | null;
2935
+ readonly testCaseId: number | null;
2936
+ readonly testRunId: number | null;
2937
+ readonly testFirstFailureRunId: number | null;
2938
+ readonly recordedAt: string;
2939
+ }
2940
+ /** @public */
2941
+ interface TagInventoryRow {
2942
+ /** The tag name (e.g. `"int"`, `"e2e"`, `"unit"`). */
2943
+ readonly tag: string;
2944
+ /** The Vitest project this tag was observed in. */
2945
+ readonly project: string;
2946
+ /**
2947
+ * Number of distinct test modules in the project's latest run that contain
2948
+ * at least one test case carrying this tag.
2949
+ */
2950
+ readonly moduleCount: number;
2951
+ /**
2952
+ * Number of test cases in the project's latest run that carry this tag.
2953
+ */
2954
+ readonly testCount: number;
2955
+ }
2956
+ declare const DataReader_base: Context.TagClass<DataReader, "vitest-agent/DataReader", {
2957
+ readonly getLatestRun: (project: string) => Effect.Effect<Option.Option<AgentReport>, DataStoreError>;
2958
+ readonly getRunsByProject: () => Effect.Effect<ReadonlyArray<ProjectRunSummary>, DataStoreError>;
2959
+ readonly getHistory: (project: string) => Effect.Effect<HistoryRecord, DataStoreError>;
2960
+ readonly getBaselines: (project: string) => Effect.Effect<Option.Option<CoverageBaselines>, DataStoreError>;
2961
+ readonly getTrends: (project: string, limit?: number) => Effect.Effect<Option.Option<TrendRecord>, DataStoreError>;
2962
+ readonly getFlaky: (project: string) => Effect.Effect<ReadonlyArray<FlakyTest>, DataStoreError>;
2963
+ readonly getPersistentFailures: (project: string) => Effect.Effect<ReadonlyArray<PersistentFailure>, DataStoreError>;
2964
+ readonly getFileCoverage: (runId: number) => Effect.Effect<ReadonlyArray<FileCoverageReport>, DataStoreError>;
2965
+ readonly getCoverage: (project: string) => Effect.Effect<Option.Option<CoverageReport>, DataStoreError>;
2966
+ readonly getTestsForFile: (filePath: string) => Effect.Effect<ReadonlyArray<string>, DataStoreError>;
2967
+ readonly getErrors: (project: string, errorName?: string) => Effect.Effect<ReadonlyArray<TestError>, DataStoreError>;
2968
+ readonly getNotes: (scope?: string, project?: string, testFullName?: string) => Effect.Effect<ReadonlyArray<NoteRow>, DataStoreError>;
2969
+ readonly getNoteById: (id: number) => Effect.Effect<Option.Option<NoteRow>, DataStoreError>;
2970
+ readonly searchNotes: (query: string) => Effect.Effect<ReadonlyArray<NoteRow>, DataStoreError>;
2971
+ readonly getManifest: () => Effect.Effect<Option.Option<CacheManifest>, DataStoreError>;
2972
+ readonly getSettings: (hash: string) => Effect.Effect<Option.Option<SettingsRow>, DataStoreError>;
2973
+ readonly getLatestSettings: () => Effect.Effect<Option.Option<SettingsRow>, DataStoreError>;
2974
+ readonly getTestByFullName: (project: string, fullName: string) => Effect.Effect<Option.Option<TestListEntry>, DataStoreError>;
2975
+ readonly listTests: (project: string, options?: {
2976
+ state?: string;
2977
+ module?: string;
2978
+ limit?: number;
2979
+ }) => Effect.Effect<ReadonlyArray<TestListEntry>, DataStoreError>;
2980
+ readonly listModules: (project: string) => Effect.Effect<ReadonlyArray<ModuleListEntry>, DataStoreError>;
2981
+ readonly listSuites: (project: string, options?: {
2982
+ module?: string;
2983
+ }) => Effect.Effect<ReadonlyArray<SuiteListEntry>, DataStoreError>;
2984
+ readonly listSettings: () => Effect.Effect<ReadonlyArray<SettingsListEntry>, DataStoreError>;
2985
+ readonly getSessionById: (id: number) => Effect.Effect<Option.Option<SessionDetail>, DataStoreError>;
2986
+ readonly getSessionByChatId: (chatId: string) => Effect.Effect<Option.Option<SessionDetail>, DataStoreError>;
2987
+ /**
2988
+ * Find every session row whose `chat_id` begins with `prefix`.
2989
+ * Used to recover the synthetic subagent row created by the
2990
+ * SubagentStart hook (`<parentChatId>-subagent-<ts>-<pid>`)
2991
+ * when subsequent PostToolUse hooks fire under the bare
2992
+ * parent chat_id. Returns most recent first.
2993
+ */
2994
+ readonly findSessionsByChatPrefix: (prefix: string) => Effect.Effect<ReadonlyArray<SessionDetail>, DataStoreError>;
2995
+ /**
2996
+ * Find the most-recently-started subagent session whose
2997
+ * `parent_session_id` is `parentSessionId` and that has not ended
2998
+ * (`ended_at IS NULL`). Used to attribute orchestrator (subagent)
2999
+ * MCP writes — e.g. `hypothesis record` — to the running subagent's
3000
+ * own session row instead of the parent main session, since the MCP
3001
+ * server's recovered context only ever names the main agent.
3002
+ */
3003
+ readonly findActiveSubagentSession: (parentSessionId: number) => Effect.Effect<Option.Option<SessionDetail>, DataStoreError>;
3004
+ readonly listSessions: (options: {
3005
+ readonly project?: string;
3006
+ readonly agentKind?: "main" | "subagent";
3007
+ readonly limit?: number;
3008
+ }) => Effect.Effect<ReadonlyArray<SessionDetail>, DataStoreError>;
3009
+ readonly searchTurns: (options: TurnSearchOptions) => Effect.Effect<ReadonlyArray<TurnSummary>, DataStoreError>;
3010
+ readonly computeAcceptanceMetrics: () => Effect.Effect<AcceptanceMetrics, DataStoreError>;
3011
+ readonly getFailureSignatureByHash: (hash: string) => Effect.Effect<Option.Option<FailureSignatureDetail>, DataStoreError>;
3012
+ readonly getTddTaskById: (id: number) => Effect.Effect<Option.Option<TddTaskDetail>, DataStoreError>;
3013
+ readonly getGoalById: (id: number) => Effect.Effect<Option.Option<GoalDetail>, DataStoreError>;
3014
+ readonly getGoalsByTddTask: (tddTaskId: number) => Effect.Effect<ReadonlyArray<GoalDetail>, DataStoreError>;
3015
+ readonly getBehaviorById: (id: number) => Effect.Effect<Option.Option<BehaviorDetail>, DataStoreError>;
3016
+ readonly getBehaviorsByGoal: (goalId: number) => Effect.Effect<ReadonlyArray<BehaviorRow>, DataStoreError>;
3017
+ readonly getBehaviorsByTddTask: (tddTaskId: number) => Effect.Effect<ReadonlyArray<BehaviorRow>, DataStoreError>;
3018
+ readonly getBehaviorDependencies: (behaviorId: number) => Effect.Effect<ReadonlyArray<BehaviorRow>, DataStoreError>;
3019
+ readonly resolveGoalIdForBehavior: (behaviorId: number) => Effect.Effect<Option.Option<number>, DataStoreError>;
3020
+ readonly getCurrentTddPhase: (tddTaskId: number) => Effect.Effect<Option.Option<CurrentTddPhase>, DataStoreError>;
3021
+ readonly getTddArtifactWithContext: (artifactId: number) => Effect.Effect<Option.Option<CitedArtifactRow>, DataStoreError>;
3022
+ readonly getCommitChanges: (sha?: string) => Effect.Effect<ReadonlyArray<CommitChangesEntry>, DataStoreError>;
3023
+ readonly listTddTasksForSession: (sessionId: number, options?: {
3024
+ /**
3025
+ * When true, also return tdd_tasks belonging to any
3026
+ * ancestor of `sessionId` via `parent_session_id`. Used
3027
+ * by hook-driven artifact recording where the
3028
+ * orchestrator opened the tdd task under the parent
3029
+ * main row but the subagent's own session row is the
3030
+ * one carrying the calling chat_id. Default `false`
3031
+ * preserves the prior single-session contract.
3032
+ */
3033
+ readonly walkParents?: boolean;
3034
+ }) => Effect.Effect<ReadonlyArray<TddTaskSummary>, DataStoreError>;
3035
+ /**
3036
+ * List artifacts recorded for a TDD task, optionally filtered
3037
+ * by `artifactKind`, `phaseId`, or `behaviorId`. Returns rows in
3038
+ * recorded_at DESC order so the most recently captured artifact
3039
+ * (the typical citation target for a phase transition) appears
3040
+ * first. `limit` defaults to 50.
3041
+ */
3042
+ readonly listTddArtifactsForTask: (input: {
3043
+ readonly tddTaskId: number;
3044
+ readonly artifactKind?: ArtifactKind;
3045
+ readonly phaseId?: number;
3046
+ readonly behaviorId?: number;
3047
+ readonly limit?: number;
3048
+ }) => Effect.Effect<ReadonlyArray<TddArtifactRow>, DataStoreError>;
3049
+ readonly listHypotheses: (options: {
3050
+ readonly sessionId?: number;
3051
+ readonly outcome?: "confirmed" | "refuted" | "abandoned" | "open";
3052
+ readonly limit?: number;
3053
+ }) => Effect.Effect<ReadonlyArray<HypothesisDetail>, DataStoreError>;
3054
+ readonly findIdempotentResponse: (procedurePath: string, key: string) => Effect.Effect<Option.Option<string>, DataStoreError>;
3055
+ readonly getLatestTestCaseForSession: (chatId: string) => Effect.Effect<Option.Option<number>, DataStoreError>;
3056
+ /**
3057
+ * Returns one `TagInventoryRow` per `(tag, project)` pair observed in
3058
+ * each project's latest test run. When `project` is supplied, results
3059
+ * are restricted to that project's latest run.
3060
+ */
3061
+ readonly listTagInventory: (options?: {
3062
+ readonly project?: string;
3063
+ }) => Effect.Effect<ReadonlyArray<TagInventoryRow>, DataStoreError>;
3064
+ /**
3065
+ * Returns every `TestListEntry` from the latest run of each project
3066
+ * (or the specified project) whose test case carries `tag`.
3067
+ */
3068
+ readonly listTestsForTag: (tag: string, options?: {
3069
+ readonly project?: string;
3070
+ }) => Effect.Effect<ReadonlyArray<TestListEntry>, DataStoreError>;
3071
+ }>;
3072
+ /** @public */
3073
+ declare class DataReader extends DataReader_base {}
1244
3074
  //#endregion
1245
3075
  //#region src/layers/DataReaderLive.d.ts
1246
3076
  /** @public */
@@ -1458,7 +3288,7 @@ declare const OutputRendererLive: Layer.Layer<OutputRenderer, never, never>;
1458
3288
  * anchor the config file resolvers.
1459
3289
  * @public
1460
3290
  */
1461
- declare const PathResolutionLive: (projectDir: string) => Layer.Layer<VitestAgentConfigFileService | import("xdg-effect").XdgResolver | import("xdg-effect").AppDirs | import("workspaces-effect").WorkspaceDiscovery, never, import("@effect/platform/FileSystem").FileSystem | import("@effect/platform/Path").Path>;
3291
+ 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
3292
  //#endregion
1463
3293
  //#region src/services/PerClientSessionMap.d.ts
1464
3294
  /** @public */
@@ -1710,12 +3540,12 @@ declare const RunContext_base: Schema.Class<RunContext, {
1710
3540
  readonly gitUpstream: string | null;
1711
3541
  } & {
1712
3542
  readonly gitWorktreeDir: string | null;
3543
+ } & {
3544
+ readonly hostMetadata: unknown;
1713
3545
  } & {
1714
3546
  readonly hostSource: string | null;
1715
3547
  } & {
1716
3548
  readonly hostValue: string | null;
1717
- } & {
1718
- readonly hostMetadata: unknown;
1719
3549
  }, {}, {}>;
1720
3550
  /**
1721
3551
  * Per-run snapshot of the workspace's git state and host context.
@@ -2088,6 +3918,40 @@ declare const BehaviorScopedEventTypes: readonly ["behavior_started", "phase_tra
2088
3918
  /** @public */
2089
3919
  type BehaviorScopedEventType = (typeof BehaviorScopedEventTypes)[number];
2090
3920
  //#endregion
3921
+ //#region src/schemas/ConsoleLeaks.d.ts
3922
+ /**
3923
+ * Per-file stray-console-output detail. Counts are of console writes
3924
+ * (one `console.*` call), not lines.
3925
+ * @public
3926
+ */
3927
+ declare const ConsoleLeakFile: Schema.Struct<{
3928
+ file: typeof Schema.String;
3929
+ stdout: typeof Schema.Number;
3930
+ stderr: typeof Schema.Number;
3931
+ tests: Schema.optional<Schema.Array$<typeof Schema.String>>;
3932
+ sample: Schema.optional<typeof Schema.String>;
3933
+ }>;
3934
+ /** @public */
3935
+ type ConsoleLeakFile = typeof ConsoleLeakFile.Type;
3936
+ /**
3937
+ * Aggregate stray-console-output signal for a single test run. Omitted from
3938
+ * a report entirely when the run produced no user console output.
3939
+ * @public
3940
+ */
3941
+ declare const ConsoleLeaks: Schema.Struct<{
3942
+ total: typeof Schema.Number;
3943
+ byFile: Schema.Array$<Schema.Struct<{
3944
+ file: typeof Schema.String;
3945
+ stdout: typeof Schema.Number;
3946
+ stderr: typeof Schema.Number;
3947
+ tests: Schema.optional<Schema.Array$<typeof Schema.String>>;
3948
+ sample: Schema.optional<typeof Schema.String>;
3949
+ }>>;
3950
+ truncated: Schema.optional<typeof Schema.Boolean>;
3951
+ }>;
3952
+ /** @public */
3953
+ type ConsoleLeaks = typeof ConsoleLeaks.Type;
3954
+ //#endregion
2091
3955
  //#region src/schemas/CoverageLevel.d.ts
2092
3956
  declare const CoverageLevel_base: Schema.Class<CoverageLevel, {
2093
3957
  lines: typeof Schema.Number;
@@ -2102,15 +3966,15 @@ declare const CoverageLevel_base: Schema.Class<CoverageLevel, {
2102
3966
  statements: typeof Schema.Number;
2103
3967
  perFile: Schema.optional<typeof Schema.Boolean>;
2104
3968
  }>, never, {
2105
- readonly lines: number;
3969
+ readonly perFile?: boolean | undefined;
3970
+ } & {
3971
+ readonly branches: number;
2106
3972
  } & {
2107
3973
  readonly functions: number;
2108
3974
  } & {
2109
- readonly branches: number;
3975
+ readonly lines: number;
2110
3976
  } & {
2111
3977
  readonly statements: number;
2112
- } & {
2113
- readonly perFile?: boolean | undefined;
2114
3978
  }, {}, {}>;
2115
3979
  /**
2116
3980
  * A coverage level configuration with per-metric thresholds and an optional
@@ -2796,6 +4660,53 @@ declare function getRecentDirection(record: TrendRecord, count?: number): {
2796
4660
  runCount: number;
2797
4661
  };
2798
4662
  //#endregion
4663
+ //#region src/utils/console-leaks.d.ts
4664
+ /**
4665
+ * A single captured stray console write, attributed to a file (and a test
4666
+ * when the write happened inside one). Fed to buildConsoleLeaks.
4667
+ * @public
4668
+ */
4669
+ interface ConsoleLeakEntry {
4670
+ readonly file: string;
4671
+ readonly test?: string;
4672
+ readonly type: "stdout" | "stderr";
4673
+ readonly content: string;
4674
+ }
4675
+ /**
4676
+ * Aggregate raw console-leak entries into a ConsoleLeaks signal:
4677
+ * bucket by file, split stdout/stderr, collect attributable test names,
4678
+ * capture one truncated sample per file, sort by total writes descending,
4679
+ * and cap the file list. Returns `undefined` when there are no entries so a
4680
+ * clean run attaches nothing.
4681
+ * @public
4682
+ */
4683
+ declare function buildConsoleLeaks(entries: ReadonlyArray<ConsoleLeakEntry>): ConsoleLeaks | undefined;
4684
+ /**
4685
+ * Structural subset of a Vitest runner task (File / Suite / Test) carrying
4686
+ * captured console output. Modeled locally so this util needs no `vitest`
4687
+ * dependency. `logs` is attached to tasks by Vitest's console interception
4688
+ * regardless of which reporter is active, which is why the walk survives
4689
+ * reporter stripping in agent mode.
4690
+ * @public
4691
+ */
4692
+ interface ConsoleLeakTask {
4693
+ readonly type?: string;
4694
+ readonly name?: string;
4695
+ readonly fullTestName?: string;
4696
+ readonly logs?: ReadonlyArray<{
4697
+ readonly type: "stdout" | "stderr";
4698
+ readonly content: string;
4699
+ }>;
4700
+ readonly tasks?: ReadonlyArray<ConsoleLeakTask>;
4701
+ }
4702
+ /**
4703
+ * Walk a Vitest `File[]` task tree (from `vitest.state.getFiles()`) into flat
4704
+ * {@link ConsoleLeakEntry} values. Each task `log` becomes one entry attributed
4705
+ * to its enclosing file and, when the log sits on a test task, that test's name.
4706
+ * @public
4707
+ */
4708
+ declare function collectConsoleLeakEntries(files: ReadonlyArray<ConsoleLeakTask>): ConsoleLeakEntry[];
4709
+ //#endregion
2799
4710
  //#region src/utils/detect-pm.d.ts
2800
4711
  /**
2801
4712
  * Filesystem abstraction for package manager detection.
@@ -3212,7 +5123,7 @@ interface ResolveDataPathOptions {
3212
5123
  * @param options - Optional programmatic overrides.
3213
5124
  * @public
3214
5125
  */
3215
- declare const resolveDataPath: (projectDir: string, options?: ResolveDataPathOptions) => Effect.Effect<any, import("config-file-effect").ConfigError | import("xdg-effect").AppDirsError, AppDirs | import("config-file-effect").ConfigFileService<VitestAgentConfig>>;
5126
+ 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
5127
  //#endregion
3217
5128
  //#region src/utils/resolve-project-key-from-cwd.d.ts
3218
5129
  /**
@@ -3324,11 +5235,10 @@ declare function validateCoverageTargetsShape(input: unknown): CoverageTargetsSh
3324
5235
  * package.json#version via rslib-builder's __PACKAGE_VERSION__ substitution.
3325
5236
  * Source-level reads (workspace `exports: "./src/index.ts"` during dev)
3326
5237
  * 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.
5238
+ * substituted yet. Exported for version introspection by downstream tooling.
3329
5239
  * @public
3330
5240
  */
3331
5241
  declare const CURRENT_SDK_VERSION: string;
3332
5242
  //#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 };
5243
+ 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, transitionEnforcesBehaviorMatch, validateCoverageConfig, validateCoverageTargetsShape, validatePhaseTransition };
3334
5244
  //# sourceMappingURL=index.d.ts.map