doc-detective 4.6.1 → 4.7.0-runtime-dependency-detection.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/dist/cli.js +57 -6
- package/dist/cli.js.map +1 -1
- package/dist/common/src/schemas/schemas.json +6 -18
- package/dist/common/src/types/generated/config_v3.d.ts +2 -1
- package/dist/common/src/types/generated/config_v3.d.ts.map +1 -1
- package/dist/common/src/types/generated/resolvedTests_v3.d.ts +2 -1
- package/dist/common/src/types/generated/resolvedTests_v3.d.ts.map +1 -1
- package/dist/core/config.d.ts +17 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +218 -63
- package/dist/core/config.js.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +7 -10
- package/dist/core/index.js.map +1 -1
- package/dist/core/tests.d.ts +41 -1
- package/dist/core/tests.d.ts.map +1 -1
- package/dist/core/tests.js +166 -7
- package/dist/core/tests.js.map +1 -1
- package/dist/debug/command.d.ts +10 -0
- package/dist/debug/command.d.ts.map +1 -0
- package/dist/debug/command.js +72 -0
- package/dist/debug/command.js.map +1 -0
- package/dist/debug/envvars.d.ts +9 -0
- package/dist/debug/envvars.d.ts.map +1 -0
- package/dist/debug/envvars.js +231 -0
- package/dist/debug/envvars.js.map +1 -0
- package/dist/debug/index.d.ts +85 -0
- package/dist/debug/index.d.ts.map +1 -0
- package/dist/debug/index.js +465 -0
- package/dist/debug/index.js.map +1 -0
- package/dist/debug/redact.d.ts +7 -0
- package/dist/debug/redact.d.ts.map +1 -0
- package/dist/debug/redact.js +190 -0
- package/dist/debug/redact.js.map +1 -0
- package/dist/debug/render.d.ts +8 -0
- package/dist/debug/render.d.ts.map +1 -0
- package/dist/debug/render.js +42 -0
- package/dist/debug/render.js.map +1 -0
- package/dist/debug/system.d.ts +24 -0
- package/dist/debug/system.d.ts.map +1 -0
- package/dist/debug/system.js +59 -0
- package/dist/debug/system.js.map +1 -0
- package/dist/debug/tools.d.ts +11 -0
- package/dist/debug/tools.d.ts.map +1 -0
- package/dist/debug/tools.js +170 -0
- package/dist/debug/tools.js.map +1 -0
- package/dist/hints/hints.d.ts.map +1 -1
- package/dist/hints/hints.js +17 -0
- package/dist/hints/hints.js.map +1 -1
- package/dist/index.cjs +374 -147
- package/dist/runtime/browsers.d.ts +14 -0
- package/dist/runtime/browsers.d.ts.map +1 -1
- package/dist/runtime/browsers.js +23 -0
- package/dist/runtime/browsers.js.map +1 -1
- package/dist/runtime/installer.d.ts.map +1 -1
- package/dist/runtime/installer.js +44 -9
- package/dist/runtime/installer.js.map +1 -1
- package/dist/runtime/loader.d.ts +20 -0
- package/dist/runtime/loader.d.ts.map +1 -1
- package/dist/runtime/loader.js +50 -0
- package/dist/runtime/loader.js.map +1 -1
- package/dist/utils.d.ts +2 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +38 -11
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
// Public entry point for the diagnostic dump, reachable via the
|
|
2
|
+
// `doc-detective debug` subcommand or `DOC_DETECTIVE_DEBUG=true`.
|
|
3
|
+
//
|
|
4
|
+
// `printDebug` collects environment information into a single structured
|
|
5
|
+
// object (`collectDebugData`), then renders it two ways from that one
|
|
6
|
+
// source of truth: a paste-friendly plaintext document printed to stdout
|
|
7
|
+
// (and optionally saved to `<outDir>/debug-<timestamp>.txt`) and a
|
|
8
|
+
// machine-readable `debug-<timestamp>.json`. Rendering from shared data
|
|
9
|
+
// means the two outputs can never disagree. Callers (currently src/cli.ts)
|
|
10
|
+
// handle `process.exit(0)` separately so tests can assert on output
|
|
11
|
+
// without forking.
|
|
12
|
+
//
|
|
13
|
+
// The dump runs even when config validation failed — the caller passes
|
|
14
|
+
// the original error as `configError`, and the renderer surfaces it under
|
|
15
|
+
// a CONFIG INVALID banner. The point of the flag is debugging, so "your
|
|
16
|
+
// config is broken" is the most useful thing we can show.
|
|
17
|
+
import fs from "node:fs";
|
|
18
|
+
import path from "node:path";
|
|
19
|
+
import { fileURLToPath } from "node:url";
|
|
20
|
+
import { getVersionData } from "../utils.js";
|
|
21
|
+
import { getBrowserDiagnostics } from "../core/config.js";
|
|
22
|
+
import { collectSystemInfo } from "./system.js";
|
|
23
|
+
import { probeAllTools } from "./tools.js";
|
|
24
|
+
import { findReferencedEnvVars, detectContainer, enumerateInputFiles, resolveDocExtensions, } from "./envvars.js";
|
|
25
|
+
import { redactValue, redactObject } from "./redact.js";
|
|
26
|
+
import { renderSection, renderKeyValues, renderDocument, } from "./render.js";
|
|
27
|
+
// Where the dump is saved by default: `<cwd>/.doc-detective/`. A function
|
|
28
|
+
// (not a constant) because it reads the live cwd at call time.
|
|
29
|
+
export function defaultDebugDir() {
|
|
30
|
+
return path.join(process.cwd(), ".doc-detective");
|
|
31
|
+
}
|
|
32
|
+
// Turn the dump's ISO timestamp into a filesystem-safe token (the `:` and
|
|
33
|
+
// `.` in an ISO string are illegal/awkward in filenames, notably on
|
|
34
|
+
// Windows). Same instant, just `-`-separated: 2026-06-13T13-40-11-123Z.
|
|
35
|
+
function timestampForFilename(iso) {
|
|
36
|
+
return iso.replace(/[:.]/g, "-");
|
|
37
|
+
}
|
|
38
|
+
// Secondary cap on browser-detection latency. Detection reads
|
|
39
|
+
// doc-detective's installed.json record (fast); the only subprocess is the
|
|
40
|
+
// macOS Safari probe, which already bounds and kills itself
|
|
41
|
+
// (`probeSafariVersion`). This race is belt-and-suspenders for any
|
|
42
|
+
// unforeseen slow path — it returns `{ timedOut: true }` rather than
|
|
43
|
+
// cancelling the work, so the self-bounding probe is what actually
|
|
44
|
+
// guarantees the cap.
|
|
45
|
+
const BROWSER_DETECTION_TIMEOUT_MS = 5000;
|
|
46
|
+
async function collectDebugData(opts) {
|
|
47
|
+
const system = collectSystemInfo();
|
|
48
|
+
return {
|
|
49
|
+
generatedAt: system.wallclockIso,
|
|
50
|
+
system,
|
|
51
|
+
docDetective: collectDocDetective(),
|
|
52
|
+
tools: await probeAllTools(opts.config?.cacheDir),
|
|
53
|
+
browsers: await collectBrowsers(opts.config),
|
|
54
|
+
container: detectContainer(),
|
|
55
|
+
environment: collectEnvVars(opts),
|
|
56
|
+
config: {
|
|
57
|
+
configPath: opts.configPath ?? null,
|
|
58
|
+
configError: opts.configError?.message,
|
|
59
|
+
redacted: safeRedactConfig(opts.config),
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
function collectDocDetective() {
|
|
64
|
+
const { loadedFrom, entryPoint } = resolveLoadedFrom();
|
|
65
|
+
let versionData;
|
|
66
|
+
try {
|
|
67
|
+
versionData = getVersionData();
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
return {
|
|
71
|
+
version: "<unknown>",
|
|
72
|
+
loadedFrom,
|
|
73
|
+
entryPoint,
|
|
74
|
+
dependencies: {},
|
|
75
|
+
error: `failed to collect version data: ${err?.message || err}`,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const main = versionData?.main || {};
|
|
79
|
+
const ddVersion = main["doc-detective"]?.version || "<unknown>";
|
|
80
|
+
const ctx = versionData?.context || {};
|
|
81
|
+
const deps = versionData?.dependencies || {};
|
|
82
|
+
const dependencies = {};
|
|
83
|
+
let lockstepWarning;
|
|
84
|
+
for (const depName of Object.keys(deps)) {
|
|
85
|
+
const dep = deps[depName];
|
|
86
|
+
const version = dep?.version || dep || "<unknown>";
|
|
87
|
+
dependencies[depName] = String(version);
|
|
88
|
+
if (depName === "doc-detective-common" &&
|
|
89
|
+
typeof dep?.version === "string" &&
|
|
90
|
+
typeof ddVersion === "string" &&
|
|
91
|
+
ddVersion !== "<unknown>" &&
|
|
92
|
+
dep.version !== ddVersion) {
|
|
93
|
+
lockstepWarning = `doc-detective (${ddVersion}) and doc-detective-common (${dep.version}) versions differ — they ship in lockstep, mismatch usually means a stale install.`;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
version: ddVersion,
|
|
98
|
+
executionMethod: ctx.executionMethod,
|
|
99
|
+
loadedFrom,
|
|
100
|
+
entryPoint,
|
|
101
|
+
nodeVersion: ctx.nodeVersion,
|
|
102
|
+
platform: ctx.platform,
|
|
103
|
+
timestamp: ctx.timestamp,
|
|
104
|
+
dependencies,
|
|
105
|
+
lockstepWarning,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
// Resolve where the running doc-detective is loaded from. `loadedFrom` is
|
|
109
|
+
// the package root (the first ancestor of this module with a package.json),
|
|
110
|
+
// which differs between a project-local `node_modules` install, a global
|
|
111
|
+
// install, and an `npx` cache dir. `entryPoint` is the script node ran.
|
|
112
|
+
function resolveLoadedFrom() {
|
|
113
|
+
const entryPoint = process.argv[1] || "<unknown>";
|
|
114
|
+
let loadedFrom = "<unknown>";
|
|
115
|
+
try {
|
|
116
|
+
let dir = path.dirname(fileURLToPath(import.meta.url));
|
|
117
|
+
for (let i = 0; i < 8; i++) {
|
|
118
|
+
if (fs.existsSync(path.join(dir, "package.json"))) {
|
|
119
|
+
loadedFrom = dir;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
const parent = path.dirname(dir);
|
|
123
|
+
if (parent === dir)
|
|
124
|
+
break;
|
|
125
|
+
dir = parent;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
// Best-effort — diagnostics must never crash.
|
|
130
|
+
}
|
|
131
|
+
return { loadedFrom, entryPoint };
|
|
132
|
+
}
|
|
133
|
+
async function collectBrowsers(config) {
|
|
134
|
+
try {
|
|
135
|
+
// getBrowserDiagnostics mutates cwd and reads process.env for
|
|
136
|
+
// APPIUM_HOME; it expects a config with an `environment.platform`
|
|
137
|
+
// field. Synthesize a minimal one if validation never completed.
|
|
138
|
+
const safeConfig = config && config.environment
|
|
139
|
+
? config
|
|
140
|
+
: { ...(config || {}), environment: { platform: detectPlatform() } };
|
|
141
|
+
const timeoutSentinel = Symbol("browser-timeout");
|
|
142
|
+
// `.unref()` so the pending timer never keeps the process alive after
|
|
143
|
+
// the real probe resolves (otherwise `doc-detective debug` would idle
|
|
144
|
+
// until the timer fires), and clear it once the race settles.
|
|
145
|
+
let timer;
|
|
146
|
+
const result = await Promise.race([
|
|
147
|
+
getBrowserDiagnostics({ config: safeConfig }),
|
|
148
|
+
new Promise((resolve) => {
|
|
149
|
+
timer = setTimeout(() => resolve(timeoutSentinel), BROWSER_DETECTION_TIMEOUT_MS);
|
|
150
|
+
timer.unref?.();
|
|
151
|
+
}),
|
|
152
|
+
]).finally(() => {
|
|
153
|
+
if (timer)
|
|
154
|
+
clearTimeout(timer);
|
|
155
|
+
});
|
|
156
|
+
if (result === timeoutSentinel)
|
|
157
|
+
return { timedOut: true };
|
|
158
|
+
return {
|
|
159
|
+
detectionFailed: result.detectionFailed,
|
|
160
|
+
browsers: result.browsers,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
catch (err) {
|
|
164
|
+
return { error: err?.message || String(err) };
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function collectEnvVars(opts) {
|
|
168
|
+
// Full env dump is OPT-IN via `--include-env`. Earlier revisions
|
|
169
|
+
// auto-dumped when running in a container, but that meant common
|
|
170
|
+
// PaaS-injected secrets (DATABASE_URL with embedded password, Sentry
|
|
171
|
+
// DSN, webhook URLs) ended up in pasted bug reports unless every user
|
|
172
|
+
// knew about the redaction regex. Now the user must explicitly ask for
|
|
173
|
+
// the bulk dump; the default is the referenced-only listing.
|
|
174
|
+
if (opts.includeEnv) {
|
|
175
|
+
const names = Object.keys(process.env).sort();
|
|
176
|
+
return {
|
|
177
|
+
mode: "full",
|
|
178
|
+
variables: names.map((name) => ({
|
|
179
|
+
name,
|
|
180
|
+
value: redactValue(name, process.env[name]),
|
|
181
|
+
})),
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
const referenced = new Set();
|
|
185
|
+
// 1. DOC_DETECTIVE_CONFIG raw string.
|
|
186
|
+
const rawEnvConfig = process.env.DOC_DETECTIVE_CONFIG;
|
|
187
|
+
if (typeof rawEnvConfig === "string") {
|
|
188
|
+
for (const n of findReferencedEnvVars(rawEnvConfig))
|
|
189
|
+
referenced.add(n);
|
|
190
|
+
}
|
|
191
|
+
// 2. Config file raw source (before substitution).
|
|
192
|
+
if (opts.configPath && typeof opts.configPath === "string") {
|
|
193
|
+
try {
|
|
194
|
+
const raw = fs.readFileSync(opts.configPath, "utf8");
|
|
195
|
+
for (const n of findReferencedEnvVars(raw))
|
|
196
|
+
referenced.add(n);
|
|
197
|
+
}
|
|
198
|
+
catch {
|
|
199
|
+
// Best-effort — if the config file is unreadable, just skip.
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
// 3. Input files raw text. Walk config.input (already a string|array of
|
|
203
|
+
// absolute paths after setConfig). Cap the walk to 200 files so a
|
|
204
|
+
// misconfigured input pointed at "/" can't hang the dump. Scope to
|
|
205
|
+
// the extensions doc-detective actually parses (per config.fileTypes)
|
|
206
|
+
// — otherwise the `$VAR` grep matches shell/code/CI syntax in
|
|
207
|
+
// unrelated source files and floods the section with junk like `$0`.
|
|
208
|
+
const inputs = normalizeInputs(opts.config?.input);
|
|
209
|
+
const allowedExtensions = resolveDocExtensions(opts.config?.fileTypes);
|
|
210
|
+
const files = enumerateInputFiles(inputs, 200, allowedExtensions);
|
|
211
|
+
for (const file of files) {
|
|
212
|
+
try {
|
|
213
|
+
const raw = fs.readFileSync(file, "utf8");
|
|
214
|
+
for (const n of findReferencedEnvVars(raw))
|
|
215
|
+
referenced.add(n);
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
// Skip unreadable / binary files.
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
const sorted = Array.from(referenced).sort();
|
|
222
|
+
return {
|
|
223
|
+
mode: "referenced",
|
|
224
|
+
scannedFileCount: files.length,
|
|
225
|
+
variables: sorted.map((name) => ({
|
|
226
|
+
name,
|
|
227
|
+
value: redactValue(name, process.env[name]),
|
|
228
|
+
})),
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
function safeRedactConfig(config) {
|
|
232
|
+
try {
|
|
233
|
+
// Redact secret-looking key values and credential-shaped strings.
|
|
234
|
+
// Without this the config bypasses the env-var redaction layer —
|
|
235
|
+
// integrations.heretto[].apiToken, docDetectiveApi.apiKey, inline
|
|
236
|
+
// webhook URLs, and anything from DOC_DETECTIVE_CONFIG would leak.
|
|
237
|
+
return redactObject(config ?? {});
|
|
238
|
+
}
|
|
239
|
+
catch (err) {
|
|
240
|
+
return `<could not process config: ${err?.message || err}>`;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
export async function printDebug(opts) {
|
|
244
|
+
const print = opts.print ?? ((line) => console.log(line));
|
|
245
|
+
const data = await collectDebugData(opts);
|
|
246
|
+
const document = renderText(data, opts);
|
|
247
|
+
print(document);
|
|
248
|
+
// Persist copies for easy attachment to bug reports, named with the same
|
|
249
|
+
// timestamp printed at the top of the dump so each run is distinct and
|
|
250
|
+
// the file matches its contents. Best-effort: a write failure (read-only
|
|
251
|
+
// fs, permissions) must never crash the dump.
|
|
252
|
+
if (opts.outDir) {
|
|
253
|
+
const stamp = timestampForFilename(data.generatedAt);
|
|
254
|
+
writeFileSafe(path.join(opts.outDir, `debug-${stamp}.txt`), document + "\n", print, "Diagnostic dump saved to");
|
|
255
|
+
let json;
|
|
256
|
+
try {
|
|
257
|
+
json = JSON.stringify(data, null, 2);
|
|
258
|
+
}
|
|
259
|
+
catch (err) {
|
|
260
|
+
json = JSON.stringify({
|
|
261
|
+
error: `failed to serialize debug data: ${err?.message || err}`,
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
writeFileSafe(path.join(opts.outDir, `debug-${stamp}.json`), json + "\n", print, "Diagnostic JSON saved to");
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
function writeFileSafe(file, contents, print, successPrefix) {
|
|
268
|
+
try {
|
|
269
|
+
// The dump can contain environment/config data, so keep it private to
|
|
270
|
+
// the user: owner-only dir (0700) and file (0600). chmod the dir too in
|
|
271
|
+
// case it already existed with looser perms. (No-ops on Windows, which
|
|
272
|
+
// doesn't use POSIX modes.)
|
|
273
|
+
const dir = path.dirname(file);
|
|
274
|
+
fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
275
|
+
try {
|
|
276
|
+
fs.chmodSync(dir, 0o700);
|
|
277
|
+
}
|
|
278
|
+
catch {
|
|
279
|
+
// Best-effort — not all platforms/filesystems honor chmod.
|
|
280
|
+
}
|
|
281
|
+
fs.writeFileSync(file, contents, { encoding: "utf8", mode: 0o600 });
|
|
282
|
+
print(`\n${successPrefix} ${file}`);
|
|
283
|
+
}
|
|
284
|
+
catch (err) {
|
|
285
|
+
print(`\n<failed to save ${file}: ${err?.message || err}>`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
// ---------------------------------------------------------------------------
|
|
289
|
+
// Plaintext rendering — consumes the structured data above.
|
|
290
|
+
// ---------------------------------------------------------------------------
|
|
291
|
+
function renderText(data, opts) {
|
|
292
|
+
const sections = [
|
|
293
|
+
renderSystemSection(data.system),
|
|
294
|
+
renderDocDetectiveSection(data.docDetective),
|
|
295
|
+
renderToolsSection(data.tools),
|
|
296
|
+
renderBrowsersSection(data.browsers),
|
|
297
|
+
renderContainerSection(data.container),
|
|
298
|
+
renderEnvSection(data.environment),
|
|
299
|
+
renderConfigSection(data.config, opts.configError ?? null),
|
|
300
|
+
];
|
|
301
|
+
return renderDocument(sections, data.generatedAt);
|
|
302
|
+
}
|
|
303
|
+
function renderSystemSection(info) {
|
|
304
|
+
return renderSection("System", renderKeyValues([
|
|
305
|
+
["platform", `${info.platform} (${info.arch})`],
|
|
306
|
+
["release", info.release],
|
|
307
|
+
["os version", info.osVersion],
|
|
308
|
+
["cpus", `${info.cpuCount} × ${info.cpuModel} @ ${info.cpuSpeedMhz}MHz`],
|
|
309
|
+
["memory", `${info.freeMemoryMb}MB free / ${info.totalMemoryMb}MB total`],
|
|
310
|
+
["uptime", `${info.uptimeSeconds}s`],
|
|
311
|
+
["hostname", info.hostname],
|
|
312
|
+
["wallclock", `${info.wallclockIso} (${info.timezone})`],
|
|
313
|
+
["pid", info.pid],
|
|
314
|
+
["ppid", info.ppid],
|
|
315
|
+
["cwd", info.cwd],
|
|
316
|
+
["argv", info.argv],
|
|
317
|
+
["execPath", info.execPath],
|
|
318
|
+
["isTTY", info.isTTY],
|
|
319
|
+
["CI", info.ci],
|
|
320
|
+
]));
|
|
321
|
+
}
|
|
322
|
+
function renderDocDetectiveSection(dd) {
|
|
323
|
+
if (dd.error) {
|
|
324
|
+
return renderSection("Doc Detective", [` <${dd.error}>`]);
|
|
325
|
+
}
|
|
326
|
+
const rows = [
|
|
327
|
+
["doc-detective", dd.version],
|
|
328
|
+
["executionMethod", dd.executionMethod],
|
|
329
|
+
["loadedFrom", dd.loadedFrom],
|
|
330
|
+
["entryPoint", dd.entryPoint],
|
|
331
|
+
["nodeVersion", dd.nodeVersion],
|
|
332
|
+
["platform", dd.platform],
|
|
333
|
+
["timestamp", dd.timestamp],
|
|
334
|
+
];
|
|
335
|
+
for (const [depName, version] of Object.entries(dd.dependencies)) {
|
|
336
|
+
rows.push([depName, version]);
|
|
337
|
+
}
|
|
338
|
+
const lines = renderKeyValues(rows);
|
|
339
|
+
if (dd.lockstepWarning) {
|
|
340
|
+
lines.push("");
|
|
341
|
+
lines.push(` ! WARNING: ${dd.lockstepWarning}`);
|
|
342
|
+
}
|
|
343
|
+
return renderSection("Doc Detective", lines);
|
|
344
|
+
}
|
|
345
|
+
function renderToolsSection(results) {
|
|
346
|
+
const rows = results.map((r) => {
|
|
347
|
+
const value = r.notes ? `${r.version} (${r.notes})` : r.version;
|
|
348
|
+
return [r.name, value];
|
|
349
|
+
});
|
|
350
|
+
// Browser/Appium drivers are reported per-browser in the Browsers section.
|
|
351
|
+
return renderSection("Tools", renderKeyValues(rows));
|
|
352
|
+
}
|
|
353
|
+
function renderBrowsersSection(data) {
|
|
354
|
+
if (data.timedOut) {
|
|
355
|
+
return renderSection("Browsers", [
|
|
356
|
+
` <browser detection timed out after ${BROWSER_DETECTION_TIMEOUT_MS}ms>`,
|
|
357
|
+
]);
|
|
358
|
+
}
|
|
359
|
+
if (data.error) {
|
|
360
|
+
return renderSection("Browsers", [
|
|
361
|
+
` <browser detection failed: ${data.error}>`,
|
|
362
|
+
]);
|
|
363
|
+
}
|
|
364
|
+
const lines = [];
|
|
365
|
+
if (data.detectionFailed) {
|
|
366
|
+
lines.push(" ! browser detection hit an error; component status may be incomplete.");
|
|
367
|
+
lines.push("");
|
|
368
|
+
}
|
|
369
|
+
// Always enumerate every supported browser with a clear AVAILABLE /
|
|
370
|
+
// NOT AVAILABLE / NOT SUPPORTED status, then break down each component
|
|
371
|
+
// (browser binary, webdriver, Appium driver) so the user can see
|
|
372
|
+
// exactly which piece is missing.
|
|
373
|
+
for (const browser of data.browsers || []) {
|
|
374
|
+
const status = !browser.supported
|
|
375
|
+
? "NOT SUPPORTED"
|
|
376
|
+
: browser.available
|
|
377
|
+
? "AVAILABLE"
|
|
378
|
+
: "NOT AVAILABLE";
|
|
379
|
+
const note = browser.note ? ` (${browser.note})` : "";
|
|
380
|
+
lines.push(` ${browser.name.padEnd(8)} ${status}${note}`);
|
|
381
|
+
for (const c of browser.components) {
|
|
382
|
+
const mark = c.installed ? "installed" : "not installed";
|
|
383
|
+
const detail = c.detail ? ` ${c.detail}` : "";
|
|
384
|
+
lines.push(` ${`${c.label}:`.padEnd(25)} ${mark}${detail}`);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return renderSection("Browsers", lines);
|
|
388
|
+
}
|
|
389
|
+
function detectPlatform() {
|
|
390
|
+
switch (process.platform) {
|
|
391
|
+
case "win32":
|
|
392
|
+
return "windows";
|
|
393
|
+
case "darwin":
|
|
394
|
+
return "mac";
|
|
395
|
+
default:
|
|
396
|
+
return "linux";
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
function renderContainerSection(info) {
|
|
400
|
+
const lines = [];
|
|
401
|
+
lines.push(...renderKeyValues([["container", info.inContainer]]));
|
|
402
|
+
if (info.signals.length > 0) {
|
|
403
|
+
lines.push(" signals:");
|
|
404
|
+
for (const s of info.signals)
|
|
405
|
+
lines.push(` - ${s}`);
|
|
406
|
+
}
|
|
407
|
+
return renderSection("Container state", lines);
|
|
408
|
+
}
|
|
409
|
+
function renderEnvSection(env) {
|
|
410
|
+
if (env.mode === "full") {
|
|
411
|
+
const lines = [];
|
|
412
|
+
lines.push(` --include-env was set — listing all ${env.variables.length} env vars (redacted by name and by value shape).`);
|
|
413
|
+
lines.push(` REVIEW BEFORE PASTING. Redaction catches common patterns but is best-effort; values with novel names or shapes may slip through.`);
|
|
414
|
+
lines.push("");
|
|
415
|
+
for (const { name, value } of env.variables) {
|
|
416
|
+
lines.push(` ${name} = ${value}`);
|
|
417
|
+
}
|
|
418
|
+
return renderSection("Environment variables (full)", lines);
|
|
419
|
+
}
|
|
420
|
+
const lines = [];
|
|
421
|
+
lines.push(` Scanned ${env.scannedFileCount ?? 0} documentation file(s) plus config + DOC_DETECTIVE_CONFIG for $VAR references.`);
|
|
422
|
+
lines.push("");
|
|
423
|
+
if (env.variables.length === 0) {
|
|
424
|
+
lines.push(" <no $VAR references found>");
|
|
425
|
+
}
|
|
426
|
+
else {
|
|
427
|
+
for (const { name, value } of env.variables) {
|
|
428
|
+
lines.push(` ${name} = ${value}`);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
return renderSection("Referenced environment variables", lines);
|
|
432
|
+
}
|
|
433
|
+
function normalizeInputs(input) {
|
|
434
|
+
if (typeof input === "string")
|
|
435
|
+
return [input];
|
|
436
|
+
if (Array.isArray(input)) {
|
|
437
|
+
return input.filter((v) => typeof v === "string" && v.length > 0);
|
|
438
|
+
}
|
|
439
|
+
return [];
|
|
440
|
+
}
|
|
441
|
+
function renderConfigSection(cfg, configError) {
|
|
442
|
+
const lines = [];
|
|
443
|
+
if (configError) {
|
|
444
|
+
lines.push(" === CONFIG INVALID ===");
|
|
445
|
+
lines.push(` ${configError.message}`);
|
|
446
|
+
lines.push("");
|
|
447
|
+
lines.push(" Best-effort raw config (validation failed):");
|
|
448
|
+
}
|
|
449
|
+
else {
|
|
450
|
+
lines.push(` configPath: ${cfg.configPath || "<none>"}`);
|
|
451
|
+
lines.push("");
|
|
452
|
+
lines.push(" Effective config (post-validation):");
|
|
453
|
+
}
|
|
454
|
+
let json;
|
|
455
|
+
try {
|
|
456
|
+
json = JSON.stringify(cfg.redacted, null, 2);
|
|
457
|
+
}
|
|
458
|
+
catch (err) {
|
|
459
|
+
json = `<could not stringify config: ${err?.message || err}>`;
|
|
460
|
+
}
|
|
461
|
+
for (const l of json.split("\n"))
|
|
462
|
+
lines.push(` ${l}`);
|
|
463
|
+
return renderSection("Config", lines);
|
|
464
|
+
}
|
|
465
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/debug/index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,kEAAkE;AAClE,EAAE;AACF,yEAAyE;AACzE,sEAAsE;AACtE,yEAAyE;AACzE,mEAAmE;AACnE,wEAAwE;AACxE,2EAA2E;AAC3E,oEAAoE;AACpE,mBAAmB;AACnB,EAAE;AACF,uEAAuE;AACvE,0EAA0E;AAC1E,wEAAwE;AACxE,0DAA0D;AAE1D,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAmB,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,aAAa,EAAmB,MAAM,YAAY,CAAC;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AAED,SAAS,mBAAmB,CAAC,GAAe,EAAE,WAAyB;IACrE,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,WAAW,EAAE,CAAC;QAChB,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACvC,KAAK,CAAC,IAAI,CAAC,KAAK,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QACvC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;IAC9D,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,IAAI,CAAC,iBAAiB,GAAG,CAAC,UAAU,IAAI,QAAQ,EAAE,CAAC,CAAC;QAC1D,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;IACtD,CAAC;IACD,IAAI,IAAY,CAAC;IACjB,IAAI,CAAC;QACH,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,IAAI,GAAG,gCAAgC,GAAG,EAAE,OAAO,IAAI,GAAG,GAAG,CAAC;IAChE,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACvD,OAAO,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function isSecretName(name: string): boolean;
|
|
2
|
+
export declare function isSecretValue(value: string): boolean;
|
|
3
|
+
export declare function redactValue(name: string, value: string | undefined): string;
|
|
4
|
+
export declare function redactArg(arg: string): string;
|
|
5
|
+
export declare function redactArgv(args: string[]): string[];
|
|
6
|
+
export declare function redactObject(value: unknown): unknown;
|
|
7
|
+
//# sourceMappingURL=redact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/debug/redact.ts"],"names":[],"mappings":"AAkEA,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAU3E;AASD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAmB7C;AAOD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAwBnD;AAkBD,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEpD"}
|