@vitest-agent/mcp 6.1.10 → 6.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
@@ -17,10 +17,10 @@
17
17
  *
18
18
  * @packageDocumentation
19
19
  */
20
- import { ToolRefusal, ToolRefusal as ToolRefusal$1 } from "@effected/mcp-kit";
21
20
  import { Context, Effect, Layer, Schema, Scope, Stdio } from "effect";
22
21
  import { McpServer, Tool, Toolkit } from "effect/ai";
23
22
  import { DataReader, DataStore, ProjectDiscovery, SessionContext } from "@vitest-agent/engine";
23
+ import { ToolRefusal, ToolRefusal as ToolRefusal$1 } from "@effected/mcp-kit";
24
24
  import { Remediation } from "@effected/kit";
25
25
  /**
26
26
  * Formerly rendered a tool's encoded result as a markdown `content[0].text`
package/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { ToolRefusal } from "@effected/mcp-kit";
1
2
  import { RenderText } from "./annotations.js";
2
3
  import { PromptsLayer } from "./prompts/layer.js";
3
4
  import { SERVER_INSTRUCTIONS, ServerLayer } from "./server.js";
@@ -34,6 +35,5 @@ import { TriageBriefInput, TriageBriefResult, handleTriageBrief, triageBriefTool
34
35
  import { TurnSearchInput, TurnSearchResult, handleTurnSearch, turnSearchTool } from "./tools/turn-search.js";
35
36
  import { WrapupPromptInput, WrapupPromptResult, handleWrapupPrompt, wrapupPromptTool } from "./tools/wrapup-prompt.js";
36
37
  import { CURRENT_MCP_VERSION } from "./version.js";
37
- import { ToolRefusal } from "@effected/mcp-kit";
38
38
 
39
39
  export { AcceptanceMetricsResult, CURRENT_MCP_VERSION, CacheHealthResult, CommitChangesInput, CommitChangesResult, ConfigureInput, ConfigureResult, FailureSignatureGetInput, FailureSignatureGetResult, FileCoverageInput, FileCoverageResult, HelpResult, HypothesisInput, HypothesisResult, InventoryInput, InventoryResult, Kit, McpSession, NoteParams, NoteResult, PhaseTransitionInput, PhaseTransitionResult, PingResult, PromptsLayer, RegisterAgentInput, RegisterAgentResult, RenderText, RunTestsInput, RunTestsResult, SERVER_INSTRUCTIONS, ServerLayer, SettingsListResult, TddArtifactListInput, TddArtifactListResult, TddBehaviorInput, TddBehaviorResult, TddGoalInput, TddGoalResult, TddProgressPushInput, TddProgressPushResult, TddTaskInput, TddTaskResult, TestCoverageInput, TestCoverageResult, TestErrorsInput, TestErrorsResult, TestHistoryInput, TestHistoryResult, TestInput, TestOverviewInput, TestOverviewResult, TestResult, TestStatusInput, TestStatusResult, TestTrendsInput, TestTrendsResult, ToolRefusal, ToolsLayer, TriageBriefInput, TriageBriefResult, TurnSearchInput, TurnSearchResult, WrapupPromptInput, WrapupPromptResult, acceptanceMetricsTool, cacheHealthTool, commitChangesTool, configureTool, createCurrentSessionIdRef, createSessionContextRef, failureSignatureGetTool, fileCoverageTool, handleAcceptanceMetrics, handleCacheHealth, handleCommitChanges, handleConfigure, handleFailureSignatureGet, handleFileCoverage, handleHelp, handleHypothesis, handleInventory, handleNote, handlePhaseTransitionRequest, handlePing, handleRegisterAgent, handleRunTests, handleSettingsList, handleTddArtifactList, handleTddBehavior, handleTddGoal, handleTddProgressPush, handleTddTask, handleTest, handleTestCoverage, handleTestErrors, handleTestHistory, handleTestOverview, handleTestStatus, handleTestTrends, handleTriageBrief, handleTurnSearch, handleWrapupPrompt, helpTool, hypothesisTool, inventoryTool, noteTool, pingTool, registerAgentTool, runTestsTool, sessionContextFromEnv, settingsListTool, tddArtifactListTool, tddBehaviorTool, tddGoalTool, tddPhaseTransitionRequestTool, tddProgressPushTool, tddTaskTool, testCoverageTool, testErrorsTool, testHistoryTool, testOverviewTool, testStatusTool, testTool, testTrendsTool, toolHandlers, triageBriefTool, turnSearchTool, wrapupPromptTool };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitest-agent/mcp",
3
- "version": "6.1.10",
3
+ "version": "6.2.0",
4
4
  "private": false,
5
5
  "description": "Model Context Protocol server for vitest-agent. Exposes 30 tools for agent access to test data, TDD lifecycle, and session management.",
6
6
  "keywords": [
@@ -43,19 +43,19 @@
43
43
  "vitest-agent-mcp": "bin/vitest-agent-mcp.js"
44
44
  },
45
45
  "dependencies": {
46
- "@effect/platform-node": "4.1.4",
46
+ "@effect/platform-node": "4.1.5",
47
47
  "@effected/commands": "0.22.0",
48
- "@effected/git": "0.32.0",
49
- "@effected/glob": "0.22.0",
48
+ "@effected/git": "0.33.0",
49
+ "@effected/glob": "0.23.0",
50
50
  "@effected/kit": "0.14.0",
51
- "@effected/mcp-kit": "0.15.0",
52
- "@effected/walker": "0.29.0",
53
- "@vitest-agent/engine": "3.2.7",
54
- "@vitest-agent/sdk": "9.0.5",
55
- "effect": "4.1.4"
51
+ "@effected/mcp-kit": "0.15.1",
52
+ "@effected/walker": "0.30.0",
53
+ "@vitest-agent/engine": "3.3.0",
54
+ "@vitest-agent/sdk": "9.1.0",
55
+ "effect": "4.1.5"
56
56
  },
57
57
  "peerDependencies": {
58
- "vitest": "^5.0.0"
58
+ "vitest": "^5.1.0"
59
59
  },
60
60
  "engines": {
61
61
  "node": ">=24.11.0"
package/prompts/layer.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { Effect, Layer, Schema } from "effect";
2
+ import { McpSchema, McpServer } from "effect/ai";
1
3
  import { McpSession } from "../session.js";
2
4
  import { explainFailurePrompt } from "./explain-failure.js";
3
5
  import { regressionSincePassPrompt } from "./regression-since-pass.js";
@@ -5,8 +7,6 @@ import { tddResumePrompt } from "./tdd-resume.js";
5
7
  import { triagePrompt } from "./triage.js";
6
8
  import { whyFlakyPrompt } from "./why-flaky.js";
7
9
  import { wrapupPrompt } from "./wrapup.js";
8
- import { Effect, Layer, Schema } from "effect";
9
- import { McpSchema, McpServer } from "effect/ai";
10
10
 
11
11
  // src/prompts/layer.ts
12
12
  /**
@@ -11,16 +11,16 @@ function whyFlakyPrompt(args) {
11
11
  "Steps:",
12
12
  "",
13
13
  `1. Call \`test_history\` for ${args.project ? `\`project: "${args.project}"\` and ` : ""}the named test to read the recent pass/fail pattern.`,
14
- "2. For any recent failure with a `signature_hash`, call `failure_signature_get` to see whether the same signature has appeared in earlier runs. A repeating signature is structural; a one-off signature is environmental.",
14
+ "2. For any recent failure with a `signature_hash`, call `failure_signature_get` to see whether the same signature has appeared in earlier runs. A repeating signature is structural; a one-off signature is environmental. `occurrenceCount` counts each finally-failed test once per run and skips sightings on tests that passed on a retry, so `occurrenceCount: 0` means the signature has only appeared on attempts that later passed: a flake. Do not compare it with the length of `recentErrors`: every retry attempt writes its own error row, and the list is capped at 10. Otherwise read flakiness from step 1's pass/fail history.",
15
15
  "3. Look for these classic flake sources, in order:",
16
- " - **Timing-based assertions** — `vi.useFakeTimers` not paired with `vi.useRealTimers`, or assertions that race with `setTimeout`/`setInterval`.",
16
+ " - **Timing-based assertions** — `vi.useFakeTimers` not paired with `vi.useRealTimers`, or assertions that race with `setTimeout`/`setInterval`. Fake timers do not patch `node:timers` or `node:timers/promises` unless you opt in with `vi.useFakeTimers({ fakeNodeBuiltins: true })` (Vitest 5.1+), so code importing from those modules keeps using real timers.",
17
17
  " - **Shared state across tests** — module-level mutables, `globalThis`, file system fixtures not cleaned up.",
18
18
  " - **External I/O** — network calls without mocks, real database connections, real disk writes.",
19
19
  " - **Non-deterministic input** — `Date.now()`, `Math.random()`, environment-dependent paths.",
20
20
  "",
21
21
  "Decide: is this a **true flake** (intermittent based on timing/state) or an **environmental failure** (consistent given specific environment conditions)? They have different fixes.",
22
22
  "",
23
- "If you reach a conclusion, record it via `hypothesis_record` with the test_error_id and stack_frame_id of the most recent failure as evidence."
23
+ "If you reach a conclusion, record it via `hypothesis` (action `record`) with the test_error_id and stack_frame_id of the most recent failure as evidence."
24
24
  ].join("\n")
25
25
  }
26
26
  }] };
package/replay.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { ToolReplay } from "@effected/mcp-kit";
2
- import { Effect, Option } from "effect";
3
2
  import { DataReader, DataStore } from "@vitest-agent/engine";
3
+ import { DateTime, Effect, Option } from "effect";
4
4
 
5
5
  // src/replay.ts
6
6
  /**
@@ -69,12 +69,12 @@ const makeReplayStore = Effect.gen(function* () {
69
69
  },
70
70
  set: (storeKey, value) => {
71
71
  const [tool, key] = splitStoreKey(storeKey);
72
- return store.recordIdempotentResponse({
72
+ return Effect.flatMap(DateTime.now, (now) => store.recordIdempotentResponse({
73
73
  procedurePath: tool,
74
74
  key,
75
75
  resultJson: value,
76
- createdAt: (/* @__PURE__ */ new Date()).toISOString()
77
- });
76
+ createdAt: DateTime.formatIso(now)
77
+ }));
78
78
  }
79
79
  };
80
80
  });
package/server.js CHANGED
@@ -1,8 +1,8 @@
1
- import { PromptsLayer } from "./prompts/layer.js";
2
- import { Kit, ToolsLayer } from "./toolkit.js";
3
1
  import { McpStdio, McpToolkit } from "@effected/mcp-kit";
4
2
  import { Effect, Layer } from "effect";
5
3
  import { McpServer } from "effect/ai";
4
+ import { PromptsLayer } from "./prompts/layer.js";
5
+ import { Kit, ToolsLayer } from "./toolkit.js";
6
6
 
7
7
  // src/server.ts
8
8
  /** One-line human summary agents see on `serverInfo.description`. */
package/toolkit.js CHANGED
@@ -1,3 +1,6 @@
1
+ import { McpToolkit } from "@effected/mcp-kit";
2
+ import { Effect } from "effect";
3
+ import { Toolkit } from "effect/ai";
1
4
  import { hypothesisReplayKey, makeReplayStore, replayWith, tddBehaviorReplayKey, tddGoalReplayKey, tddTaskReplayKey } from "./replay.js";
2
5
  import { acceptanceMetricsTool, handleAcceptanceMetrics } from "./tools/acceptance-metrics.js";
3
6
  import { cacheHealthTool, handleCacheHealth } from "./tools/cache-health.js";
@@ -29,9 +32,6 @@ import { handleTestTrends, testTrendsTool } from "./tools/trends.js";
29
32
  import { handleTriageBrief, triageBriefTool } from "./tools/triage-brief.js";
30
33
  import { handleTurnSearch, turnSearchTool } from "./tools/turn-search.js";
31
34
  import { handleWrapupPrompt, wrapupPromptTool } from "./tools/wrapup-prompt.js";
32
- import { McpToolkit } from "@effected/mcp-kit";
33
- import { Effect } from "effect";
34
- import { Toolkit } from "effect/ai";
35
35
 
36
36
  // src/toolkit.ts
37
37
  /**
@@ -1,6 +1,6 @@
1
+ import { DataReader } from "@vitest-agent/engine";
1
2
  import { Effect, Schema } from "effect";
2
3
  import { Tool } from "effect/ai";
3
- import { DataReader } from "@vitest-agent/engine";
4
4
 
5
5
  // src/tools/acceptance-metrics.ts
6
6
  const totalAnnotation = { description: "Sample size — number of observations the metric ratio is computed over." };
@@ -1,8 +1,8 @@
1
1
  import { ToolOutputSchema } from "@effected/mcp-kit";
2
- import { Effect, Option, Schema } from "effect";
3
- import { Tool } from "effect/ai";
4
2
  import { DataReader } from "@vitest-agent/engine";
5
3
  import { CacheManifest } from "@vitest-agent/sdk";
4
+ import { Clock, Effect, Option, Schema } from "effect";
5
+ import { Tool } from "effect/ai";
6
6
 
7
7
  // src/tools/cache-health.ts
8
8
  const ManifestPresent = Schema.Struct({
@@ -38,7 +38,7 @@ const handleCacheHealth = () => Effect.gen(function* () {
38
38
  const manifestOpt = yield* (yield* DataReader).getManifest();
39
39
  if (Option.isNone(manifestOpt)) return { manifestPresent: false };
40
40
  const manifest = manifestOpt.value;
41
- const ageMs = Date.now() - new Date(manifest.updatedAt).getTime();
41
+ const ageMs = (yield* Clock.currentTimeMillis) - new Date(manifest.updatedAt).getTime();
42
42
  return {
43
43
  manifestPresent: true,
44
44
  manifest,
@@ -1,6 +1,6 @@
1
+ import { DataReader } from "@vitest-agent/engine";
1
2
  import { Effect, Schema } from "effect";
2
3
  import { Tool } from "effect/ai";
3
- import { DataReader } from "@vitest-agent/engine";
4
4
 
5
5
  // src/tools/commit-changes.ts
6
6
  const FileRow = Schema.Struct({
@@ -1,7 +1,7 @@
1
1
  import { ToolOutputSchema } from "@effected/mcp-kit";
2
+ import { DataReader } from "@vitest-agent/engine";
2
3
  import { Effect, Option, Schema } from "effect";
3
4
  import { Tool } from "effect/ai";
4
- import { DataReader } from "@vitest-agent/engine";
5
5
 
6
6
  // src/tools/configure.ts
7
7
  const SettingsRowSchema = Schema.Struct({
package/tools/coverage.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { ToolOutputSchema } from "@effected/mcp-kit";
2
- import { Effect, Option, Schema } from "effect";
3
- import { Tool } from "effect/ai";
4
2
  import { DataReader } from "@vitest-agent/engine";
5
3
  import { CoverageReport } from "@vitest-agent/sdk";
4
+ import { Effect, Option, Schema } from "effect";
5
+ import { Tool } from "effect/ai";
6
6
 
7
7
  // src/tools/coverage.ts
8
8
  const CoverageAvailable = Schema.Struct({
package/tools/errors.js CHANGED
@@ -1,6 +1,6 @@
1
+ import { DataReader } from "@vitest-agent/engine";
1
2
  import { Effect, Schema } from "effect";
2
3
  import { Tool } from "effect/ai";
3
- import { DataReader } from "@vitest-agent/engine";
4
4
 
5
5
  // src/tools/errors.ts
6
6
  /** One annotation attached to a failing test, surfaced with its error. */
@@ -1,7 +1,7 @@
1
1
  import { ToolOutputSchema } from "@effected/mcp-kit";
2
+ import { DataReader } from "@vitest-agent/engine";
2
3
  import { Effect, Option, Schema } from "effect";
3
4
  import { Tool } from "effect/ai";
4
- import { DataReader } from "@vitest-agent/engine";
5
5
 
6
6
  // src/tools/failure-signature-get.ts
7
7
  const RecentError = Schema.Struct({
@@ -18,7 +18,7 @@ const SignatureFound = Schema.Struct({
18
18
  firstSeenRunId: Schema.NullOr(Schema.Number),
19
19
  firstSeenAt: Schema.String,
20
20
  lastSeenAt: Schema.NullOr(Schema.String),
21
- occurrenceCount: Schema.Finite.annotate({ description: "Total times this signature has been observed." }),
21
+ occurrenceCount: Schema.Finite.annotate({ description: "Failed-test occurrences, counted once per test per run. Sightings on tests that passed on a retry advance lastSeenAt but are not counted, so 0 means the signature was only seen on retried-then-passed tests." }),
22
22
  recentErrors: Schema.Array(RecentError)
23
23
  });
24
24
  const SignatureMissing = Schema.Struct({
@@ -1,8 +1,8 @@
1
1
  import { ToolOutputSchema } from "@effected/mcp-kit";
2
- import { Effect, Option, Schema } from "effect";
3
- import { Tool } from "effect/ai";
4
2
  import { DataReader } from "@vitest-agent/engine";
5
3
  import { CoverageTotals, FileCoverageReport } from "@vitest-agent/sdk";
4
+ import { Effect, Option, Schema } from "effect";
5
+ import { Tool } from "effect/ai";
6
6
 
7
7
  // src/tools/file-coverage.ts
8
8
  const CoverageGlobalThresholds = Schema.Struct({
package/tools/history.js CHANGED
@@ -1,7 +1,7 @@
1
- import { Effect, Schema } from "effect";
2
- import { Tool } from "effect/ai";
3
1
  import { DataReader } from "@vitest-agent/engine";
4
2
  import { HistoryRecord, StrayOutput } from "@vitest-agent/sdk";
3
+ import { Effect, Schema } from "effect";
4
+ import { Tool } from "effect/ai";
5
5
 
6
6
  // src/tools/history.ts
7
7
  const FlakyTestRow = Schema.Struct({
@@ -1,9 +1,9 @@
1
- import { McpSession } from "../session.js";
2
- import { IdempotentReplayMarker } from "../utils/replay-marker.js";
3
1
  import { McpToolkit, ToolOutputSchema, ToolRefusal } from "@effected/mcp-kit";
4
- import { Effect, Match, Option, Schema } from "effect";
5
- import { Tool } from "effect/ai";
6
2
  import { DataReader, DataStore } from "@vitest-agent/engine";
3
+ import { DateTime, Effect, Match, Option, Schema } from "effect";
4
+ import { Tool } from "effect/ai";
5
+ import { McpSession } from "../session.js";
6
+ import { IdempotentReplayMarker } from "../utils/replay-marker.js";
7
7
 
8
8
  // src/tools/hypothesis.ts
9
9
  const HypothesisRowSchema = Schema.Struct({
@@ -151,7 +151,7 @@ const handleHypothesis = (input) => Match.value(input).pipe(Match.discriminators
151
151
  yield* (yield* DataStore).validateHypothesis({
152
152
  id: variant.id,
153
153
  outcome: variant.outcome,
154
- validatedAt: variant.validatedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
154
+ validatedAt: variant.validatedAt ?? DateTime.formatIso(yield* DateTime.now),
155
155
  ...variant.validatedTurnId !== void 0 && { validatedTurnId: variant.validatedTurnId }
156
156
  }).pipe(Effect.catchIf((error) => error.reason.startsWith("unknown hypothesis id"), () => Effect.fail(ToolRefusal.refuse(`Unknown hypothesis id ${variant.id}.`, {
157
157
  hint: "Use the id hypothesis action='record' returned, or find it with hypothesis action='list'.",
@@ -1,8 +1,8 @@
1
- import { collectProjectRows, resolveProjectTargets } from "./_project-groups.js";
2
1
  import { McpToolkit, ToolOutputSchema, ToolRefusal } from "@effected/mcp-kit";
2
+ import { DataReader } from "@vitest-agent/engine";
3
3
  import { Effect, Match, Option, Schema } from "effect";
4
4
  import { Tool } from "effect/ai";
5
- import { DataReader } from "@vitest-agent/engine";
5
+ import { collectProjectRows, resolveProjectTargets } from "./_project-groups.js";
6
6
 
7
7
  // src/tools/inventory.ts
8
8
  const ProjectRunSummary = Schema.Struct({
package/tools/note.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { McpToolkit, ToolOutputSchema, ToolRefusal } from "@effected/mcp-kit";
2
+ import { DataReader, DataStore } from "@vitest-agent/engine";
2
3
  import { Effect, Match, Option, Schema } from "effect";
3
4
  import { Tool } from "effect/ai";
4
- import { DataReader, DataStore } from "@vitest-agent/engine";
5
5
 
6
6
  // src/tools/note.ts
7
7
  const NoteScope = Schema.Literals([
package/tools/overview.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ToolOutputSchema } from "@effected/mcp-kit";
2
+ import { DataReader } from "@vitest-agent/engine";
2
3
  import { Effect, Option, Schema } from "effect";
3
4
  import { Tool } from "effect/ai";
4
- import { DataReader } from "@vitest-agent/engine";
5
5
 
6
6
  // src/tools/overview.ts
7
7
  const ProjectRunSummary = Schema.Struct({
package/tools/ping.js CHANGED
@@ -1,6 +1,6 @@
1
+ import { CurrentDistribution, DistributionField } from "@effected/kit";
1
2
  import { Effect, Option, Schema } from "effect";
2
3
  import { Tool } from "effect/ai";
3
- import { CurrentDistribution, DistributionField } from "@effected/kit";
4
4
 
5
5
  // src/tools/ping.ts
6
6
  /**
@@ -1,7 +1,7 @@
1
1
  import { ToolOutputSchema } from "@effected/mcp-kit";
2
- import { Effect, Option, Schema } from "effect";
3
- import { Tool } from "effect/ai";
4
2
  import { DataReader, DataStore, deriveIdempotencyKey } from "@vitest-agent/engine";
3
+ import { Clock, Effect, Option, Schema } from "effect";
4
+ import { Tool } from "effect/ai";
5
5
 
6
6
  // src/tools/register-agent.ts
7
7
  /**
@@ -120,7 +120,7 @@ const handleRegisterAgent = (input) => Effect.gen(function* () {
120
120
  agentType: input.agentType,
121
121
  parentAgentId: input.parentAgentId ?? null,
122
122
  conversationId: input.conversationId ?? null,
123
- startedAt: Math.floor(Date.now() / 1e3),
123
+ startedAt: Math.floor((yield* Clock.currentTimeMillis) / 1e3),
124
124
  ...input.startGitBranch !== void 0 && { startGitBranch: input.startGitBranch },
125
125
  ...input.startGitCommitSha !== void 0 && { startGitCommitSha: input.startGitCommitSha },
126
126
  ...input.startWorktreeDir !== void 0 && { startWorktreeDir: input.startWorktreeDir },
@@ -1,18 +1,18 @@
1
- import { McpSession } from "../session.js";
2
- import { ToolOutputSchema } from "@effected/mcp-kit";
3
- import { Context, Data, Effect, FileSystem, Layer, Option, Path, Result, Schema } from "effect";
4
- import { Tool } from "effect/ai";
5
- import { DataReader, DataStore } from "@vitest-agent/engine";
6
- import { AgentReport, RunDiagnostics, SuggestedActionRecord, VITEST_CONFIG_FILES, buildAgentReport, buildConsoleLeaks, collectConsoleLeakEntries, formatScopedCoverageNote, readStrayOutput, suggestedActionsFromRunDiagnostics } from "@vitest-agent/sdk";
7
- import { ErrorText, Exclusive, ProcessScope } from "@effected/kit";
8
1
  import { fileURLToPath } from "node:url";
9
2
  import * as NodeChildProcessSpawner from "@effect/platform-node/NodeChildProcessSpawner";
10
3
  import * as NodeFileSystem from "@effect/platform-node/NodeFileSystem";
11
4
  import * as NodePath from "@effect/platform-node/NodePath";
12
5
  import { ModuleResolution } from "@effected/commands/node-sync";
13
6
  import { Git, TreeIdentity } from "@effected/git";
7
+ import { ErrorText, Exclusive, ProcessScope } from "@effected/kit";
8
+ import { ToolOutputSchema } from "@effected/mcp-kit";
14
9
  import { StdioCapture } from "@effected/mcp-kit/node";
15
10
  import { Walker } from "@effected/walker";
11
+ import { DataReader, DataStore } from "@vitest-agent/engine";
12
+ import { AgentReport, RunDiagnostics, SuggestedActionRecord, VITEST_CONFIG_FILES, buildAgentReport, buildConsoleLeaks, collectConsoleLeakEntries, formatScopedCoverageNote, readStrayOutput, suggestedActionsFromRunDiagnostics } from "@vitest-agent/sdk";
13
+ import { Context, Data, Effect, FileSystem, Layer, Option, Path, Result, Schema } from "effect";
14
+ import { Tool } from "effect/ai";
15
+ import { McpSession } from "../session.js";
16
16
 
17
17
  // src/tools/run-tests.ts
18
18
  const TagFilter = Schema.Struct({
@@ -1,6 +1,6 @@
1
+ import { DataReader } from "@vitest-agent/engine";
1
2
  import { Effect, Schema } from "effect";
2
3
  import { Tool } from "effect/ai";
3
- import { DataReader } from "@vitest-agent/engine";
4
4
 
5
5
  // src/tools/settings-list.ts
6
6
  const SettingsRow = Schema.Struct({
package/tools/status.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { ToolOutputSchema } from "@effected/mcp-kit";
2
- import { Effect, Option, Schema } from "effect";
3
- import { Tool } from "effect/ai";
4
2
  import { DataReader } from "@vitest-agent/engine";
5
3
  import { CacheManifestEntry, StrayOutput } from "@vitest-agent/sdk";
4
+ import { Effect, Option, Schema } from "effect";
5
+ import { Tool } from "effect/ai";
6
6
 
7
7
  // src/tools/status.ts
8
8
  /**
@@ -1,6 +1,6 @@
1
+ import { DataReader } from "@vitest-agent/engine";
1
2
  import { Effect, Schema } from "effect";
2
3
  import { Tool } from "effect/ai";
3
- import { DataReader } from "@vitest-agent/engine";
4
4
 
5
5
  // src/tools/tdd-artifact.ts
6
6
  const ArtifactKindSchema = Schema.Literals([
@@ -1,10 +1,10 @@
1
- import { IdempotentReplayMarker } from "../utils/replay-marker.js";
2
- import { behaviorNotFound, goalNotFound, illegalStatusTransition, tddEnvelope, tddTaskAlreadyEnded, tddTaskNotFound } from "./_tdd-error-envelope.js";
3
1
  import { McpToolkit, ToolOutcome, ToolRefusal } from "@effected/mcp-kit";
4
- import { Effect, Match, Option, Schema } from "effect";
5
- import { Tool } from "effect/ai";
6
2
  import { DataReader, DataStore } from "@vitest-agent/engine";
7
3
  import { BehaviorDetail, BehaviorRow } from "@vitest-agent/sdk";
4
+ import { Effect, Match, Option, Schema } from "effect";
5
+ import { Tool } from "effect/ai";
6
+ import { IdempotentReplayMarker } from "../utils/replay-marker.js";
7
+ import { behaviorNotFound, goalNotFound, illegalStatusTransition, tddEnvelope, tddTaskAlreadyEnded, tddTaskNotFound } from "./_tdd-error-envelope.js";
8
8
 
9
9
  // src/tools/tdd-behavior.ts
10
10
  /**
package/tools/tdd-goal.js CHANGED
@@ -1,10 +1,10 @@
1
- import { IdempotentReplayMarker } from "../utils/replay-marker.js";
2
- import { goalNotFound, illegalStatusTransition, tddEnvelope, tddTaskAlreadyEnded, tddTaskNotFound } from "./_tdd-error-envelope.js";
3
1
  import { McpToolkit, ToolOutcome, ToolRefusal } from "@effected/mcp-kit";
4
- import { Effect, Match, Option, Schema } from "effect";
5
- import { Tool } from "effect/ai";
6
2
  import { DataReader, DataStore } from "@vitest-agent/engine";
7
3
  import { GoalDetail, GoalRow } from "@vitest-agent/sdk";
4
+ import { Effect, Match, Option, Schema } from "effect";
5
+ import { Tool } from "effect/ai";
6
+ import { IdempotentReplayMarker } from "../utils/replay-marker.js";
7
+ import { goalNotFound, illegalStatusTransition, tddEnvelope, tddTaskAlreadyEnded, tddTaskNotFound } from "./_tdd-error-envelope.js";
8
8
 
9
9
  // src/tools/tdd-goal.ts
10
10
  /**
@@ -1,9 +1,9 @@
1
+ import { Remediation } from "@effected/kit";
1
2
  import { ToolOutputSchema } from "@effected/mcp-kit";
2
- import { Effect, Option, Schema } from "effect";
3
- import { Tool } from "effect/ai";
4
3
  import { DataReader, DataStore } from "@vitest-agent/engine";
5
4
  import { requiredArtifactForTransition, transitionEnforcesBehaviorMatch, validatePhaseTransition } from "@vitest-agent/sdk";
6
- import { Remediation } from "@effected/kit";
5
+ import { Clock, DateTime, Effect, Option, Schema } from "effect";
6
+ import { Tool } from "effect/ai";
7
7
 
8
8
  // src/tools/tdd-phase-transition-request.ts
9
9
  /**
@@ -109,7 +109,7 @@ const handlePhaseTransitionRequest = (input) => Effect.gen(function* () {
109
109
  const store = yield* DataStore;
110
110
  const currentOpt = yield* reader.getCurrentTddPhase(input.tddTaskId);
111
111
  const currentPhase = Option.isSome(currentOpt) ? currentOpt.value.phase : "spike";
112
- const phaseStartedAt = Option.isSome(currentOpt) ? currentOpt.value.startedAt : (/* @__PURE__ */ new Date()).toISOString();
112
+ const phaseStartedAt = Option.isSome(currentOpt) ? currentOpt.value.startedAt : DateTime.formatIso(yield* DateTime.now);
113
113
  const currentPhaseId = Option.isSome(currentOpt) ? currentOpt.value.id : null;
114
114
  const goalOpt = yield* reader.getGoalById(input.goalId);
115
115
  if (Option.isNone(goalOpt)) return {
@@ -200,7 +200,7 @@ const handlePhaseTransitionRequest = (input) => Effect.gen(function* () {
200
200
  limit: 1
201
201
  });
202
202
  if (recent.length === 0) {
203
- const sinceIso = (/* @__PURE__ */ new Date(Date.now() - DIAGNOSTIC_WINDOW_MINUTES * 6e4)).toISOString();
203
+ const sinceIso = (/* @__PURE__ */ new Date((yield* Clock.currentTimeMillis) - DIAGNOSTIC_WINDOW_MINUTES * 6e4)).toISOString();
204
204
  const crossSessionCount = yield* reader.countRecentArtifactsInOtherSessionsOfConversation({
205
205
  tddTaskId: input.tddTaskId,
206
206
  sinceIso
@@ -250,7 +250,7 @@ const handlePhaseTransitionRequest = (input) => Effect.gen(function* () {
250
250
  current_phase: currentPhase,
251
251
  current_phase_id: currentPhaseId,
252
252
  phase_started_at: phaseStartedAt,
253
- now: (/* @__PURE__ */ new Date()).toISOString(),
253
+ now: DateTime.formatIso(yield* DateTime.now),
254
254
  requested_phase: input.requestedPhase,
255
255
  cited_artifact: citedArtifact,
256
256
  requested_behavior_id: input.behaviorId ?? null
@@ -268,7 +268,7 @@ const handlePhaseTransitionRequest = (input) => Effect.gen(function* () {
268
268
  const out = yield* store.writeTddPhase({
269
269
  tddTaskId: input.tddTaskId,
270
270
  phase: result.phase,
271
- startedAt: (/* @__PURE__ */ new Date()).toISOString(),
271
+ startedAt: DateTime.formatIso(yield* DateTime.now),
272
272
  ...input.behaviorId !== void 0 && { behaviorId: input.behaviorId },
273
273
  ...input.reason !== void 0 && { transitionReason: input.reason }
274
274
  });
@@ -1,7 +1,7 @@
1
- import { Effect, Option, Schema } from "effect";
2
- import { McpServer, Tool } from "effect/ai";
3
1
  import { DataReader } from "@vitest-agent/engine";
4
2
  import { ChannelEvent } from "@vitest-agent/sdk";
3
+ import { Effect, Option, Schema } from "effect";
4
+ import { McpServer, Tool } from "effect/ai";
5
5
 
6
6
  // src/tools/tdd-progress-push.ts
7
7
  /**
package/tools/tdd-task.js CHANGED
@@ -1,9 +1,9 @@
1
- import { IdempotentReplayMarker } from "../utils/replay-marker.js";
2
1
  import { McpToolkit, ToolFailure, ToolOutputSchema, ToolRefusal } from "@effected/mcp-kit";
3
- import { Effect, Match, Option, Schema } from "effect";
4
- import { Tool } from "effect/ai";
5
2
  import { DataReader, DataStore } from "@vitest-agent/engine";
6
3
  import { GoalDetail } from "@vitest-agent/sdk";
4
+ import { DateTime, Effect, Match, Option, Schema } from "effect";
5
+ import { Tool } from "effect/ai";
6
+ import { IdempotentReplayMarker } from "../utils/replay-marker.js";
7
7
 
8
8
  // src/tools/tdd-task.ts
9
9
  const TddPhaseRow = Schema.Struct({
@@ -173,7 +173,7 @@ const handleTddTask = (input) => Match.value(input).pipe(Match.discriminatorsExh
173
173
  tddTaskId: yield* store.writeTddTask({
174
174
  sessionId,
175
175
  goal: variant.goal,
176
- startedAt: variant.startedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
176
+ startedAt: variant.startedAt ?? DateTime.formatIso(yield* DateTime.now),
177
177
  ...variant.runId !== void 0 && { runId: variant.runId },
178
178
  ...variant.parentTddTaskId !== void 0 && { parentTddTaskId: variant.parentTddTaskId }
179
179
  }),
@@ -185,7 +185,7 @@ const handleTddTask = (input) => Match.value(input).pipe(Match.discriminatorsExh
185
185
  yield* (yield* DataStore).endTddTask({
186
186
  id: variant.tddTaskId,
187
187
  outcome: variant.outcome,
188
- endedAt: (/* @__PURE__ */ new Date()).toISOString(),
188
+ endedAt: DateTime.formatIso(yield* DateTime.now),
189
189
  ...variant.summaryNoteId !== void 0 && { summaryNoteId: variant.summaryNoteId }
190
190
  });
191
191
  return {
package/tools/test.js CHANGED
@@ -1,8 +1,8 @@
1
- import { collectProjectRows, resolveProjectTargets } from "./_project-groups.js";
2
1
  import { McpToolkit, ToolOutputSchema, ToolRefusal } from "@effected/mcp-kit";
2
+ import { DataReader } from "@vitest-agent/engine";
3
3
  import { Effect, Match, Option, Schema } from "effect";
4
4
  import { Tool } from "effect/ai";
5
- import { DataReader } from "@vitest-agent/engine";
5
+ import { collectProjectRows, resolveProjectTargets } from "./_project-groups.js";
6
6
 
7
7
  // src/tools/test.ts
8
8
  const TestRowSchema = Schema.Struct({
package/tools/trends.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { ToolOutputSchema } from "@effected/mcp-kit";
2
- import { Effect, Option, Schema } from "effect";
3
- import { Tool } from "effect/ai";
4
2
  import { DataReader } from "@vitest-agent/engine";
5
3
  import { TrendRecord } from "@vitest-agent/sdk";
4
+ import { Effect, Option, Schema } from "effect";
5
+ import { Tool } from "effect/ai";
6
6
 
7
7
  // src/tools/trends.ts
8
8
  const TrendsAvailable = Schema.Struct({
@@ -1,6 +1,6 @@
1
+ import { DataReader, formatTriageEffect } from "@vitest-agent/engine";
1
2
  import { Effect, Schema } from "effect";
2
3
  import { Tool } from "effect/ai";
3
- import { DataReader, formatTriageEffect } from "@vitest-agent/engine";
4
4
 
5
5
  // src/tools/triage-brief.ts
6
6
  /**
@@ -1,6 +1,6 @@
1
+ import { DataReader } from "@vitest-agent/engine";
1
2
  import { Effect, Schema } from "effect";
2
3
  import { Tool } from "effect/ai";
3
- import { DataReader } from "@vitest-agent/engine";
4
4
 
5
5
  // src/tools/turn-search.ts
6
6
  const TurnRow = Schema.Struct({
@@ -1,6 +1,6 @@
1
+ import { DataReader, formatWrapupEffect } from "@vitest-agent/engine";
1
2
  import { Effect, Schema } from "effect";
2
3
  import { Tool } from "effect/ai";
3
- import { DataReader, formatWrapupEffect } from "@vitest-agent/engine";
4
4
 
5
5
  // src/tools/wrapup-prompt.ts
6
6
  /**
package/version.js CHANGED
@@ -7,6 +7,6 @@
7
7
  *
8
8
  * @public
9
9
  */
10
- const CURRENT_MCP_VERSION = "6.1.10";
10
+ const CURRENT_MCP_VERSION = "6.2.0";
11
11
 
12
12
  export { CURRENT_MCP_VERSION };