cbrowser 8.2.4 → 8.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analysis/bug-hunter.d.ts +0 -0
- package/dist/analysis/bug-hunter.d.ts.map +0 -0
- package/dist/analysis/bug-hunter.js +0 -0
- package/dist/analysis/bug-hunter.js.map +0 -0
- package/dist/analysis/chaos-testing.d.ts +0 -0
- package/dist/analysis/chaos-testing.d.ts.map +0 -0
- package/dist/analysis/chaos-testing.js +0 -0
- package/dist/analysis/chaos-testing.js.map +0 -0
- package/dist/analysis/index.d.ts +0 -0
- package/dist/analysis/index.d.ts.map +0 -0
- package/dist/analysis/index.js +0 -0
- package/dist/analysis/index.js.map +0 -0
- package/dist/analysis/natural-language.d.ts +0 -0
- package/dist/analysis/natural-language.d.ts.map +0 -0
- package/dist/analysis/natural-language.js +0 -0
- package/dist/analysis/natural-language.js.map +0 -0
- package/dist/analysis/persona-comparison.d.ts +0 -0
- package/dist/analysis/persona-comparison.d.ts.map +0 -0
- package/dist/analysis/persona-comparison.js +0 -0
- package/dist/analysis/persona-comparison.js.map +0 -0
- package/dist/browser.d.ts +0 -0
- package/dist/browser.d.ts.map +0 -0
- package/dist/browser.js +0 -0
- package/dist/browser.js.map +0 -0
- package/dist/cli.d.ts +0 -0
- package/dist/cli.d.ts.map +0 -0
- package/dist/cli.js +179 -1
- package/dist/cli.js.map +1 -1
- package/dist/cognitive/index.d.ts +71 -0
- package/dist/cognitive/index.d.ts.map +1 -0
- package/dist/cognitive/index.js +468 -0
- package/dist/cognitive/index.js.map +1 -0
- package/dist/config.d.ts +0 -0
- package/dist/config.d.ts.map +0 -0
- package/dist/config.js +0 -0
- package/dist/config.js.map +0 -0
- package/dist/daemon.d.ts +0 -0
- package/dist/daemon.d.ts.map +0 -0
- package/dist/daemon.js +0 -0
- package/dist/daemon.js.map +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.d.ts.map +0 -0
- package/dist/index.js +0 -0
- package/dist/index.js.map +0 -0
- package/dist/mcp-server-remote.d.ts +0 -0
- package/dist/mcp-server-remote.d.ts.map +0 -0
- package/dist/mcp-server-remote.js +0 -0
- package/dist/mcp-server-remote.js.map +0 -0
- package/dist/mcp-server.d.ts +0 -0
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +277 -0
- package/dist/mcp-server.js.map +1 -1
- package/dist/performance/index.d.ts +0 -0
- package/dist/performance/index.d.ts.map +0 -0
- package/dist/performance/index.js +0 -0
- package/dist/performance/index.js.map +0 -0
- package/dist/performance/metrics.d.ts +0 -0
- package/dist/performance/metrics.d.ts.map +0 -0
- package/dist/performance/metrics.js +0 -0
- package/dist/performance/metrics.js.map +0 -0
- package/dist/personas.d.ts +18 -1
- package/dist/personas.d.ts.map +1 -1
- package/dist/personas.js +247 -0
- package/dist/personas.js.map +1 -1
- package/dist/testing/coverage.d.ts +0 -0
- package/dist/testing/coverage.d.ts.map +0 -0
- package/dist/testing/coverage.js +0 -0
- package/dist/testing/coverage.js.map +0 -0
- package/dist/testing/flaky-detection.d.ts +0 -0
- package/dist/testing/flaky-detection.d.ts.map +0 -0
- package/dist/testing/flaky-detection.js +0 -0
- package/dist/testing/flaky-detection.js.map +0 -0
- package/dist/testing/index.d.ts +0 -0
- package/dist/testing/index.d.ts.map +0 -0
- package/dist/testing/index.js +0 -0
- package/dist/testing/index.js.map +0 -0
- package/dist/testing/nl-test-suite.d.ts +0 -0
- package/dist/testing/nl-test-suite.d.ts.map +0 -0
- package/dist/testing/nl-test-suite.js +0 -0
- package/dist/testing/nl-test-suite.js.map +0 -0
- package/dist/testing/test-repair.d.ts +0 -0
- package/dist/testing/test-repair.d.ts.map +0 -0
- package/dist/testing/test-repair.js +0 -0
- package/dist/testing/test-repair.js.map +0 -0
- package/dist/types.d.ts +176 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -0
- package/dist/types.js.map +1 -1
- package/dist/visual/ab-comparison.d.ts +0 -0
- package/dist/visual/ab-comparison.d.ts.map +0 -0
- package/dist/visual/ab-comparison.js +0 -0
- package/dist/visual/ab-comparison.js.map +0 -0
- package/dist/visual/cross-browser.d.ts +0 -0
- package/dist/visual/cross-browser.d.ts.map +0 -0
- package/dist/visual/cross-browser.js +0 -0
- package/dist/visual/cross-browser.js.map +0 -0
- package/dist/visual/index.d.ts +0 -0
- package/dist/visual/index.d.ts.map +0 -0
- package/dist/visual/index.js +0 -0
- package/dist/visual/index.js.map +0 -0
- package/dist/visual/regression.d.ts +0 -0
- package/dist/visual/regression.d.ts.map +0 -0
- package/dist/visual/regression.js +0 -0
- package/dist/visual/regression.js.map +0 -0
- package/dist/visual/responsive.d.ts +0 -0
- package/dist/visual/responsive.d.ts.map +0 -0
- package/dist/visual/responsive.js +0 -0
- package/dist/visual/responsive.js.map +0 -0
- package/package.json +2 -1
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/analysis/index.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/dist/analysis/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/browser.d.ts
CHANGED
|
File without changes
|
package/dist/browser.d.ts.map
CHANGED
|
File without changes
|
package/dist/browser.js
CHANGED
|
File without changes
|
package/dist/browser.js.map
CHANGED
|
File without changes
|
package/dist/cli.d.ts
CHANGED
|
File without changes
|
package/dist/cli.d.ts.map
CHANGED
|
File without changes
|
package/dist/cli.js
CHANGED
|
@@ -21,10 +21,11 @@ const mcp_server_js_1 = require("./mcp-server.js");
|
|
|
21
21
|
const mcp_server_remote_js_1 = require("./mcp-server-remote.js");
|
|
22
22
|
const daemon_js_1 = require("./daemon.js");
|
|
23
23
|
const config_js_1 = require("./config.js");
|
|
24
|
+
const index_js_5 = require("./cognitive/index.js");
|
|
24
25
|
function showHelp() {
|
|
25
26
|
console.log(`
|
|
26
27
|
╔══════════════════════════════════════════════════════════════════════════════╗
|
|
27
|
-
║ CBrowser CLI
|
|
28
|
+
║ CBrowser CLI v8.2.5 ║
|
|
28
29
|
║ AI-powered browser automation with cross-browser visual testing ║
|
|
29
30
|
║ Semantic Versioning: https://semver.org/ ║
|
|
30
31
|
╚══════════════════════════════════════════════════════════════════════════════╝
|
|
@@ -52,6 +53,24 @@ AUTONOMOUS JOURNEYS
|
|
|
52
53
|
--goal <goal> What to accomplish
|
|
53
54
|
--record-video Record journey as video
|
|
54
55
|
|
|
56
|
+
COGNITIVE JOURNEY (v8.0.0) - API-powered autonomous user simulation
|
|
57
|
+
cognitive-journey Run autonomous cognitive simulation using Claude API
|
|
58
|
+
--persona <name> Persona name or description (default: first-timer)
|
|
59
|
+
--start <url> Starting URL (required)
|
|
60
|
+
--goal <goal> Goal statement (required)
|
|
61
|
+
--max-steps <n> Maximum steps before timeout (default: 50)
|
|
62
|
+
--max-time <s> Maximum time in seconds (default: 120)
|
|
63
|
+
--verbose Show step-by-step narration
|
|
64
|
+
--output <file> Save JSON report to file
|
|
65
|
+
--html Generate HTML report
|
|
66
|
+
Examples:
|
|
67
|
+
cbrowser cognitive-journey --start "https://example.com" \\
|
|
68
|
+
--goal "Sign up for an account" --persona first-timer
|
|
69
|
+
cbrowser cognitive-journey --start "https://shop.example.com" \\
|
|
70
|
+
--goal "Find and purchase a blue shirt" --persona elderly-user --verbose
|
|
71
|
+
|
|
72
|
+
Note: Requires Anthropic API key. Set with: cbrowser config set-api-key <key>
|
|
73
|
+
|
|
55
74
|
MULTI-PERSONA COMPARISON (v6.0.0)
|
|
56
75
|
compare-personas Compare multiple personas on the same journey
|
|
57
76
|
--start <url> Starting URL (required)
|
|
@@ -467,6 +486,12 @@ DAEMON MODE (v6.4.0)
|
|
|
467
486
|
Note: When daemon is running, all commands automatically connect to it
|
|
468
487
|
instead of launching a new browser - much faster for iteration!
|
|
469
488
|
|
|
489
|
+
API CONFIGURATION (v8.0.0)
|
|
490
|
+
config set-api-key <key> Set Anthropic API key for cognitive journeys
|
|
491
|
+
config show-api-key Show configured API key (masked)
|
|
492
|
+
config remove-api-key Remove stored API key
|
|
493
|
+
config set-model <model> Set Claude model (default: claude-sonnet-4-20250514)
|
|
494
|
+
|
|
470
495
|
DIAGNOSTICS
|
|
471
496
|
status Show environment status and diagnostics
|
|
472
497
|
Displays data directories, browsers, config, heal cache
|
|
@@ -901,6 +926,72 @@ async function main() {
|
|
|
901
926
|
console.log((0, config_js_1.formatStatus)(info));
|
|
902
927
|
process.exit(0);
|
|
903
928
|
}
|
|
929
|
+
// Config command - runs before browser instantiation
|
|
930
|
+
if (command === "config") {
|
|
931
|
+
const subCommand = args[0];
|
|
932
|
+
const fs = await import("fs");
|
|
933
|
+
const path = await import("path");
|
|
934
|
+
switch (subCommand) {
|
|
935
|
+
case "set-api-key": {
|
|
936
|
+
const apiKey = args[1];
|
|
937
|
+
if (!apiKey) {
|
|
938
|
+
console.error("Usage: cbrowser config set-api-key <api-key>");
|
|
939
|
+
process.exit(1);
|
|
940
|
+
}
|
|
941
|
+
if (!apiKey.startsWith("sk-ant-")) {
|
|
942
|
+
console.error("❌ Invalid API key format. Anthropic keys start with 'sk-ant-'");
|
|
943
|
+
process.exit(1);
|
|
944
|
+
}
|
|
945
|
+
(0, index_js_5.setAnthropicApiKey)(apiKey);
|
|
946
|
+
console.log("✅ Anthropic API key saved to ~/.cbrowser/config.json");
|
|
947
|
+
process.exit(0);
|
|
948
|
+
}
|
|
949
|
+
case "show-api-key": {
|
|
950
|
+
const key = (0, index_js_5.getAnthropicApiKey)();
|
|
951
|
+
if (key) {
|
|
952
|
+
const masked = key.slice(0, 7) + "..." + key.slice(-4);
|
|
953
|
+
console.log(`Anthropic API key: ${masked}`);
|
|
954
|
+
console.log(`Source: ${process.env.ANTHROPIC_API_KEY ? "environment" : "config file"}`);
|
|
955
|
+
}
|
|
956
|
+
else {
|
|
957
|
+
console.log("No Anthropic API key configured.");
|
|
958
|
+
console.log("Set with: cbrowser config set-api-key <key>");
|
|
959
|
+
}
|
|
960
|
+
process.exit(0);
|
|
961
|
+
}
|
|
962
|
+
case "remove-api-key": {
|
|
963
|
+
(0, index_js_5.removeAnthropicApiKey)();
|
|
964
|
+
console.log("✅ Anthropic API key removed from config.");
|
|
965
|
+
if (process.env.ANTHROPIC_API_KEY) {
|
|
966
|
+
console.log("⚠️ Note: ANTHROPIC_API_KEY environment variable is still set.");
|
|
967
|
+
}
|
|
968
|
+
process.exit(0);
|
|
969
|
+
}
|
|
970
|
+
case "set-model": {
|
|
971
|
+
const model = args[1];
|
|
972
|
+
if (!model) {
|
|
973
|
+
console.error("Usage: cbrowser config set-model <model>");
|
|
974
|
+
console.error("Examples: claude-sonnet-4-20250514, claude-3-5-sonnet-20241022");
|
|
975
|
+
process.exit(1);
|
|
976
|
+
}
|
|
977
|
+
const configPath = path.join((0, config_js_1.getDataDir)(), "config.json");
|
|
978
|
+
let config = {};
|
|
979
|
+
if (fs.existsSync(configPath)) {
|
|
980
|
+
try {
|
|
981
|
+
config = JSON.parse(fs.readFileSync(configPath, "utf-8"));
|
|
982
|
+
}
|
|
983
|
+
catch { }
|
|
984
|
+
}
|
|
985
|
+
config.anthropicModel = model;
|
|
986
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
987
|
+
console.log(`✅ Claude model set to: ${model}`);
|
|
988
|
+
process.exit(0);
|
|
989
|
+
}
|
|
990
|
+
default:
|
|
991
|
+
console.error("Usage: cbrowser config [set-api-key|show-api-key|remove-api-key|set-model]");
|
|
992
|
+
process.exit(1);
|
|
993
|
+
}
|
|
994
|
+
}
|
|
904
995
|
// Install/Sync PAI skill (both commands do the same thing)
|
|
905
996
|
if (command === "install-skill" || command === "sync-skill") {
|
|
906
997
|
const { execSync } = await import("child_process");
|
|
@@ -4152,6 +4243,93 @@ Documentation: https://github.com/alexandriashai/cbrowser/wiki
|
|
|
4152
4243
|
}
|
|
4153
4244
|
break;
|
|
4154
4245
|
}
|
|
4246
|
+
// =========================================================================
|
|
4247
|
+
// Cognitive Journey (v8.0.0) - API-powered autonomous user simulation
|
|
4248
|
+
// =========================================================================
|
|
4249
|
+
case "cognitive-journey": {
|
|
4250
|
+
// Check API key first
|
|
4251
|
+
if (!(0, index_js_5.isApiKeyConfigured)()) {
|
|
4252
|
+
console.error("❌ Anthropic API key not configured.");
|
|
4253
|
+
console.error("");
|
|
4254
|
+
console.error("Set your API key with:");
|
|
4255
|
+
console.error(" cbrowser config set-api-key sk-ant-...");
|
|
4256
|
+
console.error("");
|
|
4257
|
+
console.error("Or set the ANTHROPIC_API_KEY environment variable.");
|
|
4258
|
+
process.exit(1);
|
|
4259
|
+
}
|
|
4260
|
+
const startUrl = options.start;
|
|
4261
|
+
const goal = options.goal;
|
|
4262
|
+
if (!startUrl) {
|
|
4263
|
+
console.error("Error: --start <url> is required");
|
|
4264
|
+
process.exit(1);
|
|
4265
|
+
}
|
|
4266
|
+
if (!goal) {
|
|
4267
|
+
console.error("Error: --goal <goal> is required");
|
|
4268
|
+
process.exit(1);
|
|
4269
|
+
}
|
|
4270
|
+
const personaName = options.persona || "first-timer";
|
|
4271
|
+
const maxSteps = options["max-steps"] ? parseInt(options["max-steps"]) : 50;
|
|
4272
|
+
const maxTime = options["max-time"] ? parseInt(options["max-time"]) : 120;
|
|
4273
|
+
const verbose = options.verbose === true;
|
|
4274
|
+
const headless = options.headless === true;
|
|
4275
|
+
console.log(`\n🧠 COGNITIVE JOURNEY`);
|
|
4276
|
+
console.log(` Persona: ${personaName}`);
|
|
4277
|
+
console.log(` Goal: "${goal}"`);
|
|
4278
|
+
console.log(` URL: ${startUrl}`);
|
|
4279
|
+
console.log(` Max steps: ${maxSteps} | Max time: ${maxTime}s`);
|
|
4280
|
+
console.log("");
|
|
4281
|
+
try {
|
|
4282
|
+
const result = await (0, index_js_5.runCognitiveJourney)({
|
|
4283
|
+
persona: personaName,
|
|
4284
|
+
goal,
|
|
4285
|
+
startUrl,
|
|
4286
|
+
maxSteps,
|
|
4287
|
+
maxTime,
|
|
4288
|
+
verbose,
|
|
4289
|
+
headless,
|
|
4290
|
+
onStep: verbose ? undefined : (step) => {
|
|
4291
|
+
process.stdout.write(`\r Step ${step.step}: ${step.phase} (${step.state.currentMood})`);
|
|
4292
|
+
},
|
|
4293
|
+
});
|
|
4294
|
+
console.log("\n");
|
|
4295
|
+
if (result.goalAchieved) {
|
|
4296
|
+
console.log(`✅ GOAL ACHIEVED in ${result.stepCount} steps (${result.totalTime.toFixed(1)}s)`);
|
|
4297
|
+
}
|
|
4298
|
+
else {
|
|
4299
|
+
console.log(`❌ ABANDONED: ${result.abandonmentReason}`);
|
|
4300
|
+
if (result.abandonmentMessage) {
|
|
4301
|
+
console.log(` 💭 "${result.abandonmentMessage}"`);
|
|
4302
|
+
}
|
|
4303
|
+
}
|
|
4304
|
+
console.log(`\n📊 Summary:`);
|
|
4305
|
+
console.log(` Steps: ${result.stepCount}`);
|
|
4306
|
+
console.log(` Time: ${result.totalTime.toFixed(1)}s`);
|
|
4307
|
+
console.log(` Friction points: ${result.frictionPoints.length}`);
|
|
4308
|
+
console.log(` Max frustration: ${(result.summary.maxFrustrationLevel * 100).toFixed(0)}%`);
|
|
4309
|
+
if (result.frictionPoints.length > 0) {
|
|
4310
|
+
console.log(`\n⚠️ Friction Points:`);
|
|
4311
|
+
for (const fp of result.frictionPoints) {
|
|
4312
|
+
console.log(` Step ${fp.step}: ${fp.type} - ${fp.monologue}`);
|
|
4313
|
+
if (fp.element) {
|
|
4314
|
+
console.log(` Element: ${fp.element}`);
|
|
4315
|
+
}
|
|
4316
|
+
}
|
|
4317
|
+
}
|
|
4318
|
+
// Save report
|
|
4319
|
+
if (options.output) {
|
|
4320
|
+
const fs = await import("fs");
|
|
4321
|
+
fs.writeFileSync(options.output, JSON.stringify(result, null, 2));
|
|
4322
|
+
console.log(`\n📄 Report saved: ${options.output}`);
|
|
4323
|
+
}
|
|
4324
|
+
// Exit with appropriate code
|
|
4325
|
+
process.exit(result.goalAchieved ? 0 : 1);
|
|
4326
|
+
}
|
|
4327
|
+
catch (error) {
|
|
4328
|
+
console.error(`\n❌ Error: ${error.message}`);
|
|
4329
|
+
process.exit(1);
|
|
4330
|
+
}
|
|
4331
|
+
break;
|
|
4332
|
+
}
|
|
4155
4333
|
default:
|
|
4156
4334
|
console.error(`Unknown command: ${command}`);
|
|
4157
4335
|
console.error("Run 'cbrowser help' for usage");
|