cbrowser 7.4.6 → 7.4.8
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 +111 -1
- package/dist/cli.js +83 -1
- package/dist/cli.js.map +1 -1
- package/dist/testing/nl-test-suite.d.ts.map +1 -1
- package/dist/testing/nl-test-suite.js +14 -13
- package/dist/testing/nl-test-suite.js.map +1 -1
- package/docs/INSTALL.md +32 -1
- package/examples/remote-mcp.ts +137 -0
- package/examples/smart-automation.ts +5 -2
- package/examples/visual-testing.ts +177 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -168,7 +168,40 @@ This isn't optional safety theater—it's how you give AI agents browser access
|
|
|
168
168
|
|
|
169
169
|
## Quick Start
|
|
170
170
|
|
|
171
|
-
### Installation
|
|
171
|
+
### Option 1: PAI Skill Installation (Claude Code Users)
|
|
172
|
+
|
|
173
|
+
If you use [Claude Code](https://claude.ai/claude-code) with [PAI (Personal AI Infrastructure)](https://github.com/danielmiessler/Personal_AI_Infrastructure), install CBrowser as a skill:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# One-line installation
|
|
177
|
+
curl -fsSL https://raw.githubusercontent.com/alexandriashai/cbrowser/main/scripts/install-skill.sh | bash
|
|
178
|
+
|
|
179
|
+
# Or via npm CLI
|
|
180
|
+
npx cbrowser install-skill
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
This installs CBrowser to `~/.claude/skills/CBrowser/` with full skill structure:
|
|
184
|
+
- `SKILL.md` - Main skill file with workflow routing
|
|
185
|
+
- `Workflows/` - Navigate, Interact, Extract, Test, Journey workflows
|
|
186
|
+
- `Tools/CBrowser.ts` - CLI wrapper for PAI
|
|
187
|
+
- `.memory/` - Session, selector, and persona storage
|
|
188
|
+
|
|
189
|
+
After installation, add to your `~/.claude/skills/skill-index.json`:
|
|
190
|
+
|
|
191
|
+
```json
|
|
192
|
+
{
|
|
193
|
+
"CBrowser": "~/.claude/skills/CBrowser/SKILL.md"
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
Then install dependencies:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
npm install -g cbrowser
|
|
201
|
+
npx playwright install
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Option 2: npm Installation (Standard)
|
|
172
205
|
|
|
173
206
|
```bash
|
|
174
207
|
# npm
|
|
@@ -184,6 +217,10 @@ yarn add cbrowser
|
|
|
184
217
|
### Install Playwright Browsers
|
|
185
218
|
|
|
186
219
|
```bash
|
|
220
|
+
# Install all browsers (recommended for cross-browser testing)
|
|
221
|
+
npx playwright install
|
|
222
|
+
|
|
223
|
+
# Or just Chromium
|
|
187
224
|
npx playwright install chromium
|
|
188
225
|
```
|
|
189
226
|
|
|
@@ -203,6 +240,77 @@ npx cbrowser assert "page contains 'Welcome'"
|
|
|
203
240
|
npx cbrowser generate-tests "https://example.com"
|
|
204
241
|
```
|
|
205
242
|
|
|
243
|
+
## v7.x Features
|
|
244
|
+
|
|
245
|
+
### AI Visual Regression (v7.0)
|
|
246
|
+
|
|
247
|
+
Semantic screenshot comparison using AI—not just pixel diffs:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
# Capture a baseline
|
|
251
|
+
npx cbrowser ai-visual capture "https://example.com" --name homepage
|
|
252
|
+
|
|
253
|
+
# Compare against baseline
|
|
254
|
+
npx cbrowser ai-visual test "https://staging.example.com" homepage --html
|
|
255
|
+
|
|
256
|
+
# List baselines
|
|
257
|
+
npx cbrowser ai-visual list
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
The AI understands what changed semantically (button moved, text changed, new section added) rather than flagging every pixel difference.
|
|
261
|
+
|
|
262
|
+
### Cross-Browser Visual Testing (v7.1)
|
|
263
|
+
|
|
264
|
+
Compare rendering across Chrome, Firefox, and Safari:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
npx cbrowser cross-browser "https://example.com" --html
|
|
268
|
+
npx cbrowser cross-browser "https://example.com" --browsers chromium,firefox,webkit
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Responsive Visual Testing (v7.2)
|
|
272
|
+
|
|
273
|
+
Test across viewport sizes (mobile, tablet, desktop):
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
npx cbrowser responsive "https://example.com" --html
|
|
277
|
+
npx cbrowser responsive "https://example.com" --viewports mobile,tablet,desktop-lg
|
|
278
|
+
npx cbrowser responsive viewports # list available presets
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### A/B Visual Comparison (v7.3)
|
|
282
|
+
|
|
283
|
+
Compare two different URLs (staging vs production, old vs new design):
|
|
284
|
+
|
|
285
|
+
```bash
|
|
286
|
+
npx cbrowser ab "https://staging.example.com" "https://example.com" --html
|
|
287
|
+
npx cbrowser ab "https://old.site.com" "https://new.site.com" --label-a "Old" --label-b "New"
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Modular Architecture (v7.4.1)
|
|
291
|
+
|
|
292
|
+
Tree-shakeable imports for smaller bundles:
|
|
293
|
+
|
|
294
|
+
```typescript
|
|
295
|
+
// Import everything (unchanged)
|
|
296
|
+
import { CBrowser, runVisualRegression, detectFlakyTests } from 'cbrowser';
|
|
297
|
+
|
|
298
|
+
// Import only what you need (modular)
|
|
299
|
+
import { runVisualRegression, runCrossBrowserTest } from 'cbrowser/visual';
|
|
300
|
+
import { runNLTestSuite, detectFlakyTests, repairTest } from 'cbrowser/testing';
|
|
301
|
+
import { huntBugs, runChaosTest, findElementByIntent } from 'cbrowser/analysis';
|
|
302
|
+
import { capturePerformanceBaseline, detectPerformanceRegression } from 'cbrowser/performance';
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
| Module | Purpose |
|
|
306
|
+
|--------|---------|
|
|
307
|
+
| `cbrowser/visual` | Visual testing (regression, cross-browser, responsive, A/B) |
|
|
308
|
+
| `cbrowser/testing` | Test automation (NL suites, repair, flaky detection, coverage) |
|
|
309
|
+
| `cbrowser/analysis` | AI analysis (bug hunting, chaos testing, persona comparison) |
|
|
310
|
+
| `cbrowser/performance` | Performance (baselines, regression detection) |
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
206
314
|
## v6.0.0 Features
|
|
207
315
|
|
|
208
316
|
### Multi-Persona Comparison
|
|
@@ -913,6 +1021,8 @@ See the [`examples/`](examples/) directory:
|
|
|
913
1021
|
|
|
914
1022
|
- `basic-usage.ts` - Navigation, extraction, sessions
|
|
915
1023
|
- `smart-automation.ts` - Smart click, assertions, test generation
|
|
1024
|
+
- `visual-testing.ts` - AI visual regression, cross-browser, responsive, A/B comparison
|
|
1025
|
+
- `remote-mcp.ts` - Remote MCP server, Auth0 OAuth, demo server setup
|
|
916
1026
|
- `journeys/checkout-flow.json` - Persona journey definition
|
|
917
1027
|
- `personas/custom-persona.json` - Custom persona template
|
|
918
1028
|
|
package/dist/cli.js
CHANGED
|
@@ -23,7 +23,7 @@ const daemon_js_1 = require("./daemon.js");
|
|
|
23
23
|
function showHelp() {
|
|
24
24
|
console.log(`
|
|
25
25
|
╔══════════════════════════════════════════════════════════════════════════════╗
|
|
26
|
-
║ CBrowser CLI v7.4.
|
|
26
|
+
║ CBrowser CLI v7.4.6 ║
|
|
27
27
|
║ AI-powered browser automation with cross-browser visual testing ║
|
|
28
28
|
╚══════════════════════════════════════════════════════════════════════════════╝
|
|
29
29
|
|
|
@@ -430,6 +430,11 @@ MCP SERVER (v5.0.0)
|
|
|
430
430
|
mcp-remote Start remote HTTP MCP server for claude.ai connectors
|
|
431
431
|
--port <port> Port to listen on (default: 3000)
|
|
432
432
|
--host <host> Host to bind to (default: 0.0.0.0)
|
|
433
|
+
|
|
434
|
+
PAI SKILL INSTALLATION (v7.4.6)
|
|
435
|
+
install-skill Install CBrowser as a PAI skill to ~/.claude/skills/
|
|
436
|
+
Downloads skill files from GitHub and creates directory structure
|
|
437
|
+
Add to skill-index.json after installation
|
|
433
438
|
--stateful Use stateful session mode
|
|
434
439
|
|
|
435
440
|
DAEMON MODE (v6.4.0)
|
|
@@ -855,6 +860,83 @@ async function main() {
|
|
|
855
860
|
await (0, mcp_server_remote_js_1.startRemoteMcpServer)();
|
|
856
861
|
return;
|
|
857
862
|
}
|
|
863
|
+
// Install PAI skill
|
|
864
|
+
if (command === "install-skill") {
|
|
865
|
+
const { execSync } = await import("child_process");
|
|
866
|
+
const path = await import("path");
|
|
867
|
+
const fs = await import("fs");
|
|
868
|
+
const os = await import("os");
|
|
869
|
+
const skillDir = path.join(os.homedir(), ".claude", "skills", "CBrowser");
|
|
870
|
+
const repoUrl = "https://raw.githubusercontent.com/alexandriashai/cbrowser/main";
|
|
871
|
+
console.log(`
|
|
872
|
+
╔═══════════════════════════════════════════════════════════════╗
|
|
873
|
+
║ CBrowser PAI Skill Installer v7.4.6 ║
|
|
874
|
+
╚═══════════════════════════════════════════════════════════════╝
|
|
875
|
+
`);
|
|
876
|
+
// Check if ~/.claude/skills exists
|
|
877
|
+
const skillsDir = path.join(os.homedir(), ".claude", "skills");
|
|
878
|
+
if (!fs.existsSync(skillsDir)) {
|
|
879
|
+
console.log("Creating ~/.claude/skills directory...");
|
|
880
|
+
fs.mkdirSync(skillsDir, { recursive: true });
|
|
881
|
+
}
|
|
882
|
+
// Check if skill exists
|
|
883
|
+
if (fs.existsSync(skillDir)) {
|
|
884
|
+
console.log("CBrowser skill already exists. Updating...");
|
|
885
|
+
fs.rmSync(skillDir, { recursive: true });
|
|
886
|
+
}
|
|
887
|
+
// Create directories
|
|
888
|
+
console.log("Creating skill directory structure...");
|
|
889
|
+
fs.mkdirSync(path.join(skillDir, "Workflows"), { recursive: true });
|
|
890
|
+
fs.mkdirSync(path.join(skillDir, "Tools"), { recursive: true });
|
|
891
|
+
fs.mkdirSync(path.join(skillDir, ".memory", "sessions"), { recursive: true });
|
|
892
|
+
// Download files
|
|
893
|
+
console.log("Downloading skill files...");
|
|
894
|
+
const files = [
|
|
895
|
+
"SKILL.md",
|
|
896
|
+
"Philosophy.md",
|
|
897
|
+
"AIVision.md",
|
|
898
|
+
"SessionManagement.md",
|
|
899
|
+
"Credentials.md",
|
|
900
|
+
"Personas.md",
|
|
901
|
+
"Workflows/Navigate.md",
|
|
902
|
+
"Workflows/Interact.md",
|
|
903
|
+
"Workflows/Extract.md",
|
|
904
|
+
"Workflows/Authenticate.md",
|
|
905
|
+
"Workflows/Test.md",
|
|
906
|
+
"Workflows/Journey.md",
|
|
907
|
+
"Tools/CBrowser.ts",
|
|
908
|
+
];
|
|
909
|
+
for (const file of files) {
|
|
910
|
+
try {
|
|
911
|
+
const url = `${repoUrl}/skill/${file}`;
|
|
912
|
+
const dest = path.join(skillDir, file);
|
|
913
|
+
console.log(` - ${file}`);
|
|
914
|
+
execSync(`curl -fsSL "${url}" -o "${dest}"`, { stdio: "pipe" });
|
|
915
|
+
}
|
|
916
|
+
catch {
|
|
917
|
+
console.log(` Warning: Could not download ${file}`);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
console.log(`
|
|
921
|
+
╔═══════════════════════════════════════════════════════════════╗
|
|
922
|
+
║ CBrowser Skill Installed Successfully! ║
|
|
923
|
+
╚═══════════════════════════════════════════════════════════════╝
|
|
924
|
+
|
|
925
|
+
Skill installed to: ${skillDir}
|
|
926
|
+
|
|
927
|
+
Next steps:
|
|
928
|
+
1. Add to your skill-index.json:
|
|
929
|
+
"CBrowser": "${skillDir}/SKILL.md"
|
|
930
|
+
|
|
931
|
+
2. Install all Playwright browsers (for cross-browser testing):
|
|
932
|
+
npx playwright install
|
|
933
|
+
|
|
934
|
+
3. Start using CBrowser in Claude Code!
|
|
935
|
+
|
|
936
|
+
Documentation: https://github.com/alexandriashai/cbrowser/wiki
|
|
937
|
+
`);
|
|
938
|
+
return;
|
|
939
|
+
}
|
|
858
940
|
// Daemon mode commands
|
|
859
941
|
if (command === "daemon") {
|
|
860
942
|
const subCommand = args[0];
|