@vitest-agent/engine 0.6.1 → 1.0.1
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 +11 -32
- package/index.js +1 -3
- package/layers/OutputPipelineLive.js +3 -4
- package/package.json +13 -13
- package/platform.js +1 -1
- package/testing.d.ts +4 -3
- package/version.js +1 -1
- package/layers/FormatSelectorLive.js +0 -20
- package/services/FormatSelector.js +0 -8
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context, Effect, FileSystem, Layer, LogLevel, Option, Path, Schema } from "effect";
|
|
2
2
|
import { ConfigFileShape } from "@effected/config-file";
|
|
3
|
-
import { Agent, AgentNotFoundError, AgentReport, ArtifactKind, ArtifactKind as ArtifactKind$1, ArtifactSuite, ArtifactSuite as ArtifactSuite$1, BehaviorDetail, BehaviorNotFoundError, BehaviorRow, BehaviorStatus, CacheManifest, CitedArtifact, CoverageBaselines, CoverageReport, DataStoreError, DetailLevel, DiscoveryError, Environment, Executor, FileCoverageReport, GoalDetail, GoalNotFoundError, GoalRow, GoalStatus, HistoryRecord, IdempotencyHit, IllegalStatusTransitionError,
|
|
3
|
+
import { Agent, AgentNotFoundError, AgentReport, ArtifactKind, ArtifactKind as ArtifactKind$1, ArtifactSuite, ArtifactSuite as ArtifactSuite$1, BehaviorDetail, BehaviorNotFoundError, BehaviorRow, BehaviorStatus, CacheManifest, CitedArtifact, CoverageBaselines, CoverageReport, DataStoreError, DetailLevel, DiscoveryError, Environment, Executor, FileCoverageReport, GoalDetail, GoalNotFoundError, GoalRow, GoalStatus, HistoryRecord, IdempotencyHit, IllegalStatusTransitionError, Phase, ProjectIdentityNotResolvableError, RegistrationConflictError, ResolvedThresholds, TddTaskAlreadyEndedError, TddTaskNotFoundError, TestClassification, TestRun, TrendEntry, TrendRecord, TurnPayload, VitestAgentConfig } from "@vitest-agent/sdk";
|
|
4
4
|
import { SqlClient } from "effect/sql/SqlClient";
|
|
5
5
|
import { RuntimeEnv } from "@effected/env";
|
|
6
6
|
import { WorkspaceDiscovery, WorkspaceDiscoveryFailure, WorkspaceRootNotFoundError } from "@effected/workspaces";
|
|
@@ -1248,28 +1248,6 @@ export declare class ExecutorResolver extends ExecutorResolver_base {}
|
|
|
1248
1248
|
/** @public */
|
|
1249
1249
|
export declare const ExecutorResolverLive: Layer.Layer<ExecutorResolver, never, never>;
|
|
1250
1250
|
//#endregion
|
|
1251
|
-
//#region src/services/FormatSelector.d.ts
|
|
1252
|
-
declare const FormatSelector_base: Context.ServiceClass<FormatSelector, "vitest-agent/FormatSelector", {
|
|
1253
|
-
readonly select: (executor: Executor, explicitFormat?: OutputFormat, environment?: Environment) => Effect.Effect<OutputFormat>;
|
|
1254
|
-
}>;
|
|
1255
|
-
/** @public */
|
|
1256
|
-
export declare class FormatSelector extends FormatSelector_base {}
|
|
1257
|
-
//#endregion
|
|
1258
|
-
//#region src/layers/FormatSelectorLive.d.ts
|
|
1259
|
-
/**
|
|
1260
|
-
* Default format dispatch:
|
|
1261
|
-
*
|
|
1262
|
-
* - GitHub Actions CI executor: `ci-annotations` (renders as `::error::`).
|
|
1263
|
-
* - Human executor: `silent` (Vitest's own reporters handle the user
|
|
1264
|
-
* experience; we just write to the database).
|
|
1265
|
-
* - Anyone else (agent-shell, terminal-bound CI): `terminal` — plain
|
|
1266
|
-
* text + ANSI color, no markdown syntax in the place that doesn't
|
|
1267
|
-
* render it. Markdown stays available via explicit `format: "markdown"`
|
|
1268
|
-
* for surfaces that *do* render it (MCP tools, GitHub step summary).
|
|
1269
|
-
* @public
|
|
1270
|
-
*/
|
|
1271
|
-
export declare const FormatSelectorLive: Layer.Layer<FormatSelector, never, never>;
|
|
1272
|
-
//#endregion
|
|
1273
1251
|
//#region src/services/HistoryTracker.d.ts
|
|
1274
1252
|
/**
|
|
1275
1253
|
* Lightweight test outcome for history classification.
|
|
@@ -1374,14 +1352,14 @@ export declare function resolveLogFile(env: Record<string, string | undefined>,
|
|
|
1374
1352
|
//#endregion
|
|
1375
1353
|
//#region src/layers/OutputPipelineLive.d.ts
|
|
1376
1354
|
/**
|
|
1377
|
-
* The output pipeline: environment detection, executor resolution
|
|
1378
|
-
*
|
|
1355
|
+
* The output pipeline: environment detection, executor resolution and detail
|
|
1356
|
+
* resolution.
|
|
1379
1357
|
*
|
|
1380
1358
|
* @param env - the environment map `EnvironmentDetectorLive` consults
|
|
1381
1359
|
* (the front end passes `process.env`)
|
|
1382
1360
|
* @public
|
|
1383
1361
|
*/
|
|
1384
|
-
export declare const OutputPipelineLive: (env: Record<string, string | undefined>) => Layer.Layer<DetailResolver | EnvironmentDetector | ExecutorResolver
|
|
1362
|
+
export declare const OutputPipelineLive: (env: Record<string, string | undefined>) => Layer.Layer<DetailResolver | EnvironmentDetector | ExecutorResolver, never, never>;
|
|
1385
1363
|
//#endregion
|
|
1386
1364
|
//#region src/layers/PathResolutionLive.d.ts
|
|
1387
1365
|
/**
|
|
@@ -1818,8 +1796,8 @@ type MigrationRecord = Record<string, Effect.Effect<void, SqlError, SqlClient>>;
|
|
|
1818
1796
|
* @public
|
|
1819
1797
|
*/
|
|
1820
1798
|
export interface SqliteStack {
|
|
1821
|
-
/** The `SqlClient` layer for `filename
|
|
1822
|
-
readonly SqliteLayer: Layer.Layer<SqliteClient | SqlClient>;
|
|
1799
|
+
/** The `SqlClient` layer for `filename`; fails with `SqlError` when the file cannot be opened. */
|
|
1800
|
+
readonly SqliteLayer: Layer.Layer<SqliteClient | SqlClient, SqlError>;
|
|
1823
1801
|
/**
|
|
1824
1802
|
* `Layer.effectDiscard`-shaped: provides nothing, runs the migrations as a
|
|
1825
1803
|
* side effect of layer acquisition. Already fed its `SqlClient`. Backed by
|
|
@@ -1851,10 +1829,11 @@ export declare const NodePlatformLayer: Layer.Layer<NodeServices.NodeServices, n
|
|
|
1851
1829
|
export declare const makeSqliteStack: (filename: string, migrations?: MigrationRecord) => SqliteStack;
|
|
1852
1830
|
/**
|
|
1853
1831
|
* What building a SQLite stack, and so `PlatformLive`, can fail with:
|
|
1854
|
-
* `@effected/store`'s setup /
|
|
1832
|
+
* opening the database (`SqlError`), `@effected/store`'s setup /
|
|
1833
|
+
* ledger-adoption failure, or a failing migration.
|
|
1855
1834
|
* @public
|
|
1856
1835
|
*/
|
|
1857
|
-
export type PlatformLiveError = StoreError | StoreMigrationError;
|
|
1836
|
+
export type PlatformLiveError = SqlError | StoreError | StoreMigrationError;
|
|
1858
1837
|
/**
|
|
1859
1838
|
* Options for {@link PlatformLive}.
|
|
1860
1839
|
* @public
|
|
@@ -1882,13 +1861,13 @@ export interface PlatformOptions {
|
|
|
1882
1861
|
* The services {@link PlatformLive} provides.
|
|
1883
1862
|
* @public
|
|
1884
1863
|
*/
|
|
1885
|
-
export type PlatformServices = DataReader | DataStore | ProjectDiscovery | HistoryTracker | EnvironmentDetector | ExecutorResolver |
|
|
1864
|
+
export type PlatformServices = DataReader | DataStore | ProjectDiscovery | HistoryTracker | EnvironmentDetector | ExecutorResolver | DetailResolver | NodeServices.NodeServices | SqliteClient | SqlClient;
|
|
1886
1865
|
/**
|
|
1887
1866
|
* The one platform assembly shared by the CLI, the MCP server and the Vitest
|
|
1888
1867
|
* plugin: SQLite + migrator + Node platform services + Logger, with
|
|
1889
1868
|
* `DataReader`, `DataStore`, `ProjectDiscovery`, `HistoryTracker` and the
|
|
1890
1869
|
* output pipeline (`EnvironmentDetector`, `ExecutorResolver`,
|
|
1891
|
-
* `
|
|
1870
|
+
* `DetailResolver`) built over them.
|
|
1892
1871
|
*
|
|
1893
1872
|
* Every env read goes through `options.env`; the engine never touches
|
|
1894
1873
|
* `process` itself.
|
package/index.js
CHANGED
|
@@ -14,8 +14,6 @@ import { EnvironmentDetectorLive, classifyEnvironment } from "./layers/Environme
|
|
|
14
14
|
import { EnvironmentDetectorTest } from "./layers/EnvironmentDetectorTest.js";
|
|
15
15
|
import { ExecutorResolver } from "./services/ExecutorResolver.js";
|
|
16
16
|
import { ExecutorResolverLive } from "./layers/ExecutorResolverLive.js";
|
|
17
|
-
import { FormatSelector } from "./services/FormatSelector.js";
|
|
18
|
-
import { FormatSelectorLive } from "./layers/FormatSelectorLive.js";
|
|
19
17
|
import { HistoryTrackerLive } from "./layers/HistoryTrackerLive.js";
|
|
20
18
|
import { HistoryTrackerTest } from "./layers/HistoryTrackerTest.js";
|
|
21
19
|
import { LoggerLive, resolveLogFile, resolveLogLevel } from "./layers/LoggerLive.js";
|
|
@@ -58,4 +56,4 @@ import { DATABASE_FILENAME, resolveDataPath } from "./utils/resolve-data-path.js
|
|
|
58
56
|
import { resolveWorkspaceKey } from "./utils/resolve-workspace-key.js";
|
|
59
57
|
import { CURRENT_ENGINE_VERSION } from "./version.js";
|
|
60
58
|
|
|
61
|
-
export { APP_NAMESPACE, AgentContext, CURRENT_ENGINE_VERSION, ConfigLive, DATABASE_FILENAME, DATA_DB_FILENAME, DATA_FALLBACK_DIR, DataReader, DataReaderLive, DataStore, DataStoreLive, DetailResolver, DetailResolverLive, DiscoveryRegistry, DiscoveryRegistryLive, EnvironmentDetector, EnvironmentDetectorLive, EnvironmentDetectorTest, ExecutorResolver, ExecutorResolverLive,
|
|
59
|
+
export { APP_NAMESPACE, AgentContext, CURRENT_ENGINE_VERSION, ConfigLive, DATABASE_FILENAME, DATA_DB_FILENAME, DATA_FALLBACK_DIR, DataReader, DataReaderLive, DataStore, DataStoreLive, DetailResolver, DetailResolverLive, DiscoveryRegistry, DiscoveryRegistryLive, EnvironmentDetector, EnvironmentDetectorLive, EnvironmentDetectorTest, ExecutorResolver, ExecutorResolverLive, HistoryTracker, HistoryTrackerLive, HistoryTrackerTest, IDEMPOTENCY_ROOT_SENTINEL, INLINE_ATTACHMENT_BODY_CAP_BYTES, LoggerLive, NodePlatformLayer, OutputPipelineLive, PROJECT_MIGRATIONS, PathResolutionLive, PerClientSessionMapReader, PerClientSessionMapReaderLive, PerClientSessionMapWriter, PerClientSessionMapWriterLive, PlatformLive, ProjectDiscovery, ProjectDiscoveryLive, ProjectDiscoveryTest, ProjectIdentity, ProjectIdentityLive, ProjectIdentityTest, REGISTRY_DB_FILENAME, REGISTRY_STORE_OPTIONS, RunContext, RunContext$, RunContextLive, RunContextService, RunContextTest, SESSIONS_DB_FILENAME, SidecarPlatformLive, VitestAgentConfigFile, _resetMigrationCacheForTesting, assembleHistoryRecord, assembleManifest, classifyEnvironment, computeFailureSignature, deriveIdempotencyKey, dispatchRecordTddArtifactEffect, endAgentEffect, ensureMigrated, formatTriageEffect, formatWrapupEffect, historyKey, makeSqliteStack, migration as migration0001, migration$1 as migration0002, normalizeAssertionShape, parseAndValidateTurnPayload, parseSessionEnvExports, recordRunWorkspaceChangesEffect, recordSessionEnd, recordSessionStart, recordTddArtifactByTaskIdEffect, recordTddArtifactEffect, recordTurnEffect, recoverSessionContextFromSessionEnv, registerAgentEffect, migration$2 as registryMigration0001, resolveDataPath, resolveHookPaths, resolveLogFile, resolveLogLevel, resolveProjectDir, resolveProjectIdentityFromCandidates, resolveProjectKeyFromCwd, resolveProjectKeyFromCwdEffect, resolveSessionForRecording, resolveSessionMapPath, resolveWorkspaceKey, migration$3 as sessionMapMigration0001 };
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { DetailResolverLive } from "./DetailResolverLive.js";
|
|
2
2
|
import { EnvironmentDetectorLive } from "./EnvironmentDetectorLive.js";
|
|
3
3
|
import { ExecutorResolverLive } from "./ExecutorResolverLive.js";
|
|
4
|
-
import { FormatSelectorLive } from "./FormatSelectorLive.js";
|
|
5
4
|
import { Layer } from "effect";
|
|
6
5
|
|
|
7
6
|
//#region src/layers/OutputPipelineLive.ts
|
|
8
7
|
/**
|
|
9
|
-
* The output pipeline: environment detection, executor resolution
|
|
10
|
-
*
|
|
8
|
+
* The output pipeline: environment detection, executor resolution and detail
|
|
9
|
+
* resolution.
|
|
11
10
|
*
|
|
12
11
|
* @param env - the environment map `EnvironmentDetectorLive` consults
|
|
13
12
|
* (the front end passes `process.env`)
|
|
14
13
|
* @public
|
|
15
14
|
*/
|
|
16
|
-
const OutputPipelineLive = (env) => Layer.mergeAll(EnvironmentDetectorLive(env), ExecutorResolverLive,
|
|
15
|
+
const OutputPipelineLive = (env) => Layer.mergeAll(EnvironmentDetectorLive(env), ExecutorResolverLive, DetailResolverLive);
|
|
17
16
|
|
|
18
17
|
//#endregion
|
|
19
18
|
export { OutputPipelineLive };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest-agent/engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
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": [
|
|
@@ -40,23 +40,23 @@
|
|
|
40
40
|
"./package.json": "./package.json"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@effect/platform-node": "^4.0.
|
|
44
|
-
"@effect/sql-sqlite-node": "^4.0.
|
|
45
|
-
"@effected/app": "^0.21.
|
|
46
|
-
"@effected/cli": "^0.
|
|
43
|
+
"@effect/platform-node": "^4.0.2",
|
|
44
|
+
"@effect/sql-sqlite-node": "^4.0.2",
|
|
45
|
+
"@effected/app": "^0.21.2",
|
|
46
|
+
"@effected/cli": "^0.16.0",
|
|
47
47
|
"@effected/config-file": "^0.14.2",
|
|
48
|
-
"@effected/engine": "^0.
|
|
48
|
+
"@effected/engine": "^0.4.0",
|
|
49
49
|
"@effected/env": "^0.1.0",
|
|
50
50
|
"@effected/glob": "^0.10.0",
|
|
51
|
-
"@effected/jsonc": "^0.15.
|
|
52
|
-
"@effected/store": "^0.13.
|
|
53
|
-
"@effected/toml": "^0.11.
|
|
51
|
+
"@effected/jsonc": "^0.15.1",
|
|
52
|
+
"@effected/store": "^0.13.1",
|
|
53
|
+
"@effected/toml": "^0.11.1",
|
|
54
54
|
"@effected/walker": "^0.15.0",
|
|
55
|
-
"@effected/workspaces": "^0.
|
|
55
|
+
"@effected/workspaces": "^0.32.0",
|
|
56
56
|
"@effected/xdg": "^0.9.0",
|
|
57
|
-
"@effected/yaml": "^0.19.
|
|
58
|
-
"@vitest-agent/sdk": "
|
|
59
|
-
"effect": "^4.0.
|
|
57
|
+
"@effected/yaml": "^0.19.1",
|
|
58
|
+
"@vitest-agent/sdk": "7.0.0",
|
|
59
|
+
"effect": "^4.0.2"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=24.11.0"
|
package/platform.js
CHANGED
|
@@ -45,7 +45,7 @@ const makeSqliteStack = (filename, migrations = PROJECT_MIGRATIONS) => {
|
|
|
45
45
|
* plugin: SQLite + migrator + Node platform services + Logger, with
|
|
46
46
|
* `DataReader`, `DataStore`, `ProjectDiscovery`, `HistoryTracker` and the
|
|
47
47
|
* output pipeline (`EnvironmentDetector`, `ExecutorResolver`,
|
|
48
|
-
* `
|
|
48
|
+
* `DetailResolver`) built over them.
|
|
49
49
|
*
|
|
50
50
|
* Every env read goes through `options.env`; the engine never touches
|
|
51
51
|
* `process` itself.
|
package/testing.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import "@effect/platform-node/NodeServices";
|
|
|
4
4
|
import "@effect/sql-sqlite-node/SqliteClient";
|
|
5
5
|
import { StoreError, StoreMigrationError } from "@effected/store";
|
|
6
6
|
import "effect/sql/SqlClient";
|
|
7
|
-
import "effect/sql/SqlError";
|
|
7
|
+
import { SqlError } from "effect/sql/SqlError";
|
|
8
8
|
//#region src/services/DataStore.d.ts
|
|
9
9
|
/** @public */
|
|
10
10
|
interface CreateGoalInput {
|
|
@@ -1065,10 +1065,11 @@ export declare class DataReader extends DataReader_base {}
|
|
|
1065
1065
|
//#region src/platform.d.ts
|
|
1066
1066
|
/**
|
|
1067
1067
|
* What building a SQLite stack, and so `PlatformLive`, can fail with:
|
|
1068
|
-
* `@effected/store`'s setup /
|
|
1068
|
+
* opening the database (`SqlError`), `@effected/store`'s setup /
|
|
1069
|
+
* ledger-adoption failure, or a failing migration.
|
|
1069
1070
|
* @public
|
|
1070
1071
|
*/
|
|
1071
|
-
type PlatformLiveError = StoreError | StoreMigrationError;
|
|
1072
|
+
type PlatformLiveError = SqlError | StoreError | StoreMigrationError;
|
|
1072
1073
|
//#endregion
|
|
1073
1074
|
//#region src/migrations/index.d.ts
|
|
1074
1075
|
/**
|
package/version.js
CHANGED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FormatSelector } from "../services/FormatSelector.js";
|
|
2
|
-
import { Effect, Layer } from "effect";
|
|
3
|
-
|
|
4
|
-
//#region src/layers/FormatSelectorLive.ts
|
|
5
|
-
/**
|
|
6
|
-
* Default format dispatch:
|
|
7
|
-
*
|
|
8
|
-
* - GitHub Actions CI executor: `ci-annotations` (renders as `::error::`).
|
|
9
|
-
* - Human executor: `silent` (Vitest's own reporters handle the user
|
|
10
|
-
* experience; we just write to the database).
|
|
11
|
-
* - Anyone else (agent-shell, terminal-bound CI): `terminal` — plain
|
|
12
|
-
* text + ANSI color, no markdown syntax in the place that doesn't
|
|
13
|
-
* render it. Markdown stays available via explicit `format: "markdown"`
|
|
14
|
-
* for surfaces that *do* render it (MCP tools, GitHub step summary).
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
17
|
-
const FormatSelectorLive = Layer.succeed(FormatSelector, { select: (executor, explicitFormat, environment) => Effect.succeed(explicitFormat ?? (environment === "ci-github" && executor === "ci" ? "ci-annotations" : executor === "human" ? "silent" : "terminal")) });
|
|
18
|
-
|
|
19
|
-
//#endregion
|
|
20
|
-
export { FormatSelectorLive };
|