@vitest-agent/sdk 1.3.3 → 2.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.
- package/errors/DataStoreError.js +22 -13
- package/index.d.ts +1032 -1101
- package/index.js +3 -3
- package/layers/ConfigLive.js +8 -9
- package/layers/DataReaderLive.js +2 -2
- package/layers/DataStoreLive.js +2 -2
- package/layers/DiscoveryRegistryLive.js +1 -1
- package/layers/LoggerLive.js +24 -24
- package/layers/PathResolutionLive.js +18 -17
- package/layers/PerClientSessionMapLive.js +1 -1
- package/layers/ProjectDiscoveryLive.js +1 -2
- package/layers/ProjectIdentityLive.js +16 -12
- package/layers/RunContextLive.js +20 -20
- package/migrations/0001_initial.js +1 -1
- package/migrations/registry_0001_initial.js +1 -1
- package/migrations/session_map_0001_initial.js +1 -1
- package/package.json +18 -18
- package/schemas/AgentReport.js +6 -9
- package/schemas/Baselines.js +3 -3
- package/schemas/CacheManifest.js +2 -2
- package/schemas/ChannelEvent.js +30 -3
- package/schemas/Common.js +76 -14
- package/schemas/ConsoleLeaks.js +2 -2
- package/schemas/Coverage.js +8 -8
- package/schemas/CoverageTargets.js +16 -10
- package/schemas/History.js +4 -4
- package/schemas/Identity.js +19 -7
- package/schemas/Options.js +3 -3
- package/schemas/RenderState.js +26 -19
- package/schemas/RunEvent.js +154 -115
- package/schemas/Tdd.js +16 -6
- package/schemas/Thresholds.js +6 -6
- package/schemas/Transport.js +1 -1
- package/schemas/Trends.js +7 -3
- package/schemas/turns/FileEditPayload.js +5 -1
- package/schemas/turns/HookFirePayload.js +15 -1
- package/schemas/turns/index.js +9 -1
- package/services/Config.js +3 -3
- package/services/DataReader.js +1 -1
- package/services/DataStore.js +1 -1
- package/services/DetailResolver.js +1 -1
- package/services/DiscoveryRegistry.js +1 -1
- package/services/EnvironmentDetector.js +1 -1
- package/services/ExecutorResolver.js +1 -1
- package/services/FormatSelector.js +1 -1
- package/services/HistoryTracker.js +1 -1
- package/services/OutputRenderer.js +1 -1
- package/services/PerClientSessionMap.js +2 -2
- package/services/ProjectDiscovery.js +1 -1
- package/services/ProjectIdentity.js +1 -1
- package/services/RunContext.js +1 -1
- package/testing/layers.js +2 -2
- package/testing.d.ts +312 -332
- package/tsdoc-metadata.json +1 -1
- package/utils/build-report.js +16 -1
- package/utils/ensure-migrated.js +3 -3
- package/utils/resolve-data-path.js +3 -3
- package/utils/resolve-workspace-key.js +11 -6
package/schemas/RunEvent.js
CHANGED
|
@@ -8,27 +8,41 @@ import { Schema } from "effect";
|
|
|
8
8
|
* Coverage metric whose threshold can be violated independently.
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
const CoverageMetric = Schema.
|
|
11
|
+
const CoverageMetric = Schema.Literals([
|
|
12
|
+
"lines",
|
|
13
|
+
"branches",
|
|
14
|
+
"functions",
|
|
15
|
+
"statements"
|
|
16
|
+
]).annotate({ identifier: "CoverageMetric" });
|
|
12
17
|
/**
|
|
13
18
|
* Severity tier for a suggested action emitted during a run.
|
|
14
19
|
* @public
|
|
15
20
|
*/
|
|
16
|
-
const ActionSeverity = Schema.
|
|
21
|
+
const ActionSeverity = Schema.Literals([
|
|
22
|
+
"info",
|
|
23
|
+
"warn",
|
|
24
|
+
"blocker"
|
|
25
|
+
]).annotate({ identifier: "ActionSeverity" });
|
|
17
26
|
/**
|
|
18
27
|
* Lifecycle scope of a Vitest setup/teardown hook.
|
|
19
28
|
* @public
|
|
20
29
|
*/
|
|
21
|
-
const HookType = Schema.
|
|
30
|
+
const HookType = Schema.Literals([
|
|
31
|
+
"beforeAll",
|
|
32
|
+
"afterAll",
|
|
33
|
+
"beforeEach",
|
|
34
|
+
"afterEach"
|
|
35
|
+
]).annotate({ identifier: "HookType" });
|
|
22
36
|
/**
|
|
23
37
|
* Terminal status of a Vitest hook run.
|
|
24
38
|
* @public
|
|
25
39
|
*/
|
|
26
|
-
const HookStatus = Schema.
|
|
40
|
+
const HookStatus = Schema.Literals(["passed", "failed"]).annotate({ identifier: "HookStatus" });
|
|
27
41
|
/**
|
|
28
42
|
* Output stream a captured user `console.log` was written to.
|
|
29
43
|
* @public
|
|
30
44
|
*/
|
|
31
|
-
const ConsoleLogLevel = Schema.
|
|
45
|
+
const ConsoleLogLevel = Schema.Literals(["stdout", "stderr"]).annotate({ identifier: "ConsoleLogLevel" });
|
|
32
46
|
/**
|
|
33
47
|
* A coverage gap surfaced to the renderer — a per-file shortfall that
|
|
34
48
|
* a renderer may want to call out individually.
|
|
@@ -38,7 +52,7 @@ const CoverageGap = Schema.Struct({
|
|
|
38
52
|
file: Schema.String,
|
|
39
53
|
missing: CoverageTotals,
|
|
40
54
|
uncoveredLines: Schema.optional(Schema.String)
|
|
41
|
-
}).
|
|
55
|
+
}).annotate({ identifier: "CoverageGap" });
|
|
42
56
|
/**
|
|
43
57
|
* The reducer projects this union into `RenderState`. Renderers
|
|
44
58
|
* never read the raw event stream — they read the projected state.
|
|
@@ -49,115 +63,140 @@ const CoverageGap = Schema.Struct({
|
|
|
49
63
|
* been updated to consume the new state shape.
|
|
50
64
|
* @public
|
|
51
65
|
*/
|
|
52
|
-
const RunEvent = Schema.Union(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}),
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}),
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
66
|
+
const RunEvent = Schema.Union([
|
|
67
|
+
Schema.TaggedStruct("RunStarted", {
|
|
68
|
+
runId: Schema.String,
|
|
69
|
+
startedAt: Schema.String,
|
|
70
|
+
configHash: Schema.String
|
|
71
|
+
}),
|
|
72
|
+
Schema.TaggedStruct("ModuleQueued", {
|
|
73
|
+
modulePath: Schema.String,
|
|
74
|
+
projectName: Schema.optional(Schema.String)
|
|
75
|
+
}),
|
|
76
|
+
Schema.TaggedStruct("ModuleStarted", {
|
|
77
|
+
modulePath: Schema.String,
|
|
78
|
+
startedAt: Schema.String,
|
|
79
|
+
projectName: Schema.optional(Schema.String)
|
|
80
|
+
}),
|
|
81
|
+
Schema.TaggedStruct("TestStarted", {
|
|
82
|
+
modulePath: Schema.String,
|
|
83
|
+
testName: Schema.String,
|
|
84
|
+
suitePath: Schema.Array(Schema.String)
|
|
85
|
+
}),
|
|
86
|
+
Schema.TaggedStruct("TestFinished", {
|
|
87
|
+
modulePath: Schema.String,
|
|
88
|
+
testName: Schema.String,
|
|
89
|
+
suitePath: Schema.Array(Schema.String),
|
|
90
|
+
status: TestState,
|
|
91
|
+
durationMs: Schema.Number,
|
|
92
|
+
error: Schema.optional(ReportError),
|
|
93
|
+
timedOut: Schema.optional(Schema.Boolean)
|
|
94
|
+
}),
|
|
95
|
+
Schema.TaggedStruct("ModuleFinished", {
|
|
96
|
+
modulePath: Schema.String,
|
|
97
|
+
passCount: Schema.Number,
|
|
98
|
+
failCount: Schema.Number,
|
|
99
|
+
skipCount: Schema.Number,
|
|
100
|
+
durationMs: Schema.Number,
|
|
101
|
+
projectName: Schema.optional(Schema.String),
|
|
102
|
+
timeoutCount: Schema.optional(Schema.Number),
|
|
103
|
+
tagCounts: Schema.optional(Schema.Record(Schema.String, Schema.Number))
|
|
104
|
+
}),
|
|
105
|
+
Schema.TaggedStruct("ModuleCollected", {
|
|
106
|
+
modulePath: Schema.String,
|
|
107
|
+
testCount: Schema.Number,
|
|
108
|
+
suiteCount: Schema.Number
|
|
109
|
+
}),
|
|
110
|
+
Schema.TaggedStruct("SuiteStarted", {
|
|
111
|
+
modulePath: Schema.String,
|
|
112
|
+
suitePath: Schema.Array(Schema.String),
|
|
113
|
+
suiteName: Schema.String
|
|
114
|
+
}),
|
|
115
|
+
Schema.TaggedStruct("SuiteFinished", {
|
|
116
|
+
modulePath: Schema.String,
|
|
117
|
+
suitePath: Schema.Array(Schema.String),
|
|
118
|
+
suiteName: Schema.String,
|
|
119
|
+
passCount: Schema.Number,
|
|
120
|
+
failCount: Schema.Number,
|
|
121
|
+
skipCount: Schema.Number
|
|
122
|
+
}),
|
|
123
|
+
Schema.TaggedStruct("HookStarted", {
|
|
124
|
+
modulePath: Schema.String,
|
|
125
|
+
hookType: HookType,
|
|
126
|
+
scopeName: Schema.String
|
|
127
|
+
}),
|
|
128
|
+
Schema.TaggedStruct("HookFinished", {
|
|
129
|
+
modulePath: Schema.String,
|
|
130
|
+
hookType: HookType,
|
|
131
|
+
scopeName: Schema.String,
|
|
132
|
+
durationMs: Schema.Number,
|
|
133
|
+
status: HookStatus,
|
|
134
|
+
error: Schema.optional(ReportError)
|
|
135
|
+
}),
|
|
136
|
+
Schema.TaggedStruct("ConsoleLog", {
|
|
137
|
+
modulePath: Schema.optional(Schema.String),
|
|
138
|
+
testName: Schema.optional(Schema.String),
|
|
139
|
+
level: ConsoleLogLevel,
|
|
140
|
+
content: Schema.String,
|
|
141
|
+
time: Schema.Number
|
|
142
|
+
}),
|
|
143
|
+
Schema.TaggedStruct("RunTimedOut", { message: Schema.String }),
|
|
144
|
+
Schema.TaggedStruct("TestAnnotated", {
|
|
145
|
+
modulePath: Schema.String,
|
|
146
|
+
testName: Schema.String,
|
|
147
|
+
suitePath: Schema.Array(Schema.String),
|
|
148
|
+
annotation: Schema.String
|
|
149
|
+
}),
|
|
150
|
+
Schema.TaggedStruct("TestArtifactRecorded", {
|
|
151
|
+
modulePath: Schema.String,
|
|
152
|
+
testName: Schema.String,
|
|
153
|
+
suitePath: Schema.Array(Schema.String),
|
|
154
|
+
artifact: Schema.String
|
|
155
|
+
}),
|
|
156
|
+
Schema.TaggedStruct("WatcherReady", {}),
|
|
157
|
+
Schema.TaggedStruct("WatcherRerun", {
|
|
158
|
+
triggerFiles: Schema.Array(Schema.String),
|
|
159
|
+
reason: Schema.optional(Schema.String)
|
|
160
|
+
}),
|
|
161
|
+
Schema.TaggedStruct("TrendComputed", {
|
|
162
|
+
direction: Schema.Literals([
|
|
163
|
+
"improving",
|
|
164
|
+
"regressing",
|
|
165
|
+
"stable"
|
|
166
|
+
]),
|
|
167
|
+
runCount: Schema.Number
|
|
168
|
+
}),
|
|
169
|
+
Schema.TaggedStruct("CoverageReady", {
|
|
170
|
+
metrics: CoverageTotals,
|
|
171
|
+
thresholds: MetricThresholds,
|
|
172
|
+
gaps: Schema.Array(CoverageGap)
|
|
173
|
+
}),
|
|
174
|
+
Schema.TaggedStruct("ThresholdViolation", {
|
|
175
|
+
metric: CoverageMetric,
|
|
176
|
+
expected: Schema.Number,
|
|
177
|
+
actual: Schema.Number
|
|
178
|
+
}),
|
|
179
|
+
Schema.TaggedStruct("FailureClassified", {
|
|
180
|
+
modulePath: Schema.String,
|
|
181
|
+
testName: Schema.String,
|
|
182
|
+
classification: TestClassification
|
|
183
|
+
}),
|
|
184
|
+
Schema.TaggedStruct("SuggestedAction", {
|
|
185
|
+
severity: ActionSeverity,
|
|
186
|
+
title: Schema.String,
|
|
187
|
+
detail: Schema.String,
|
|
188
|
+
targetTool: Schema.optional(Schema.String)
|
|
189
|
+
}),
|
|
190
|
+
Schema.TaggedStruct("RunFinished", {
|
|
191
|
+
runId: Schema.String,
|
|
192
|
+
finishedAt: Schema.String,
|
|
193
|
+
passCount: Schema.Number,
|
|
194
|
+
failCount: Schema.Number,
|
|
195
|
+
skipCount: Schema.Number,
|
|
196
|
+
durationMs: Schema.Number,
|
|
197
|
+
timeoutCount: Schema.optional(Schema.Number)
|
|
198
|
+
})
|
|
199
|
+
]).annotate({ identifier: "RunEvent" });
|
|
161
200
|
|
|
162
201
|
//#endregion
|
|
163
202
|
export { ActionSeverity, ConsoleLogLevel, FileCoverageReport as CoverageFile, CoverageGap, CoverageMetric, HookStatus, HookType, RunEvent };
|
package/schemas/Tdd.js
CHANGED
|
@@ -2,9 +2,19 @@ import { Schema } from "effect";
|
|
|
2
2
|
|
|
3
3
|
//#region src/schemas/Tdd.ts
|
|
4
4
|
/** @public */
|
|
5
|
-
const GoalStatus = Schema.
|
|
5
|
+
const GoalStatus = Schema.Literals([
|
|
6
|
+
"pending",
|
|
7
|
+
"in_progress",
|
|
8
|
+
"done",
|
|
9
|
+
"abandoned"
|
|
10
|
+
]).annotate({ identifier: "GoalStatus" });
|
|
6
11
|
/** @public */
|
|
7
|
-
const BehaviorStatus = Schema.
|
|
12
|
+
const BehaviorStatus = Schema.Literals([
|
|
13
|
+
"pending",
|
|
14
|
+
"in_progress",
|
|
15
|
+
"done",
|
|
16
|
+
"abandoned"
|
|
17
|
+
]).annotate({ identifier: "BehaviorStatus" });
|
|
8
18
|
/** @public */
|
|
9
19
|
const GoalRow = Schema.Struct({
|
|
10
20
|
id: Schema.Number,
|
|
@@ -13,7 +23,7 @@ const GoalRow = Schema.Struct({
|
|
|
13
23
|
goal: Schema.String,
|
|
14
24
|
status: GoalStatus,
|
|
15
25
|
createdAt: Schema.String
|
|
16
|
-
}).
|
|
26
|
+
}).annotate({ identifier: "GoalRow" });
|
|
17
27
|
/** @public */
|
|
18
28
|
const BehaviorRow = Schema.Struct({
|
|
19
29
|
id: Schema.Number,
|
|
@@ -23,12 +33,12 @@ const BehaviorRow = Schema.Struct({
|
|
|
23
33
|
suggestedTestName: Schema.NullOr(Schema.String),
|
|
24
34
|
status: BehaviorStatus,
|
|
25
35
|
createdAt: Schema.String
|
|
26
|
-
}).
|
|
36
|
+
}).annotate({ identifier: "BehaviorRow" });
|
|
27
37
|
/** @public */
|
|
28
38
|
const GoalDetail = Schema.Struct({
|
|
29
39
|
...GoalRow.fields,
|
|
30
40
|
behaviors: Schema.Array(BehaviorRow)
|
|
31
|
-
}).
|
|
41
|
+
}).annotate({ identifier: "GoalDetail" });
|
|
32
42
|
/** @public */
|
|
33
43
|
const BehaviorDetail = Schema.Struct({
|
|
34
44
|
...BehaviorRow.fields,
|
|
@@ -38,7 +48,7 @@ const BehaviorDetail = Schema.Struct({
|
|
|
38
48
|
status: GoalStatus
|
|
39
49
|
}),
|
|
40
50
|
dependencies: Schema.Array(BehaviorRow)
|
|
41
|
-
}).
|
|
51
|
+
}).annotate({ identifier: "BehaviorDetail" });
|
|
42
52
|
|
|
43
53
|
//#endregion
|
|
44
54
|
export { BehaviorDetail, BehaviorRow, BehaviorStatus, GoalDetail, GoalRow, GoalStatus };
|
package/schemas/Thresholds.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
2
|
|
|
3
3
|
//#region src/schemas/Thresholds.ts
|
|
4
4
|
/**
|
|
@@ -10,21 +10,21 @@ const MetricThresholds = Schema.Struct({
|
|
|
10
10
|
functions: Schema.optional(Schema.Number),
|
|
11
11
|
branches: Schema.optional(Schema.Number),
|
|
12
12
|
statements: Schema.optional(Schema.Number)
|
|
13
|
-
}).
|
|
13
|
+
}).annotate({ identifier: "MetricThresholds" });
|
|
14
14
|
/**
|
|
15
15
|
* A glob pattern paired with its metric thresholds.
|
|
16
16
|
* @public
|
|
17
17
|
*/
|
|
18
|
-
const PatternThresholds = Schema.Tuple(Schema.String, MetricThresholds).
|
|
18
|
+
const PatternThresholds = Schema.Tuple([Schema.String, MetricThresholds]).annotate({ identifier: "PatternThresholds" });
|
|
19
19
|
/**
|
|
20
20
|
* Fully resolved thresholds ready for evaluation.
|
|
21
21
|
* @public
|
|
22
22
|
*/
|
|
23
23
|
const ResolvedThresholds = Schema.Struct({
|
|
24
24
|
global: MetricThresholds,
|
|
25
|
-
perFile: Schema.
|
|
26
|
-
patterns: Schema.
|
|
27
|
-
}).
|
|
25
|
+
perFile: Schema.Boolean.pipe(Schema.withDecodingDefaultKey(Effect.succeed(false))),
|
|
26
|
+
patterns: Schema.Array(PatternThresholds).pipe(Schema.withDecodingDefaultKey(Effect.succeed([])))
|
|
27
|
+
}).annotate({ identifier: "ResolvedThresholds" });
|
|
28
28
|
|
|
29
29
|
//#endregion
|
|
30
30
|
export { MetricThresholds, PatternThresholds, ResolvedThresholds };
|
package/schemas/Transport.js
CHANGED
|
@@ -10,7 +10,7 @@ import { Schema } from "effect";
|
|
|
10
10
|
* diff and no breaking API change at the call site.
|
|
11
11
|
* @public
|
|
12
12
|
*/
|
|
13
|
-
const Transport = Schema.Union(Schema.Struct({ kind: Schema.Literal("local") })).
|
|
13
|
+
const Transport = Schema.Union([Schema.Struct({ kind: Schema.Literal("local") })]).annotate({ identifier: "Transport" });
|
|
14
14
|
|
|
15
15
|
//#endregion
|
|
16
16
|
export { Transport };
|
package/schemas/Trends.js
CHANGED
|
@@ -10,14 +10,18 @@ const TrendEntry = Schema.Struct({
|
|
|
10
10
|
timestamp: Schema.String,
|
|
11
11
|
coverage: CoverageTotals,
|
|
12
12
|
delta: CoverageTotals,
|
|
13
|
-
direction: Schema.
|
|
13
|
+
direction: Schema.Literals([
|
|
14
|
+
"improving",
|
|
15
|
+
"regressing",
|
|
16
|
+
"stable"
|
|
17
|
+
]),
|
|
14
18
|
targetsHash: Schema.optional(Schema.String)
|
|
15
|
-
}).
|
|
19
|
+
}).annotate({ identifier: "TrendEntry" });
|
|
16
20
|
/**
|
|
17
21
|
* Per-project trend record with sliding window of entries.
|
|
18
22
|
* @public
|
|
19
23
|
*/
|
|
20
|
-
const TrendRecord = Schema.Struct({ entries: Schema.Array(TrendEntry) }).
|
|
24
|
+
const TrendRecord = Schema.Struct({ entries: Schema.Array(TrendEntry) }).annotate({ identifier: "TrendRecord" });
|
|
21
25
|
|
|
22
26
|
//#endregion
|
|
23
27
|
export { TrendEntry, TrendRecord };
|
|
@@ -5,7 +5,11 @@ import { Schema } from "effect";
|
|
|
5
5
|
const FileEditPayload = Schema.Struct({
|
|
6
6
|
type: Schema.Literal("file_edit"),
|
|
7
7
|
file_path: Schema.String,
|
|
8
|
-
edit_kind: Schema.
|
|
8
|
+
edit_kind: Schema.Literals([
|
|
9
|
+
"write",
|
|
10
|
+
"edit",
|
|
11
|
+
"multi_edit"
|
|
12
|
+
]),
|
|
9
13
|
lines_added: Schema.optional(Schema.Number),
|
|
10
14
|
lines_removed: Schema.optional(Schema.Number),
|
|
11
15
|
diff: Schema.optional(Schema.String)
|
|
@@ -4,7 +4,21 @@ import { Schema } from "effect";
|
|
|
4
4
|
/** @public */
|
|
5
5
|
const HookFirePayload = Schema.Struct({
|
|
6
6
|
type: Schema.Literal("hook_fire"),
|
|
7
|
-
hook_kind: Schema.
|
|
7
|
+
hook_kind: Schema.Literals([
|
|
8
|
+
"SessionStart",
|
|
9
|
+
"SessionEnd",
|
|
10
|
+
"Stop",
|
|
11
|
+
"StopFailure",
|
|
12
|
+
"SubagentStart",
|
|
13
|
+
"SubagentStop",
|
|
14
|
+
"PreCompact",
|
|
15
|
+
"PostCompact",
|
|
16
|
+
"PreToolUse",
|
|
17
|
+
"PostToolUse",
|
|
18
|
+
"PostToolUseFailure",
|
|
19
|
+
"UserPromptSubmit",
|
|
20
|
+
"FileChanged"
|
|
21
|
+
]),
|
|
8
22
|
chat_id: Schema.optional(Schema.String),
|
|
9
23
|
previous_record_failures: Schema.optional(Schema.Array(Schema.String))
|
|
10
24
|
});
|
package/schemas/turns/index.js
CHANGED
|
@@ -9,7 +9,15 @@ import { Schema } from "effect";
|
|
|
9
9
|
|
|
10
10
|
//#region src/schemas/turns/index.ts
|
|
11
11
|
/** @public */
|
|
12
|
-
const TurnPayload = Schema.Union(
|
|
12
|
+
const TurnPayload = Schema.Union([
|
|
13
|
+
UserPromptPayload,
|
|
14
|
+
ToolCallPayload,
|
|
15
|
+
ToolResultPayload,
|
|
16
|
+
FileEditPayload,
|
|
17
|
+
HookFirePayload,
|
|
18
|
+
NotePayload,
|
|
19
|
+
HypothesisPayload
|
|
20
|
+
]);
|
|
13
21
|
|
|
14
22
|
//#endregion
|
|
15
23
|
export { FileEditPayload, HookFirePayload, HypothesisPayload, NotePayload, ToolCallPayload, ToolResultPayload, TurnPayload, UserPromptPayload };
|
package/services/Config.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ConfigFile } from "config-file
|
|
1
|
+
import { ConfigFile } from "@effected/config-file";
|
|
2
2
|
|
|
3
3
|
//#region src/services/Config.ts
|
|
4
4
|
/**
|
|
5
|
-
* Typed
|
|
5
|
+
* Typed service class (Context tag) for the vitest-agent config file service.
|
|
6
6
|
*
|
|
7
7
|
* Both runtime packages (reporter, MCP) yield this tag to access the loaded
|
|
8
8
|
* `VitestAgentConfig`. The live layer is built per `projectDir` via
|
|
9
9
|
* `ConfigLive(projectDir)`.
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
var VitestAgentConfigFile = class extends ConfigFile.Service()("vitest-agent/Config") {};
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
15
15
|
export { VitestAgentConfigFile };
|
package/services/DataReader.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Context } from "effect";
|
|
|
2
2
|
|
|
3
3
|
//#region src/services/DataReader.ts
|
|
4
4
|
/** @public */
|
|
5
|
-
var DataReader = class extends Context.
|
|
5
|
+
var DataReader = class extends Context.Service()("vitest-agent/DataReader") {};
|
|
6
6
|
|
|
7
7
|
//#endregion
|
|
8
8
|
export { DataReader };
|
package/services/DataStore.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Context } from "effect";
|
|
|
2
2
|
|
|
3
3
|
//#region src/services/DataStore.ts
|
|
4
4
|
/** @public */
|
|
5
|
-
var DataStore = class extends Context.
|
|
5
|
+
var DataStore = class extends Context.Service()("vitest-agent/DataStore") {};
|
|
6
6
|
|
|
7
7
|
//#endregion
|
|
8
8
|
export { DataStore };
|
|
@@ -2,7 +2,7 @@ import { Context } from "effect";
|
|
|
2
2
|
|
|
3
3
|
//#region src/services/DetailResolver.ts
|
|
4
4
|
/** @public */
|
|
5
|
-
var DetailResolver = class extends Context.
|
|
5
|
+
var DetailResolver = class extends Context.Service()("vitest-agent/DetailResolver") {};
|
|
6
6
|
|
|
7
7
|
//#endregion
|
|
8
8
|
export { DetailResolver };
|
|
@@ -2,7 +2,7 @@ import { Context } from "effect";
|
|
|
2
2
|
|
|
3
3
|
//#region src/services/DiscoveryRegistry.ts
|
|
4
4
|
/** @public */
|
|
5
|
-
var DiscoveryRegistry = class extends Context.
|
|
5
|
+
var DiscoveryRegistry = class extends Context.Service()("vitest-agent/DiscoveryRegistry") {};
|
|
6
6
|
|
|
7
7
|
//#endregion
|
|
8
8
|
export { DiscoveryRegistry };
|
|
@@ -2,7 +2,7 @@ import { Context } from "effect";
|
|
|
2
2
|
|
|
3
3
|
//#region src/services/EnvironmentDetector.ts
|
|
4
4
|
/** @public */
|
|
5
|
-
var EnvironmentDetector = class extends Context.
|
|
5
|
+
var EnvironmentDetector = class extends Context.Service()("vitest-agent/EnvironmentDetector") {};
|
|
6
6
|
|
|
7
7
|
//#endregion
|
|
8
8
|
export { EnvironmentDetector };
|
|
@@ -2,7 +2,7 @@ import { Context } from "effect";
|
|
|
2
2
|
|
|
3
3
|
//#region src/services/ExecutorResolver.ts
|
|
4
4
|
/** @public */
|
|
5
|
-
var ExecutorResolver = class extends Context.
|
|
5
|
+
var ExecutorResolver = class extends Context.Service()("vitest-agent/ExecutorResolver") {};
|
|
6
6
|
|
|
7
7
|
//#endregion
|
|
8
8
|
export { ExecutorResolver };
|
|
@@ -2,7 +2,7 @@ import { Context } from "effect";
|
|
|
2
2
|
|
|
3
3
|
//#region src/services/FormatSelector.ts
|
|
4
4
|
/** @public */
|
|
5
|
-
var FormatSelector = class extends Context.
|
|
5
|
+
var FormatSelector = class extends Context.Service()("vitest-agent/FormatSelector") {};
|
|
6
6
|
|
|
7
7
|
//#endregion
|
|
8
8
|
export { FormatSelector };
|
|
@@ -14,7 +14,7 @@ import { Context } from "effect";
|
|
|
14
14
|
*/
|
|
15
15
|
const historyKey = (modulePath, fullName) => JSON.stringify([modulePath, fullName]);
|
|
16
16
|
/** @public */
|
|
17
|
-
var HistoryTracker = class extends Context.
|
|
17
|
+
var HistoryTracker = class extends Context.Service()("vitest-agent/HistoryTracker") {};
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
20
20
|
export { HistoryTracker, historyKey };
|
|
@@ -2,7 +2,7 @@ import { Context } from "effect";
|
|
|
2
2
|
|
|
3
3
|
//#region src/services/OutputRenderer.ts
|
|
4
4
|
/** @public */
|
|
5
|
-
var OutputRenderer = class extends Context.
|
|
5
|
+
var OutputRenderer = class extends Context.Service()("vitest-agent/OutputRenderer") {};
|
|
6
6
|
|
|
7
7
|
//#endregion
|
|
8
8
|
export { OutputRenderer };
|
|
@@ -9,14 +9,14 @@ import { Context } from "effect";
|
|
|
9
9
|
* methods would be a type error.
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
|
-
var PerClientSessionMapReader = class extends Context.
|
|
12
|
+
var PerClientSessionMapReader = class extends Context.Service()("vitest-agent/PerClientSessionMapReader") {};
|
|
13
13
|
/**
|
|
14
14
|
* Read-write side of the session map. Sidecar provides this; the
|
|
15
15
|
* Writer layer also satisfies the Reader tag so consumers of either
|
|
16
16
|
* one resolve.
|
|
17
17
|
* @public
|
|
18
18
|
*/
|
|
19
|
-
var PerClientSessionMapWriter = class extends Context.
|
|
19
|
+
var PerClientSessionMapWriter = class extends Context.Service()("vitest-agent/PerClientSessionMapWriter") {};
|
|
20
20
|
|
|
21
21
|
//#endregion
|
|
22
22
|
export { PerClientSessionMapReader, PerClientSessionMapWriter };
|
|
@@ -2,7 +2,7 @@ import { Context } from "effect";
|
|
|
2
2
|
|
|
3
3
|
//#region src/services/ProjectDiscovery.ts
|
|
4
4
|
/** @public */
|
|
5
|
-
var ProjectDiscovery = class extends Context.
|
|
5
|
+
var ProjectDiscovery = class extends Context.Service()("vitest-agent/ProjectDiscovery") {};
|
|
6
6
|
|
|
7
7
|
//#endregion
|
|
8
8
|
export { ProjectDiscovery };
|
|
@@ -57,7 +57,7 @@ const resolveProjectIdentityFromCandidates = (candidates) => {
|
|
|
57
57
|
* pre-built `ResolvedIdentity`.
|
|
58
58
|
* @public
|
|
59
59
|
*/
|
|
60
|
-
var ProjectIdentity = class extends Context.
|
|
60
|
+
var ProjectIdentity = class extends Context.Service()("vitest-agent/ProjectIdentity") {};
|
|
61
61
|
|
|
62
62
|
//#endregion
|
|
63
63
|
export { ProjectIdentity, resolveProjectIdentityFromCandidates };
|
package/services/RunContext.js
CHANGED
|
@@ -38,7 +38,7 @@ var AgentContext = class extends Schema.Class("vitest-agent/AgentContext")({
|
|
|
38
38
|
* returns whatever the test fixture passes.
|
|
39
39
|
* @public
|
|
40
40
|
*/
|
|
41
|
-
var RunContext$ = class extends Context.
|
|
41
|
+
var RunContext$ = class extends Context.Service()("vitest-agent/RunContextService") {};
|
|
42
42
|
/**
|
|
43
43
|
* Re-export the service tag under a less-collision-prone name. The
|
|
44
44
|
* `RunContext` Schema.Class above shares its symbol-name with the
|