@monoes/monomindcli 1.10.29 → 1.10.30
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/.claude/helpers/auto-memory-hook.mjs +39 -4
- package/.claude/helpers/handlers/edit-handler.cjs +145 -0
- package/.claude/helpers/handlers/route-handler.cjs +393 -0
- package/.claude/helpers/handlers/session-handler.cjs +167 -0
- package/.claude/helpers/handlers/session-restore-handler.cjs +343 -0
- package/.claude/helpers/handlers/task-handler.cjs +329 -0
- package/.claude/helpers/hook-handler.cjs +114 -2273
- package/.claude/helpers/intelligence.cjs +21 -2
- package/.claude/helpers/learning-service.mjs +166 -8
- package/.claude/helpers/memory-palace.cjs +72 -12
- package/.claude/helpers/router.cjs +79 -5
- package/.claude/helpers/statusline.cjs +193 -399
- package/.claude/helpers/utils/micro-agents.cjs +338 -0
- package/.claude/helpers/utils/monograph.cjs +349 -0
- package/.claude/helpers/utils/telemetry.cjs +144 -0
- package/.claude/skills/agent-browser-testing/SKILL.md +3 -2
- package/.claude/skills/monomind/browse-agentcore.md +116 -0
- package/.claude/skills/monomind/browse-electron.md +189 -0
- package/.claude/skills/monomind/browse-qa.md +229 -0
- package/.claude/skills/monomind/browse-references/authentication.md +162 -0
- package/.claude/skills/monomind/browse-references/trust-boundaries.md +41 -0
- package/.claude/skills/monomind/browse-references/video-recording.md +84 -0
- package/.claude/skills/monomind/browse-slack.md +189 -0
- package/.claude/skills/monomind/browse-vercel.md +240 -0
- package/.claude/skills/monomind/browse.md +724 -0
- package/dist/src/browser/actions.d.ts +13 -0
- package/dist/src/browser/actions.d.ts.map +1 -0
- package/dist/src/browser/actions.js +201 -0
- package/dist/src/browser/actions.js.map +1 -0
- package/dist/src/browser/browser.d.ts +14 -0
- package/dist/src/browser/browser.d.ts.map +1 -0
- package/dist/src/browser/browser.js +198 -0
- package/dist/src/browser/browser.js.map +1 -0
- package/dist/src/browser/cdp.d.ts +17 -0
- package/dist/src/browser/cdp.d.ts.map +1 -0
- package/dist/src/browser/cdp.js +106 -0
- package/dist/src/browser/cdp.js.map +1 -0
- package/dist/src/browser/index.d.ts +11 -0
- package/dist/src/browser/index.d.ts.map +1 -0
- package/dist/src/browser/index.js +11 -0
- package/dist/src/browser/index.js.map +1 -0
- package/dist/src/browser/network.d.ts +11 -0
- package/dist/src/browser/network.d.ts.map +1 -0
- package/dist/src/browser/network.js +81 -0
- package/dist/src/browser/network.js.map +1 -0
- package/dist/src/browser/screenshot.d.ts +15 -0
- package/dist/src/browser/screenshot.d.ts.map +1 -0
- package/dist/src/browser/screenshot.js +36 -0
- package/dist/src/browser/screenshot.js.map +1 -0
- package/dist/src/browser/session.d.ts +8 -0
- package/dist/src/browser/session.d.ts.map +1 -0
- package/dist/src/browser/session.js +50 -0
- package/dist/src/browser/session.js.map +1 -0
- package/dist/src/browser/snapshot.d.ts +12 -0
- package/dist/src/browser/snapshot.d.ts.map +1 -0
- package/dist/src/browser/snapshot.js +147 -0
- package/dist/src/browser/snapshot.js.map +1 -0
- package/dist/src/browser/tabs.d.ts +8 -0
- package/dist/src/browser/tabs.d.ts.map +1 -0
- package/dist/src/browser/tabs.js +25 -0
- package/dist/src/browser/tabs.js.map +1 -0
- package/dist/src/browser/types.d.ts +109 -0
- package/dist/src/browser/types.d.ts.map +1 -0
- package/dist/src/browser/types.js +16 -0
- package/dist/src/browser/types.js.map +1 -0
- package/dist/src/browser/wait.d.ts +4 -0
- package/dist/src/browser/wait.d.ts.map +1 -0
- package/dist/src/browser/wait.js +122 -0
- package/dist/src/browser/wait.js.map +1 -0
- package/dist/src/commands/browse.d.ts +8 -0
- package/dist/src/commands/browse.d.ts.map +1 -0
- package/dist/src/commands/browse.js +573 -0
- package/dist/src/commands/browse.js.map +1 -0
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +2 -0
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/ui/dashboard-v2.html +1692 -0
- package/dist/src/ui/server.mjs +15 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
// Extracted from hook-handler.cjs — session-scoped telemetry helpers.
|
|
3
|
+
// All functions are stateless and read/write .monomind/metrics/*.json files.
|
|
4
|
+
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const fs = require('fs');
|
|
7
|
+
|
|
8
|
+
const CWD = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
9
|
+
|
|
10
|
+
function _recordRecentEdit(filePath) {
|
|
11
|
+
if (!filePath) return;
|
|
12
|
+
try {
|
|
13
|
+
var f = path.join(CWD, '.monomind', 'metrics', 'recent-edits.json');
|
|
14
|
+
fs.mkdirSync(path.dirname(f), { recursive: true });
|
|
15
|
+
var d = { edits: [] };
|
|
16
|
+
try { d = JSON.parse(fs.readFileSync(f, 'utf-8')); } catch (_) {}
|
|
17
|
+
if (!Array.isArray(d.edits)) d.edits = [];
|
|
18
|
+
d.edits = d.edits.filter(function(e) { return e.file !== filePath; });
|
|
19
|
+
d.edits.unshift({ file: filePath, editedAt: Date.now() });
|
|
20
|
+
if (d.edits.length > 10) d.edits = d.edits.slice(0, 10);
|
|
21
|
+
fs.writeFileSync(f, JSON.stringify(d));
|
|
22
|
+
} catch (e) { /* non-fatal */ }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function _getRecentEdits() {
|
|
26
|
+
try {
|
|
27
|
+
var f = path.join(CWD, '.monomind', 'metrics', 'recent-edits.json');
|
|
28
|
+
if (!fs.existsSync(f)) return [];
|
|
29
|
+
var d = JSON.parse(fs.readFileSync(f, 'utf-8'));
|
|
30
|
+
if (!Array.isArray(d.edits)) return [];
|
|
31
|
+
var cutoff = Date.now() - 2 * 60 * 60 * 1000;
|
|
32
|
+
return d.edits.filter(function(e) { return e.editedAt > cutoff; });
|
|
33
|
+
} catch (e) { return []; }
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function _recordToolCall(signature) {
|
|
37
|
+
try {
|
|
38
|
+
var f = path.join(CWD, '.monomind', 'metrics', 'tool-calls.json');
|
|
39
|
+
fs.mkdirSync(path.dirname(f), { recursive: true });
|
|
40
|
+
var d = {};
|
|
41
|
+
try { d = JSON.parse(fs.readFileSync(f, 'utf-8')); } catch (_) {}
|
|
42
|
+
if (typeof d !== 'object' || d === null) d = {};
|
|
43
|
+
if (!d.startedAt || (Date.now() - d.startedAt) > 4 * 60 * 60 * 1000) {
|
|
44
|
+
d = { startedAt: Date.now(), calls: {} };
|
|
45
|
+
}
|
|
46
|
+
d.calls[signature] = (d.calls[signature] || 0) + 1;
|
|
47
|
+
fs.writeFileSync(f, JSON.stringify(d));
|
|
48
|
+
return d.calls[signature];
|
|
49
|
+
} catch (e) { return 0; }
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function _getBudgetStatus() {
|
|
53
|
+
try {
|
|
54
|
+
var budgetFile = path.join(CWD, '.monomind', 'budget.json');
|
|
55
|
+
var summaryFile = path.join(CWD, '.monomind', 'metrics', 'token-summary.json');
|
|
56
|
+
if (!fs.existsSync(summaryFile)) return null;
|
|
57
|
+
var summary = JSON.parse(fs.readFileSync(summaryFile, 'utf-8'));
|
|
58
|
+
var todayCost = summary.todayCost || (summary.today && summary.today.cost) || 0;
|
|
59
|
+
var monthCost = summary.monthCost || (summary.month && summary.month.cost) || 0;
|
|
60
|
+
|
|
61
|
+
var dailyLimit, monthlyLimit, autoTuned = false;
|
|
62
|
+
if (fs.existsSync(budgetFile)) {
|
|
63
|
+
try {
|
|
64
|
+
var b = JSON.parse(fs.readFileSync(budgetFile, 'utf-8'));
|
|
65
|
+
dailyLimit = b.dailyLimit;
|
|
66
|
+
monthlyLimit = b.monthlyLimit;
|
|
67
|
+
} catch (_) {}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (!dailyLimit || !monthlyLimit) {
|
|
71
|
+
var now = new Date();
|
|
72
|
+
var daysIntoMonth = now.getUTCDate();
|
|
73
|
+
var dailyAvg = daysIntoMonth >= 1 ? monthCost / daysIntoMonth : 0;
|
|
74
|
+
if (dailyAvg > 5 && daysIntoMonth >= 7) {
|
|
75
|
+
dailyLimit = Math.max(dailyLimit || 0, Math.ceil(dailyAvg * 1.5));
|
|
76
|
+
monthlyLimit = Math.max(monthlyLimit || 0, Math.ceil(dailyAvg * 1.5 * 30));
|
|
77
|
+
autoTuned = true;
|
|
78
|
+
try {
|
|
79
|
+
fs.mkdirSync(path.dirname(budgetFile), { recursive: true });
|
|
80
|
+
fs.writeFileSync(budgetFile, JSON.stringify({
|
|
81
|
+
dailyLimit: dailyLimit, monthlyLimit: monthlyLimit,
|
|
82
|
+
autoTuned: true, tunedAt: now.toISOString(),
|
|
83
|
+
basis: 'rolling avg $' + dailyAvg.toFixed(2) + '/day × 1.5',
|
|
84
|
+
note: 'Edit these values to set a hard ceiling. Delete the file to re-tune.',
|
|
85
|
+
}, null, 2));
|
|
86
|
+
} catch (_) {}
|
|
87
|
+
} else {
|
|
88
|
+
dailyLimit = dailyLimit || 50;
|
|
89
|
+
monthlyLimit = monthlyLimit || 1500;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
var dailyPct = Math.round((todayCost / dailyLimit) * 100);
|
|
94
|
+
var monthlyPct = Math.round((monthCost / monthlyLimit) * 100);
|
|
95
|
+
var rollingDaily = (new Date()).getUTCDate() >= 1 ? monthCost / (new Date()).getUTCDate() : 0;
|
|
96
|
+
var spike = rollingDaily > 0 && todayCost > rollingDaily * 2.0 && todayCost > 5;
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
todayCost, monthCost, dailyLimit, monthlyLimit,
|
|
100
|
+
dailyPct, monthlyPct, autoTuned, spike,
|
|
101
|
+
alert: dailyPct >= 80 || monthlyPct >= 80 || spike,
|
|
102
|
+
breached: dailyPct >= 100 || monthlyPct >= 100,
|
|
103
|
+
};
|
|
104
|
+
} catch (e) { return null; }
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function _recordHookLatency(handlerName, durationMs) {
|
|
108
|
+
try {
|
|
109
|
+
var f = path.join(CWD, '.monomind', 'metrics', 'hook-latency.json');
|
|
110
|
+
fs.mkdirSync(path.dirname(f), { recursive: true });
|
|
111
|
+
var d = {};
|
|
112
|
+
try { d = JSON.parse(fs.readFileSync(f, 'utf-8')); } catch (_) {}
|
|
113
|
+
if (typeof d !== 'object' || d === null) d = {};
|
|
114
|
+
var entry = d[handlerName] || { count: 0, total: 0, max: 0 };
|
|
115
|
+
entry.count++;
|
|
116
|
+
entry.total += durationMs;
|
|
117
|
+
entry.max = Math.max(entry.max, durationMs);
|
|
118
|
+
entry.mean = Math.round(entry.total / entry.count);
|
|
119
|
+
d[handlerName] = entry;
|
|
120
|
+
d.lastUpdated = Date.now();
|
|
121
|
+
fs.writeFileSync(f, JSON.stringify(d));
|
|
122
|
+
} catch (e) {}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function _recordDecisionMarkers(promptText) {
|
|
126
|
+
if (!promptText || typeof promptText !== 'string') return;
|
|
127
|
+
var markers = /\b(let's go with|we (?:chose|decided|picked|will go with)|decision[:\s]|choosing|going with|prefer to|let's use)\b[^\.\n]{0,200}/gi;
|
|
128
|
+
var matches = promptText.match(markers);
|
|
129
|
+
if (!matches || matches.length === 0) return;
|
|
130
|
+
try {
|
|
131
|
+
var f = path.join(CWD, '.monomind', 'decisions.jsonl');
|
|
132
|
+
var entry = JSON.stringify({ ts: Date.now(), excerpts: matches.slice(0, 3), prompt: promptText.slice(0, 400) });
|
|
133
|
+
fs.appendFileSync(f, entry + '\n');
|
|
134
|
+
} catch (e) {}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
module.exports = {
|
|
138
|
+
_recordRecentEdit,
|
|
139
|
+
_getRecentEdits,
|
|
140
|
+
_recordToolCall,
|
|
141
|
+
_getBudgetStatus,
|
|
142
|
+
_recordHookLatency,
|
|
143
|
+
_recordDecisionMarkers,
|
|
144
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agent-browser-testing
|
|
3
|
-
description: UI testing and task walkthrough using agent-browser — install, navigate, test golden paths, report issues, and help users accomplish tasks through any web UI
|
|
4
|
-
version:
|
|
3
|
+
description: UI testing and task walkthrough using agent-browser — install, navigate, test golden paths, report issues, and help users accomplish tasks through any web UI. Delegates to monomind:browse for full feature coverage.
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
delegates_to: monomind:browse
|
|
5
6
|
triggers:
|
|
6
7
|
- /ui-test
|
|
7
8
|
- /browse
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: monomind:browse-agentcore
|
|
3
|
+
description: Run browser automation on AWS Bedrock AgentCore cloud browser sessions. Use when the user wants to run browser automation on AWS, use a cloud browser with AWS credentials, or needs a managed browser session backed by AWS infrastructure. Triggers include "use agentcore", "run on AWS", "cloud browser with AWS", "bedrock browser", or any task requiring AWS-hosted browser automation.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
triggers:
|
|
6
|
+
- agentcore browser
|
|
7
|
+
- aws cloud browser
|
|
8
|
+
- bedrock browser
|
|
9
|
+
- run browser on aws
|
|
10
|
+
- browser automation aws
|
|
11
|
+
tools:
|
|
12
|
+
- Bash
|
|
13
|
+
requires:
|
|
14
|
+
- agent-browser >= 0.25.4
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<!-- Pattern adapted from agent-browser — rebranded for monomind -->
|
|
18
|
+
|
|
19
|
+
# AWS Bedrock AgentCore Browser (monomind:browse-agentcore)
|
|
20
|
+
|
|
21
|
+
Run browser automation on cloud browser sessions hosted by AWS Bedrock AgentCore. All standard browser commands work identically — the only difference is where the browser runs.
|
|
22
|
+
|
|
23
|
+
See `monomind:browse` for the full browser automation reference.
|
|
24
|
+
|
|
25
|
+
## Setup
|
|
26
|
+
|
|
27
|
+
Credentials are resolved automatically (in order):
|
|
28
|
+
1. Environment variables (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, optionally `AWS_SESSION_TOKEN`)
|
|
29
|
+
2. AWS CLI fallback (`aws configure export-credentials`) — supports SSO, IAM roles, named profiles
|
|
30
|
+
|
|
31
|
+
No additional setup needed if AWS credentials are already configured.
|
|
32
|
+
|
|
33
|
+
## Core Workflow
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Open a page on an AgentCore cloud browser
|
|
37
|
+
agent-browser -p agentcore open https://example.com
|
|
38
|
+
|
|
39
|
+
# Everything else is identical to local Chrome
|
|
40
|
+
agent-browser snapshot -i
|
|
41
|
+
agent-browser click @e1
|
|
42
|
+
agent-browser screenshot page.png
|
|
43
|
+
agent-browser close
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Environment Variables
|
|
47
|
+
|
|
48
|
+
| Variable | Description | Default |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| `AGENTCORE_REGION` | AWS region | `us-east-1` |
|
|
51
|
+
| `AGENTCORE_BROWSER_ID` | Browser identifier | `aws.browser.v1` |
|
|
52
|
+
| `AGENTCORE_PROFILE_ID` | Persistent browser profile (cookies, localStorage) | none |
|
|
53
|
+
| `AGENTCORE_SESSION_TIMEOUT` | Session timeout in seconds | `3600` |
|
|
54
|
+
| `AWS_PROFILE` | AWS CLI profile for credential resolution | `default` |
|
|
55
|
+
|
|
56
|
+
## Set Provider Globally
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
export AGENT_BROWSER_PROVIDER=agentcore
|
|
60
|
+
export AGENTCORE_REGION=us-east-2
|
|
61
|
+
|
|
62
|
+
agent-browser open https://example.com
|
|
63
|
+
agent-browser snapshot -i
|
|
64
|
+
agent-browser click @e1
|
|
65
|
+
agent-browser close
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Persistent Profiles
|
|
69
|
+
|
|
70
|
+
Reuse login state across sessions:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# First run — log in
|
|
74
|
+
AGENTCORE_PROFILE_ID=my-app agent-browser -p agentcore open https://app.example.com/login
|
|
75
|
+
agent-browser snapshot -i
|
|
76
|
+
agent-browser fill @e1 "user@example.com"
|
|
77
|
+
agent-browser fill @e2 "password"
|
|
78
|
+
agent-browser click @e3
|
|
79
|
+
agent-browser close
|
|
80
|
+
|
|
81
|
+
# Future runs — already authenticated
|
|
82
|
+
AGENTCORE_PROFILE_ID=my-app agent-browser -p agentcore open https://app.example.com/dashboard
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Credential Patterns
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Explicit (CI/CD)
|
|
89
|
+
export AWS_ACCESS_KEY_ID=AKIA...
|
|
90
|
+
export AWS_SECRET_ACCESS_KEY=...
|
|
91
|
+
agent-browser -p agentcore open https://example.com
|
|
92
|
+
|
|
93
|
+
# SSO
|
|
94
|
+
aws sso login --profile my-profile
|
|
95
|
+
AWS_PROFILE=my-profile agent-browser -p agentcore open https://example.com
|
|
96
|
+
|
|
97
|
+
# Default credential chain (IAM role, etc.)
|
|
98
|
+
agent-browser -p agentcore open https://example.com
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Live View
|
|
102
|
+
|
|
103
|
+
When a session starts, AgentCore prints a Live View URL to stderr — open it in the AWS Console to watch in real time:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
Session: abc123-def456
|
|
107
|
+
Live View: https://us-east-1.console.aws.amazon.com/bedrock-agentcore/browser/aws.browser.v1/session/abc123-def456#
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Troubleshooting
|
|
111
|
+
|
|
112
|
+
| Error | Fix |
|
|
113
|
+
|-------|-----|
|
|
114
|
+
| "Failed to run aws CLI" | Install AWS CLI or set `AWS_ACCESS_KEY_ID`/`AWS_SECRET_ACCESS_KEY` directly |
|
|
115
|
+
| "Run 'aws sso login'" | SSO credentials expired — run `aws sso login` |
|
|
116
|
+
| Session timeout | Increase with `AGENTCORE_SESSION_TIMEOUT=7200` |
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: monomind:browse-electron
|
|
3
|
+
description: Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using browser automation via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, or test an Electron application.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
triggers:
|
|
6
|
+
- automate electron
|
|
7
|
+
- control vscode
|
|
8
|
+
- interact with discord app
|
|
9
|
+
- test electron app
|
|
10
|
+
- connect to desktop app
|
|
11
|
+
- electron desktop automation
|
|
12
|
+
- automate slack desktop
|
|
13
|
+
tools:
|
|
14
|
+
- Bash
|
|
15
|
+
requires:
|
|
16
|
+
- agent-browser >= 0.25.4
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<!-- Pattern adapted from agent-browser — rebranded for monomind -->
|
|
20
|
+
|
|
21
|
+
# Electron App Automation (monomind:browse-electron)
|
|
22
|
+
|
|
23
|
+
Automate any Electron desktop app using agent-browser via Chrome DevTools Protocol (CDP). Electron apps are built on Chromium and expose a CDP port, enabling the same snapshot-interact workflow used for web pages.
|
|
24
|
+
|
|
25
|
+
See `monomind:browse` for the full browser automation reference.
|
|
26
|
+
|
|
27
|
+
## Core Workflow
|
|
28
|
+
|
|
29
|
+
1. **Launch** the Electron app with remote debugging enabled
|
|
30
|
+
2. **Connect** agent-browser to the CDP port
|
|
31
|
+
3. **Snapshot** to discover interactive elements
|
|
32
|
+
4. **Interact** using element refs
|
|
33
|
+
5. **Re-snapshot** after navigation or state changes
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Launch an Electron app with remote debugging
|
|
37
|
+
open -a "Slack" --args --remote-debugging-port=9222
|
|
38
|
+
|
|
39
|
+
# Connect agent-browser to the app
|
|
40
|
+
agent-browser connect 9222
|
|
41
|
+
|
|
42
|
+
# Standard workflow from here
|
|
43
|
+
agent-browser snapshot -i
|
|
44
|
+
agent-browser click @e5
|
|
45
|
+
agent-browser screenshot slack-desktop.png
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Launching with CDP
|
|
49
|
+
|
|
50
|
+
Every Electron app supports `--remote-debugging-port` since it's built into Chromium.
|
|
51
|
+
|
|
52
|
+
### macOS
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
open -a "Slack" --args --remote-debugging-port=9222
|
|
56
|
+
open -a "Visual Studio Code" --args --remote-debugging-port=9223
|
|
57
|
+
open -a "Discord" --args --remote-debugging-port=9224
|
|
58
|
+
open -a "Figma" --args --remote-debugging-port=9225
|
|
59
|
+
open -a "Notion" --args --remote-debugging-port=9226
|
|
60
|
+
open -a "Spotify" --args --remote-debugging-port=9227
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Linux
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
slack --remote-debugging-port=9222
|
|
67
|
+
code --remote-debugging-port=9223
|
|
68
|
+
discord --remote-debugging-port=9224
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Windows
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
"C:\Users\%USERNAME%\AppData\Local\slack\slack.exe" --remote-debugging-port=9222
|
|
75
|
+
"C:\Users\%USERNAME%\AppData\Local\Programs\Microsoft VS Code\Code.exe" --remote-debugging-port=9223
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Important:** If the app is already running, quit it first — the flag must be present at launch time.
|
|
79
|
+
|
|
80
|
+
## Connecting
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Connect to a specific port (persists for session)
|
|
84
|
+
agent-browser connect 9222
|
|
85
|
+
|
|
86
|
+
# Or pass --cdp on each command
|
|
87
|
+
agent-browser --cdp 9222 snapshot -i
|
|
88
|
+
|
|
89
|
+
# Auto-discover a running Chromium-based app
|
|
90
|
+
agent-browser --auto-connect snapshot -i
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Tab Management
|
|
94
|
+
|
|
95
|
+
Electron apps often have multiple windows or webviews:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
agent-browser tab # list all targets (windows, webviews)
|
|
99
|
+
agent-browser tab t2 # switch by stable id
|
|
100
|
+
agent-browser tab --url "*settings*" # switch by URL pattern
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Webview Support
|
|
104
|
+
|
|
105
|
+
Electron `<webview>` elements appear as separate targets in the tab list:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
agent-browser connect 9222
|
|
109
|
+
agent-browser tab
|
|
110
|
+
# 0: [page] Slack - Main Window https://app.slack.com/
|
|
111
|
+
# 1: [webview] Embedded Content https://example.com/widget
|
|
112
|
+
|
|
113
|
+
agent-browser tab t2 # switch to webview
|
|
114
|
+
agent-browser snapshot -i
|
|
115
|
+
agent-browser click @e3
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Common Patterns
|
|
119
|
+
|
|
120
|
+
### Inspect and Navigate
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
open -a "Slack" --args --remote-debugging-port=9222
|
|
124
|
+
sleep 3
|
|
125
|
+
agent-browser connect 9222
|
|
126
|
+
agent-browser snapshot -i
|
|
127
|
+
agent-browser click @e10
|
|
128
|
+
agent-browser snapshot -i
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Screenshots
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
agent-browser connect 9222
|
|
135
|
+
agent-browser screenshot app-state.png
|
|
136
|
+
agent-browser screenshot --annotate annotated-app.png
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Extract Data
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
agent-browser connect 9222
|
|
143
|
+
agent-browser snapshot -i
|
|
144
|
+
agent-browser get text @e5
|
|
145
|
+
agent-browser snapshot --json > app-state.json
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Fill Forms
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
agent-browser connect 9222
|
|
152
|
+
agent-browser snapshot -i
|
|
153
|
+
agent-browser fill @e3 "search query"
|
|
154
|
+
agent-browser press Enter
|
|
155
|
+
agent-browser wait 1000
|
|
156
|
+
agent-browser snapshot -i
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Multiple Apps Simultaneously
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
agent-browser --session slack connect 9222
|
|
163
|
+
agent-browser --session vscode connect 9223
|
|
164
|
+
|
|
165
|
+
agent-browser --session slack snapshot -i
|
|
166
|
+
agent-browser --session vscode snapshot -i
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## Color Scheme
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
agent-browser connect 9222
|
|
173
|
+
agent-browser --color-scheme dark snapshot -i
|
|
174
|
+
# or
|
|
175
|
+
AGENT_BROWSER_COLOR_SCHEME=dark agent-browser connect 9222
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Troubleshooting
|
|
179
|
+
|
|
180
|
+
| Problem | Fix |
|
|
181
|
+
|---------|-----|
|
|
182
|
+
| "Connection refused" | App not launched with `--remote-debugging-port`, or port mismatch |
|
|
183
|
+
| Connect fails after launch | Wait a few seconds — `sleep 3` before connect |
|
|
184
|
+
| Elements not in snapshot | Use `agent-browser tab` to switch to the right window/webview |
|
|
185
|
+
| Can't type in inputs | Try `agent-browser keyboard type "text"` or `keyboard inserttext "text"` |
|
|
186
|
+
|
|
187
|
+
## Supported Apps
|
|
188
|
+
|
|
189
|
+
Any Electron app: Slack, Discord, Teams, Signal, VS Code, GitHub Desktop, Postman, Figma, Notion, Obsidian, Spotify, Linear, 1Password, and more.
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: monomind:browse-qa
|
|
3
|
+
description: Systematic exploratory testing of a web application to find bugs, UX issues, and quality problems. Use when asked to dogfood, QA, exploratory test, find issues, bug hunt, or review the quality of a web app. Produces a structured report with full reproduction evidence — step-by-step screenshots, repro steps, and severity ratings for every finding.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
triggers:
|
|
6
|
+
- dogfood
|
|
7
|
+
- qa this app
|
|
8
|
+
- find bugs
|
|
9
|
+
- exploratory test
|
|
10
|
+
- bug hunt
|
|
11
|
+
- test this site
|
|
12
|
+
- quality review
|
|
13
|
+
- ux review
|
|
14
|
+
- find issues
|
|
15
|
+
- systematic test
|
|
16
|
+
tools:
|
|
17
|
+
- Bash
|
|
18
|
+
requires:
|
|
19
|
+
- agent-browser >= 0.25.4
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
<!-- Pattern adapted from agent-browser — rebranded for monomind -->
|
|
23
|
+
|
|
24
|
+
# Systematic QA / Dogfood Testing (monomind:browse-qa)
|
|
25
|
+
|
|
26
|
+
Systematically explore a web application, find issues, and produce a report with full reproduction evidence for every finding.
|
|
27
|
+
|
|
28
|
+
See `monomind:browse` for the full browser automation reference.
|
|
29
|
+
|
|
30
|
+
## Inputs
|
|
31
|
+
|
|
32
|
+
| Parameter | Default | Example override |
|
|
33
|
+
|---|---|---|
|
|
34
|
+
| **Target URL** | _(required)_ | `vercel.com`, `http://localhost:3000` |
|
|
35
|
+
| **Session name** | Slugified domain | `my-qa-session` |
|
|
36
|
+
| **Output directory** | `./qa-output/` | `/tmp/qa` |
|
|
37
|
+
| **Scope** | Full app | `Focus on the billing page` |
|
|
38
|
+
| **Authentication** | None | `Sign in as user@example.com` |
|
|
39
|
+
|
|
40
|
+
Start immediately with defaults. Only ask if authentication is mentioned but credentials are missing.
|
|
41
|
+
|
|
42
|
+
Always call `agent-browser` directly — never `npx agent-browser`. The direct binary uses the fast Rust client.
|
|
43
|
+
|
|
44
|
+
## Workflow
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
1. Initialize → Set up session, output dirs, report file
|
|
48
|
+
2. Authenticate → Sign in if needed, save state
|
|
49
|
+
3. Orient → Navigate to starting point, initial snapshot
|
|
50
|
+
4. Explore → Systematically visit pages and test features
|
|
51
|
+
5. Document → Screenshot + record each issue as found
|
|
52
|
+
6. Wrap up → Summary counts, close session
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 1. Initialize
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
mkdir -p ./qa-output/screenshots
|
|
59
|
+
SESSION="$(echo '<TARGET_URL>' | sed 's|https\?://||; s|/.*||; s|\.|-|g')"
|
|
60
|
+
agent-browser --session "$SESSION" open <TARGET_URL>
|
|
61
|
+
agent-browser --session "$SESSION" wait --load networkidle
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 2. Authenticate (if needed)
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
agent-browser --session "$SESSION" snapshot -i
|
|
68
|
+
agent-browser --session "$SESSION" fill @e1 "<EMAIL>"
|
|
69
|
+
agent-browser --session "$SESSION" fill @e2 "<PASSWORD>"
|
|
70
|
+
agent-browser --session "$SESSION" click @e3
|
|
71
|
+
agent-browser --session "$SESSION" wait --load networkidle
|
|
72
|
+
|
|
73
|
+
# Save auth state for reuse
|
|
74
|
+
agent-browser --session "$SESSION" state save ./qa-output/auth-state.json
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
For OTP/email codes: ask the user, wait for input, then enter the code.
|
|
78
|
+
|
|
79
|
+
### 3. Orient
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
agent-browser --session "$SESSION" screenshot --annotate ./qa-output/screenshots/00-initial.png
|
|
83
|
+
agent-browser --session "$SESSION" snapshot -i
|
|
84
|
+
agent-browser --session "$SESSION" get title
|
|
85
|
+
agent-browser --session "$SESSION" get url
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Document the starting state: what is visible, main navigation elements, key actions available.
|
|
89
|
+
|
|
90
|
+
### 4. Explore
|
|
91
|
+
|
|
92
|
+
For each area/page:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
agent-browser --session "$SESSION" click @e[nav-item]
|
|
96
|
+
agent-browser --session "$SESSION" wait --load networkidle
|
|
97
|
+
agent-browser --session "$SESSION" snapshot -i
|
|
98
|
+
agent-browser --session "$SESSION" screenshot ./qa-output/screenshots/<page-name>.png
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Test systematically:**
|
|
102
|
+
- Navigation: does every link work? Does back/forward work?
|
|
103
|
+
- Forms: submit empty, submit invalid, submit valid
|
|
104
|
+
- Interactive elements: hover states, click states, disabled states
|
|
105
|
+
- Responsive: `agent-browser set viewport 375 812` (mobile), `1280 720` (desktop)
|
|
106
|
+
- Error states: what happens when APIs fail? Use `network route` to simulate failures
|
|
107
|
+
- Loading states: `wait --load networkidle` then check if spinners resolve
|
|
108
|
+
|
|
109
|
+
### 5. Document Each Issue
|
|
110
|
+
|
|
111
|
+
For every issue found:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# 1. Screenshot the broken state
|
|
115
|
+
agent-browser --session "$SESSION" screenshot ./qa-output/screenshots/bug-<N>-<name>.png
|
|
116
|
+
|
|
117
|
+
# 2. Record reproduction steps in report
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Issue format:
|
|
121
|
+
```
|
|
122
|
+
## Issue N: <short title>
|
|
123
|
+
|
|
124
|
+
**Severity:** Critical / High / Medium / Low
|
|
125
|
+
**URL:** <current URL>
|
|
126
|
+
**Steps to reproduce:**
|
|
127
|
+
1. <step>
|
|
128
|
+
2. <step>
|
|
129
|
+
**Expected:** <what should happen>
|
|
130
|
+
**Actual:** <what happened>
|
|
131
|
+
**Screenshot:** screenshots/bug-N-name.png
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### 6. Wrap Up
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
agent-browser --session "$SESSION" close
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Print summary:
|
|
141
|
+
```
|
|
142
|
+
QA SUMMARY
|
|
143
|
+
━━━━━━━━━━━━━━━━━━━━━━━━
|
|
144
|
+
Target: <URL>
|
|
145
|
+
Pages: <N> tested
|
|
146
|
+
Issues: Critical=<N> High=<N> Medium=<N> Low=<N>
|
|
147
|
+
Output: ./qa-output/
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Severity Guide
|
|
151
|
+
|
|
152
|
+
| Level | Description | Example |
|
|
153
|
+
|---|---|---|
|
|
154
|
+
| Critical | Blocks core user flow | Login broken, payment fails |
|
|
155
|
+
| High | Major feature broken | Form won't submit, page 404 |
|
|
156
|
+
| Medium | Degraded experience | Wrong error message, slow load |
|
|
157
|
+
| Low | Polish / cosmetic | Alignment off, typo |
|
|
158
|
+
|
|
159
|
+
## Testing Checklist
|
|
160
|
+
|
|
161
|
+
**Navigation:**
|
|
162
|
+
- [ ] All nav links work
|
|
163
|
+
- [ ] Breadcrumbs correct
|
|
164
|
+
- [ ] Back/forward work
|
|
165
|
+
- [ ] No broken links (`get url` shows expected path)
|
|
166
|
+
|
|
167
|
+
**Forms:**
|
|
168
|
+
- [ ] Empty submit → validation errors shown
|
|
169
|
+
- [ ] Invalid data → appropriate error
|
|
170
|
+
- [ ] Valid data → success state
|
|
171
|
+
- [ ] Required field indicators visible
|
|
172
|
+
|
|
173
|
+
**Interactive:**
|
|
174
|
+
- [ ] All buttons clickable (check `is enabled`)
|
|
175
|
+
- [ ] Dropdowns open and close
|
|
176
|
+
- [ ] Modals open and close
|
|
177
|
+
- [ ] Tooltips appear on hover
|
|
178
|
+
|
|
179
|
+
**Responsive:**
|
|
180
|
+
- [ ] Mobile (375×812): `agent-browser set viewport 375 812`
|
|
181
|
+
- [ ] Tablet (768×1024): `agent-browser set viewport 768 1024`
|
|
182
|
+
- [ ] Desktop (1280×720): `agent-browser set viewport 1280 720`
|
|
183
|
+
|
|
184
|
+
**Error states:**
|
|
185
|
+
- [ ] Network error: `agent-browser network route "https://api.*" --abort`
|
|
186
|
+
- [ ] Empty state: check when lists/tables have no data
|
|
187
|
+
- [ ] 404 page: navigate to `/nonexistent-path`
|
|
188
|
+
|
|
189
|
+
**Accessibility:**
|
|
190
|
+
- [ ] Tab order logical (press Tab through all elements)
|
|
191
|
+
- [ ] All inputs have labels (visible in snapshot)
|
|
192
|
+
- [ ] Buttons have accessible names
|
|
193
|
+
|
|
194
|
+
## API Error Simulation
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# Block all API calls to test error handling
|
|
198
|
+
agent-browser batch \
|
|
199
|
+
'["open"]' \
|
|
200
|
+
'["network", "route", "https://api.example.com/*", "--abort"]' \
|
|
201
|
+
'["navigate", "https://app.example.com/dashboard"]'
|
|
202
|
+
agent-browser snapshot -i
|
|
203
|
+
# → Verify error states render correctly
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## Diff Regression Testing
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
# Baseline
|
|
210
|
+
agent-browser open https://app.example.com && agent-browser snapshot -i > ./qa-output/baseline.txt
|
|
211
|
+
|
|
212
|
+
# After change
|
|
213
|
+
agent-browser open https://app.example.com && agent-browser diff snapshot --baseline ./qa-output/baseline.txt
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Monomind Integration
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
# Create tasks for critical bugs
|
|
220
|
+
npx monomind task create \
|
|
221
|
+
--title "CRITICAL: <issue title>" \
|
|
222
|
+
--description "Steps: <repro steps>. Screenshot: ./qa-output/screenshots/bug-N.png"
|
|
223
|
+
|
|
224
|
+
# Store QA session patterns for reuse
|
|
225
|
+
npx monomind memory store \
|
|
226
|
+
--namespace browse \
|
|
227
|
+
--key "qa-flow-<app>" \
|
|
228
|
+
--value "open → wait networkidle → screenshot → systematically test nav/forms/responsive"
|
|
229
|
+
```
|