@vitest-agent/sdk 2.3.0 → 2.4.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
@@ -2822,7 +2822,7 @@ interface HistoryQueryOptions {
2822
2822
  }
2823
2823
  /**
2824
2824
  * Narrowing options shared by the classification reads
2825
- * ({@link DataReader.getFlaky} / `getPersistentFailures`). Mirrors the
2825
+ * (`DataReader.getFlaky` / `getPersistentFailures`). Mirrors the
2826
2826
  * `testName` / `modulePath` half of {@link HistoryQueryOptions} so a
2827
2827
  * caller that scoped `getHistory` to one test can scope the derived
2828
2828
  * classifications to the same test instead of receiving the whole
@@ -2837,7 +2837,7 @@ interface ClassificationQueryOptions {
2837
2837
  readonly modulePath?: string;
2838
2838
  }
2839
2839
  /**
2840
- * Narrowing options for {@link DataReader.getTestByFullName}. A
2840
+ * Narrowing options for `DataReader.getTestByFullName`. A
2841
2841
  * `full_name` is not file-qualified (Decision D20), so the same name can
2842
2842
  * exist in more than one module; `modulePath` disambiguates.
2843
2843
  *
package/index.js CHANGED
@@ -117,7 +117,7 @@ import { requiredArtifactForTransition, transitionEnforcesBehaviorMatch, validat
117
117
  * substituted yet. Exported for version introspection by downstream tooling.
118
118
  * @public
119
119
  */
120
- const CURRENT_SDK_VERSION = "2.3.0";
120
+ const CURRENT_SDK_VERSION = "2.4.0";
121
121
 
122
122
  //#endregion
123
123
  export { ActionSeverity, ActorType, Agent, AgentConsoleMode, AgentContext, AgentId, AgentNotFoundError, AgentPluginOptions, AgentReport, AgentReporterOptions, BehaviorAbandonedEvent, BehaviorAddedEvent, BehaviorCompletedEvent, BehaviorDetail, BehaviorNotFoundError, BehaviorRow, BehaviorScopedEventTypes, BehaviorStartedEvent, BehaviorStatus, BehaviorsReadyEvent, BlockedEvent, CURRENT_SDK_VERSION, CacheManifest, CacheManifestEntry, ChannelEvent, ChatId, CiConsoleMode, ConfigLive, ConsoleLeakFile, ConsoleLeaks, ConsoleLogLevel, ConsoleMode, ConsoleOutputMode, ConsoleOutputs, ConversationId, ConversationNotFoundError, CoverageBaselines, FileCoverageReport as CoverageFile, CoverageGap, CoverageLevel, CoverageMetric, CoverageRenderState, CoverageReport, CoverageTargets, CoverageTargetsMetrics, CoverageTotals, DATABASE_FILENAME, DataReader, DataReaderLive, DataStore, DataStoreError, DataStoreLive, DetailLevel, DetailResolver, DetailResolverLive, DiscoveryError, DiscoveryRegistry, DiscoveryRegistryLive, Environment, EnvironmentDetector, EnvironmentDetectorLive, EnvironmentDetectorTest, Executor, ExecutorResolver, ExecutorResolverLive, FailureRecord, FileCoverageReport, FileEditPayload, FormatSelector, FormatSelectorLive, GfmFormatter, GitCommandError, GoalAbandonedEvent, GoalAddedEvent, GoalCompletedEvent, GoalDetail, GoalNotFoundError, GoalRow, GoalStartedEvent, GoalStatus, GoalsReadyEvent, HistoryRecord, HistoryTracker, HistoryTrackerLive, HistoryTrackerTest, HookFirePayload, HookStatus, HookType, HostKind, HostMetadataParseError, HumanConsoleMode, HypothesisPayload, IDEMPOTENCY_ROOT_SENTINEL, IdempotencyHit, IllegalStatusTransitionError, JsonFormatter, LoggerLive, MarkdownFormatter, MetricThresholds, ModuleRecord, ModuleReport, NON_DISCOVERABLE_DIRS, NotePayload, OutputFormat, OutputPipelineLive, OutputRenderer, OutputRendererLive, PackageManager, PathResolutionError, PathResolutionLive, PatternThresholds, PerClientSessionMapReader, PerClientSessionMapReaderLive, PerClientSessionMapWriter, PerClientSessionMapWriterLive, PhaseTransitionEvent, ProbeMissError, ProjectDiscovery, ProjectDiscoveryLive, ProjectDiscoveryTest, ProjectIdentity, ProjectIdentityLive, ProjectIdentityNotResolvableError, ProjectIdentityTest, ProjectKey, RegistrationConflictError, RenderState, RenderTotals, ReportError, ReportSummary, ResolvedThresholds, RunContext, RunContext$, RunContextLive, RunContextService, RunContextTest, RunEvent, SRC_DIR, SessionCompleteEvent, SessionNotFoundError, SessionOutcome, SidecarTimeoutError, SilentFormatter, SuggestedActionRecord, TEST_DIR, TEST_FILE_GLOB_SUFFIX, TEST_HELPER_DIRS, TagCountEntry, TddTaskAlreadyEndedError, TddTaskId, TddTaskNotFoundError, TerminalFormatter, TestClassification, TestHistory, TestRecord, TestReport, TestRun, TestRunReason, TestState, ToolCallPayload, ToolResultPayload, Transport, TrendEntry, TrendRecord, TurnPayload, UserPromptPayload, VitestAgentConfig, VitestAgentConfigFile, _resetMigrationCacheForTesting, ansi, assembleHistoryRecord, assembleManifest, buildAgentReport, buildConsoleLeaks, buildEnvPrefix, canonicalizeGitUrl, ciAnnotationsFormatter, classifyTest, classifyTestPath, coerceErrorField, coerceErrorText, collectConsoleLeakEntries, compressLines, computeFailureSignature, computeTrend, countSuiteFailures, deriveIdempotencyKey, detectPackageManager, detectVitestScripts, determineTier, ensureMigrated, extractSqlReason, findFunctionBoundary, findOwningWorkspace, formatConsoleMarkdown, formatFatalError, formatGfm, formatTriageEffect, formatWrapupEffect, getRecentDirection, getRunCommand, getWorstMetric, gitUrlToProjectKey, hashTargets, historyKey, initialRenderState, isTestFileName, isTimeoutError, isVitestInvocation, migration as migration0001, normalizeAssertionShape, normalizeWorkspaceKey, osc8, probeHostMetadataFromEnv, migration$1 as registryMigration0001, relativePath, requiredArtifactForTransition, resolveCoverageInput, resolveDataPath, resolveLogFile, resolveLogLevel, resolveProjectIdentityFromCandidates, resolveProjectKeyFromCwd, resolveWorkspaceKey, rewriteBashCommand, safeFilename, migration$2 as sessionMapMigration0001, stripAnsi, transitionEnforcesBehaviorMatch, validateCoverageConfig, validateCoverageTargetsShape, validatePhaseTransition };
@@ -2,36 +2,6 @@ import { Effect } from "effect";
2
2
  import { SqlClient } from "effect/unstable/sql/SqlClient";
3
3
 
4
4
  //#region src/migrations/0001_initial.ts
5
- /**
6
- * Consolidated fresh-install schema for the per-project `data.db`.
7
- *
8
- * Pre-2.0 policy (per repo CLAUDE.md): a single canonical migration
9
- * defines the entire schema. The agent-agnostic-taxonomy plan folded
10
- * the prior `0002_comprehensive` drop-and-recreate into this file
11
- * directly and bolted on the new agent taxonomy.
12
- *
13
- * What this migration creates beyond the prior 0001+0002 baseline:
14
- * - `agents` table — first-class agent invocations with a
15
- * `parent_agent_id` tree, idempotency key, and inherited git
16
- * context
17
- * - `sessions.conversation_id`, `sessions.host_kind` — cross-window
18
- * rollup key + host vendor identifier
19
- * - `actor_type`, `agent_id`, `conversation_id` on action tables
20
- * (`test_runs`, `hypotheses`, `notes`, `tdd_phases`) with CHECK
21
- * constraints
22
- * - Per-run git context on `test_runs`: branch, sha, dirty, upstream,
23
- * worktree dir, host source/value/metadata
24
- * - Six `AFTER UPDATE` immutability triggers locking
25
- * `conversation_id` on every table that carries it
26
- *
27
- * Agent-facing ID convention (post `chatId` / `sessionId` / `tddTaskId`
28
- * rename): the `sessions` row PK is `sessions.id`, the host chat UUID
29
- * column is `sessions.chat_id`, and a TDD task PK is `tdd_tasks.id`.
30
- * The `tdd_session_goals` / `tdd_session_behaviors` table names retain
31
- * their legacy "_session_" segment but their `session_id` columns
32
- * actually point at `tdd_tasks(id)` (a TDD task, not a session row).
33
- * @public
34
- */
35
5
  /** @internal */
36
6
  const migration = Effect.gen(function* () {
37
7
  const sql = yield* SqlClient;
@@ -2,29 +2,6 @@ import { Effect } from "effect";
2
2
  import { SqlClient } from "effect/unstable/sql/SqlClient";
3
3
 
4
4
  //#region src/migrations/session_map_0001_initial.ts
5
- /**
6
- * Migration for the per-client session map SQLite at
7
- * `${CLAUDE_PLUGIN_DATA}/sessions.db` (Claude Code) or the
8
- * client-specific equivalent.
9
- *
10
- * The session map is a host-specific side-channel that translates
11
- * client-native identifiers (transcript path, hook-payload session id)
12
- * into the canonical UUIDs the per-project `data.db` expects. It lets
13
- * `claude --resume` reuse the same `conversation_id` UUID across
14
- * restarts.
15
- *
16
- * Two STRICT tables:
17
- * - `conversation_map` keyed on the transcript filename UUID
18
- * (already a UUID per Claude Code's convention)
19
- * - `session_map` keyed on the host's native session id (the chat
20
- * UUID — `session_id` from the Claude Code hook payload, exposed
21
- * to agents as `chatId` post the 2026-05 rename)
22
- *
23
- * Concurrent writers from multiple Claude Code windows converge via
24
- * idempotent UPSERTs on the native-id keys; WAL mode plus 5s
25
- * busy_timeout absorb contention.
26
- * @public
27
- */
28
5
  /** @internal */
29
6
  const migration = Effect.gen(function* () {
30
7
  const sql = yield* SqlClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitest-agent/sdk",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "private": false,
5
5
  "description": "Shared Effect Schema, SQLite migrations, data layer, services, formatters, and utilities for vitest-agent packages.",
6
6
  "keywords": [
@@ -45,19 +45,19 @@
45
45
  "./package.json": "./package.json"
46
46
  },
47
47
  "dependencies": {
48
- "@effect/platform-node": "4.0.0-beta.107",
49
- "@effect/sql-sqlite-node": "4.0.0-beta.107",
50
- "@effected/config-file": "^0.4.1",
51
- "@effected/jsonc": "^0.6.0",
52
- "@effected/toml": "^0.4.0",
53
- "@effected/walker": "^0.4.0",
54
- "@effected/workspaces": "^0.12.0",
55
- "@effected/xdg": "^0.2.1",
56
- "@effected/yaml": "^0.8.0",
48
+ "@effect/platform-node": "4.0.0-rc.109",
49
+ "@effect/sql-sqlite-node": "4.0.0-rc.109",
50
+ "@effected/config-file": "^0.5.0",
51
+ "@effected/jsonc": "^0.7.0",
52
+ "@effected/toml": "^0.5.0",
53
+ "@effected/walker": "^0.5.0",
54
+ "@effected/workspaces": "^0.14.0",
55
+ "@effected/xdg": "^0.3.0",
56
+ "@effected/yaml": "^0.10.0",
57
57
  "acorn": "^8.18.0",
58
58
  "acorn-typescript": "^1.4.13",
59
59
  "ajv": "^8.20.0",
60
- "effect": "4.0.0-beta.107",
60
+ "effect": "4.0.0-rc.109",
61
61
  "std-env": "^4.2.0"
62
62
  },
63
63
  "engines": {
@@ -1,16 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
 
3
3
  //#region src/schemas/ChannelEvent.ts
4
- /**
5
- * Channel event schemas for the orchestrator → main-agent progress push.
6
- *
7
- * All payloads share a `type` discriminator and pass through
8
- * `tdd_progress_push`. Behavior-level events declare goalId/sessionId
9
- * fields, but the MCP server resolves those server-side from
10
- * behaviorId via `DataReader.resolveGoalIdForBehavior` before emitting
11
- * the notification — caller-supplied values for goalId/sessionId on
12
- * behavior events are advisory and may be overwritten.
13
- */
14
4
  /** @public */
15
5
  const SessionOutcome = Schema.Literals([
16
6
  "succeeded",
package/schemas/Common.js CHANGED
@@ -2,12 +2,6 @@ import { Schema } from "effect";
2
2
 
3
3
  //#region src/schemas/Common.ts
4
4
  /**
5
- * Common schemas shared across multiple modules.
6
- *
7
- * Defines enums/literals and the ReportError struct used by
8
- * both AgentReport and CacheManifest schemas.
9
- */
10
- /**
11
5
  * Possible states for an individual test case.
12
6
  * @public
13
7
  */
package/testing.d.ts CHANGED
@@ -1246,7 +1246,7 @@ interface HistoryQueryOptions {
1246
1246
  }
1247
1247
  /**
1248
1248
  * Narrowing options shared by the classification reads
1249
- * ({@link DataReader.getFlaky} / `getPersistentFailures`). Mirrors the
1249
+ * (`DataReader.getFlaky` / `getPersistentFailures`). Mirrors the
1250
1250
  * `testName` / `modulePath` half of {@link HistoryQueryOptions} so a
1251
1251
  * caller that scoped `getHistory` to one test can scope the derived
1252
1252
  * classifications to the same test instead of receiving the whole
@@ -1261,7 +1261,7 @@ interface ClassificationQueryOptions {
1261
1261
  readonly modulePath?: string;
1262
1262
  }
1263
1263
  /**
1264
- * Narrowing options for {@link DataReader.getTestByFullName}. A
1264
+ * Narrowing options for `DataReader.getTestByFullName`. A
1265
1265
  * `full_name` is not file-qualified (Decision D20), so the same name can
1266
1266
  * exist in more than one module; `modulePath` disambiguates.
1267
1267
  *