@vitest-agent/engine 0.2.6 → 0.2.7

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
@@ -2446,8 +2446,10 @@ export declare const recoverSessionContextFromSessionEnv: (opts: {
2446
2446
  * Precedence: `VITEST_AGENT_PROJECT_DIR` (hook-driven override), then
2447
2447
  * `VITEST_AGENT_REPORTER_PROJECT_DIR` (the plugin-spawned MCP server's
2448
2448
  * hand-off), then `CLAUDE_PROJECT_DIR` (Claude Code's own convention),
2449
- * then `cwd`. An empty string counts as unset. Pure: both the env map and
2450
- * the working directory are injected by the caller.
2449
+ * then `cwd`. Delegates to `@effected/engine`'s `LaunchContext.projectDir`:
2450
+ * a value is trimmed, and an empty or whitespace-only value, or one a plugin
2451
+ * host left as a literal unsubstituted `${...}` placeholder, counts as unset.
2452
+ * Pure: both the env map and the working directory are injected by the caller.
2451
2453
  *
2452
2454
  * @param input - the env map and the fallback working directory
2453
2455
  * @public
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitest-agent/engine",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "private": false,
5
5
  "description": "Shared services, layers, SQLite data layer, migrations and platform resolution for the vitest-agent CLI and MCP server.",
6
6
  "keywords": [
@@ -43,11 +43,12 @@
43
43
  "@effect/platform-node": "4.0.0-rc.117",
44
44
  "@effect/sql-sqlite-node": "4.0.0-rc.117",
45
45
  "@effected/config-file": "^0.12.0",
46
+ "@effected/engine": "^0.1.0",
46
47
  "@effected/glob": "^0.8.0",
47
48
  "@effected/jsonc": "^0.13.0",
48
49
  "@effected/toml": "^0.9.0",
49
50
  "@effected/walker": "^0.12.0",
50
- "@effected/workspaces": "^0.26.0",
51
+ "@effected/workspaces": "^0.27.0",
51
52
  "@effected/xdg": "^0.7.0",
52
53
  "@effected/yaml": "^0.17.0",
53
54
  "@vitest-agent/sdk": "5.1.2",
package/project-dir.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { LaunchContext } from "@effected/engine";
2
+
1
3
  //#region src/project-dir.ts
2
4
  /**
3
5
  * Environment variables that may override the project directory, in
@@ -14,19 +16,19 @@ const PROJECT_DIR_ENV_KEYS = [
14
16
  * Precedence: `VITEST_AGENT_PROJECT_DIR` (hook-driven override), then
15
17
  * `VITEST_AGENT_REPORTER_PROJECT_DIR` (the plugin-spawned MCP server's
16
18
  * hand-off), then `CLAUDE_PROJECT_DIR` (Claude Code's own convention),
17
- * then `cwd`. An empty string counts as unset. Pure: both the env map and
18
- * the working directory are injected by the caller.
19
+ * then `cwd`. Delegates to `@effected/engine`'s `LaunchContext.projectDir`:
20
+ * a value is trimmed, and an empty or whitespace-only value, or one a plugin
21
+ * host left as a literal unsubstituted `${...}` placeholder, counts as unset.
22
+ * Pure: both the env map and the working directory are injected by the caller.
19
23
  *
20
24
  * @param input - the env map and the fallback working directory
21
25
  * @public
22
26
  */
23
- const resolveProjectDir = (input) => {
24
- for (const key of PROJECT_DIR_ENV_KEYS) {
25
- const value = input.env[key];
26
- if (value !== void 0 && value !== "") return value;
27
- }
28
- return input.cwd;
29
- };
27
+ const resolveProjectDir = (input) => LaunchContext.projectDir({
28
+ env: input.env,
29
+ keys: PROJECT_DIR_ENV_KEYS,
30
+ cwd: input.cwd
31
+ });
30
32
 
31
33
  //#endregion
32
34
  export { resolveProjectDir };
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.59.2"
8
+ "packageVersion": "7.59.1"
9
9
  }
10
10
  ]
11
11
  }
package/version.js CHANGED
@@ -1,6 +1,6 @@
1
1
  //#region src/version.ts
2
2
  /** Build-time injected package version (see architecture.md D36). @public */
3
- const CURRENT_ENGINE_VERSION = "0.2.6";
3
+ const CURRENT_ENGINE_VERSION = "0.2.7";
4
4
 
5
5
  //#endregion
6
6
  export { CURRENT_ENGINE_VERSION };