@vitest-agent/cli 4.1.4 → 4.1.5
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/commands/db.js +2 -19
- package/commands/doctor.js +3 -3
- package/package.json +14 -14
- package/tsdoc-metadata.json +1 -1
- package/version.js +1 -1
package/commands/db.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProjectDataLive, ProjectDir } from "../layers/project-data.js";
|
|
2
2
|
import { formatDbQuery } from "../lib/format-db-query.js";
|
|
3
|
-
import { Cancelled, CliExit, CliInteractive } from "@effected/cli";
|
|
3
|
+
import { Cancelled, CliExit, CliInteractive, Fmt } from "@effected/cli";
|
|
4
4
|
import { ConfigLive, DataStore, VitestAgentConfigFile, resolveDataPath } from "@vitest-agent/engine";
|
|
5
5
|
import { Console, Effect, FileSystem, Layer, Option, Schema } from "effect";
|
|
6
6
|
import { Argument, Command, Flag, Prompt } from "effect/cli";
|
|
@@ -93,23 +93,6 @@ const resetCommand = Command.make("reset", { yes: yesOption }, ({ yes }) => Effe
|
|
|
93
93
|
})).pipe(Command.withDescription("Wipe the database (human-only; blocked in agent contexts)"));
|
|
94
94
|
const queryFormatOption = Flag.Literals("format", ["table", "json"]).pipe(Flag.withDefault("table"), Flag.withDescription("Output format for query results"));
|
|
95
95
|
const sqlArg = Argument.String("sql").pipe(Argument.withDescription("Read-only SQL statement to execute against data.db"));
|
|
96
|
-
/**
|
|
97
|
-
* Flatten an error and its cause chain into a single message so the
|
|
98
|
-
* driver's `attempt to write a readonly database` text surfaces to
|
|
99
|
-
* the user regardless of which layer wrapped it.
|
|
100
|
-
*/
|
|
101
|
-
const describeError = (error) => {
|
|
102
|
-
if (!(error instanceof Error)) return String(error);
|
|
103
|
-
const parts = [];
|
|
104
|
-
const seen = /* @__PURE__ */ new Set();
|
|
105
|
-
let current = error;
|
|
106
|
-
while (current instanceof Error && !seen.has(current)) {
|
|
107
|
-
seen.add(current);
|
|
108
|
-
if (current.message.length > 0 && !parts.includes(current.message)) parts.push(current.message);
|
|
109
|
-
current = current.cause;
|
|
110
|
-
}
|
|
111
|
-
return parts.join(": ");
|
|
112
|
-
};
|
|
113
96
|
const queryCommand = Command.make("query", {
|
|
114
97
|
sql: sqlArg,
|
|
115
98
|
format: queryFormatOption
|
|
@@ -132,7 +115,7 @@ const queryCommand = Command.make("query", {
|
|
|
132
115
|
filename: dbPath,
|
|
133
116
|
readonly: true
|
|
134
117
|
})), Effect.catch((error) => Effect.sync(() => {
|
|
135
|
-
process.stderr.write(`db query: ${
|
|
118
|
+
process.stderr.write(`db query: ${Fmt.errorText(error)}\n`);
|
|
136
119
|
process.exit(3);
|
|
137
120
|
})));
|
|
138
121
|
})).pipe(Command.withDescription("Run a read-only SQL query against the database"));
|
package/commands/doctor.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { ProjectDataLive, ProjectDir } from "../layers/project-data.js";
|
|
2
2
|
import { formatDoctor } from "../lib/format-doctor.js";
|
|
3
|
+
import { CliFormat } from "@effected/cli";
|
|
3
4
|
import { DataReader, resolveDataPath } from "@vitest-agent/engine";
|
|
4
5
|
import { Effect, Option } from "effect";
|
|
5
6
|
import { Command, Flag } from "effect/cli";
|
|
6
7
|
|
|
7
8
|
// src/commands/doctor.ts
|
|
8
9
|
const formatOption = Flag.withDefault(Flag.Literals("format", ["markdown", "json"]), "markdown");
|
|
9
|
-
const writeOutput = (results, format) => Effect.sync(() => {
|
|
10
|
-
|
|
11
|
-
else process.stdout.write(`${formatDoctor(results)}\n`);
|
|
10
|
+
const writeOutput = (results, format) => format === "json" ? CliFormat.printJson(results) : Effect.sync(() => {
|
|
11
|
+
process.stdout.write(`${formatDoctor(results)}\n`);
|
|
12
12
|
});
|
|
13
13
|
const doctorCommand = Command.make("doctor", { format: formatOption }, ({ format }) => Effect.gen(function* () {
|
|
14
14
|
const reader = yield* DataReader;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest-agent/cli",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "On-demand CLI for vitest-agent. Reads cached test data and reports status, overview, coverage, history, trends, and cache health.",
|
|
6
6
|
"keywords": [
|
|
@@ -43,19 +43,19 @@
|
|
|
43
43
|
"vitest-agent": "bin/vitest-agent.js"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@effect/platform-node": "^4.0.
|
|
47
|
-
"@effect/sql-sqlite-node": "^4.0.
|
|
48
|
-
"@effected/cli": "^0.
|
|
49
|
-
"@effected/config-file": "^0.
|
|
50
|
-
"@effected/engine": "^0.
|
|
51
|
-
"@effected/env": "^0.
|
|
52
|
-
"@effected/glob": "^0.
|
|
53
|
-
"@effected/walker": "^0.
|
|
54
|
-
"@effected/workspaces": "^0.
|
|
55
|
-
"@vitest-agent/engine": "3.0.
|
|
56
|
-
"@vitest-agent/sdk": "9.0.
|
|
57
|
-
"@vitest-agent/sidecar": "2.2.
|
|
58
|
-
"effect": "^4.0.
|
|
46
|
+
"@effect/platform-node": "^4.0.7",
|
|
47
|
+
"@effect/sql-sqlite-node": "^4.0.7",
|
|
48
|
+
"@effected/cli": "^0.24.0",
|
|
49
|
+
"@effected/config-file": "^0.22.0",
|
|
50
|
+
"@effected/engine": "^0.10.0",
|
|
51
|
+
"@effected/env": "^0.7.0",
|
|
52
|
+
"@effected/glob": "^0.16.0",
|
|
53
|
+
"@effected/walker": "^0.22.0",
|
|
54
|
+
"@effected/workspaces": "^0.40.0",
|
|
55
|
+
"@vitest-agent/engine": "3.0.1",
|
|
56
|
+
"@vitest-agent/sdk": "9.0.1",
|
|
57
|
+
"@vitest-agent/sidecar": "2.2.16",
|
|
58
|
+
"effect": "^4.0.7"
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=24.11.0"
|
package/tsdoc-metadata.json
CHANGED