hool-cli 0.9.0 → 0.9.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.
@@ -1,56 +1,37 @@
1
1
  #!/bin/bash
2
2
  # Hook: Login Nudge
3
3
  # Trigger: Called by PL before first QA run or when authenticated testing is needed
4
- # Purpose: Prompt user to manually log into browser profiles
4
+ # Purpose: Prompt user to manually log into the shared browser profile
5
5
  #
6
- # Agents can't log into services requiring real credentials (OAuth, 2FA, passwords).
7
- # This hook opens each browser profile in headed mode so the user can log in.
8
- # After login, the profile persists cookies/localStorage for agent use.
6
+ # All agents share a single browser profile at .hool/browser-profiles/shared/
7
+ # via --user-data-dir. User logs in once via headful mode, all agents (headless
8
+ # and headful) get the same auth state.
9
9
 
10
10
  set -euo pipefail
11
11
 
12
- PROFILES_DIR=".hool/browser-profiles"
13
- PROFILES=("qa" "fe-dev" "forensic")
12
+ SHARED_PROFILE=".hool/browser-profiles/shared"
13
+ mkdir -p "$SHARED_PROFILE"
14
14
 
15
15
  echo "============================================"
16
16
  echo " BROWSER PROFILE LOGIN REQUIRED"
17
17
  echo "============================================"
18
18
  echo ""
19
- echo "Agents need authenticated browser sessions to test login-protected flows."
20
- echo "You need to manually log into each browser profile."
19
+ echo "Agents need an authenticated browser session to test login-protected flows."
20
+ echo "All agents share a single browser profile at: ${SHARED_PROFILE}/"
21
21
  echo ""
22
-
23
- for profile in "${PROFILES[@]}"; do
24
- PROFILE_DIR="${PROFILES_DIR}/${profile}"
25
- mkdir -p "$PROFILE_DIR"
26
-
27
- echo "---"
28
- echo "Profile: ${profile}"
29
- echo " Purpose:"
30
- case "$profile" in
31
- qa) echo " QA agent uses this for E2E testing and visual testing" ;;
32
- fe-dev) echo " FE Dev uses this for design card comparison and visual checks" ;;
33
- forensic) echo " Forensic uses this for reproducing UI bugs" ;;
34
- esac
35
- echo " Directory: ${PROFILE_DIR}/"
36
- echo ""
37
- done
38
-
39
22
  echo "============================================"
40
23
  echo " HOW TO LOG IN"
41
24
  echo "============================================"
42
25
  echo ""
43
- echo "For each profile, run:"
44
- echo ""
45
- echo " playwright-mcp --profile .hool/browser-profiles/<profile-name>"
26
+ echo "Run:"
46
27
  echo ""
47
- echo "This opens a browser with that profile. Log into all required services,"
48
- echo "then close the browser. The auth state will persist for agent use."
28
+ echo " playwright-mcp --user-data-dir ${SHARED_PROFILE}"
49
29
  echo ""
50
- echo "Example:"
51
- echo " playwright-mcp --profile .hool/browser-profiles/qa"
30
+ echo "This opens a visible browser with the shared profile."
31
+ echo "Log into all required services, then close the browser."
32
+ echo "The auth state persists for all agents in both headless and headful modes."
52
33
  echo ""
53
- echo "After logging in to all profiles, tell the Product Lead you're done."
34
+ echo "After logging in, tell the Product Lead you're done."
54
35
  echo "============================================"
55
36
 
56
37
  # Output for hook system
@@ -58,7 +39,7 @@ cat << 'EOF'
58
39
  {
59
40
  "hookSpecificOutput": {
60
41
  "hookEventName": "UserPromptSubmit",
61
- "additionalContext": "LOGIN NUDGE: Browser profiles need user login before agents can test authenticated flows. Profiles: qa, fe-dev, forensic. Ask the user to run: playwright-mcp --profile .hool/browser-profiles/<name> for each profile, log into required services, then close the browser."
42
+ "additionalContext": "LOGIN NUDGE: Shared browser profile needs user login before agents can test authenticated flows. Profile: .hool/browser-profiles/shared/. Ask the user to run: playwright-mcp --user-data-dir .hool/browser-profiles/shared log into required services, then close the browser."
62
43
  }
63
44
  }
64
45
  EOF
@@ -17,7 +17,8 @@ if [ ! -f "$METRICS_FILE" ]; then
17
17
  INIT
18
18
  fi
19
19
 
20
- # Increment total tool calls
21
- current_total=$(grep -oP '(?<=tool-calls: )\d+' "$METRICS_FILE" 2>/dev/null || echo "0")
20
+ # Increment total tool calls (BSD sed compatible)
21
+ current_total=$(sed -n 's/.*tool-calls: *\([0-9]*\).*/\1/p' "$METRICS_FILE" 2>/dev/null | head -1)
22
+ current_total=${current_total:-0}
22
23
  new_total=$((current_total + 1))
23
24
  sed -i '' "s/tool-calls: ${current_total}/tool-calls: ${new_total}/" "$METRICS_FILE" 2>/dev/null || true
@@ -2,49 +2,143 @@
2
2
  "servers": {
3
3
  "context7": {
4
4
  "command": "npx",
5
- "args": ["-y", "@context7/mcp"],
5
+ "args": [
6
+ "-y",
7
+ "@context7/mcp"
8
+ ],
6
9
  "install": "global (npx auto-installs)",
7
10
  "description": "Up-to-date library documentation. All agents use this.",
8
- "agents": ["all"]
11
+ "agents": [
12
+ "all"
13
+ ]
9
14
  },
10
15
  "deepwiki": {
11
16
  "command": "npx",
12
- "args": ["-y", "deepwiki-mcp"],
17
+ "args": [
18
+ "-y",
19
+ "deepwiki-mcp"
20
+ ],
13
21
  "install": "global (npx auto-installs)",
14
22
  "description": "Deep documentation for open-source projects.",
15
- "agents": ["product-lead", "be-tech-lead", "fe-tech-lead", "be-dev", "fe-dev"]
23
+ "agents": [
24
+ "product-lead",
25
+ "be-tech-lead",
26
+ "fe-tech-lead",
27
+ "be-dev",
28
+ "fe-dev"
29
+ ]
16
30
  },
17
31
  "playwright": {
18
32
  "package": "@playwright/mcp",
19
33
  "command": "playwright-mcp",
20
- "args": ["--headless"],
34
+ "args": [
35
+ "--headless"
36
+ ],
21
37
  "install": "npm install -g @playwright/mcp (done during hool init)",
22
- "description": "Browser automation. Single instance, multiple named profiles.",
23
- "agents": ["qa", "forensic", "fe-dev"],
38
+ "description": "Headless browser automation. Single instance, multiple named profiles. Shares browser profile with playwright-headful.",
39
+ "agents": [
40
+ "qa",
41
+ "forensic",
42
+ "fe-dev"
43
+ ],
24
44
  "profiles": {
25
45
  "description": "Each agent operates in its own named browser profile stored under .hool/browser-profiles/<profile-name>/. Profiles persist cookies, localStorage, and auth state across sessions.",
26
- "available": ["qa", "fe-dev", "forensic"],
46
+ "available": [
47
+ "qa",
48
+ "fe-dev",
49
+ "forensic"
50
+ ],
27
51
  "user-login-required": "Agents cannot log into services that require real credentials (OAuth, 2FA, etc). The user must manually open each profile and log in before agents can test authenticated flows. See the login-nudge hook."
28
- }
52
+ },
53
+ "shares-profile-with": "playwright-headful"
54
+ },
55
+ "playwright-headful": {
56
+ "command": "playwright-mcp",
57
+ "args": [],
58
+ "install": "npm install -g @playwright/mcp (same binary as headless, just no --headless flag)",
59
+ "description": "Visible browser for human-assisted login, interactive debugging, and live demos. Shares browser profile with headless mode.",
60
+ "agents": [
61
+ "qa",
62
+ "forensic",
63
+ "fe-dev"
64
+ ],
65
+ "shares-profile-with": "playwright"
29
66
  }
30
67
  },
31
68
  "by-domain": {
32
- "web-app": ["context7", "deepwiki", "playwright"],
33
- "api-only": ["context7", "deepwiki"],
34
- "cli-tool": ["context7", "deepwiki"],
35
- "browser-game": ["context7", "deepwiki", "playwright"],
36
- "animation": ["context7", "deepwiki", "playwright"],
37
- "mobile": ["context7", "deepwiki"],
38
- "desktop": ["context7", "deepwiki", "playwright"]
69
+ "web-app": [
70
+ "context7",
71
+ "deepwiki",
72
+ "playwright",
73
+ "playwright-headful"
74
+ ],
75
+ "api-only": [
76
+ "context7",
77
+ "deepwiki"
78
+ ],
79
+ "cli-tool": [
80
+ "context7",
81
+ "deepwiki"
82
+ ],
83
+ "browser-game": [
84
+ "context7",
85
+ "deepwiki",
86
+ "playwright",
87
+ "playwright-headful"
88
+ ],
89
+ "animation": [
90
+ "context7",
91
+ "deepwiki",
92
+ "playwright",
93
+ "playwright-headful"
94
+ ],
95
+ "mobile": [
96
+ "context7",
97
+ "deepwiki"
98
+ ],
99
+ "desktop": [
100
+ "context7",
101
+ "deepwiki",
102
+ "playwright",
103
+ "playwright-headful"
104
+ ]
39
105
  },
40
106
  "agent-access-matrix": {
41
- "product-lead": ["context7", "deepwiki"],
42
- "be-tech-lead": ["context7", "deepwiki"],
43
- "fe-tech-lead": ["context7", "deepwiki"],
44
- "be-dev": ["context7", "deepwiki"],
45
- "fe-dev": ["context7", "deepwiki", "playwright"],
46
- "qa": ["context7", "playwright"],
47
- "forensic": ["context7", "playwright"],
48
- "governor": ["context7"]
107
+ "product-lead": [
108
+ "context7",
109
+ "deepwiki",
110
+ "playwright-headful"
111
+ ],
112
+ "be-tech-lead": [
113
+ "context7",
114
+ "deepwiki"
115
+ ],
116
+ "fe-tech-lead": [
117
+ "context7",
118
+ "deepwiki"
119
+ ],
120
+ "be-dev": [
121
+ "context7",
122
+ "deepwiki"
123
+ ],
124
+ "fe-dev": [
125
+ "context7",
126
+ "deepwiki",
127
+ "playwright",
128
+ "playwright-headful"
129
+ ],
130
+ "qa": [
131
+ "context7",
132
+ "playwright",
133
+ "playwright-headful"
134
+ ],
135
+ "forensic": [
136
+ "context7",
137
+ "playwright",
138
+ "playwright-headful"
139
+ ],
140
+ "governor": [
141
+ "context7"
142
+ ]
49
143
  }
50
144
  }
@@ -52,10 +52,10 @@ project-root/ ← Project-level git (Product Lead owns)
52
52
 
53
53
  ### Playwright Browser Profiles
54
54
  - Globally installed (`npm install -g @playwright/mcp`) — persistent binary, not ephemeral npx
55
- - Each agent uses a named profile: `qa`, `fe-dev`, `forensic`
56
- - Profiles stored in `.hool/browser-profiles/<profile-name>/`
57
- - Cookies, localStorage, and auth state persist per profile across sessions
58
- - Agents cannot log into OAuth/2FA services — user must manually log into profiles first (see login-nudge hook)
55
+ - **Shared profile**: Both headless and headful modes share the same browser profile at `.hool/browser-profiles/shared/` via `--user-data-dir`
56
+ - Cookies, localStorage, and auth state persist across sessions and across modes (headless ↔ headful)
57
+ - User logs in via headful mode agents test via headless mode with the same auth state
58
+ - Agents cannot log into OAuth/2FA services — user must manually log in first (see login-nudge hook)
59
59
 
60
60
  ### Playwright Modes (Headless vs Headful)
61
61
 
@@ -2,24 +2,38 @@
2
2
  "env": {
3
3
  "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
4
4
  },
5
+ "teammateMode": "tmux",
5
6
  "mcpServers": {
6
7
  "context7": {
7
8
  "command": "npx",
8
- "args": ["-y", "@context7/mcp"]
9
+ "args": [
10
+ "-y",
11
+ "@context7/mcp"
12
+ ]
9
13
  },
10
14
  "deepwiki": {
11
15
  "command": "npx",
12
- "args": ["-y", "deepwiki-mcp"]
16
+ "args": [
17
+ "-y",
18
+ "deepwiki-mcp"
19
+ ]
13
20
  },
14
21
  "playwright": {
15
22
  "command": "playwright-mcp",
16
- "args": ["--headless"],
17
- "_note": "Globally installed via npm install -g @playwright/mcp. Default headless mode for automation, screenshots, E2E testing."
23
+ "args": [
24
+ "--headless",
25
+ "--user-data-dir",
26
+ ".hool/browser-profiles/shared"
27
+ ],
28
+ "_note": "Headless mode. Shares browser profile with playwright-headful via --user-data-dir."
18
29
  },
19
30
  "playwright-headful": {
20
31
  "command": "playwright-mcp",
21
- "args": [],
22
- "_note": "Headful mode — visible browser for human-assisted login, interactive debugging, and live demos. Use when user needs to see/interact with the browser."
32
+ "args": [
33
+ "--user-data-dir",
34
+ ".hool/browser-profiles/shared"
35
+ ],
36
+ "_note": "Headful (visible) mode. Shares browser profile with playwright (headless) via same --user-data-dir."
23
37
  }
24
38
  },
25
39
  "permissions": {