@vitest-agent/engine 0.4.0 → 0.5.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
@@ -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, FormatterContext, GoalDetail, GoalNotFoundError, GoalRow, GoalStatus, HistoryRecord, IdempotencyHit, IllegalStatusTransitionError, OutputFormat, Phase, ProjectIdentityNotResolvableError, RegistrationConflictError, RenderedOutput, ResolvedThresholds, TddTaskAlreadyEndedError, TddTaskNotFoundError, TestClassification, TestRun, TrendEntry, TrendRecord, TurnPayload, VitestAgentConfig } from "@vitest-agent/sdk";
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, OutputFormat, 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";
@@ -1375,24 +1375,13 @@ export declare function resolveLogFile(env: Record<string, string | undefined>,
1375
1375
  //#region src/layers/OutputPipelineLive.d.ts
1376
1376
  /**
1377
1377
  * The output pipeline: environment detection, executor resolution, format
1378
- * selection, detail resolution and rendering.
1378
+ * selection and detail resolution.
1379
1379
  *
1380
1380
  * @param env - the environment map `EnvironmentDetectorLive` consults
1381
1381
  * (the front end passes `process.env`)
1382
1382
  * @public
1383
1383
  */
1384
- export declare const OutputPipelineLive: (env: Record<string, string | undefined>) => Layer.Layer<DetailResolver | EnvironmentDetector | ExecutorResolver | FormatSelector | OutputRenderer, never, never>;
1385
- //#endregion
1386
- //#region src/services/OutputRenderer.d.ts
1387
- declare const OutputRenderer_base: Context.ServiceClass<OutputRenderer, "vitest-agent/OutputRenderer", {
1388
- readonly render: (reports: ReadonlyArray<AgentReport>, format: OutputFormat, context: FormatterContext) => Effect.Effect<ReadonlyArray<RenderedOutput>>;
1389
- }>;
1390
- /** @public */
1391
- export declare class OutputRenderer extends OutputRenderer_base {}
1392
- //#endregion
1393
- //#region src/layers/OutputRendererLive.d.ts
1394
- /** @public */
1395
- export declare const OutputRendererLive: Layer.Layer<OutputRenderer, never, never>;
1384
+ export declare const OutputPipelineLive: (env: Record<string, string | undefined>) => Layer.Layer<DetailResolver | EnvironmentDetector | ExecutorResolver | FormatSelector, never, never>;
1396
1385
  //#endregion
1397
1386
  //#region src/layers/PathResolutionLive.d.ts
1398
1387
  /**
@@ -1880,13 +1869,13 @@ export interface PlatformOptions {
1880
1869
  * The services {@link PlatformLive} provides.
1881
1870
  * @public
1882
1871
  */
1883
- export type PlatformServices = DataReader | DataStore | ProjectDiscovery | HistoryTracker | EnvironmentDetector | ExecutorResolver | FormatSelector | DetailResolver | OutputRenderer | NodeServices.NodeServices | SqliteClient | SqlClient;
1872
+ export type PlatformServices = DataReader | DataStore | ProjectDiscovery | HistoryTracker | EnvironmentDetector | ExecutorResolver | FormatSelector | DetailResolver | NodeServices.NodeServices | SqliteClient | SqlClient;
1884
1873
  /**
1885
1874
  * The one platform assembly shared by the CLI, the MCP server and the Vitest
1886
1875
  * plugin: SQLite + migrator + Node platform services + Logger, with
1887
1876
  * `DataReader`, `DataStore`, `ProjectDiscovery`, `HistoryTracker` and the
1888
1877
  * output pipeline (`EnvironmentDetector`, `ExecutorResolver`,
1889
- * `FormatSelector`, `DetailResolver`, `OutputRenderer`) built over them.
1878
+ * `FormatSelector`, `DetailResolver`) built over them.
1890
1879
  *
1891
1880
  * Every env read goes through `options.env`; the engine never touches
1892
1881
  * `process` itself.
package/index.js CHANGED
@@ -19,8 +19,6 @@ import { FormatSelectorLive } from "./layers/FormatSelectorLive.js";
19
19
  import { HistoryTrackerLive } from "./layers/HistoryTrackerLive.js";
20
20
  import { HistoryTrackerTest } from "./layers/HistoryTrackerTest.js";
21
21
  import { LoggerLive, resolveLogFile, resolveLogLevel } from "./layers/LoggerLive.js";
22
- import { OutputRenderer } from "./services/OutputRenderer.js";
23
- import { OutputRendererLive } from "./layers/OutputRendererLive.js";
24
22
  import { OutputPipelineLive } from "./layers/OutputPipelineLive.js";
25
23
  import { APP_NAMESPACE, DATA_FALLBACK_DIR, PathResolutionLive } from "./layers/PathResolutionLive.js";
26
24
  import { PerClientSessionMapReader, PerClientSessionMapWriter } from "./services/PerClientSessionMap.js";
@@ -60,4 +58,4 @@ import { DATABASE_FILENAME, resolveDataPath } from "./utils/resolve-data-path.js
60
58
  import { resolveWorkspaceKey } from "./utils/resolve-workspace-key.js";
61
59
  import { CURRENT_ENGINE_VERSION } from "./version.js";
62
60
 
63
- 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, FormatSelector, FormatSelectorLive, HistoryTracker, HistoryTrackerLive, HistoryTrackerTest, IDEMPOTENCY_ROOT_SENTINEL, INLINE_ATTACHMENT_BODY_CAP_BYTES, LoggerLive, NodePlatformLayer, OutputPipelineLive, OutputRenderer, OutputRendererLive, PROJECT_MIGRATIONS, PathResolutionLive, PerClientSessionMapReader, PerClientSessionMapReaderLive, PerClientSessionMapWriter, PerClientSessionMapWriterLive, PlatformLive, ProjectDiscovery, ProjectDiscoveryLive, ProjectDiscoveryTest, ProjectIdentity, ProjectIdentityLive, ProjectIdentityTest, REGISTRY_DB_FILENAME, 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 };
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, FormatSelector, FormatSelectorLive, 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, 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 };
@@ -2,19 +2,18 @@ import { DetailResolverLive } from "./DetailResolverLive.js";
2
2
  import { EnvironmentDetectorLive } from "./EnvironmentDetectorLive.js";
3
3
  import { ExecutorResolverLive } from "./ExecutorResolverLive.js";
4
4
  import { FormatSelectorLive } from "./FormatSelectorLive.js";
5
- import { OutputRendererLive } from "./OutputRendererLive.js";
6
5
  import { Layer } from "effect";
7
6
 
8
7
  //#region src/layers/OutputPipelineLive.ts
9
8
  /**
10
9
  * The output pipeline: environment detection, executor resolution, format
11
- * selection, detail resolution and rendering.
10
+ * selection and detail resolution.
12
11
  *
13
12
  * @param env - the environment map `EnvironmentDetectorLive` consults
14
13
  * (the front end passes `process.env`)
15
14
  * @public
16
15
  */
17
- const OutputPipelineLive = (env) => Layer.mergeAll(EnvironmentDetectorLive(env), ExecutorResolverLive, FormatSelectorLive, DetailResolverLive, OutputRendererLive);
16
+ const OutputPipelineLive = (env) => Layer.mergeAll(EnvironmentDetectorLive(env), ExecutorResolverLive, FormatSelectorLive, DetailResolverLive);
18
17
 
19
18
  //#endregion
20
19
  export { OutputPipelineLive };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitest-agent/engine",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
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": [
@@ -53,7 +53,7 @@
53
53
  "@effected/workspaces": "^0.31.0",
54
54
  "@effected/xdg": "^0.9.0",
55
55
  "@effected/yaml": "^0.19.0",
56
- "@vitest-agent/sdk": "5.2.0",
56
+ "@vitest-agent/sdk": "6.0.0",
57
57
  "effect": "^4.0.0"
58
58
  },
59
59
  "engines": {
package/platform.js CHANGED
@@ -41,7 +41,7 @@ const makeSqliteStack = (filename, migrations = PROJECT_MIGRATIONS) => {
41
41
  * plugin: SQLite + migrator + Node platform services + Logger, with
42
42
  * `DataReader`, `DataStore`, `ProjectDiscovery`, `HistoryTracker` and the
43
43
  * output pipeline (`EnvironmentDetector`, `ExecutorResolver`,
44
- * `FormatSelector`, `DetailResolver`, `OutputRenderer`) built over them.
44
+ * `FormatSelector`, `DetailResolver`) built over them.
45
45
  *
46
46
  * Every env read goes through `options.env`; the engine never touches
47
47
  * `process` itself.
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.4.0";
3
+ const CURRENT_ENGINE_VERSION = "0.5.0";
4
4
 
5
5
  //#endregion
6
6
  export { CURRENT_ENGINE_VERSION };
@@ -1,23 +0,0 @@
1
- import { OutputRenderer } from "../services/OutputRenderer.js";
2
- import { GfmFormatter, JsonFormatter, MarkdownFormatter, SilentFormatter, TerminalFormatter, ciAnnotationsFormatter } from "@vitest-agent/sdk";
3
- import { Effect, Layer } from "effect";
4
-
5
- //#region src/layers/OutputRendererLive.ts
6
- const formatters = /* @__PURE__ */ new Map([
7
- ["terminal", TerminalFormatter],
8
- ["markdown", MarkdownFormatter],
9
- ["gfm", GfmFormatter],
10
- ["json", JsonFormatter],
11
- ["silent", SilentFormatter],
12
- ["vitest-bypass", SilentFormatter],
13
- ["ci-annotations", ciAnnotationsFormatter]
14
- ]);
15
- /** @public */
16
- const OutputRendererLive = Layer.succeed(OutputRenderer, { render: (reports, format, context) => Effect.sync(() => {
17
- const formatter = formatters.get(format);
18
- if (!formatter) return [];
19
- return formatter.render(reports, context);
20
- }) });
21
-
22
- //#endregion
23
- export { OutputRendererLive };
@@ -1,8 +0,0 @@
1
- import { Context } from "effect";
2
-
3
- //#region src/services/OutputRenderer.ts
4
- /** @public */
5
- var OutputRenderer = class extends Context.Service()("vitest-agent/OutputRenderer") {};
6
-
7
- //#endregion
8
- export { OutputRenderer };