vibecode-anything 0.3.0 → 0.4.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/README.md +239 -67
- package/dist/cli.js +2140 -73
- package/dist/core/adapters.d.ts +26 -3
- package/dist/core/adapters.js +411 -25
- package/dist/core/agent-adapter.d.ts +67 -0
- package/dist/core/agent-adapter.js +312 -0
- package/dist/core/anti-cheat.d.ts +6 -0
- package/dist/core/anti-cheat.js +372 -0
- package/dist/core/badge.d.ts +18 -0
- package/dist/core/badge.js +360 -0
- package/dist/core/cache.d.ts +47 -0
- package/dist/core/cache.js +403 -0
- package/dist/core/ci-export.d.ts +35 -0
- package/dist/core/ci-export.js +796 -0
- package/dist/core/ci-formats.d.ts +21 -0
- package/dist/core/ci-formats.js +388 -0
- package/dist/core/client-codegen.d.ts +36 -0
- package/dist/core/client-codegen.js +2538 -0
- package/dist/core/compose.d.ts +71 -0
- package/dist/core/compose.js +1088 -0
- package/dist/core/docs-export.d.ts +37 -0
- package/dist/core/docs-export.js +2706 -0
- package/dist/core/doctor.d.ts +21 -1
- package/dist/core/doctor.js +234 -21
- package/dist/core/exec.d.ts +26 -2
- package/dist/core/exec.js +235 -8
- package/dist/core/fixtures.d.ts +153 -0
- package/dist/core/fixtures.js +2245 -0
- package/dist/core/format.d.ts +77 -0
- package/dist/core/format.js +632 -0
- package/dist/core/fs-snapshot.d.ts +37 -0
- package/dist/core/fs-snapshot.js +216 -0
- package/dist/core/graphql-export.d.ts +34 -0
- package/dist/core/graphql-export.js +2482 -0
- package/dist/core/har-export.d.ts +29 -0
- package/dist/core/har-export.js +988 -0
- package/dist/core/html-report.d.ts +27 -0
- package/dist/core/html-report.js +1535 -0
- package/dist/core/http-export.d.ts +31 -0
- package/dist/core/http-export.js +726 -0
- package/dist/core/impact.d.ts +80 -0
- package/dist/core/impact.js +1412 -0
- package/dist/core/lint.d.ts +38 -0
- package/dist/core/lint.js +1111 -0
- package/dist/core/load-export.d.ts +37 -0
- package/dist/core/load-export.js +1813 -0
- package/dist/core/mcp-export.d.ts +35 -0
- package/dist/core/mcp-export.js +1736 -0
- package/dist/core/mock-server.d.ts +47 -0
- package/dist/core/mock-server.js +1722 -0
- package/dist/core/openapi-export.d.ts +44 -0
- package/dist/core/openapi-export.js +1074 -0
- package/dist/core/parity.d.ts +6 -1
- package/dist/core/parity.js +36 -1
- package/dist/core/playwright-exporter.d.ts +23 -0
- package/dist/core/playwright-exporter.js +1343 -0
- package/dist/core/png.js +45 -9
- package/dist/core/regression.d.ts +54 -0
- package/dist/core/regression.js +529 -0
- package/dist/core/responsive.d.ts +86 -0
- package/dist/core/responsive.js +606 -0
- package/dist/core/run.d.ts +74 -0
- package/dist/core/run.js +696 -0
- package/dist/core/scheduler.d.ts +24 -0
- package/dist/core/scheduler.js +162 -0
- package/dist/core/schema-export.d.ts +29 -0
- package/dist/core/schema-export.js +2215 -0
- package/dist/core/schema.d.ts +3 -2
- package/dist/core/schema.js +460 -17
- package/dist/core/security.d.ts +233 -0
- package/dist/core/security.js +1839 -0
- package/dist/core/server-export.d.ts +38 -0
- package/dist/core/server-export.js +3198 -0
- package/dist/core/spec-writer.d.ts +9 -0
- package/dist/core/spec-writer.js +1202 -0
- package/dist/core/store.d.ts +11 -2
- package/dist/core/store.js +128 -8
- package/dist/core/target-map.d.ts +34 -0
- package/dist/core/target-map.js +262 -0
- package/dist/core/test-exporter.d.ts +25 -0
- package/dist/core/test-exporter.js +1918 -0
- package/dist/core/types.d.ts +182 -14
- package/dist/core/visual-semantic.d.ts +67 -0
- package/dist/core/visual-semantic.js +673 -0
- package/dist/core/visual.js +65 -16
- package/dist/core/watch.d.ts +28 -3
- package/dist/core/watch.js +222 -12
- package/dist/core/yaml.d.ts +5 -0
- package/dist/core/yaml.js +1009 -0
- package/dist/diagnostics/diagnose.d.ts +53 -0
- package/dist/diagnostics/diagnose.js +1083 -0
- package/dist/diagnostics/flake.d.ts +71 -0
- package/dist/diagnostics/flake.js +608 -0
- package/dist/diagnostics/mutation-audit.d.ts +69 -0
- package/dist/diagnostics/mutation-audit.js +769 -0
- package/dist/diagnostics/spatial.d.ts +42 -0
- package/dist/diagnostics/spatial.js +346 -0
- package/dist/diagnostics/trends.d.ts +122 -0
- package/dist/diagnostics/trends.js +1190 -0
- package/dist/discovery/discover.d.ts +111 -0
- package/dist/discovery/discover.js +2017 -0
- package/dist/discovery/lock.d.ts +116 -0
- package/dist/discovery/lock.js +1505 -0
- package/dist/discovery/routes.d.ts +36 -0
- package/dist/discovery/routes.js +1494 -0
- package/dist/discovery/test-importer.d.ts +92 -0
- package/dist/discovery/test-importer.js +4952 -0
- package/dist/index.d.ts +123 -0
- package/dist/index.js +99 -0
- package/dist/ingestors/api-collections.d.ts +28 -0
- package/dist/ingestors/api-collections.js +2335 -0
- package/dist/ingestors/api-repo.d.ts +2 -1
- package/dist/ingestors/api-repo.js +483 -85
- package/dist/ingestors/asyncapi.d.ts +26 -0
- package/dist/ingestors/asyncapi.js +2105 -0
- package/dist/ingestors/bridges.d.ts +2 -0
- package/dist/ingestors/bridges.js +702 -0
- package/dist/ingestors/cli.d.ts +2 -1
- package/dist/ingestors/cli.js +234 -46
- package/dist/ingestors/curl.d.ts +14 -0
- package/dist/ingestors/curl.js +1024 -0
- package/dist/ingestors/graphql.d.ts +56 -0
- package/dist/ingestors/graphql.js +1852 -0
- package/dist/ingestors/http-file.d.ts +20 -0
- package/dist/ingestors/http-file.js +923 -0
- package/dist/ingestors/index.js +486 -6
- package/dist/ingestors/openrpc.d.ts +29 -0
- package/dist/ingestors/openrpc.js +1807 -0
- package/dist/ingestors/proto.d.ts +47 -0
- package/dist/ingestors/proto.js +2690 -0
- package/dist/ingestors/trace.d.ts +10 -0
- package/dist/ingestors/trace.js +599 -0
- package/dist/ingestors/video.d.ts +4 -1
- package/dist/ingestors/video.js +86 -36
- package/dist/ingestors/web.d.ts +16 -1
- package/dist/ingestors/web.js +474 -32
- package/dist/mcp/server.js +3532 -67
- package/dist/oracles/api-repo.js +102 -30
- package/dist/oracles/cli.js +65 -17
- package/dist/oracles/http-workflow.d.ts +68 -0
- package/dist/oracles/http-workflow.js +828 -0
- package/dist/oracles/image.js +178 -28
- package/dist/oracles/index.d.ts +3 -1
- package/dist/oracles/index.js +243 -14
- package/dist/oracles/perf-budget.d.ts +90 -0
- package/dist/oracles/perf-budget.js +1329 -0
- package/dist/oracles/stream.d.ts +94 -0
- package/dist/oracles/stream.js +1268 -0
- package/dist/oracles/ui-states.d.ts +49 -0
- package/dist/oracles/ui-states.js +894 -0
- package/dist/oracles/video.d.ts +1 -1
- package/dist/oracles/video.js +232 -16
- package/dist/oracles/web.js +464 -73
- package/dist/plugins/builtins.d.ts +12 -0
- package/dist/plugins/builtins.js +1052 -0
- package/dist/plugins/registry.d.ts +86 -0
- package/dist/plugins/registry.js +554 -0
- package/dist/setup/index.js +145 -33
- package/package.json +56 -47
- package/skills/vibecode-anything/SKILL.md +75 -52
package/dist/core/doctor.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type CliAgentKind } from "./agent-adapter.js";
|
|
1
2
|
import type { AdapterProbeResults, SetupScope } from "./types.js";
|
|
2
3
|
export type DoctorCheckStatus = "ok" | "warn" | "fail";
|
|
3
4
|
export interface DoctorCheck {
|
|
@@ -25,11 +26,27 @@ export interface BinaryProbeResult {
|
|
|
25
26
|
version?: string;
|
|
26
27
|
error?: string;
|
|
27
28
|
}
|
|
29
|
+
export interface DoctorAgentEntry {
|
|
30
|
+
agent: CliAgentKind;
|
|
31
|
+
available: boolean;
|
|
32
|
+
path?: string;
|
|
33
|
+
installHint?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface DoctorAgentsSummary {
|
|
36
|
+
detected: CliAgentKind[];
|
|
37
|
+
entries: DoctorAgentEntry[];
|
|
38
|
+
}
|
|
39
|
+
export interface FormatPrettyDoctorOptions {
|
|
40
|
+
color?: boolean;
|
|
41
|
+
}
|
|
28
42
|
export interface DoctorDeps {
|
|
29
43
|
nodeVersion?: string;
|
|
30
44
|
tsStrippingSupported?: boolean;
|
|
31
|
-
probeAdapters?: (
|
|
45
|
+
probeAdapters?: (options?: {
|
|
46
|
+
cwd?: string;
|
|
47
|
+
}) => Promise<AdapterProbeResults>;
|
|
32
48
|
probeBinary?: (bin: string, args: readonly string[]) => BinaryProbeResult | Promise<BinaryProbeResult>;
|
|
49
|
+
findExecutable?: (name: string) => string | null;
|
|
33
50
|
}
|
|
34
51
|
export interface DoctorReport {
|
|
35
52
|
ok: boolean;
|
|
@@ -45,6 +62,9 @@ export interface DoctorReport {
|
|
|
45
62
|
requiredFailed: number;
|
|
46
63
|
};
|
|
47
64
|
checks: DoctorCheck[];
|
|
65
|
+
agents: DoctorAgentsSummary;
|
|
48
66
|
}
|
|
49
67
|
/** Run all seven environment checks and produce a single doctor report. */
|
|
50
68
|
export declare function runDoctor(options?: DoctorOptions, deps?: DoctorDeps): Promise<DoctorReport>;
|
|
69
|
+
/** Render a clean terminal dashboard for `vibecode-anything doctor --pretty`. */
|
|
70
|
+
export declare function formatPrettyDoctor(report: DoctorReport, options?: FormatPrettyDoctorOptions): string;
|
package/dist/core/doctor.js
CHANGED
|
@@ -10,11 +10,14 @@ import fs from "node:fs";
|
|
|
10
10
|
import os from "node:os";
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import { probeAdapters } from "./adapters.js";
|
|
13
|
+
import { CLI_AGENT_ORDER, findExecutableInPath } from "./agent-adapter.js";
|
|
13
14
|
import { VibecodeError, errorMessage } from "./errors.js";
|
|
15
|
+
import { buildWindowsCmdSpawn, isWindowsCmdShim } from "./exec.js";
|
|
14
16
|
const SERVER_ID = "vibecode-anything";
|
|
15
17
|
const VALID_SCOPES = new Set(["project", "global"]);
|
|
16
18
|
const NODE_INSTALL_HINT = "Install Node.js >= 20.0.0 (Node 24+ recommended for native TypeScript execution).";
|
|
17
19
|
const PLAYWRIGHT_FALLBACK = "Native HTTP fetch fallback still verifies web_route landmarks without Playwright.";
|
|
20
|
+
const PLAYWRIGHT_CORE_NO_BROWSER_HINT = "Install Google Chrome or Microsoft Edge, set VIBECODE_CHROME_PATH to a browser executable, or run: npm install -D playwright && npx playwright install chromium";
|
|
18
21
|
const FFMPEG_FALLBACK = "Ordered PNG keyframe directory input (with optional .srt/.vtt) still works without ffmpeg/ffprobe.";
|
|
19
22
|
const SHARP_FALLBACK = "Pure-Node built-in PNG decoder/encoder still verifies PNG images without sharp.";
|
|
20
23
|
const REA_INSTALL_HINT = "Install rea CLI on PATH or set VIBECODE_REA_PATH.";
|
|
@@ -22,6 +25,24 @@ const REA_FALLBACK = "Offline 'vibecode-anything ingest --domain rea --source <m
|
|
|
22
25
|
const CLI_ANYTHING_INSTALL_HINT = "Install cli-anything CLI on PATH or set VIBECODE_CLI_ANYTHING_PATH.";
|
|
23
26
|
const CLI_ANYTHING_FALLBACK = "Offline 'vibecode-anything ingest --domain cli-anything --source <spec.json>' still works without the cli-anything binary.";
|
|
24
27
|
const MCP_FALLBACK = "CLI commands (ingest/verify/watch/status/diff) work directly without MCP registration.";
|
|
28
|
+
const AGENT_INSTALL_HINTS = {
|
|
29
|
+
claude: "npm install -g @anthropic-ai/claude-code",
|
|
30
|
+
codex: "npm install -g @openai/codex",
|
|
31
|
+
agy: "Install Antigravity CLI (agy)",
|
|
32
|
+
opencode: "npm install -g opencode-ai"
|
|
33
|
+
};
|
|
34
|
+
const ANSI = {
|
|
35
|
+
reset: "\x1b[0m",
|
|
36
|
+
bold: "\x1b[1m",
|
|
37
|
+
dim: "\x1b[2m",
|
|
38
|
+
red: "\x1b[31m",
|
|
39
|
+
green: "\x1b[32m",
|
|
40
|
+
yellow: "\x1b[33m",
|
|
41
|
+
cyan: "\x1b[36m"
|
|
42
|
+
};
|
|
43
|
+
function style(text, codes, useColor) {
|
|
44
|
+
return useColor ? `${codes}${text}${ANSI.reset}` : text;
|
|
45
|
+
}
|
|
25
46
|
function describeType(value) {
|
|
26
47
|
if (value === null)
|
|
27
48
|
return "null";
|
|
@@ -48,8 +69,18 @@ function defaultProbeBinary(bin, args) {
|
|
|
48
69
|
for (const arg of attempts) {
|
|
49
70
|
let res;
|
|
50
71
|
try {
|
|
51
|
-
|
|
52
|
-
|
|
72
|
+
if (isWindowsCmdShim(bin)) {
|
|
73
|
+
const spec = buildWindowsCmdSpawn(bin, [arg]);
|
|
74
|
+
res = spawnSync(spec.command, spec.args, {
|
|
75
|
+
encoding: "utf8",
|
|
76
|
+
timeout: 5000,
|
|
77
|
+
windowsHide: true,
|
|
78
|
+
windowsVerbatimArguments: spec.windowsVerbatimArguments
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
res = spawnSync(bin, [arg], { encoding: "utf8", timeout: 5000, windowsHide: true });
|
|
83
|
+
}
|
|
53
84
|
}
|
|
54
85
|
catch (err) {
|
|
55
86
|
return { available: false, error: errorMessage(err) };
|
|
@@ -126,6 +157,7 @@ function clientLayouts(scope, cwd, homeDir, antigravityDir) {
|
|
|
126
157
|
return [
|
|
127
158
|
{
|
|
128
159
|
client: "claude-code",
|
|
160
|
+
configKey: "mcpServers",
|
|
129
161
|
layout: {
|
|
130
162
|
mcpPath: scope === "global" ? path.join(homeDir, ".claude.json") : path.join(cwd, ".mcp.json"),
|
|
131
163
|
skillPath: path.join(base, ".claude", "skills", SERVER_ID, "SKILL.md")
|
|
@@ -133,6 +165,7 @@ function clientLayouts(scope, cwd, homeDir, antigravityDir) {
|
|
|
133
165
|
},
|
|
134
166
|
{
|
|
135
167
|
client: "cursor",
|
|
168
|
+
configKey: "mcpServers",
|
|
136
169
|
layout: {
|
|
137
170
|
mcpPath: path.join(base, ".cursor", "mcp.json"),
|
|
138
171
|
skillPath: path.join(base, ".cursor", "skills", SERVER_ID, "SKILL.md")
|
|
@@ -140,6 +173,7 @@ function clientLayouts(scope, cwd, homeDir, antigravityDir) {
|
|
|
140
173
|
},
|
|
141
174
|
{
|
|
142
175
|
client: "antigravity",
|
|
176
|
+
configKey: "mcpServers",
|
|
143
177
|
layout: {
|
|
144
178
|
mcpPath: antigravityDir
|
|
145
179
|
? path.join(antigravityDir, "mcp_config.json")
|
|
@@ -148,6 +182,44 @@ function clientLayouts(scope, cwd, homeDir, antigravityDir) {
|
|
|
148
182
|
? path.join(homeDir, ".gemini", "antigravity", "skills", SERVER_ID, "SKILL.md")
|
|
149
183
|
: path.join(cwd, ".agents", "skills", SERVER_ID, "SKILL.md")
|
|
150
184
|
}
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
client: "codex",
|
|
188
|
+
configKey: "mcpServers",
|
|
189
|
+
layout: {
|
|
190
|
+
mcpPath: path.join(base, ".codex", "mcp.json"),
|
|
191
|
+
skillPath: path.join(base, ".codex", "skills", SERVER_ID, "SKILL.md")
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
client: "opencode",
|
|
196
|
+
configKey: "mcp",
|
|
197
|
+
layout: {
|
|
198
|
+
mcpPath: scope === "global"
|
|
199
|
+
? path.join(homeDir, ".config", "opencode", "opencode.json")
|
|
200
|
+
: path.join(cwd, "opencode.json"),
|
|
201
|
+
skillPath: path.join(base, ".opencode", "skills", SERVER_ID, "SKILL.md")
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
client: "windsurf",
|
|
206
|
+
configKey: "mcpServers",
|
|
207
|
+
layout: {
|
|
208
|
+
mcpPath: scope === "global"
|
|
209
|
+
? path.join(homeDir, ".codeium", "windsurf", "mcp_config.json")
|
|
210
|
+
: path.join(cwd, ".windsurf", "mcp.json"),
|
|
211
|
+
skillPath: path.join(base, ".windsurf", "skills", SERVER_ID, "SKILL.md")
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
client: "cline",
|
|
216
|
+
configKey: "mcpServers",
|
|
217
|
+
layout: {
|
|
218
|
+
mcpPath: scope === "global"
|
|
219
|
+
? path.join(homeDir, ".cline", "mcp_settings.json")
|
|
220
|
+
: path.join(cwd, ".cline", "mcp.json"),
|
|
221
|
+
skillPath: path.join(base, ".cline", "skills", SERVER_ID, "SKILL.md")
|
|
222
|
+
}
|
|
151
223
|
}
|
|
152
224
|
];
|
|
153
225
|
}
|
|
@@ -155,7 +227,7 @@ function inspectMcp(scope, cwd, homeDir, antigravityDir) {
|
|
|
155
227
|
const clients = [];
|
|
156
228
|
const errors = [];
|
|
157
229
|
let registeredCount = 0;
|
|
158
|
-
for (const { client, layout } of clientLayouts(scope, cwd, homeDir, antigravityDir)) {
|
|
230
|
+
for (const { client, configKey, layout } of clientLayouts(scope, cwd, homeDir, antigravityDir)) {
|
|
159
231
|
const detail = {
|
|
160
232
|
client,
|
|
161
233
|
mcpPath: layout.mcpPath,
|
|
@@ -185,12 +257,21 @@ function inspectMcp(scope, cwd, homeDir, antigravityDir) {
|
|
|
185
257
|
detail.error = `${client}: ${layout.mcpPath} must contain a top-level JSON object, found ${describeType(parsed)}.`;
|
|
186
258
|
}
|
|
187
259
|
else {
|
|
188
|
-
const servers = parsed
|
|
260
|
+
const servers = parsed[configKey];
|
|
189
261
|
if (servers !== undefined && (!servers || typeof servers !== "object" || Array.isArray(servers))) {
|
|
190
|
-
detail.error = `${client}: "
|
|
262
|
+
detail.error = `${client}: "${configKey}" in ${layout.mcpPath} must be a JSON object, found ${describeType(servers)}.`;
|
|
191
263
|
}
|
|
192
264
|
else if (servers && typeof servers === "object") {
|
|
193
|
-
|
|
265
|
+
const entry = servers[SERVER_ID];
|
|
266
|
+
if (configKey === "mcp") {
|
|
267
|
+
detail.registered = Boolean(entry &&
|
|
268
|
+
typeof entry === "object" &&
|
|
269
|
+
!Array.isArray(entry) &&
|
|
270
|
+
entry.enabled !== false);
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
detail.registered = Boolean(entry);
|
|
274
|
+
}
|
|
194
275
|
}
|
|
195
276
|
}
|
|
196
277
|
}
|
|
@@ -234,6 +315,80 @@ function inspectMcp(scope, cwd, homeDir, antigravityDir) {
|
|
|
234
315
|
fallbackHint: MCP_FALLBACK
|
|
235
316
|
};
|
|
236
317
|
}
|
|
318
|
+
function playwrightCheck(pw) {
|
|
319
|
+
const details = {};
|
|
320
|
+
if (pw.source)
|
|
321
|
+
details.source = pw.source;
|
|
322
|
+
if (pw.packagePath)
|
|
323
|
+
details.packagePath = pw.packagePath;
|
|
324
|
+
if (pw.browserPath)
|
|
325
|
+
details.browserPath = pw.browserPath;
|
|
326
|
+
if (pw.browserName)
|
|
327
|
+
details.browserName = pw.browserName;
|
|
328
|
+
let message;
|
|
329
|
+
if (pw.available) {
|
|
330
|
+
const via = pw.source ? ` via ${pw.source}` : "";
|
|
331
|
+
const ver = pw.version ? ` (${pw.version})` : "";
|
|
332
|
+
const browserSuffix = pw.browserPath
|
|
333
|
+
? ` using ${pw.browserName ? `${pw.browserName} at ` : ""}${pw.browserPath}`
|
|
334
|
+
: "";
|
|
335
|
+
message = `Playwright available${via}${ver}${browserSuffix}.`;
|
|
336
|
+
}
|
|
337
|
+
else if (pw.source === "playwright-core" && !pw.browserPath) {
|
|
338
|
+
const ver = pw.version ? ` (${pw.version})` : "";
|
|
339
|
+
message = `Playwright package playwright-core${ver} was found, but no system Chrome/Edge/Chromium browser was detected; web_route landmarks fall back to native HTTP fetch.`;
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
message = "Playwright is not available; web_route landmarks fall back to native HTTP fetch.";
|
|
343
|
+
}
|
|
344
|
+
let installHint;
|
|
345
|
+
if (!pw.available) {
|
|
346
|
+
if (pw.source === "playwright-core" && !pw.browserPath) {
|
|
347
|
+
installHint =
|
|
348
|
+
pw.installHint && pw.installHint.includes("VIBECODE_CHROME_PATH")
|
|
349
|
+
? pw.installHint
|
|
350
|
+
: PLAYWRIGHT_CORE_NO_BROWSER_HINT;
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
installHint = pw.installHint;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
const resolvedPath = pw.path ?? pw.browserPath;
|
|
357
|
+
return {
|
|
358
|
+
id: "playwright",
|
|
359
|
+
name: "Playwright",
|
|
360
|
+
required: false,
|
|
361
|
+
status: pw.available ? "ok" : "warn",
|
|
362
|
+
message,
|
|
363
|
+
...(pw.version ? { version: pw.version } : {}),
|
|
364
|
+
...(resolvedPath ? { path: resolvedPath } : {}),
|
|
365
|
+
...(installHint ? { installHint } : {}),
|
|
366
|
+
fallbackHint: PLAYWRIGHT_FALLBACK,
|
|
367
|
+
...(Object.keys(details).length > 0 ? { details } : {})
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
function inspectCodingAgents(findExecutable) {
|
|
371
|
+
const detected = [];
|
|
372
|
+
const entries = [];
|
|
373
|
+
for (const agent of CLI_AGENT_ORDER) {
|
|
374
|
+
let resolved = null;
|
|
375
|
+
try {
|
|
376
|
+
resolved = findExecutable(agent);
|
|
377
|
+
}
|
|
378
|
+
catch {
|
|
379
|
+
resolved = null;
|
|
380
|
+
}
|
|
381
|
+
const resolvedPath = typeof resolved === "string" && resolved.trim().length > 0 ? resolved : undefined;
|
|
382
|
+
if (resolvedPath) {
|
|
383
|
+
detected.push(agent);
|
|
384
|
+
entries.push({ agent, available: true, path: resolvedPath });
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
entries.push({ agent, available: false, installHint: AGENT_INSTALL_HINTS[agent] });
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return { detected, entries };
|
|
391
|
+
}
|
|
237
392
|
/** Run all seven environment checks and produce a single doctor report. */
|
|
238
393
|
export async function runDoctor(options = {}, deps = {}) {
|
|
239
394
|
const scopeInput = options.scope ?? "project";
|
|
@@ -244,8 +399,9 @@ export async function runDoctor(options = {}, deps = {}) {
|
|
|
244
399
|
const strict = Boolean(options.strict);
|
|
245
400
|
const cwd = options.cwd ?? process.cwd();
|
|
246
401
|
const homeDir = options.homeDir ?? os.homedir();
|
|
247
|
-
const adapters = deps.probeAdapters ? await deps.probeAdapters() : await probeAdapters();
|
|
402
|
+
const adapters = deps.probeAdapters ? await deps.probeAdapters({ cwd }) : await probeAdapters({ cwd });
|
|
248
403
|
const probe = deps.probeBinary ?? defaultProbeBinary;
|
|
404
|
+
const findExecutable = deps.findExecutable ?? ((name) => findExecutableInPath(name));
|
|
249
405
|
const pw = adapters.playwright;
|
|
250
406
|
const ffmpegMissing = [];
|
|
251
407
|
if (!adapters.ffmpeg.available)
|
|
@@ -258,19 +414,7 @@ export async function runDoctor(options = {}, deps = {}) {
|
|
|
258
414
|
].filter(Boolean);
|
|
259
415
|
const checks = [
|
|
260
416
|
nodeCheck(deps.nodeVersion ?? process.versions.node, deps.tsStrippingSupported),
|
|
261
|
-
|
|
262
|
-
id: "playwright",
|
|
263
|
-
name: "Playwright",
|
|
264
|
-
required: false,
|
|
265
|
-
status: pw.available ? "ok" : "warn",
|
|
266
|
-
message: pw.available
|
|
267
|
-
? `Playwright available${pw.version ? ` (${pw.version})` : ""}.`
|
|
268
|
-
: "Playwright is not available; web_route landmarks fall back to native HTTP fetch.",
|
|
269
|
-
...(pw.version ? { version: pw.version } : {}),
|
|
270
|
-
...(pw.path ? { path: pw.path } : {}),
|
|
271
|
-
...(pw.available ? {} : { installHint: pw.installHint }),
|
|
272
|
-
fallbackHint: PLAYWRIGHT_FALLBACK
|
|
273
|
-
},
|
|
417
|
+
playwrightCheck(pw),
|
|
274
418
|
{
|
|
275
419
|
id: "ffmpeg",
|
|
276
420
|
name: "ffmpeg / ffprobe",
|
|
@@ -308,5 +452,74 @@ export async function runDoctor(options = {}, deps = {}) {
|
|
|
308
452
|
requiredFailed: checks.filter((check) => check.required && check.status === "fail").length
|
|
309
453
|
};
|
|
310
454
|
const exitCode = summary.fail > 0 || summary.requiredFailed > 0 || (strict && summary.warn > 0) ? 1 : 0;
|
|
311
|
-
|
|
455
|
+
const agents = inspectCodingAgents(findExecutable);
|
|
456
|
+
return { ok: exitCode === 0, command: "doctor", scope, strict, exitCode, summary, checks, agents };
|
|
457
|
+
}
|
|
458
|
+
function checkStatusBadge(status, useColor) {
|
|
459
|
+
switch (status) {
|
|
460
|
+
case "ok":
|
|
461
|
+
return `${style("[OK]", `${ANSI.bold}${ANSI.green}`, useColor)} `;
|
|
462
|
+
case "warn":
|
|
463
|
+
return style("[WARN]", `${ANSI.bold}${ANSI.yellow}`, useColor);
|
|
464
|
+
case "fail":
|
|
465
|
+
return style("[FAIL]", `${ANSI.bold}${ANSI.red}`, useColor);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
/** Render a clean terminal dashboard for `vibecode-anything doctor --pretty`. */
|
|
469
|
+
export function formatPrettyDoctor(report, options = {}) {
|
|
470
|
+
const useColor = options.color === true;
|
|
471
|
+
const lines = [];
|
|
472
|
+
const overallStatus = report.summary.fail > 0 || report.summary.requiredFailed > 0 || !report.ok
|
|
473
|
+
? { label: "FAIL", color: `${ANSI.bold}${ANSI.red}` }
|
|
474
|
+
: report.summary.warn > 0
|
|
475
|
+
? { label: "WARNINGS", color: `${ANSI.bold}${ANSI.yellow}` }
|
|
476
|
+
: { label: "HEALTHY", color: `${ANSI.bold}${ANSI.green}` };
|
|
477
|
+
lines.push(`${style("vibecode-anything doctor", `${ANSI.bold}${ANSI.cyan}`, useColor)} ${style(`[${overallStatus.label}]`, overallStatus.color, useColor)}`);
|
|
478
|
+
lines.push(`Scope: ${report.scope} | Strict: ${report.strict ? "on" : "off"}`);
|
|
479
|
+
lines.push("");
|
|
480
|
+
lines.push(style("Environment Checks:", ANSI.bold, useColor));
|
|
481
|
+
for (const check of report.checks) {
|
|
482
|
+
const badge = checkStatusBadge(check.status, useColor);
|
|
483
|
+
let detail = check.message.trim();
|
|
484
|
+
if (check.version && !detail.includes(check.version)) {
|
|
485
|
+
detail = `${detail} (${check.version})`;
|
|
486
|
+
}
|
|
487
|
+
if (check.path && !detail.includes(check.path)) {
|
|
488
|
+
detail = `${detail} [${check.path}]`;
|
|
489
|
+
}
|
|
490
|
+
lines.push(` ${badge} ${check.name.padEnd(17)} ${detail}`);
|
|
491
|
+
if (check.id === "mcp" && Array.isArray(check.details?.clients) && check.details.clients.length > 0) {
|
|
492
|
+
const clients = check.details.clients;
|
|
493
|
+
const registeredNames = clients
|
|
494
|
+
.filter((c) => c && c.registered === true && typeof c.client === "string")
|
|
495
|
+
.map((c) => c.client);
|
|
496
|
+
const registeredSuffix = registeredNames.length > 0 ? ` (${registeredNames.join(", ")})` : "";
|
|
497
|
+
lines.push(` ${style("clients:", ANSI.dim, useColor)} ${registeredNames.length}/${clients.length} registered${registeredSuffix}`);
|
|
498
|
+
}
|
|
499
|
+
if (check.status === "warn" || check.status === "fail") {
|
|
500
|
+
const hint = check.installHint || check.fallbackHint;
|
|
501
|
+
if (hint) {
|
|
502
|
+
lines.push(` ${style("hint:", ANSI.dim, useColor)} ${hint}`);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
lines.push("");
|
|
507
|
+
const agentEntries = report.agents?.entries ?? [];
|
|
508
|
+
const detectedAgents = report.agents?.detected ?? [];
|
|
509
|
+
lines.push(`${style("Autonomous Coding Agents (vibecode-anything run):", ANSI.bold, useColor)} ${detectedAgents.length}/${agentEntries.length} detected`);
|
|
510
|
+
for (const entry of agentEntries) {
|
|
511
|
+
if (entry.available) {
|
|
512
|
+
lines.push(` ${style("[OK]", `${ANSI.bold}${ANSI.green}`, useColor)} ${entry.agent.padEnd(10)} ${entry.path ?? "available"}`);
|
|
513
|
+
}
|
|
514
|
+
else {
|
|
515
|
+
const hintSuffix = entry.installHint ? ` (${entry.installHint})` : "";
|
|
516
|
+
lines.push(` ${style("[--]", ANSI.dim, useColor)} ${entry.agent.padEnd(10)} ${style("not found", ANSI.dim, useColor)}${hintSuffix}`);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
lines.push("");
|
|
520
|
+
const okPart = style(`${report.summary.ok} ok`, ANSI.green, useColor);
|
|
521
|
+
const warnPart = style(`${report.summary.warn} warn`, report.summary.warn > 0 ? ANSI.yellow : ANSI.dim, useColor);
|
|
522
|
+
const failPart = style(`${report.summary.fail} fail`, report.summary.fail > 0 ? ANSI.red : ANSI.dim, useColor);
|
|
523
|
+
lines.push(`Summary: ${okPart}, ${warnPart}, ${failPart} (${report.summary.total} checks, exit ${report.exitCode})`);
|
|
524
|
+
return lines.join("\n");
|
|
312
525
|
}
|
package/dist/core/exec.d.ts
CHANGED
|
@@ -1,14 +1,38 @@
|
|
|
1
|
+
import { type ChildProcess } from "node:child_process";
|
|
1
2
|
import type { CommandExecOptions, CommandExecResult } from "./types.js";
|
|
3
|
+
export interface SpawnBoundedCommandOptions extends CommandExecOptions {
|
|
4
|
+
maxBufferBytes?: number;
|
|
5
|
+
flattenWindowsCmdNewlines?: boolean;
|
|
6
|
+
}
|
|
2
7
|
/**
|
|
3
8
|
* Cross-platform quote-aware command tokenizer.
|
|
4
9
|
* Handles "double quotes", 'single quotes', and Windows paths with spaces.
|
|
5
10
|
* Does NOT invoke a shell.
|
|
6
11
|
*/
|
|
7
12
|
export declare function splitCommand(cmdString: unknown): string[];
|
|
13
|
+
export declare function isWindowsCmdShim(target: string, platform?: NodeJS.Platform): boolean;
|
|
14
|
+
export declare function quoteWindowsCmdArg(arg: string): string;
|
|
15
|
+
export interface WindowsCmdSpawnSpec {
|
|
16
|
+
command: string;
|
|
17
|
+
args: string[];
|
|
18
|
+
windowsVerbatimArguments: true;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Build a shell-free cmd.exe invocation for Windows .cmd/.bat shims so Node 24+
|
|
22
|
+
* does not emit [DEP0190] (passing args with shell: true).
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildWindowsCmdSpawn(target: string, args: readonly string[], comSpec?: string): WindowsCmdSpawnSpec;
|
|
8
25
|
/**
|
|
9
26
|
* Safe command execution wrapper.
|
|
10
27
|
* Spawns directly (shell: false) by default to preserve exact arg boundaries
|
|
11
|
-
* and prevent injection; on Windows,
|
|
12
|
-
*
|
|
28
|
+
* and prevent injection; on Windows, invokes .cmd/.bat shims via cmd.exe /d /s /c
|
|
29
|
+
* with windowsVerbatimArguments: true to avoid Node 24+ [DEP0190] warnings.
|
|
13
30
|
*/
|
|
14
31
|
export declare function runCommand(target: string, args?: readonly (string | number | boolean)[], options?: CommandExecOptions): CommandExecResult;
|
|
32
|
+
/** Terminates a spawned child and its process group/tree across POSIX and Windows. */
|
|
33
|
+
export declare function killProcessTree(child: ChildProcess): void;
|
|
34
|
+
/**
|
|
35
|
+
* Executes an async command with deterministic stdio handling, bounded output buffering,
|
|
36
|
+
* and full process-tree termination on timeout.
|
|
37
|
+
*/
|
|
38
|
+
export declare function spawnBoundedCommand(target: string, args?: readonly (string | number | boolean)[], options?: SpawnBoundedCommandOptions): Promise<CommandExecResult>;
|