cbrowser 20.0.0 → 20.0.2
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 +21 -16
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +2 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/help-format.d.ts +35 -0
- package/dist/help-format.d.ts.map +1 -0
- package/dist/help-format.js +140 -0
- package/dist/help-format.js.map +1 -0
- package/dist/types.js +28 -28
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -531,7 +531,7 @@ AI FRIENDLINESS - Audit sites for AI agent compatibility
|
|
|
531
531
|
--output <file> Save JSON report to file
|
|
532
532
|
--html Generate HTML report
|
|
533
533
|
Grades sites on: Findability (35%), Stability (30%),
|
|
534
|
-
|
|
534
|
+
Agent perceivability (20%), Semantics (15%)
|
|
535
535
|
Examples:
|
|
536
536
|
cbrowser agent-ready-audit "https://example.com"
|
|
537
537
|
cbrowser agent-ready-audit "https://example.com" --html --output report.json
|
|
@@ -600,10 +600,9 @@ ACCESSIBILITY
|
|
|
600
600
|
a11y audit [url] Audit a specific URL
|
|
601
601
|
|
|
602
602
|
TEST RECORDING
|
|
603
|
-
record start
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
record save <name> Save recorded test
|
|
603
|
+
record start / stop / save Refused since 20.0: each command is its own process, so
|
|
604
|
+
nothing was ever recorded. Write the flow as a test and
|
|
605
|
+
run it in one process: test-suite --inline "..." --capture
|
|
607
606
|
record list List saved recordings
|
|
608
607
|
record generate <name> Generate Playwright test code
|
|
609
608
|
|
|
@@ -670,7 +669,7 @@ PERSONA QUESTIONNAIRE
|
|
|
670
669
|
|
|
671
670
|
PARALLEL EXECUTION
|
|
672
671
|
parallel devices <url> Run same URL across multiple devices
|
|
673
|
-
--devices <list> Comma-separated device names (default:
|
|
672
|
+
--devices <list> Comma-separated device names (default: cbrowser's own presets, 'device list')
|
|
674
673
|
--concurrency <n> Max parallel browsers (default: 3)
|
|
675
674
|
--browser, --no-headless The browser for every device
|
|
676
675
|
parallel urls <urls> Run same task across multiple URLs
|
|
@@ -2571,16 +2570,17 @@ async function runDoctor(outputOpts) {
|
|
|
2571
2570
|
const checks = [];
|
|
2572
2571
|
// Check 1: Node.js version
|
|
2573
2572
|
const nodeVersion = process.versions.node;
|
|
2574
|
-
const nodeMajor =
|
|
2575
|
-
|
|
2576
|
-
|
|
2573
|
+
const [nodeMajor, nodeMinor] = nodeVersion.split(".").map((n) => parseInt(n, 10));
|
|
2574
|
+
// engines.node is >=20.9.0 since 20.0 (sharp 0.35 dropped Node 18).
|
|
2575
|
+
if (nodeMajor > 20 || (nodeMajor === 20 && nodeMinor >= 9)) {
|
|
2576
|
+
checks.push({ name: "Node.js", status: "pass", message: `v${nodeVersion} (>= 20.9 required)` });
|
|
2577
2577
|
}
|
|
2578
2578
|
else {
|
|
2579
2579
|
checks.push({
|
|
2580
2580
|
name: "Node.js",
|
|
2581
2581
|
status: "fail",
|
|
2582
|
-
message: `v${nodeVersion} (>=
|
|
2583
|
-
fix: "Install Node.js
|
|
2582
|
+
message: `v${nodeVersion} (>= 20.9 required)`,
|
|
2583
|
+
fix: "Install Node.js 20.9 or newer from https://nodejs.org (or stay on cbrowser 19.x)",
|
|
2584
2584
|
});
|
|
2585
2585
|
}
|
|
2586
2586
|
// Check 2: Playwright chromium — the binary must actually be on disk.
|
|
@@ -2793,17 +2793,22 @@ async function main() {
|
|
|
2793
2793
|
process.exit(1);
|
|
2794
2794
|
}
|
|
2795
2795
|
const { askCbrowser } = await import("./help-client.js");
|
|
2796
|
+
const { formatAnswerForTerminal, sourceLines, sourcePath, sourceUrls } = await import("./help-format.js");
|
|
2796
2797
|
try {
|
|
2797
2798
|
const r = await askCbrowser(question, { context: typeof options.context === "string" ? options.context : undefined });
|
|
2798
2799
|
if (options.json === true || getOutputOptions().json) {
|
|
2799
|
-
|
|
2800
|
+
// The answer stays as the service sent it (markdown); the links are added beside it.
|
|
2801
|
+
printData("ask", { question: r.question, answer: r.answer, sources: r.sources, sourceUrls: sourceUrls(r.sources) });
|
|
2800
2802
|
}
|
|
2801
2803
|
else {
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
+
// A terminal gets plain text and full links (help-format.ts).
|
|
2805
|
+
const known = r.sources.map(sourcePath).filter((p) => p !== null);
|
|
2806
|
+
console.log(formatAnswerForTerminal(r.answer, known));
|
|
2807
|
+
const lines = sourceLines(r.sources);
|
|
2808
|
+
if (lines.length > 0) {
|
|
2804
2809
|
console.log("\nSources:");
|
|
2805
|
-
for (const
|
|
2806
|
-
console.log(` - ${
|
|
2810
|
+
for (const line of lines)
|
|
2811
|
+
console.log(` - ${line}`);
|
|
2807
2812
|
}
|
|
2808
2813
|
}
|
|
2809
2814
|
process.exit(0);
|