@vitest-agent/sdk 2.5.0 → 3.0.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.
@@ -1,8 +1,15 @@
1
1
  import { Context } from "effect";
2
2
 
3
3
  //#region src/services/DataStore.ts
4
+ /**
5
+ * Ceiling on an inline attachment body. Vitest has already copied file
6
+ * attachments into `.vitest/attachments/`, so a large body is referenced
7
+ * by `path` rather than duplicated into `data.db`.
8
+ * @public
9
+ */
10
+ const INLINE_ATTACHMENT_BODY_CAP_BYTES = 65536;
4
11
  /** @public */
5
12
  var DataStore = class extends Context.Service()("vitest-agent/DataStore") {};
6
13
 
7
14
  //#endregion
8
- export { DataStore };
15
+ export { DataStore, INLINE_ATTACHMENT_BODY_CAP_BYTES };
package/testing/layers.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DataReaderLive } from "../layers/DataReaderLive.js";
2
2
  import { DataStoreLive } from "../layers/DataStoreLive.js";
3
- import migration from "../migrations/0001_initial.js";
3
+ import { PROJECT_MIGRATIONS } from "../migrations/index.js";
4
4
  import { Layer } from "effect";
5
5
  import * as NodeServices from "@effect/platform-node/NodeServices";
6
6
  import { layer } from "@effect/sql-sqlite-node/SqliteClient";
@@ -11,7 +11,7 @@ import * as SqliteMigrator from "@effect/sql-sqlite-node/SqliteMigrator";
11
11
  function makeTestLayer(filename) {
12
12
  const SqliteLayer = layer({ filename });
13
13
  const PlatformLayer = NodeServices.layer;
14
- const MigratorLayer = SqliteMigrator.layer({ loader: SqliteMigrator.fromRecord({ "0001_initial": migration }) }).pipe(Layer.provide(Layer.merge(SqliteLayer, PlatformLayer)));
14
+ const MigratorLayer = SqliteMigrator.layer({ loader: SqliteMigrator.fromRecord(PROJECT_MIGRATIONS) }).pipe(Layer.provide(Layer.merge(SqliteLayer, PlatformLayer)));
15
15
  return Layer.mergeAll(DataStoreLive.pipe(Layer.provide(SqliteLayer)), DataReaderLive.pipe(Layer.provide(SqliteLayer)), MigratorLayer, SqliteLayer, PlatformLayer);
16
16
  }
17
17
  /** @public */
package/testing.d.ts CHANGED
@@ -9,7 +9,7 @@ declare const DataStoreError_base: new <A extends Record<string, any> = {}>(args
9
9
  * Error raised when a SQLite operation fails at read, write, or migration time.
10
10
  * @public
11
11
  */
12
- declare class DataStoreError extends DataStoreError_base<{
12
+ export declare class DataStoreError extends DataStoreError_base<{
13
13
  readonly operation: "read" | "write" | "migrate";
14
14
  readonly table: string;
15
15
  readonly reason: string;
@@ -26,7 +26,7 @@ declare class DataStoreError extends DataStoreError_base<{
26
26
  * Complete per-project test report written to disk as JSON.
27
27
  * @public
28
28
  */
29
- declare const AgentReport: Schema.Struct<{
29
+ export declare const AgentReport: Schema.Struct<{
30
30
  readonly timestamp: Schema.String;
31
31
  readonly project: Schema.optional<Schema.String>;
32
32
  readonly reason: Schema.Literals<readonly ["passed", "failed", "interrupted"]>;
@@ -100,6 +100,12 @@ declare const AgentReport: Schema.Struct<{
100
100
  readonly functions: Schema.optional<Schema.Number>;
101
101
  readonly branches: Schema.optional<Schema.Number>;
102
102
  readonly statements: Schema.optional<Schema.Number>;
103
+ readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
104
+ readonly lines: Schema.optional<Schema.Number>;
105
+ readonly functions: Schema.optional<Schema.Number>;
106
+ readonly branches: Schema.optional<Schema.Number>;
107
+ readonly statements: Schema.optional<Schema.Number>;
108
+ }>]>>;
103
109
  }>]>>, never>;
104
110
  }>;
105
111
  readonly targets: Schema.optional<Schema.Struct<{
@@ -114,6 +120,12 @@ declare const AgentReport: Schema.Struct<{
114
120
  readonly functions: Schema.optional<Schema.Number>;
115
121
  readonly branches: Schema.optional<Schema.Number>;
116
122
  readonly statements: Schema.optional<Schema.Number>;
123
+ readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
124
+ readonly lines: Schema.optional<Schema.Number>;
125
+ readonly functions: Schema.optional<Schema.Number>;
126
+ readonly branches: Schema.optional<Schema.Number>;
127
+ readonly statements: Schema.optional<Schema.Number>;
128
+ }>]>>;
117
129
  }>]>>, never>;
118
130
  }>>;
119
131
  readonly baselines: Schema.optional<Schema.Struct<{
@@ -128,6 +140,12 @@ declare const AgentReport: Schema.Struct<{
128
140
  readonly functions: Schema.optional<Schema.Number>;
129
141
  readonly branches: Schema.optional<Schema.Number>;
130
142
  readonly statements: Schema.optional<Schema.Number>;
143
+ readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
144
+ readonly lines: Schema.optional<Schema.Number>;
145
+ readonly functions: Schema.optional<Schema.Number>;
146
+ readonly branches: Schema.optional<Schema.Number>;
147
+ readonly statements: Schema.optional<Schema.Number>;
148
+ }>]>>;
131
149
  }>]>>, never>;
132
150
  }>>;
133
151
  readonly scoped: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
@@ -178,14 +196,14 @@ declare const AgentReport: Schema.Struct<{
178
196
  }>>;
179
197
  }>;
180
198
  /** @public */
181
- type AgentReport = typeof AgentReport.Type;
199
+ export type AgentReport = typeof AgentReport.Type;
182
200
  //#endregion
183
201
  //#region src/schemas/Baselines.d.ts
184
202
  /**
185
203
  * Coverage baselines -- the auto-ratcheting high-water mark.
186
204
  * @public
187
205
  */
188
- declare const CoverageBaselines: Schema.Struct<{
206
+ export declare const CoverageBaselines: Schema.Struct<{
189
207
  readonly updatedAt: Schema.String;
190
208
  readonly global: Schema.Struct<{
191
209
  readonly lines: Schema.optional<Schema.Number>;
@@ -198,17 +216,23 @@ declare const CoverageBaselines: Schema.Struct<{
198
216
  readonly functions: Schema.optional<Schema.Number>;
199
217
  readonly branches: Schema.optional<Schema.Number>;
200
218
  readonly statements: Schema.optional<Schema.Number>;
219
+ readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
220
+ readonly lines: Schema.optional<Schema.Number>;
221
+ readonly functions: Schema.optional<Schema.Number>;
222
+ readonly branches: Schema.optional<Schema.Number>;
223
+ readonly statements: Schema.optional<Schema.Number>;
224
+ }>]>>;
201
225
  }>]>>, never>;
202
226
  }>;
203
227
  /** @public */
204
- type CoverageBaselines = typeof CoverageBaselines.Type;
228
+ export type CoverageBaselines = typeof CoverageBaselines.Type;
205
229
  //#endregion
206
230
  //#region src/schemas/CacheManifest.d.ts
207
231
  /**
208
232
  * Root manifest file that indexes all project reports.
209
233
  * @public
210
234
  */
211
- declare const CacheManifest: Schema.Struct<{
235
+ export declare const CacheManifest: Schema.Struct<{
212
236
  readonly updatedAt: Schema.String;
213
237
  readonly cacheDir: Schema.String;
214
238
  readonly projects: Schema.$Array<Schema.Struct<{
@@ -220,14 +244,14 @@ declare const CacheManifest: Schema.Struct<{
220
244
  }>>;
221
245
  }>;
222
246
  /** @public */
223
- type CacheManifest = typeof CacheManifest.Type;
247
+ export type CacheManifest = typeof CacheManifest.Type;
224
248
  //#endregion
225
249
  //#region src/schemas/Coverage.d.ts
226
250
  /**
227
251
  * Per-file coverage data including uncovered line ranges.
228
252
  * @public
229
253
  */
230
- declare const FileCoverageReport: Schema.Struct<{
254
+ export declare const FileCoverageReport: Schema.Struct<{
231
255
  readonly file: Schema.String;
232
256
  readonly summary: Schema.Struct<{
233
257
  readonly statements: Schema.Number;
@@ -238,12 +262,12 @@ declare const FileCoverageReport: Schema.Struct<{
238
262
  readonly uncoveredLines: Schema.String;
239
263
  }>;
240
264
  /** @public */
241
- type FileCoverageReport = typeof FileCoverageReport.Type;
265
+ export type FileCoverageReport = typeof FileCoverageReport.Type;
242
266
  /**
243
267
  * Complete coverage report attached to an AgentReport.
244
268
  * @public
245
269
  */
246
- declare const CoverageReport: Schema.Struct<{
270
+ export declare const CoverageReport: Schema.Struct<{
247
271
  readonly totals: Schema.Struct<{
248
272
  readonly statements: Schema.Number;
249
273
  readonly branches: Schema.Number;
@@ -262,6 +286,12 @@ declare const CoverageReport: Schema.Struct<{
262
286
  readonly functions: Schema.optional<Schema.Number>;
263
287
  readonly branches: Schema.optional<Schema.Number>;
264
288
  readonly statements: Schema.optional<Schema.Number>;
289
+ readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
290
+ readonly lines: Schema.optional<Schema.Number>;
291
+ readonly functions: Schema.optional<Schema.Number>;
292
+ readonly branches: Schema.optional<Schema.Number>;
293
+ readonly statements: Schema.optional<Schema.Number>;
294
+ }>]>>;
265
295
  }>]>>, never>;
266
296
  }>;
267
297
  readonly targets: Schema.optional<Schema.Struct<{
@@ -276,6 +306,12 @@ declare const CoverageReport: Schema.Struct<{
276
306
  readonly functions: Schema.optional<Schema.Number>;
277
307
  readonly branches: Schema.optional<Schema.Number>;
278
308
  readonly statements: Schema.optional<Schema.Number>;
309
+ readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
310
+ readonly lines: Schema.optional<Schema.Number>;
311
+ readonly functions: Schema.optional<Schema.Number>;
312
+ readonly branches: Schema.optional<Schema.Number>;
313
+ readonly statements: Schema.optional<Schema.Number>;
314
+ }>]>>;
279
315
  }>]>>, never>;
280
316
  }>>;
281
317
  readonly baselines: Schema.optional<Schema.Struct<{
@@ -290,6 +326,12 @@ declare const CoverageReport: Schema.Struct<{
290
326
  readonly functions: Schema.optional<Schema.Number>;
291
327
  readonly branches: Schema.optional<Schema.Number>;
292
328
  readonly statements: Schema.optional<Schema.Number>;
329
+ readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
330
+ readonly lines: Schema.optional<Schema.Number>;
331
+ readonly functions: Schema.optional<Schema.Number>;
332
+ readonly branches: Schema.optional<Schema.Number>;
333
+ readonly statements: Schema.optional<Schema.Number>;
334
+ }>]>>;
293
335
  }>]>>, never>;
294
336
  }>>;
295
337
  readonly scoped: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
@@ -319,14 +361,14 @@ declare const CoverageReport: Schema.Struct<{
319
361
  readonly belowTargetFiles: Schema.optional<Schema.$Array<Schema.String>>;
320
362
  }>;
321
363
  /** @public */
322
- type CoverageReport = typeof CoverageReport.Type;
364
+ export type CoverageReport = typeof CoverageReport.Type;
323
365
  //#endregion
324
366
  //#region src/schemas/History.d.ts
325
367
  /**
326
368
  * Per-project history record containing all tracked tests.
327
369
  * @public
328
370
  */
329
- declare const HistoryRecord: Schema.Struct<{
371
+ export declare const HistoryRecord: Schema.Struct<{
330
372
  readonly project: Schema.String;
331
373
  readonly updatedAt: Schema.String;
332
374
  readonly tests: Schema.$Array<Schema.Struct<{
@@ -339,19 +381,19 @@ declare const HistoryRecord: Schema.Struct<{
339
381
  }>>;
340
382
  }>;
341
383
  /** @public */
342
- type HistoryRecord = typeof HistoryRecord.Type;
384
+ export type HistoryRecord = typeof HistoryRecord.Type;
343
385
  //#endregion
344
386
  //#region src/schemas/Tdd.d.ts
345
387
  /** @public */
346
- declare const GoalStatus: Schema.Literals<readonly ["pending", "in_progress", "done", "abandoned"]>;
388
+ export declare const GoalStatus: Schema.Literals<readonly ["pending", "in_progress", "done", "abandoned"]>;
347
389
  /** @public */
348
- type GoalStatus = typeof GoalStatus.Type;
390
+ export type GoalStatus = typeof GoalStatus.Type;
349
391
  /** @public */
350
- declare const BehaviorStatus: Schema.Literals<readonly ["pending", "in_progress", "done", "abandoned"]>;
392
+ export declare const BehaviorStatus: Schema.Literals<readonly ["pending", "in_progress", "done", "abandoned"]>;
351
393
  /** @public */
352
- type BehaviorStatus = typeof BehaviorStatus.Type;
394
+ export type BehaviorStatus = typeof BehaviorStatus.Type;
353
395
  /** @public */
354
- declare const GoalRow: Schema.Struct<{
396
+ export declare const GoalRow: Schema.Struct<{
355
397
  readonly id: Schema.Number;
356
398
  readonly sessionId: Schema.Number;
357
399
  readonly ordinal: Schema.Number;
@@ -360,9 +402,9 @@ declare const GoalRow: Schema.Struct<{
360
402
  readonly createdAt: Schema.String;
361
403
  }>;
362
404
  /** @public */
363
- type GoalRow = typeof GoalRow.Type;
405
+ export type GoalRow = typeof GoalRow.Type;
364
406
  /** @public */
365
- declare const BehaviorRow: Schema.Struct<{
407
+ export declare const BehaviorRow: Schema.Struct<{
366
408
  readonly id: Schema.Number;
367
409
  readonly goalId: Schema.Number;
368
410
  readonly ordinal: Schema.Number;
@@ -372,9 +414,9 @@ declare const BehaviorRow: Schema.Struct<{
372
414
  readonly createdAt: Schema.String;
373
415
  }>;
374
416
  /** @public */
375
- type BehaviorRow = typeof BehaviorRow.Type;
417
+ export type BehaviorRow = typeof BehaviorRow.Type;
376
418
  /** @public */
377
- declare const GoalDetail: Schema.Struct<{
419
+ export declare const GoalDetail: Schema.Struct<{
378
420
  readonly id: Schema.Number;
379
421
  readonly sessionId: Schema.Number;
380
422
  readonly ordinal: Schema.Number;
@@ -392,9 +434,9 @@ declare const GoalDetail: Schema.Struct<{
392
434
  }>>;
393
435
  }>;
394
436
  /** @public */
395
- type GoalDetail = typeof GoalDetail.Type;
437
+ export type GoalDetail = typeof GoalDetail.Type;
396
438
  /** @public */
397
- declare const BehaviorDetail: Schema.Struct<{
439
+ export declare const BehaviorDetail: Schema.Struct<{
398
440
  readonly id: Schema.Number;
399
441
  readonly goalId: Schema.Number;
400
442
  readonly ordinal: Schema.Number;
@@ -418,14 +460,14 @@ declare const BehaviorDetail: Schema.Struct<{
418
460
  }>>;
419
461
  }>;
420
462
  /** @public */
421
- type BehaviorDetail = typeof BehaviorDetail.Type;
463
+ export type BehaviorDetail = typeof BehaviorDetail.Type;
422
464
  //#endregion
423
465
  //#region src/schemas/Trends.d.ts
424
466
  /**
425
467
  * A single coverage trend data point recorded on a full test run.
426
468
  * @public
427
469
  */
428
- declare const TrendEntry: Schema.Struct<{
470
+ export declare const TrendEntry: Schema.Struct<{
429
471
  readonly timestamp: Schema.String;
430
472
  readonly coverage: Schema.Struct<{
431
473
  readonly statements: Schema.Number;
@@ -443,12 +485,12 @@ declare const TrendEntry: Schema.Struct<{
443
485
  readonly targetsHash: Schema.optional<Schema.String>;
444
486
  }>;
445
487
  /** @public */
446
- type TrendEntry = typeof TrendEntry.Type;
488
+ export type TrendEntry = typeof TrendEntry.Type;
447
489
  /**
448
490
  * Per-project trend record with sliding window of entries.
449
491
  * @public
450
492
  */
451
- declare const TrendRecord: Schema.Struct<{
493
+ export declare const TrendRecord: Schema.Struct<{
452
494
  readonly entries: Schema.$Array<Schema.Struct<{
453
495
  readonly timestamp: Schema.String;
454
496
  readonly coverage: Schema.Struct<{
@@ -468,7 +510,7 @@ declare const TrendRecord: Schema.Struct<{
468
510
  }>>;
469
511
  }>;
470
512
  /** @public */
471
- type TrendRecord = typeof TrendRecord.Type;
513
+ export type TrendRecord = typeof TrendRecord.Type;
472
514
  //#endregion
473
515
  //#region src/utils/validate-phase-transition.d.ts
474
516
  /** @public */
@@ -519,9 +561,9 @@ interface CitedArtifact {
519
561
  * agent's lifetime.
520
562
  * @public
521
563
  */
522
- declare const AgentId: Schema.brand<Schema.String, "AgentId">;
564
+ export declare const AgentId: Schema.brand<Schema.String, "AgentId">;
523
565
  /** @public */
524
- type AgentId = Schema.Schema.Type<typeof AgentId>;
566
+ export type AgentId = Schema.Schema.Type<typeof AgentId>;
525
567
  /**
526
568
  * The agent host process's chat id (Claude Code's per-process chat
527
569
  * UUID, etc.). Shorter-lived than a conversation; one conversation can
@@ -529,9 +571,9 @@ type AgentId = Schema.Schema.Type<typeof AgentId>;
529
571
  * `sessions.id` (the SQLite agent-run PK).
530
572
  * @public
531
573
  */
532
- declare const ChatId: Schema.brand<Schema.String, "ChatId">;
574
+ export declare const ChatId: Schema.brand<Schema.String, "ChatId">;
533
575
  /** @public */
534
- type ChatId = Schema.Schema.Type<typeof ChatId>;
576
+ export type ChatId = Schema.Schema.Type<typeof ChatId>;
535
577
  //#endregion
536
578
  //#region src/errors/AgentErrors.d.ts
537
579
  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 & {
@@ -543,7 +585,7 @@ declare const AgentNotFoundError_base: new <A extends Record<string, any> = {}>(
543
585
  * this agent first.
544
586
  * @public
545
587
  */
546
- declare class AgentNotFoundError extends AgentNotFoundError_base<{
588
+ export declare class AgentNotFoundError extends AgentNotFoundError_base<{
547
589
  readonly agentId: AgentId;
548
590
  readonly chatId?: ChatId;
549
591
  }> {}
@@ -556,7 +598,7 @@ declare const RegistrationConflictError_base: new <A extends Record<string, any>
556
598
  * caller named. Distinct from `IdempotencyHit`, which is a success.
557
599
  * @public
558
600
  */
559
- declare class RegistrationConflictError extends RegistrationConflictError_base<{
601
+ export declare class RegistrationConflictError extends RegistrationConflictError_base<{
560
602
  readonly reason: string;
561
603
  }> {
562
604
  constructor(args: {
@@ -569,7 +611,7 @@ declare const GoalNotFoundError_base: new <A extends Record<string, any> = {}>(a
569
611
  readonly _tag: "GoalNotFoundError";
570
612
  } & Readonly<A>;
571
613
  /** @public */
572
- declare class GoalNotFoundError extends GoalNotFoundError_base<{
614
+ export declare class GoalNotFoundError extends GoalNotFoundError_base<{
573
615
  readonly id: number;
574
616
  readonly reason: string;
575
617
  }> {
@@ -582,7 +624,7 @@ declare const BehaviorNotFoundError_base: new <A extends Record<string, any> = {
582
624
  readonly _tag: "BehaviorNotFoundError";
583
625
  } & Readonly<A>;
584
626
  /** @public */
585
- declare class BehaviorNotFoundError extends BehaviorNotFoundError_base<{
627
+ export declare class BehaviorNotFoundError extends BehaviorNotFoundError_base<{
586
628
  readonly id: number;
587
629
  readonly reason: string;
588
630
  }> {
@@ -595,7 +637,7 @@ declare const TddTaskNotFoundError_base: new <A extends Record<string, any> = {}
595
637
  readonly _tag: "TddTaskNotFoundError";
596
638
  } & Readonly<A>;
597
639
  /** @public */
598
- declare class TddTaskNotFoundError extends TddTaskNotFoundError_base<{
640
+ export declare class TddTaskNotFoundError extends TddTaskNotFoundError_base<{
599
641
  readonly id: number;
600
642
  readonly reason: string;
601
643
  }> {
@@ -610,7 +652,7 @@ declare const TddTaskAlreadyEndedError_base: new <A extends Record<string, any>
610
652
  readonly _tag: "TddTaskAlreadyEndedError";
611
653
  } & Readonly<A>;
612
654
  /** @public */
613
- declare class TddTaskAlreadyEndedError extends TddTaskAlreadyEndedError_base<{
655
+ export declare class TddTaskAlreadyEndedError extends TddTaskAlreadyEndedError_base<{
614
656
  readonly id: number;
615
657
  readonly endedAt: string;
616
658
  readonly outcome: TddTaskEndOutcome;
@@ -627,7 +669,7 @@ declare const IllegalStatusTransitionError_base: new <A extends Record<string, a
627
669
  readonly _tag: "IllegalStatusTransitionError";
628
670
  } & Readonly<A>;
629
671
  /** @public */
630
- declare class IllegalStatusTransitionError extends IllegalStatusTransitionError_base<{
672
+ export declare class IllegalStatusTransitionError extends IllegalStatusTransitionError_base<{
631
673
  readonly entity: IllegalStatusTransitionEntity;
632
674
  readonly id: number;
633
675
  readonly from: string;
@@ -667,7 +709,7 @@ declare const Agent_base: Schema.Class<Agent, Schema.TaggedStruct<"Agent", {
667
709
  * two reveals a mid-session branch switch, which is itself signal.
668
710
  * @public
669
711
  */
670
- declare class Agent extends Agent_base {}
712
+ export declare class Agent extends Agent_base {}
671
713
  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> & {
672
714
  readonly _tag: "IdempotencyHit";
673
715
  } & import("effect/Pipeable").Pipeable;
@@ -682,7 +724,7 @@ declare const IdempotencyHit_base: new <A extends Record<string, any> = {}>(args
682
724
  * downstream code uses `Match.tag` to branch.
683
725
  * @public
684
726
  */
685
- declare class IdempotencyHit extends IdempotencyHit_base<{
727
+ export declare class IdempotencyHit extends IdempotencyHit_base<{
686
728
  readonly existingAgentId: typeof AgentId.Type;
687
729
  }> {}
688
730
  //#endregion
@@ -698,12 +740,23 @@ declare const ResolvedThresholds: Schema.Struct<{
698
740
  readonly branches: Schema.optional<Schema.Number>;
699
741
  readonly statements: Schema.optional<Schema.Number>;
700
742
  }>;
701
- readonly perFile: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
743
+ readonly perFile: Schema.withDecodingDefaultKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
744
+ readonly lines: Schema.optional<Schema.Number>;
745
+ readonly functions: Schema.optional<Schema.Number>;
746
+ readonly branches: Schema.optional<Schema.Number>;
747
+ readonly statements: Schema.optional<Schema.Number>;
748
+ }>]>, never>;
702
749
  readonly patterns: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Struct<{
703
750
  readonly lines: Schema.optional<Schema.Number>;
704
751
  readonly functions: Schema.optional<Schema.Number>;
705
752
  readonly branches: Schema.optional<Schema.Number>;
706
753
  readonly statements: Schema.optional<Schema.Number>;
754
+ readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
755
+ readonly lines: Schema.optional<Schema.Number>;
756
+ readonly functions: Schema.optional<Schema.Number>;
757
+ readonly branches: Schema.optional<Schema.Number>;
758
+ readonly statements: Schema.optional<Schema.Number>;
759
+ }>]>>;
707
760
  }>]>>, never>;
708
761
  }>;
709
762
  /** @public */
@@ -877,6 +930,41 @@ interface TestErrorInput {
877
930
  readonly ordinal?: number;
878
931
  }
879
932
  /** @public */
933
+ interface TestAttachmentInput {
934
+ readonly contentType?: string;
935
+ /** Post-resolution path under `.vitest/attachments/`, or an http(s) URL. */
936
+ readonly path?: string;
937
+ /** Inline body; persisted only when `byteSize` is under the 64 KiB cap. */
938
+ readonly body?: string;
939
+ /** How to read `body`. Vitest treats a string body as base64 unless `"utf-8"`. */
940
+ readonly bodyEncoding?: "base64" | "utf-8";
941
+ readonly byteSize: number;
942
+ }
943
+ /** @public */
944
+ interface TestAnnotationInput {
945
+ readonly testCaseId: number;
946
+ /** Arbitrary Vitest annotation type -- not an enum. */
947
+ readonly type: string;
948
+ readonly message: string;
949
+ readonly locationFile?: string;
950
+ readonly locationLine?: number;
951
+ readonly locationColumn?: number;
952
+ readonly attachments?: ReadonlyArray<TestAttachmentInput>;
953
+ }
954
+ /** @public */
955
+ interface TestArtifactInput {
956
+ readonly testCaseId: number;
957
+ /** `pkg:name`; `internal:` types are Vitest's own and are never written. */
958
+ readonly type: string;
959
+ readonly message?: string;
960
+ /** JSON of the artifact's custom fields, minus attachments and location. */
961
+ readonly data?: string;
962
+ readonly locationFile?: string;
963
+ readonly locationLine?: number;
964
+ readonly locationColumn?: number;
965
+ readonly attachments?: ReadonlyArray<TestAttachmentInput>;
966
+ }
967
+ /** @public */
880
968
  interface FileCoverageInput {
881
969
  readonly fileId: number;
882
970
  readonly statements: number;
@@ -1090,6 +1178,17 @@ declare const DataStore_base: Context.ServiceClass<DataStore, "vitest-agent/Data
1090
1178
  readonly writeSuites: (moduleId: number, suites: ReadonlyArray<SuiteInput>) => Effect.Effect<ReadonlyArray<number>, DataStoreError>;
1091
1179
  readonly writeTestCases: (moduleId: number, tests: ReadonlyArray<TestCaseInput>) => Effect.Effect<ReadonlyArray<number>, DataStoreError>;
1092
1180
  readonly writeErrors: (runId: number, errors: ReadonlyArray<TestErrorInput>) => Effect.Effect<void, DataStoreError>;
1181
+ /**
1182
+ * Persist `context.annotate` notes and their attachment descriptors.
1183
+ * `runId` is carried for log correlation only -- `test_annotations`
1184
+ * rows are reachable through `test_cases`.
1185
+ */
1186
+ readonly writeAnnotations: (runId: number, annotations: ReadonlyArray<TestAnnotationInput>) => Effect.Effect<void, DataStoreError>;
1187
+ /**
1188
+ * Persist `recordArtifact` payloads and their attachment
1189
+ * descriptors. `runId` is carried for log correlation only.
1190
+ */
1191
+ readonly writeArtifacts: (runId: number, artifacts: ReadonlyArray<TestArtifactInput>) => Effect.Effect<void, DataStoreError>;
1093
1192
  readonly writeCoverage: (runId: number, coverage: ReadonlyArray<FileCoverageInput>) => Effect.Effect<void, DataStoreError>;
1094
1193
  readonly writeHistory: (project: string, fullName: string, modulePath: string, runId: number, timestamp: string, state: string, duration: number | null, flaky: boolean, retryCount: number, errorMessage: string | null) => Effect.Effect<void, DataStoreError>;
1095
1194
  readonly writeBaselines: (baselines: CoverageBaselines) => Effect.Effect<void, DataStoreError>;
@@ -1187,7 +1286,7 @@ declare const DataStore_base: Context.ServiceClass<DataStore, "vitest-agent/Data
1187
1286
  readonly endAgent: (agentId: string, endedAt: number) => Effect.Effect<void, AgentNotFoundError | DataStoreError>;
1188
1287
  }>;
1189
1288
  /** @public */
1190
- declare class DataStore extends DataStore_base {}
1289
+ export declare class DataStore extends DataStore_base {}
1191
1290
  //#endregion
1192
1291
  //#region src/services/DataReader.d.ts
1193
1292
  /** @public */
@@ -1515,6 +1614,45 @@ interface TagInventoryRow {
1515
1614
  */
1516
1615
  readonly testCount: number;
1517
1616
  }
1617
+ /** @public */
1618
+ interface TestArtifactQueryOptions {
1619
+ /** Disambiguates a fullName that exists in more than one module. */
1620
+ readonly modulePath?: string;
1621
+ }
1622
+ /** @public */
1623
+ interface PersistedAttachment {
1624
+ readonly contentType?: string;
1625
+ readonly path?: string;
1626
+ readonly body?: string;
1627
+ /** How to read `body`. Absent when nothing was stored inline. */
1628
+ readonly bodyEncoding?: "base64" | "utf-8";
1629
+ readonly byteSize: number | null;
1630
+ }
1631
+ /** @public */
1632
+ interface TestAnnotationRow {
1633
+ readonly id: number;
1634
+ readonly type: string;
1635
+ readonly message: string;
1636
+ readonly location?: {
1637
+ readonly file: string;
1638
+ readonly line: number;
1639
+ readonly column: number;
1640
+ };
1641
+ readonly attachments: ReadonlyArray<PersistedAttachment>;
1642
+ }
1643
+ /** @public */
1644
+ interface TestArtifactRow {
1645
+ readonly id: number;
1646
+ readonly type: string;
1647
+ readonly message: string | null;
1648
+ readonly data: string | null;
1649
+ readonly location?: {
1650
+ readonly file: string;
1651
+ readonly line: number;
1652
+ readonly column: number;
1653
+ };
1654
+ readonly attachments: ReadonlyArray<PersistedAttachment>;
1655
+ }
1518
1656
  declare const DataReader_base: Context.ServiceClass<DataReader, "vitest-agent/DataReader", {
1519
1657
  readonly getLatestRun: (project: string) => Effect.Effect<Option.Option<AgentReport>, DataStoreError>;
1520
1658
  readonly getRunsByProject: () => Effect.Effect<ReadonlyArray<ProjectRunSummary>, DataStoreError>;
@@ -1527,6 +1665,10 @@ declare const DataReader_base: Context.ServiceClass<DataReader, "vitest-agent/Da
1527
1665
  readonly getCoverage: (project: string) => Effect.Effect<Option.Option<CoverageReport>, DataStoreError>;
1528
1666
  readonly getTestsForFile: (filePath: string) => Effect.Effect<ReadonlyArray<string>, DataStoreError>;
1529
1667
  readonly getErrors: (project: string, errorName?: string) => Effect.Effect<ReadonlyArray<TestError>, DataStoreError>;
1668
+ /** Annotations recorded for a test in the project's latest run. */
1669
+ readonly getAnnotationsForTest: (project: string, fullName: string, options?: TestArtifactQueryOptions) => Effect.Effect<ReadonlyArray<TestAnnotationRow>, DataStoreError>;
1670
+ /** Artifacts recorded for a test in the project's latest run. */
1671
+ readonly getArtifactsForTest: (project: string, fullName: string, options?: TestArtifactQueryOptions) => Effect.Effect<ReadonlyArray<TestArtifactRow>, DataStoreError>;
1530
1672
  readonly getNotes: (scope?: string, project?: string, testFullName?: string) => Effect.Effect<ReadonlyArray<NoteRow>, DataStoreError>;
1531
1673
  readonly getNoteById: (id: number) => Effect.Effect<Option.Option<NoteRow>, DataStoreError>;
1532
1674
  readonly searchNotes: (query: string) => Effect.Effect<ReadonlyArray<NoteRow>, DataStoreError>;
@@ -1675,25 +1817,46 @@ declare const DataReader_base: Context.ServiceClass<DataReader, "vitest-agent/Da
1675
1817
  }) => Effect.Effect<ReadonlyArray<TestListEntry>, DataStoreError>;
1676
1818
  }>;
1677
1819
  /** @public */
1678
- declare class DataReader extends DataReader_base {}
1820
+ export declare class DataReader extends DataReader_base {}
1821
+ //#endregion
1822
+ //#region src/migrations/index.d.ts
1823
+ /**
1824
+ * Every migration that must run against a per-project `data.db`, keyed by
1825
+ * migration id in application order.
1826
+ *
1827
+ * This is the single source of truth for the project database's migration
1828
+ * set: `ensureMigrated`, the sdk testing layer, `ReporterLive`, `McpLive`,
1829
+ * `CliLive` and `SidecarLive` all pass it straight to
1830
+ * `SqliteMigrator.fromRecord`, so adding a migration file and registering it
1831
+ * here is enough to reach every process that opens a project database.
1832
+ *
1833
+ * The session-map and discovery-registry databases are separate schemas with
1834
+ * their own migrations and are deliberately not listed here.
1835
+ *
1836
+ * @public
1837
+ */
1838
+ export declare const PROJECT_MIGRATIONS: {
1839
+ readonly "0001_initial": import("effect/Effect").Effect<void, import("effect/unstable/sql/SqlError").SqlError, import("effect/unstable/sql/SqlClient").SqlClient>;
1840
+ readonly "0002_test_artifacts": import("effect/Effect").Effect<void, import("effect/unstable/sql/SqlError").SqlError, import("effect/unstable/sql/SqlClient").SqlClient>;
1841
+ };
1679
1842
  //#endregion
1680
1843
  //#region src/testing/layers.d.ts
1681
1844
  /** @public */
1682
- declare function makeTestLayer(filename: string): Layer.Layer<DataReader | DataStore | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | NodeServices.NodeServices, SqliteMigrator.MigrationError | import("effect/unstable/sql/SqlError").SqlError, never>;
1845
+ export declare function makeTestLayer(filename: string): Layer.Layer<DataReader | DataStore | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | NodeServices.NodeServices, SqliteMigrator.MigrationError | import("effect/unstable/sql/SqlError").SqlError, never>;
1683
1846
  /** @public */
1684
- declare const DataStoreTestLayer: Layer.Layer<DataReader | DataStore | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | NodeServices.NodeServices, SqliteMigrator.MigrationError | import("effect/unstable/sql/SqlError").SqlError, never>;
1847
+ export declare const DataStoreTestLayer: Layer.Layer<DataReader | DataStore | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | NodeServices.NodeServices, SqliteMigrator.MigrationError | import("effect/unstable/sql/SqlError").SqlError, never>;
1685
1848
  //#endregion
1686
1849
  //#region src/testing/index.d.ts
1687
1850
  /** @public */
1688
- declare function empty(filename: string): Layer.Layer<DataReader | DataStore | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | import("@effect/platform-node/NodeServices").NodeServices, import("@effect/sql-sqlite-node/SqliteMigrator").MigrationError | import("effect/unstable/sql/SqlError").SqlError, never>;
1851
+ export declare function empty(filename: string): Layer.Layer<DataReader | DataStore | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | import("@effect/platform-node/NodeServices").NodeServices, import("@effect/sql-sqlite-node/SqliteMigrator").MigrationError | import("effect/unstable/sql/SqlError").SqlError, never>;
1689
1852
  /** @public */
1690
- declare function singlePassingRun(filename: string): Layer.Layer<DataReader | DataStore | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | import("@effect/platform-node/NodeServices").NodeServices, DataStoreError | import("@effect/sql-sqlite-node/SqliteMigrator").MigrationError | import("effect/unstable/sql/SqlError").SqlError, never>;
1853
+ export declare function singlePassingRun(filename: string): Layer.Layer<DataReader | DataStore | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | import("@effect/platform-node/NodeServices").NodeServices, DataStoreError | import("@effect/sql-sqlite-node/SqliteMigrator").MigrationError | import("effect/unstable/sql/SqlError").SqlError, never>;
1691
1854
  /** @public */
1692
- declare function withFailures(filename: string): Layer.Layer<DataReader | DataStore | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | import("@effect/platform-node/NodeServices").NodeServices, DataStoreError | import("@effect/sql-sqlite-node/SqliteMigrator").MigrationError | import("effect/unstable/sql/SqlError").SqlError, never>;
1855
+ export declare function withFailures(filename: string): Layer.Layer<DataReader | DataStore | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | import("@effect/platform-node/NodeServices").NodeServices, DataStoreError | import("@effect/sql-sqlite-node/SqliteMigrator").MigrationError | import("effect/unstable/sql/SqlError").SqlError, never>;
1693
1856
  /** @public */
1694
- declare function flaky(filename: string): Layer.Layer<DataReader | DataStore | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | import("@effect/platform-node/NodeServices").NodeServices, DataStoreError | import("@effect/sql-sqlite-node/SqliteMigrator").MigrationError | import("effect/unstable/sql/SqlError").SqlError, never>;
1857
+ export declare function flaky(filename: string): Layer.Layer<DataReader | DataStore | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | import("@effect/platform-node/NodeServices").NodeServices, DataStoreError | import("@effect/sql-sqlite-node/SqliteMigrator").MigrationError | import("effect/unstable/sql/SqlError").SqlError, never>;
1695
1858
  /** @public */
1696
- declare function withTddTask(filename: string): Layer.Layer<DataReader | DataStore | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | import("@effect/platform-node/NodeServices").NodeServices, BehaviorNotFoundError | DataStoreError | GoalNotFoundError | IllegalStatusTransitionError | import("@effect/sql-sqlite-node/SqliteMigrator").MigrationError | import("effect/unstable/sql/SqlError").SqlError | TddTaskAlreadyEndedError | TddTaskNotFoundError, never>;
1859
+ export declare function withTddTask(filename: string): Layer.Layer<DataReader | DataStore | import("effect/unstable/sql/SqlClient").SqlClient | import("@effect/sql-sqlite-node/SqliteClient").SqliteClient | import("@effect/platform-node/NodeServices").NodeServices, BehaviorNotFoundError | DataStoreError | GoalNotFoundError | IllegalStatusTransitionError | import("@effect/sql-sqlite-node/SqliteMigrator").MigrationError | import("effect/unstable/sql/SqlError").SqlError | TddTaskAlreadyEndedError | TddTaskNotFoundError, never>;
1697
1860
  //#endregion
1698
- export { type AcceptanceMetrics, Agent, AgentId, AgentNotFoundError, AgentReport, type ArtifactKind, type ArtifactSuite, type AssociateRunSessionInput, BehaviorDetail, BehaviorNotFoundError, BehaviorRow, BehaviorStatus, CacheManifest, type ChangeKind, ChatId, type CitedArtifact, type CitedArtifactRow, type ClassificationQueryOptions, type CommitChangesEntry, CoverageBaselines, CoverageReport, type CreateBehaviorInput, type CreateGoalInput, type CurrentTddPhase, DataReader, DataStore, DataStoreError, DataStoreTestLayer, type EndTddTaskInput, type FailureSignatureDetail, type FailureSignatureWriteInput, type FileCoverageInput, FileCoverageReport, type FlakyTest, GoalDetail, GoalNotFoundError, GoalRow, GoalStatus, type HistoryQueryOptions, HistoryRecord, type HypothesisDetail, type HypothesisInput, IdempotencyHit, type IdempotentResponseInput, type IllegalStatusTransitionEntity, IllegalStatusTransitionError, type ModuleInput, type ModuleListEntry, type NoteInput, type NoteRow, type PersistentFailure, type Phase, type ProjectRunSummary, type RegisterAgentInput, RegistrationConflictError, type ResolvedThresholds, type RunChangedFile, type RunInvocationMethod, type SessionDetail, type SessionInput, type SettingsInput, type SettingsListEntry, type SettingsRow, type StackFrameInput, type SuiteInput, type SuiteListEntry, type TagInventoryRow, type TddArtifactDetail, type TddArtifactRow, type TddPhaseDetail, TddTaskAlreadyEndedError, type TddTaskDetail, type TddTaskEndOutcome, type TddTaskInput, TddTaskNotFoundError, type TddTaskSummary, type TestCaseInput, type TestError, type TestErrorInput, type TestListEntry, type TestLookupOptions, type TestRunInput, TrendEntry, TrendRecord, type TurnInput, type TurnSearchOptions, type TurnSummary, type UpdateBehaviorInput, type UpdateGoalInput, type ValidateHypothesisInput, type WriteCommitInput, type WriteRunChangedFilesInput, type WriteTddArtifactInput, type WriteTddPhaseInput, type WriteTddPhaseOutput, empty, flaky, makeTestLayer, singlePassingRun, withFailures, withTddTask };
1861
+ export type { AcceptanceMetrics, ArtifactKind, ArtifactSuite, AssociateRunSessionInput, ChangeKind, CitedArtifact, CitedArtifactRow, ClassificationQueryOptions, CommitChangesEntry, CreateBehaviorInput, CreateGoalInput, CurrentTddPhase, EndTddTaskInput, FailureSignatureDetail, FailureSignatureWriteInput, FileCoverageInput, FlakyTest, HistoryQueryOptions, HypothesisDetail, HypothesisInput, IdempotentResponseInput, IllegalStatusTransitionEntity, ModuleInput, ModuleListEntry, NoteInput, NoteRow, PersistedAttachment, PersistentFailure, Phase, ProjectRunSummary, RegisterAgentInput, ResolvedThresholds, RunChangedFile, RunInvocationMethod, SessionDetail, SessionInput, SettingsInput, SettingsListEntry, SettingsRow, StackFrameInput, SuiteInput, SuiteListEntry, TagInventoryRow, TddArtifactDetail, TddArtifactRow, TddPhaseDetail, TddTaskDetail, TddTaskEndOutcome, TddTaskInput, TddTaskSummary, TestAnnotationInput, TestAnnotationRow, TestArtifactInput, TestArtifactQueryOptions, TestArtifactRow, TestAttachmentInput, TestCaseInput, TestError, TestErrorInput, TestListEntry, TestLookupOptions, TestRunInput, TurnInput, TurnSearchOptions, TurnSummary, UpdateBehaviorInput, UpdateGoalInput, ValidateHypothesisInput, WriteCommitInput, WriteRunChangedFilesInput, WriteTddArtifactInput, WriteTddPhaseInput, WriteTddPhaseOutput };
1699
1862
  //# sourceMappingURL=testing.d.ts.map