vibecode-anything 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +407 -2
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +2519 -0
- package/dist/core/adapters.d.ts +31 -0
- package/dist/core/adapters.js +478 -0
- 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/diff.d.ts +10 -0
- package/dist/core/diff.js +207 -0
- package/dist/core/docs-export.d.ts +37 -0
- package/dist/core/docs-export.js +2706 -0
- package/dist/core/doctor.d.ts +70 -0
- package/dist/core/doctor.js +525 -0
- package/dist/core/errors.d.ts +32 -0
- package/dist/core/errors.js +81 -0
- package/dist/core/exec.d.ts +38 -0
- package/dist/core/exec.js +336 -0
- 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 +14 -0
- package/dist/core/parity.js +173 -0
- package/dist/core/playwright-exporter.d.ts +23 -0
- package/dist/core/playwright-exporter.js +1343 -0
- package/dist/core/png.d.ts +7 -0
- package/dist/core/png.js +339 -0
- 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 +18 -0
- package/dist/core/schema.js +1057 -0
- 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/slices.d.ts +24 -0
- package/dist/core/slices.js +294 -0
- package/dist/core/spec-writer.d.ts +9 -0
- package/dist/core/spec-writer.js +1202 -0
- package/dist/core/store.d.ts +26 -0
- package/dist/core/store.js +217 -0
- 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 +919 -0
- package/dist/core/types.js +4 -0
- package/dist/core/visual-semantic.d.ts +67 -0
- package/dist/core/visual-semantic.js +673 -0
- package/dist/core/visual.d.ts +34 -0
- package/dist/core/visual.js +508 -0
- package/dist/core/watch.d.ts +78 -0
- package/dist/core/watch.js +495 -0
- 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 +6 -0
- package/dist/ingestors/api-repo.js +1120 -0
- package/dist/ingestors/asyncapi.d.ts +26 -0
- package/dist/ingestors/asyncapi.js +2105 -0
- package/dist/ingestors/bridges.d.ts +5 -0
- package/dist/ingestors/bridges.js +1264 -0
- package/dist/ingestors/cli.d.ts +10 -0
- package/dist/ingestors/cli.js +454 -0
- 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/image.d.ts +2 -0
- package/dist/ingestors/image.js +147 -0
- package/dist/ingestors/index.d.ts +5 -0
- package/dist/ingestors/index.js +577 -0
- 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 +50 -0
- package/dist/ingestors/video.js +655 -0
- package/dist/ingestors/web.d.ts +40 -0
- package/dist/ingestors/web.js +839 -0
- package/dist/mcp/server.d.ts +2 -0
- package/dist/mcp/server.js +3969 -0
- package/dist/oracles/api-repo.d.ts +2 -0
- package/dist/oracles/api-repo.js +286 -0
- package/dist/oracles/cli.d.ts +2 -0
- package/dist/oracles/cli.js +205 -0
- package/dist/oracles/http-workflow.d.ts +68 -0
- package/dist/oracles/http-workflow.js +828 -0
- package/dist/oracles/image.d.ts +2 -0
- package/dist/oracles/image.js +429 -0
- package/dist/oracles/index.d.ts +6 -0
- package/dist/oracles/index.js +320 -0
- 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 +21 -0
- package/dist/oracles/video.js +627 -0
- package/dist/oracles/web.d.ts +2 -0
- package/dist/oracles/web.js +871 -0
- 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.d.ts +7 -0
- package/dist/setup/index.js +298 -0
- package/package.json +54 -4
- package/skills/vibecode-anything/SKILL.md +75 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type CliAgentKind } from "./agent-adapter.js";
|
|
2
|
+
import type { AdapterProbeResults, SetupScope } from "./types.js";
|
|
3
|
+
export type DoctorCheckStatus = "ok" | "warn" | "fail";
|
|
4
|
+
export interface DoctorCheck {
|
|
5
|
+
id: "node" | "playwright" | "ffmpeg" | "sharp" | "rea" | "cli-anything" | "mcp";
|
|
6
|
+
name: string;
|
|
7
|
+
required: boolean;
|
|
8
|
+
status: DoctorCheckStatus;
|
|
9
|
+
version?: string;
|
|
10
|
+
path?: string;
|
|
11
|
+
message: string;
|
|
12
|
+
installHint?: string;
|
|
13
|
+
fallbackHint?: string;
|
|
14
|
+
details?: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
export interface DoctorOptions {
|
|
17
|
+
cwd?: string;
|
|
18
|
+
homeDir?: string;
|
|
19
|
+
scope?: SetupScope | string;
|
|
20
|
+
antigravityDir?: string;
|
|
21
|
+
strict?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface BinaryProbeResult {
|
|
24
|
+
available: boolean;
|
|
25
|
+
path?: string;
|
|
26
|
+
version?: string;
|
|
27
|
+
error?: string;
|
|
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
|
+
}
|
|
42
|
+
export interface DoctorDeps {
|
|
43
|
+
nodeVersion?: string;
|
|
44
|
+
tsStrippingSupported?: boolean;
|
|
45
|
+
probeAdapters?: (options?: {
|
|
46
|
+
cwd?: string;
|
|
47
|
+
}) => Promise<AdapterProbeResults>;
|
|
48
|
+
probeBinary?: (bin: string, args: readonly string[]) => BinaryProbeResult | Promise<BinaryProbeResult>;
|
|
49
|
+
findExecutable?: (name: string) => string | null;
|
|
50
|
+
}
|
|
51
|
+
export interface DoctorReport {
|
|
52
|
+
ok: boolean;
|
|
53
|
+
command: "doctor";
|
|
54
|
+
scope: SetupScope;
|
|
55
|
+
strict: boolean;
|
|
56
|
+
exitCode: number;
|
|
57
|
+
summary: {
|
|
58
|
+
total: number;
|
|
59
|
+
ok: number;
|
|
60
|
+
warn: number;
|
|
61
|
+
fail: number;
|
|
62
|
+
requiredFailed: number;
|
|
63
|
+
};
|
|
64
|
+
checks: DoctorCheck[];
|
|
65
|
+
agents: DoctorAgentsSummary;
|
|
66
|
+
}
|
|
67
|
+
/** Run all seven environment checks and produce a single doctor report. */
|
|
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;
|
|
@@ -0,0 +1,525 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment diagnostics for vibecode-anything v0.3.
|
|
3
|
+
*
|
|
4
|
+
* Reports required and optional capabilities with install/fallback hints so
|
|
5
|
+
* CLI and MCP callers can decide whether to degrade or stop. Zero runtime
|
|
6
|
+
* dependencies: Node.js built-ins only.
|
|
7
|
+
*/
|
|
8
|
+
import { spawnSync } from "node:child_process";
|
|
9
|
+
import fs from "node:fs";
|
|
10
|
+
import os from "node:os";
|
|
11
|
+
import path from "node:path";
|
|
12
|
+
import { probeAdapters } from "./adapters.js";
|
|
13
|
+
import { CLI_AGENT_ORDER, findExecutableInPath } from "./agent-adapter.js";
|
|
14
|
+
import { VibecodeError, errorMessage } from "./errors.js";
|
|
15
|
+
import { buildWindowsCmdSpawn, isWindowsCmdShim } from "./exec.js";
|
|
16
|
+
const SERVER_ID = "vibecode-anything";
|
|
17
|
+
const VALID_SCOPES = new Set(["project", "global"]);
|
|
18
|
+
const NODE_INSTALL_HINT = "Install Node.js >= 20.0.0 (Node 24+ recommended for native TypeScript execution).";
|
|
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";
|
|
21
|
+
const FFMPEG_FALLBACK = "Ordered PNG keyframe directory input (with optional .srt/.vtt) still works without ffmpeg/ffprobe.";
|
|
22
|
+
const SHARP_FALLBACK = "Pure-Node built-in PNG decoder/encoder still verifies PNG images without sharp.";
|
|
23
|
+
const REA_INSTALL_HINT = "Install rea CLI on PATH or set VIBECODE_REA_PATH.";
|
|
24
|
+
const REA_FALLBACK = "Offline 'vibecode-anything ingest --domain rea --source <manifest.json>' still works without the rea binary.";
|
|
25
|
+
const CLI_ANYTHING_INSTALL_HINT = "Install cli-anything CLI on PATH or set VIBECODE_CLI_ANYTHING_PATH.";
|
|
26
|
+
const CLI_ANYTHING_FALLBACK = "Offline 'vibecode-anything ingest --domain cli-anything --source <spec.json>' still works without the cli-anything binary.";
|
|
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
|
+
}
|
|
46
|
+
function describeType(value) {
|
|
47
|
+
if (value === null)
|
|
48
|
+
return "null";
|
|
49
|
+
if (Array.isArray(value))
|
|
50
|
+
return "array";
|
|
51
|
+
return typeof value;
|
|
52
|
+
}
|
|
53
|
+
function firstNonEmptyLine(stdout, stderr) {
|
|
54
|
+
for (const source of [stdout, stderr]) {
|
|
55
|
+
for (const line of String(source ?? "").split(/\r?\n/)) {
|
|
56
|
+
const trimmed = line.trim();
|
|
57
|
+
if (trimmed)
|
|
58
|
+
return trimmed;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
/** Probe a binary with --version, falling back to --help when it exits non-zero. */
|
|
64
|
+
function defaultProbeBinary(bin, args) {
|
|
65
|
+
const attempts = args.length > 0 ? [...args] : ["--version"];
|
|
66
|
+
if (!attempts.includes("--help"))
|
|
67
|
+
attempts.push("--help");
|
|
68
|
+
let lastError = "binary probe failed";
|
|
69
|
+
for (const arg of attempts) {
|
|
70
|
+
let res;
|
|
71
|
+
try {
|
|
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
|
+
}
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
return { available: false, error: errorMessage(err) };
|
|
87
|
+
}
|
|
88
|
+
if (res.error)
|
|
89
|
+
return { available: false, error: errorMessage(res.error) };
|
|
90
|
+
if (res.status !== 0) {
|
|
91
|
+
lastError = `${bin} ${arg} exited with code ${String(res.status)}`;
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
const version = firstNonEmptyLine(String(res.stdout ?? ""), String(res.stderr ?? ""));
|
|
95
|
+
return { available: true, path: bin, ...(version ? { version } : {}) };
|
|
96
|
+
}
|
|
97
|
+
return { available: false, error: lastError };
|
|
98
|
+
}
|
|
99
|
+
function parseMajor(version) {
|
|
100
|
+
const match = /^v?(\d+)\.(\d+)\.(\d+)/.exec(version.trim());
|
|
101
|
+
return match ? Number(match[1]) : null;
|
|
102
|
+
}
|
|
103
|
+
function nodeCheck(nodeVersion, tsStrippingSupported) {
|
|
104
|
+
const major = parseMajor(nodeVersion);
|
|
105
|
+
const nativeTypeScript = tsStrippingSupported ?? Boolean(process.features?.typescript);
|
|
106
|
+
const details = { version: nodeVersion, major, nativeTypeScript };
|
|
107
|
+
if (major === null || major < 20) {
|
|
108
|
+
return {
|
|
109
|
+
id: "node",
|
|
110
|
+
name: "Node.js",
|
|
111
|
+
required: true,
|
|
112
|
+
status: "fail",
|
|
113
|
+
message: `Node.js ${nodeVersion || "unknown"} does not meet the minimum required version 20.0.0.`,
|
|
114
|
+
installHint: NODE_INSTALL_HINT,
|
|
115
|
+
details
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
id: "node",
|
|
120
|
+
name: "Node.js",
|
|
121
|
+
required: true,
|
|
122
|
+
status: "ok",
|
|
123
|
+
message: `Node.js ${nodeVersion} meets the minimum required version 20.0.0 (native TypeScript: ${nativeTypeScript ? "available" : "unavailable"}).`,
|
|
124
|
+
details
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
async function binaryCheck(id, name, envVar, defaultBin, installHint, fallbackHint, probe) {
|
|
128
|
+
const bin = process.env[envVar] || defaultBin;
|
|
129
|
+
let result;
|
|
130
|
+
try {
|
|
131
|
+
result = await probe(bin, ["--version"]);
|
|
132
|
+
}
|
|
133
|
+
catch (err) {
|
|
134
|
+
result = { available: false, error: errorMessage(err) };
|
|
135
|
+
}
|
|
136
|
+
const details = { binary: bin };
|
|
137
|
+
if (result.error)
|
|
138
|
+
details.error = result.error;
|
|
139
|
+
return {
|
|
140
|
+
id,
|
|
141
|
+
name,
|
|
142
|
+
required: false,
|
|
143
|
+
status: result.available ? "ok" : "warn",
|
|
144
|
+
message: result.available
|
|
145
|
+
? `${name} CLI available at ${result.path || bin}${result.version ? ` (${result.version})` : ""}.`
|
|
146
|
+
: `${name} CLI was not found${result.error ? ` (${result.error})` : ""}.`,
|
|
147
|
+
...(result.path ? { path: result.path } : result.available ? { path: bin } : {}),
|
|
148
|
+
...(result.version ? { version: result.version } : {}),
|
|
149
|
+
...(result.available ? {} : { installHint }),
|
|
150
|
+
fallbackHint,
|
|
151
|
+
details
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/** Mirrors the exact client path layouts used by `vibecode-anything setup`. */
|
|
155
|
+
function clientLayouts(scope, cwd, homeDir, antigravityDir) {
|
|
156
|
+
const base = scope === "global" ? homeDir : cwd;
|
|
157
|
+
return [
|
|
158
|
+
{
|
|
159
|
+
client: "claude-code",
|
|
160
|
+
configKey: "mcpServers",
|
|
161
|
+
layout: {
|
|
162
|
+
mcpPath: scope === "global" ? path.join(homeDir, ".claude.json") : path.join(cwd, ".mcp.json"),
|
|
163
|
+
skillPath: path.join(base, ".claude", "skills", SERVER_ID, "SKILL.md")
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
client: "cursor",
|
|
168
|
+
configKey: "mcpServers",
|
|
169
|
+
layout: {
|
|
170
|
+
mcpPath: path.join(base, ".cursor", "mcp.json"),
|
|
171
|
+
skillPath: path.join(base, ".cursor", "skills", SERVER_ID, "SKILL.md")
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
client: "antigravity",
|
|
176
|
+
configKey: "mcpServers",
|
|
177
|
+
layout: {
|
|
178
|
+
mcpPath: antigravityDir
|
|
179
|
+
? path.join(antigravityDir, "mcp_config.json")
|
|
180
|
+
: path.join(homeDir, ".gemini", "antigravity", "mcp_config.json"),
|
|
181
|
+
skillPath: scope === "global"
|
|
182
|
+
? path.join(homeDir, ".gemini", "antigravity", "skills", SERVER_ID, "SKILL.md")
|
|
183
|
+
: path.join(cwd, ".agents", "skills", SERVER_ID, "SKILL.md")
|
|
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
|
+
}
|
|
223
|
+
}
|
|
224
|
+
];
|
|
225
|
+
}
|
|
226
|
+
function inspectMcp(scope, cwd, homeDir, antigravityDir) {
|
|
227
|
+
const clients = [];
|
|
228
|
+
const errors = [];
|
|
229
|
+
let registeredCount = 0;
|
|
230
|
+
for (const { client, configKey, layout } of clientLayouts(scope, cwd, homeDir, antigravityDir)) {
|
|
231
|
+
const detail = {
|
|
232
|
+
client,
|
|
233
|
+
mcpPath: layout.mcpPath,
|
|
234
|
+
skillPath: layout.skillPath,
|
|
235
|
+
mcpExists: false,
|
|
236
|
+
registered: false,
|
|
237
|
+
skillInstalled: false
|
|
238
|
+
};
|
|
239
|
+
try {
|
|
240
|
+
if (fs.existsSync(layout.mcpPath)) {
|
|
241
|
+
detail.mcpExists = true;
|
|
242
|
+
if (fs.statSync(layout.mcpPath).isDirectory()) {
|
|
243
|
+
detail.error = `${client}: ${layout.mcpPath} is a directory, expected a JSON file.`;
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
const text = fs.readFileSync(layout.mcpPath, "utf8");
|
|
247
|
+
if (text.trim()) {
|
|
248
|
+
let parsed;
|
|
249
|
+
try {
|
|
250
|
+
parsed = JSON.parse(text);
|
|
251
|
+
}
|
|
252
|
+
catch (err) {
|
|
253
|
+
detail.error = `${client}: invalid JSON in ${layout.mcpPath} (${errorMessage(err)}).`;
|
|
254
|
+
}
|
|
255
|
+
if (!detail.error) {
|
|
256
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
257
|
+
detail.error = `${client}: ${layout.mcpPath} must contain a top-level JSON object, found ${describeType(parsed)}.`;
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
const servers = parsed[configKey];
|
|
261
|
+
if (servers !== undefined && (!servers || typeof servers !== "object" || Array.isArray(servers))) {
|
|
262
|
+
detail.error = `${client}: "${configKey}" in ${layout.mcpPath} must be a JSON object, found ${describeType(servers)}.`;
|
|
263
|
+
}
|
|
264
|
+
else if (servers && typeof servers === "object") {
|
|
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
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
catch (err) {
|
|
283
|
+
detail.error = `${client}: could not inspect ${layout.mcpPath} (${errorMessage(err)}).`;
|
|
284
|
+
}
|
|
285
|
+
try {
|
|
286
|
+
detail.skillInstalled = fs.existsSync(layout.skillPath) && fs.statSync(layout.skillPath).isFile();
|
|
287
|
+
}
|
|
288
|
+
catch {
|
|
289
|
+
detail.skillInstalled = false;
|
|
290
|
+
}
|
|
291
|
+
if (detail.registered)
|
|
292
|
+
registeredCount++;
|
|
293
|
+
if (detail.error)
|
|
294
|
+
errors.push(detail.error);
|
|
295
|
+
clients.push(detail);
|
|
296
|
+
}
|
|
297
|
+
const base = { id: "mcp", name: "MCP registration", required: false, details: { clients } };
|
|
298
|
+
if (errors.length > 0) {
|
|
299
|
+
return {
|
|
300
|
+
...base,
|
|
301
|
+
status: "fail",
|
|
302
|
+
message: `MCP configuration errors: ${errors.join(" ")}`,
|
|
303
|
+
installHint: `Fix the MCP configuration errors or re-run vibecode-anything setup --clients auto --scope ${scope}.`,
|
|
304
|
+
fallbackHint: MCP_FALLBACK
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
if (registeredCount > 0) {
|
|
308
|
+
return { ...base, status: "ok", message: `MCP registered for ${registeredCount}/${clients.length} client(s)` };
|
|
309
|
+
}
|
|
310
|
+
return {
|
|
311
|
+
...base,
|
|
312
|
+
status: "warn",
|
|
313
|
+
message: "MCP is not registered for any supported client.",
|
|
314
|
+
installHint: `vibecode-anything setup --clients auto --scope ${scope}`,
|
|
315
|
+
fallbackHint: MCP_FALLBACK
|
|
316
|
+
};
|
|
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
|
+
}
|
|
392
|
+
/** Run all seven environment checks and produce a single doctor report. */
|
|
393
|
+
export async function runDoctor(options = {}, deps = {}) {
|
|
394
|
+
const scopeInput = options.scope ?? "project";
|
|
395
|
+
if (!VALID_SCOPES.has(scopeInput)) {
|
|
396
|
+
throw new VibecodeError("CONTRACT_INVALID", `scope must be one of ${[...VALID_SCOPES].join(", ")} (got "${scopeInput}"). Pass --scope project or --scope global.`);
|
|
397
|
+
}
|
|
398
|
+
const scope = scopeInput;
|
|
399
|
+
const strict = Boolean(options.strict);
|
|
400
|
+
const cwd = options.cwd ?? process.cwd();
|
|
401
|
+
const homeDir = options.homeDir ?? os.homedir();
|
|
402
|
+
const adapters = deps.probeAdapters ? await deps.probeAdapters({ cwd }) : await probeAdapters({ cwd });
|
|
403
|
+
const probe = deps.probeBinary ?? defaultProbeBinary;
|
|
404
|
+
const findExecutable = deps.findExecutable ?? ((name) => findExecutableInPath(name));
|
|
405
|
+
const pw = adapters.playwright;
|
|
406
|
+
const ffmpegMissing = [];
|
|
407
|
+
if (!adapters.ffmpeg.available)
|
|
408
|
+
ffmpegMissing.push("ffmpeg");
|
|
409
|
+
if (!adapters.ffprobe.available)
|
|
410
|
+
ffmpegMissing.push("ffprobe");
|
|
411
|
+
const ffmpegHints = [
|
|
412
|
+
!adapters.ffmpeg.available ? adapters.ffmpeg.installHint : "",
|
|
413
|
+
!adapters.ffprobe.available ? adapters.ffprobe.installHint : ""
|
|
414
|
+
].filter(Boolean);
|
|
415
|
+
const checks = [
|
|
416
|
+
nodeCheck(deps.nodeVersion ?? process.versions.node, deps.tsStrippingSupported),
|
|
417
|
+
playwrightCheck(pw),
|
|
418
|
+
{
|
|
419
|
+
id: "ffmpeg",
|
|
420
|
+
name: "ffmpeg / ffprobe",
|
|
421
|
+
required: false,
|
|
422
|
+
status: ffmpegMissing.length === 0 ? "ok" : "warn",
|
|
423
|
+
message: ffmpegMissing.length === 0
|
|
424
|
+
? "ffmpeg and ffprobe are available."
|
|
425
|
+
: `Missing video adapter binaries: ${ffmpegMissing.join(", ")}.`,
|
|
426
|
+
...(ffmpegMissing.length === 0 ? {} : { installHint: ffmpegHints.join(" ") }),
|
|
427
|
+
fallbackHint: FFMPEG_FALLBACK,
|
|
428
|
+
details: { ffmpeg: adapters.ffmpeg, ffprobe: adapters.ffprobe }
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
id: "sharp",
|
|
432
|
+
name: "sharp",
|
|
433
|
+
required: false,
|
|
434
|
+
status: adapters.sharp.available ? "ok" : "warn",
|
|
435
|
+
message: adapters.sharp.available
|
|
436
|
+
? `sharp available${adapters.sharp.version ? ` (${adapters.sharp.version})` : ""}.`
|
|
437
|
+
: "sharp is not available; PNG parsing falls back to the pure-Node decoder.",
|
|
438
|
+
...(adapters.sharp.version ? { version: adapters.sharp.version } : {}),
|
|
439
|
+
...(adapters.sharp.path ? { path: adapters.sharp.path } : {}),
|
|
440
|
+
...(adapters.sharp.available ? {} : { installHint: adapters.sharp.installHint }),
|
|
441
|
+
fallbackHint: SHARP_FALLBACK
|
|
442
|
+
},
|
|
443
|
+
await binaryCheck("rea", "rea", "VIBECODE_REA_PATH", "rea", REA_INSTALL_HINT, REA_FALLBACK, probe),
|
|
444
|
+
await binaryCheck("cli-anything", "cli-anything", "VIBECODE_CLI_ANYTHING_PATH", "cli-anything", CLI_ANYTHING_INSTALL_HINT, CLI_ANYTHING_FALLBACK, probe),
|
|
445
|
+
inspectMcp(scope, cwd, homeDir, options.antigravityDir)
|
|
446
|
+
];
|
|
447
|
+
const summary = {
|
|
448
|
+
total: checks.length,
|
|
449
|
+
ok: checks.filter((check) => check.status === "ok").length,
|
|
450
|
+
warn: checks.filter((check) => check.status === "warn").length,
|
|
451
|
+
fail: checks.filter((check) => check.status === "fail").length,
|
|
452
|
+
requiredFailed: checks.filter((check) => check.required && check.status === "fail").length
|
|
453
|
+
};
|
|
454
|
+
const exitCode = summary.fail > 0 || summary.requiredFailed > 0 || (strict && summary.warn > 0) ? 1 : 0;
|
|
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");
|
|
525
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Diagnostic, VibecodeErrorOptions } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Structured error envelope shared by every vibecode-anything module.
|
|
4
|
+
*
|
|
5
|
+
* Every module throws (or returns) diagnostics shaped like:
|
|
6
|
+
* { code, message, adapter?, installHint?, fallbackHint?, details? }
|
|
7
|
+
*/
|
|
8
|
+
export declare class VibecodeError extends Error {
|
|
9
|
+
readonly code: string;
|
|
10
|
+
readonly adapter?: string;
|
|
11
|
+
readonly installHint?: string;
|
|
12
|
+
readonly fallbackHint?: string;
|
|
13
|
+
readonly details?: unknown;
|
|
14
|
+
constructor(code: string, message: string, options?: VibecodeErrorOptions);
|
|
15
|
+
toJSON(): Diagnostic;
|
|
16
|
+
}
|
|
17
|
+
export declare const ERROR_CODES: Readonly<{
|
|
18
|
+
readonly CONTRACT_INVALID: "CONTRACT_INVALID";
|
|
19
|
+
readonly CONTRACT_NOT_FOUND: "CONTRACT_NOT_FOUND";
|
|
20
|
+
readonly ADAPTER_MISSING: "ADAPTER_MISSING";
|
|
21
|
+
readonly ADAPTER_DEGRADED: "ADAPTER_DEGRADED";
|
|
22
|
+
readonly TARGET_MISSING: "TARGET_MISSING";
|
|
23
|
+
readonly EXEC_TIMEOUT: "EXEC_TIMEOUT";
|
|
24
|
+
readonly UNSUPPORTED_FORMAT: "UNSUPPORTED_FORMAT";
|
|
25
|
+
readonly BRIDGE_FORMAT_ERROR: "BRIDGE_FORMAT_ERROR";
|
|
26
|
+
}>;
|
|
27
|
+
/** Extract a human-readable message from an unknown thrown value. */
|
|
28
|
+
export declare function errorMessage(error: unknown): string;
|
|
29
|
+
/** Extract an error code property from an unknown thrown value, if present. */
|
|
30
|
+
export declare function errorCode(error: unknown): string | undefined;
|
|
31
|
+
/** Serialize any thrown value into the standard diagnostic envelope. */
|
|
32
|
+
export declare function toDiagnostic(error: unknown): Diagnostic;
|