@vitest-agent/sdk 2.4.7 → 2.4.8

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
@@ -3362,9 +3362,12 @@ declare const OutputRendererLive: Layer.Layer<OutputRenderer, never, never>;
3362
3362
  * Callers still need to provide `FileSystem` and `Path` from
3363
3363
  * `@effect/platform-node`'s `NodeServices.layer` (or the equivalent on Bun).
3364
3364
  *
3365
- * `WorkspaceDiscovery` is anchored at `projectDir`: on v4,
3366
- * `@effected/workspaces` resolves the workspace root from the layer's `cwd`
3367
- * rather than a per-call path, so the `cwd` is pinned here.
3365
+ * `WorkspaceDiscovery` is pinned to `projectDir` as its `cwd`, which sets the
3366
+ * root for the layer-bound methods (`listPackages`, `info`, `refresh`). The
3367
+ * per-root methods (`listPackagesIn`, `infoIn`, `refreshIn`) take a directory
3368
+ * per call and ignore that pin — `resolveWorkspaceKey` and
3369
+ * `ProjectIdentityLive` use them, so a long-lived host built against one root
3370
+ * still answers correctly for a git worktree or an unrelated project.
3368
3371
  *
3369
3372
  * @param projectDir - Absolute path inside the user's workspace, used to
3370
3373
  * anchor the config file resolvers and workspace discovery.
@@ -5231,10 +5234,13 @@ declare const resolveProjectKeyFromCwd: (cwd: string) => string;
5231
5234
  * `@effected/workspaces`'s schema, so a successful root lookup always yields a
5232
5235
  * usable name.
5233
5236
  *
5234
- * Note (v4): `@effected/workspaces` anchors discovery at the `WorkspaceDiscovery`
5235
- * layer's `cwd`, not at a per-call path — `discovery.listPackages()` takes no
5236
- * argument. `projectDir` is retained for the not-found diagnostic; callers that
5237
- * need to anchor at a specific directory build `WorkspaceDiscovery.layer({ cwd })`.
5237
+ * Discovery is anchored at `projectDir` per call via `listPackagesIn`, not at
5238
+ * the `WorkspaceDiscovery` layer's `cwd`: patterns, member manifests and names
5239
+ * are read from beneath `projectDir`'s own root, so one long-lived layer
5240
+ * answers correctly for a git worktree, a nested repository, or an unrelated
5241
+ * project. Fails with the library's `WorkspaceRootNotFoundError` when
5242
+ * `projectDir` sits in no workspace at all; results are memoized per resolved
5243
+ * root, so many directories in one workspace share a single discovery.
5238
5244
  *
5239
5245
  * @param projectDir - Absolute path inside the workspace. Typically the
5240
5246
  * reporter's resolved `projectDir` (CLAUDE_PROJECT_DIR or process.cwd()).
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.4.7";
120
+ const CURRENT_SDK_VERSION = "2.4.8";
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 };
@@ -20,9 +20,12 @@ const AppDirsLive = AppDirs.layer({ namespace: "vitest-agent" }).pipe(Layer.prov
20
20
  * Callers still need to provide `FileSystem` and `Path` from
21
21
  * `@effect/platform-node`'s `NodeServices.layer` (or the equivalent on Bun).
22
22
  *
23
- * `WorkspaceDiscovery` is anchored at `projectDir`: on v4,
24
- * `@effected/workspaces` resolves the workspace root from the layer's `cwd`
25
- * rather than a per-call path, so the `cwd` is pinned here.
23
+ * `WorkspaceDiscovery` is pinned to `projectDir` as its `cwd`, which sets the
24
+ * root for the layer-bound methods (`listPackages`, `info`, `refresh`). The
25
+ * per-root methods (`listPackagesIn`, `infoIn`, `refreshIn`) take a directory
26
+ * per call and ignore that pin — `resolveWorkspaceKey` and
27
+ * `ProjectIdentityLive` use them, so a long-lived host built against one root
28
+ * still answers correctly for a git worktree or an unrelated project.
26
29
  *
27
30
  * @param projectDir - Absolute path inside the user's workspace, used to
28
31
  * anchor the config file resolvers and workspace discovery.
@@ -31,7 +31,7 @@ const readPackageRepoUrl = (packageJsonPath) => Effect.gen(function* () {
31
31
  const collectCandidates = (workspaceRoot, options) => Effect.gen(function* () {
32
32
  const tomlConfig = yield* (yield* VitestAgentConfigFile).loadOrDefault(new VitestAgentConfig({})).pipe(Effect.catch(() => Effect.succeed(new VitestAgentConfig({}))));
33
33
  const gitRemote = yield* readGitRemote(workspaceRoot);
34
- const root = (yield* (yield* WorkspaceDiscovery).listPackages().pipe(Effect.catch(() => Effect.succeed([])))).find((pkg) => pkg.isRootWorkspace);
34
+ const root = (yield* (yield* WorkspaceDiscovery).listPackagesIn(workspaceRoot).pipe(Effect.catch(() => Effect.succeed([])))).find((pkg) => pkg.isRootWorkspace);
35
35
  const packageJsonRepoUrl = root ? yield* readPackageRepoUrl(root.packageJsonPath) : Option.none();
36
36
  const candidates = {};
37
37
  if (options.projectId !== void 0) candidates.explicit = options.projectId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitest-agent/sdk",
3
- "version": "2.4.7",
3
+ "version": "2.4.8",
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": [
@@ -51,7 +51,7 @@
51
51
  "@effected/jsonc": "^0.7.0",
52
52
  "@effected/toml": "^0.5.0",
53
53
  "@effected/walker": "^0.5.0",
54
- "@effected/workspaces": "^0.17.2",
54
+ "@effected/workspaces": "^0.18.0",
55
55
  "@effected/xdg": "^0.3.0",
56
56
  "@effected/yaml": "^0.11.0",
57
57
  "acorn": "^8.18.0",
@@ -16,17 +16,20 @@ import { WorkspaceDiscovery, WorkspaceRootNotFoundError } from "@effected/worksp
16
16
  * `@effected/workspaces`'s schema, so a successful root lookup always yields a
17
17
  * usable name.
18
18
  *
19
- * Note (v4): `@effected/workspaces` anchors discovery at the `WorkspaceDiscovery`
20
- * layer's `cwd`, not at a per-call path — `discovery.listPackages()` takes no
21
- * argument. `projectDir` is retained for the not-found diagnostic; callers that
22
- * need to anchor at a specific directory build `WorkspaceDiscovery.layer({ cwd })`.
19
+ * Discovery is anchored at `projectDir` per call via `listPackagesIn`, not at
20
+ * the `WorkspaceDiscovery` layer's `cwd`: patterns, member manifests and names
21
+ * are read from beneath `projectDir`'s own root, so one long-lived layer
22
+ * answers correctly for a git worktree, a nested repository, or an unrelated
23
+ * project. Fails with the library's `WorkspaceRootNotFoundError` when
24
+ * `projectDir` sits in no workspace at all; results are memoized per resolved
25
+ * root, so many directories in one workspace share a single discovery.
23
26
  *
24
27
  * @param projectDir - Absolute path inside the workspace. Typically the
25
28
  * reporter's resolved `projectDir` (CLAUDE_PROJECT_DIR or process.cwd()).
26
29
  * @public
27
30
  */
28
31
  const resolveWorkspaceKey = (projectDir) => Effect.gen(function* () {
29
- const root = (yield* (yield* WorkspaceDiscovery).listPackages()).find((pkg) => pkg.isRootWorkspace);
32
+ const root = (yield* (yield* WorkspaceDiscovery).listPackagesIn(projectDir)).find((pkg) => pkg.isRootWorkspace);
30
33
  if (!root) return yield* Effect.fail(new WorkspaceRootNotFoundError({
31
34
  searchPath: projectDir,
32
35
  markers: []