@zibby/core 0.1.21 → 0.1.22

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.
Files changed (167) hide show
  1. package/dist/agents/base.js +17 -0
  2. package/dist/backend-client.js +1 -0
  3. package/dist/constants/tool-names.js +1 -0
  4. package/dist/constants/zibby-scratch.js +1 -0
  5. package/dist/constants.js +1 -0
  6. package/dist/enrichment/base.js +1 -0
  7. package/dist/enrichment/enrichers/accessibility-enricher.js +1 -0
  8. package/dist/enrichment/enrichers/dom-enricher.js +1 -0
  9. package/dist/enrichment/enrichers/page-state-enricher.js +1 -0
  10. package/dist/enrichment/enrichers/position-enricher.js +1 -0
  11. package/dist/enrichment/index.js +1 -0
  12. package/dist/enrichment/mcp-integration.js +1 -0
  13. package/dist/enrichment/mcp-ref-enricher.js +1 -0
  14. package/dist/enrichment/pipeline.js +3 -0
  15. package/dist/enrichment/trace-text-enricher.js +1 -0
  16. package/dist/framework/agents/assistant-strategy.js +5 -0
  17. package/dist/framework/agents/base.js +1 -0
  18. package/dist/framework/agents/claude-strategy.js +4 -0
  19. package/dist/framework/agents/codex-strategy.js +4 -0
  20. package/dist/framework/agents/cursor-strategy.js +32 -0
  21. package/dist/framework/agents/gemini-strategy.js +11 -0
  22. package/dist/framework/agents/index.js +13 -0
  23. package/dist/framework/agents/middleware/assistant-round-pipeline.js +3 -0
  24. package/dist/framework/agents/providers/base.js +1 -0
  25. package/dist/framework/agents/providers/index.js +1 -0
  26. package/dist/framework/agents/providers/openai-transport.js +2 -0
  27. package/dist/framework/agents/providers/openai.js +1 -0
  28. package/dist/framework/agents/providers/transport-base.js +1 -0
  29. package/dist/framework/agents/utils/auth-resolver.js +1 -0
  30. package/dist/framework/agents/utils/cursor-output-formatter.js +1 -0
  31. package/dist/framework/agents/utils/openai-proxy-formatter.js +9 -0
  32. package/dist/framework/agents/utils/payload-budget.js +3 -0
  33. package/dist/framework/agents/utils/structured-output-formatter.js +21 -0
  34. package/dist/framework/code-generator.js +10 -0
  35. package/dist/framework/constants.js +1 -0
  36. package/dist/framework/context-loader.js +5 -0
  37. package/dist/framework/function-bridge.js +2 -0
  38. package/dist/framework/function-skill-registry.js +1 -0
  39. package/dist/framework/graph-compiler.js +1 -0
  40. package/dist/framework/graph.js +5 -0
  41. package/dist/framework/index.js +1 -0
  42. package/dist/framework/mcp-client.js +2 -0
  43. package/dist/framework/node-registry.js +9 -0
  44. package/dist/framework/node.js +5 -0
  45. package/dist/framework/output-parser.js +3 -0
  46. package/dist/framework/skill-registry.js +1 -0
  47. package/dist/framework/state-utils.js +1 -0
  48. package/dist/framework/state.js +1 -0
  49. package/dist/framework/tool-resolver.js +1 -0
  50. package/dist/index.js +8 -0
  51. package/dist/runtime/generation/base.js +1 -0
  52. package/dist/runtime/generation/index.js +3 -0
  53. package/dist/runtime/generation/mcp-ref-strategy.js +41 -0
  54. package/dist/runtime/generation/stable-id-strategy.js +16 -0
  55. package/dist/runtime/stable-id-runtime.js +1 -0
  56. package/dist/runtime/verification/base.js +1 -0
  57. package/dist/runtime/verification/index.js +3 -0
  58. package/dist/runtime/verification/playwright-json-strategy.js +1 -0
  59. package/dist/runtime/zibby-runtime.js +1 -0
  60. package/dist/sync/index.js +1 -0
  61. package/dist/sync/uploader.js +1 -0
  62. package/dist/tools/run-playwright-test.js +5 -0
  63. package/dist/utils/adf-converter.js +7 -0
  64. package/dist/utils/ast-utils.js +1 -0
  65. package/dist/utils/ci-setup.js +5 -0
  66. package/dist/utils/cursor-mcp-isolated-home.js +1 -0
  67. package/dist/utils/cursor-utils.js +18 -0
  68. package/dist/utils/live-frame-discovery.js +1 -0
  69. package/dist/utils/logger.js +1 -0
  70. package/dist/utils/mcp-config-writer.js +10 -0
  71. package/dist/utils/mission-control-from-run-states.js +1 -0
  72. package/dist/utils/node-schema-parser.js +1 -0
  73. package/dist/utils/parallel-config.js +1 -0
  74. package/dist/utils/post-process-events.js +1 -0
  75. package/dist/utils/result-handler.js +1 -0
  76. package/{src → dist}/utils/ripple-effect.js +3 -12
  77. package/dist/utils/run-capacity-coordinator.js +1 -0
  78. package/dist/utils/run-capacity-queue.js +2 -0
  79. package/dist/utils/run-index-merge.js +1 -0
  80. package/dist/utils/run-index-post-cli.js +1 -0
  81. package/dist/utils/run-registry.js +3 -0
  82. package/dist/utils/run-state-session.js +2 -0
  83. package/dist/utils/selector-generator.js +4 -0
  84. package/dist/utils/session-state-constants.js +1 -0
  85. package/dist/utils/session-state-live-runs.js +1 -0
  86. package/dist/utils/streaming-parser.js +4 -0
  87. package/dist/utils/test-post-processor.js +18 -0
  88. package/dist/utils/timeline.js +14 -0
  89. package/dist/utils/trace-parser.js +2 -0
  90. package/dist/utils/video-organizer.js +3 -0
  91. package/package.json +49 -35
  92. package/templates/browser-test-automation/README.md +29 -7
  93. package/templates/browser-test-automation/chat.mjs +36 -0
  94. package/templates/browser-test-automation/graph.mjs +5 -9
  95. package/templates/browser-test-automation/nodes/execute-live.mjs +30 -58
  96. package/templates/browser-test-automation/nodes/generate-script.mjs +32 -12
  97. package/templates/browser-test-automation/nodes/utils.mjs +153 -10
  98. package/templates/browser-test-automation/pipeline-ids.js +12 -0
  99. package/templates/browser-test-automation/result-handler.mjs +78 -2
  100. package/templates/browser-test-automation/run-index.mjs +418 -0
  101. package/scripts/export-default-workflows.js +0 -51
  102. package/scripts/patch-cursor-mcp.js +0 -174
  103. package/scripts/setup-ci.sh +0 -115
  104. package/scripts/setup-official-playwright-mcp.sh +0 -226
  105. package/scripts/test-with-video.sh +0 -49
  106. package/src/agents/base.js +0 -361
  107. package/src/constants.js +0 -47
  108. package/src/enrichment/base.js +0 -49
  109. package/src/enrichment/enrichers/accessibility-enricher.js +0 -197
  110. package/src/enrichment/enrichers/dom-enricher.js +0 -171
  111. package/src/enrichment/enrichers/page-state-enricher.js +0 -129
  112. package/src/enrichment/enrichers/position-enricher.js +0 -67
  113. package/src/enrichment/index.js +0 -96
  114. package/src/enrichment/mcp-integration.js +0 -149
  115. package/src/enrichment/mcp-ref-enricher.js +0 -78
  116. package/src/enrichment/pipeline.js +0 -192
  117. package/src/enrichment/trace-text-enricher.js +0 -115
  118. package/src/framework/AGENTS.md +0 -98
  119. package/src/framework/agents/base.js +0 -72
  120. package/src/framework/agents/claude-strategy.js +0 -278
  121. package/src/framework/agents/cursor-strategy.js +0 -544
  122. package/src/framework/agents/index.js +0 -105
  123. package/src/framework/agents/utils/cursor-output-formatter.js +0 -67
  124. package/src/framework/agents/utils/openai-proxy-formatter.js +0 -249
  125. package/src/framework/code-generator.js +0 -301
  126. package/src/framework/constants.js +0 -33
  127. package/src/framework/context-loader.js +0 -101
  128. package/src/framework/function-bridge.js +0 -78
  129. package/src/framework/function-skill-registry.js +0 -20
  130. package/src/framework/graph-compiler.js +0 -342
  131. package/src/framework/graph.js +0 -610
  132. package/src/framework/index.js +0 -28
  133. package/src/framework/node-registry.js +0 -163
  134. package/src/framework/node.js +0 -259
  135. package/src/framework/output-parser.js +0 -71
  136. package/src/framework/skill-registry.js +0 -55
  137. package/src/framework/state-utils.js +0 -52
  138. package/src/framework/state.js +0 -67
  139. package/src/framework/tool-resolver.js +0 -65
  140. package/src/index.js +0 -345
  141. package/src/runtime/generation/base.js +0 -46
  142. package/src/runtime/generation/index.js +0 -70
  143. package/src/runtime/generation/mcp-ref-strategy.js +0 -197
  144. package/src/runtime/generation/stable-id-strategy.js +0 -170
  145. package/src/runtime/stable-id-runtime.js +0 -248
  146. package/src/runtime/verification/base.js +0 -44
  147. package/src/runtime/verification/index.js +0 -67
  148. package/src/runtime/verification/playwright-json-strategy.js +0 -119
  149. package/src/runtime/zibby-runtime.js +0 -299
  150. package/src/sync/index.js +0 -2
  151. package/src/sync/uploader.js +0 -29
  152. package/src/tools/run-playwright-test.js +0 -158
  153. package/src/utils/adf-converter.js +0 -68
  154. package/src/utils/ast-utils.js +0 -37
  155. package/src/utils/ci-setup.js +0 -124
  156. package/src/utils/cursor-utils.js +0 -71
  157. package/src/utils/logger.js +0 -144
  158. package/src/utils/mcp-config-writer.js +0 -115
  159. package/src/utils/node-schema-parser.js +0 -522
  160. package/src/utils/post-process-events.js +0 -55
  161. package/src/utils/result-handler.js +0 -102
  162. package/src/utils/selector-generator.js +0 -239
  163. package/src/utils/streaming-parser.js +0 -387
  164. package/src/utils/test-post-processor.js +0 -211
  165. package/src/utils/timeline.js +0 -217
  166. package/src/utils/trace-parser.js +0 -325
  167. package/src/utils/video-organizer.js +0 -91
@@ -1,115 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- echo "🚀 Complete CI/CD Setup (from scratch)"
5
- echo "======================================="
6
- echo ""
7
-
8
- # Get the absolute path to the project
9
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10
- PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
11
-
12
- echo "📍 Project root: $PROJECT_ROOT"
13
- echo ""
14
-
15
- # Check OS
16
- OS="$(uname -s)"
17
- echo "🖥️ Detected OS: $OS"
18
- echo ""
19
-
20
- # Step 1: Check/Install Node.js
21
- echo "Step 1: Checking Node.js..."
22
- if command -v node &> /dev/null; then
23
- NODE_VERSION=$(node --version)
24
- echo "✓ Node.js installed: $NODE_VERSION"
25
- else
26
- echo "✗ Node.js not found!"
27
- echo " Install: https://nodejs.org/ or use nvm"
28
- exit 1
29
- fi
30
- echo ""
31
-
32
- # Step 2: Check/Install Python 3
33
- echo "Step 2: Checking Python 3..."
34
- if command -v python3 &> /dev/null; then
35
- PYTHON_VERSION=$(python3 --version)
36
- echo "✓ Python 3 installed: $PYTHON_VERSION"
37
- else
38
- echo "✗ Python 3 not found!"
39
- exit 1
40
- fi
41
- echo ""
42
-
43
- # Step 3: Install npm dependencies
44
- echo "Step 3: Installing npm dependencies..."
45
- cd "$PROJECT_ROOT"
46
- if [ -f "package.json" ]; then
47
- npm install --silent > /dev/null 2>&1
48
- echo "✓ npm dependencies installed"
49
- else
50
- echo "✗ package.json not found"
51
- exit 1
52
- fi
53
- echo ""
54
-
55
- # Step 4: Check/Install cursor-agent
56
- echo "Step 4: Checking cursor-agent..."
57
- if command -v cursor-agent &> /dev/null; then
58
- CURSOR_VERSION=$(cursor-agent --version 2>&1 | head -1 || echo "unknown")
59
- echo "✓ cursor-agent installed: $CURSOR_VERSION"
60
- else
61
- echo "⚠️ cursor-agent not found - installing..."
62
-
63
- if [ "$OS" = "Darwin" ] || [ "$OS" = "Linux" ]; then
64
- # Install cursor-agent
65
- curl -fsSL https://cursor.com/install | bash
66
-
67
- # Add to PATH for current session
68
- export PATH="$HOME/.local/bin:$PATH"
69
-
70
- if command -v cursor-agent &> /dev/null; then
71
- echo "✓ cursor-agent installed successfully"
72
- else
73
- echo "✗ cursor-agent installation failed"
74
- echo " Manual install: curl https://cursor.com/install -fsS | bash"
75
- exit 1
76
- fi
77
- else
78
- echo "✗ Unsupported OS for automatic cursor-agent installation"
79
- echo " Install manually: https://cursor.com/cli"
80
- exit 1
81
- fi
82
- fi
83
- echo ""
84
-
85
- # Step 5: Check CURSOR_API_KEY (REQUIRED for CI/CD)
86
- echo "Step 5: Checking CURSOR_API_KEY..."
87
- if [ -z "$CURSOR_API_KEY" ]; then
88
- echo "⚠️ CURSOR_API_KEY not set"
89
- echo " ⚠️ REQUIRED for CI/CD - cursor-agent will fail without it!"
90
- echo " Set it as an environment variable in your CI/CD config"
91
- echo " Get your key from: https://cursor.com/settings"
92
- echo ""
93
- echo " Example (GitLab CI):"
94
- echo " variables:"
95
- echo " CURSOR_API_KEY: \$CURSOR_API_KEY"
96
- echo ""
97
- else
98
- echo "✓ CURSOR_API_KEY is set"
99
- fi
100
- echo ""
101
-
102
- # Step 6: Run the official Playwright MCP setup
103
- echo "Step 6: Setting up official Playwright MCP..."
104
- echo ""
105
- bash "$SCRIPT_DIR/setup-official-playwright-mcp.sh"
106
-
107
- echo ""
108
- echo "======================================="
109
- echo "✅ Complete CI/CD setup finished!"
110
- echo "======================================="
111
- echo ""
112
- echo "Ready to use in CI/CD:"
113
- echo " cursor-agent -p 'Navigate to google.com' --mcp-server playwright-official"
114
- echo ""
115
-
@@ -1,226 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -e
4
-
5
- # Get script directory for relative imports
6
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7
-
8
- # Step 1: Check cursor-agent (check actual locations, not just PATH)
9
- CURSOR_AGENT_PATH=""
10
- if command -v cursor-agent &> /dev/null; then
11
- CURSOR_AGENT_PATH=$(command -v cursor-agent)
12
- elif [ -x "$HOME/.local/bin/cursor-agent" ]; then
13
- CURSOR_AGENT_PATH="$HOME/.local/bin/cursor-agent"
14
- elif [ -x "$HOME/.cursor/bin/cursor-agent" ]; then
15
- CURSOR_AGENT_PATH="$HOME/.cursor/bin/cursor-agent"
16
- fi
17
-
18
- if [ -z "$CURSOR_AGENT_PATH" ]; then
19
- echo "⚠️ cursor-agent not found. Installing..."
20
- curl https://cursor.com/install -fsS | bash
21
- # Check again after install
22
- if [ -x "$HOME/.local/bin/cursor-agent" ]; then
23
- CURSOR_AGENT_PATH="$HOME/.local/bin/cursor-agent"
24
- elif [ -x "$HOME/.cursor/bin/cursor-agent" ]; then
25
- CURSOR_AGENT_PATH="$HOME/.cursor/bin/cursor-agent"
26
- fi
27
- fi
28
-
29
- # Always ensure these directories are in PATH for this script
30
- export PATH="$HOME/.cursor/bin:$HOME/.local/bin:$PATH"
31
-
32
- # Step 2: Find Node.js absolute paths (Cursor GUI doesn't have shell PATH)
33
- NODE_PATH=$(which node 2>/dev/null || echo "")
34
- NPX_PATH=$(which npx 2>/dev/null || echo "")
35
- NODE_BIN_DIR=$(dirname "$NODE_PATH" 2>/dev/null || echo "")
36
-
37
- if [ -z "$NODE_PATH" ]; then
38
- echo "❌ node not found. Please install Node.js"
39
- exit 1
40
- fi
41
-
42
- echo " Using Node: $NODE_PATH"
43
-
44
- # Step 3: Find Zibby MCP Browser (stable IDs + event recording)
45
- echo "Setting up Zibby MCP Browser..."
46
-
47
- # Resolve @zibby/mcp-browser from node_modules (works in workspace, global, and npx installs)
48
- ZIBBY_MCP_PKG=$("$NODE_PATH" -e "try{console.log(require.resolve('@zibby/mcp-browser/package.json',{paths:['$SCRIPT_DIR/..']}))}catch{}" 2>/dev/null)
49
- if [ -n "$ZIBBY_MCP_PKG" ]; then
50
- ZIBBY_MCP_BIN="$(dirname "$ZIBBY_MCP_PKG")/bin/mcp-browser-zibby.js"
51
- fi
52
-
53
- # Fallback: try workspace path (dev only)
54
- if [ -z "$ZIBBY_MCP_BIN" ] || [ ! -f "$ZIBBY_MCP_BIN" ]; then
55
- ZIBBY_MCP_DIR="$SCRIPT_DIR/../../mcps/browser"
56
- if [ -f "$ZIBBY_MCP_DIR/bin/mcp-browser-zibby.js" ]; then
57
- ZIBBY_MCP_BIN="$ZIBBY_MCP_DIR/bin/mcp-browser-zibby.js"
58
- fi
59
- fi
60
-
61
- # Final fallback: official @playwright/mcp (no stable IDs or event recording)
62
- if [ -z "$ZIBBY_MCP_BIN" ] || [ ! -f "$ZIBBY_MCP_BIN" ]; then
63
- PLAYWRIGHT_MCP_PKG=$("$NODE_PATH" -e "try{console.log(require.resolve('@playwright/mcp/package.json',{paths:['$SCRIPT_DIR/..']}))}catch{}" 2>/dev/null)
64
- if [ -n "$PLAYWRIGHT_MCP_PKG" ]; then
65
- ZIBBY_MCP_BIN="$(dirname "$PLAYWRIGHT_MCP_PKG")/cli.js"
66
- echo " ⚠️ Using @playwright/mcp (official) — stable IDs and event recording unavailable"
67
- fi
68
- fi
69
-
70
- if [ -z "$ZIBBY_MCP_BIN" ] || [ ! -f "$ZIBBY_MCP_BIN" ]; then
71
- echo "❌ No Playwright MCP found. Run: npm install @zibby/mcp-browser"
72
- exit 1
73
- fi
74
-
75
- echo " ✅ Zibby MCP Browser ready"
76
-
77
- # Install ffmpeg for video recording
78
- echo "🎬 Installing ffmpeg for video recording..."
79
- if command -v playwright &> /dev/null 2>&1; then
80
- playwright install ffmpeg > /dev/null 2>&1 && echo " ✅ ffmpeg installed" || echo " ⚠️ Could not install ffmpeg"
81
- else
82
- "$NPX_PATH" --yes playwright install ffmpeg > /dev/null 2>&1 && echo " ✅ ffmpeg installed" || echo " ⚠️ Could not install ffmpeg (will disable video)"
83
- fi
84
-
85
- # Step 4: Configure MCP
86
- echo "Configuring Zibby MCP Browser..."
87
- mkdir -p ~/.cursor
88
-
89
- # Default viewport size (can be overridden via env)
90
- VIEWPORT_WIDTH="${ZIBBY_VIEWPORT_WIDTH:-1280}"
91
- VIEWPORT_HEIGHT="${ZIBBY_VIEWPORT_HEIGHT:-720}"
92
- VIEWPORT_SIZE="${VIEWPORT_WIDTH}x${VIEWPORT_HEIGHT}"
93
-
94
- # Build MCP args array
95
- MCP_ARGS="\"--save-video=${VIEWPORT_SIZE}\", \"--viewport-size=${VIEWPORT_SIZE}\", \"--output-dir=test-results\""
96
-
97
- # Check if headless mode requested (default is headed)
98
- if [ "$ZIBBY_HEADLESS" = "1" ]; then
99
- MCP_ARGS="$MCP_ARGS, \"--headless\""
100
- echo " Mode: Headless (hidden browser)"
101
- else
102
- echo " Mode: Headed (visible browser)"
103
- fi
104
-
105
- # Check if video recording requested (default is on)
106
- if [ "$ZIBBY_VIDEO" != "off" ]; then
107
- echo " Video: Enabled (${VIEWPORT_SIZE})"
108
- else
109
- MCP_ARGS="\"--viewport-size=${VIEWPORT_SIZE}\", \"--output-dir=test-results\""
110
- if [ "$ZIBBY_HEADLESS" = "1" ]; then
111
- MCP_ARGS="$MCP_ARGS, \"--headless\""
112
- fi
113
- echo " Video: Disabled"
114
- fi
115
-
116
- # Check if Zibby Cloud MCP should be included
117
- if [ "$ZIBBY_CLOUD_SYNC" = "1" ]; then
118
- LOCAL_MCP_PATH="$SCRIPT_DIR/../../mcp-server/src/index.js"
119
-
120
- if [ -f "$LOCAL_MCP_PATH" ]; then
121
- MCP_PKG_DIR="$SCRIPT_DIR/../../mcp-server"
122
- if [ -f "$MCP_PKG_DIR/package.json" ]; then
123
- echo " 📦 Installing Zibby Cloud MCP dependencies..."
124
- (cd "$MCP_PKG_DIR" && npm install --silent > /dev/null 2>&1) || echo " ⚠️ Warning: Could not install dependencies"
125
- fi
126
-
127
- cat > ~/.cursor/mcp.json <<EOF
128
- {
129
- "mcpServers": {
130
- "playwright-official": {
131
- "command": "$NODE_PATH",
132
- "args": ["$ZIBBY_MCP_BIN", $MCP_ARGS],
133
- "env": {
134
- "PATH": "$NODE_BIN_DIR:/usr/bin:/bin:/usr/sbin:/sbin"
135
- },
136
- "description": "Zibby MCP Browser - Forked Playwright MCP with stable ID support"
137
- },
138
- "zibby": {
139
- "command": "$NODE_PATH",
140
- "args": ["$LOCAL_MCP_PATH"],
141
- "env": {
142
- "ZIBBY_API_KEY": "${ZIBBY_API_KEY}",
143
- "PATH": "$NODE_BIN_DIR:/usr/bin:/bin:/usr/sbin:/sbin"
144
- },
145
- "description": "Zibby Cloud Sync - Upload test results and artifacts"
146
- }
147
- }
148
- }
149
- EOF
150
- echo " + Zibby MCP Browser (stable IDs + event recording)"
151
- echo " + Zibby Cloud MCP (cloud sync enabled)"
152
- else
153
- echo " ⚠️ Cloud sync requested but local MCP server not found"
154
- cat > ~/.cursor/mcp.json <<EOF
155
- {
156
- "mcpServers": {
157
- "playwright-official": {
158
- "command": "$NODE_PATH",
159
- "args": ["$ZIBBY_MCP_BIN", $MCP_ARGS],
160
- "env": {
161
- "PATH": "$NODE_BIN_DIR:/usr/bin:/bin:/usr/sbin:/sbin"
162
- },
163
- "description": "Zibby MCP Browser - Forked Playwright MCP with stable ID support"
164
- }
165
- }
166
- }
167
- EOF
168
- echo " + Zibby MCP Browser (stable IDs + event recording)"
169
- fi
170
- else
171
- cat > ~/.cursor/mcp.json <<EOF
172
- {
173
- "mcpServers": {
174
- "playwright-official": {
175
- "command": "$NODE_PATH",
176
- "args": ["$ZIBBY_MCP_BIN", $MCP_ARGS],
177
- "env": {
178
- "PATH": "$NODE_BIN_DIR:/usr/bin:/bin:/usr/sbin:/sbin"
179
- },
180
- "description": "Zibby MCP Browser - Forked Playwright MCP with stable ID support"
181
- }
182
- }
183
- }
184
- EOF
185
- echo " + Zibby MCP Browser (stable IDs + event recording)"
186
- fi
187
-
188
- # Step 5: Patch cursor-agent
189
- echo "Patching cursor-agent..."
190
- node "$SCRIPT_DIR/patch-cursor-mcp.js" > /dev/null 2>&1 || echo " (patch may not be needed for your version)"
191
-
192
- # Step 6: Get approval key
193
- echo "🔑 Getting approval key..."
194
- APPROVAL_OUTPUT=$(cursor-agent mcp list 2>&1)
195
-
196
- APPROVAL_KEY_LINE=$(echo "$APPROVAL_OUTPUT" | grep "🔑 APPROVAL KEY.*playwright-official" | head -1)
197
- echo "$APPROVAL_KEY_LINE"
198
-
199
- APPROVAL_KEY=$(echo "$APPROVAL_KEY_LINE" | sed -E 's/.*=> ([^ ]+).*/\1/' | head -1)
200
-
201
- if [ -z "$APPROVAL_KEY" ]; then
202
- APPROVAL_KEY=$(echo "$APPROVAL_OUTPUT" | grep -oE 'playwright-official-[a-f0-9]+' | head -1)
203
- fi
204
-
205
- if [ -z "$APPROVAL_KEY" ]; then
206
- echo "⚠️ Could not auto-extract approval key"
207
- echo " This is OK for development - approval key only needed for CI/CD"
208
- echo " For CI/CD: Run 'cursor-agent mcp list' and save the key"
209
- else
210
- # Step 7: Setup workspace approvals (only if we got the key)
211
- echo "Configuring approvals..."
212
- WORKSPACE_PATH="$PWD"
213
- WORKSPACE_ENCODED=$(echo "$WORKSPACE_PATH" | sed 's|^/||' | sed 's|/|-|g')
214
- APPROVAL_DIR="$HOME/.cursor/projects/$WORKSPACE_ENCODED"
215
- APPROVAL_FILE="$APPROVAL_DIR/mcp-approvals.json"
216
-
217
- mkdir -p "$APPROVAL_DIR"
218
- cat > "$APPROVAL_FILE" <<EOF
219
- ["$APPROVAL_KEY"]
220
- EOF
221
- echo "Auto-approval configured for this workspace"
222
- fi
223
-
224
- echo ""
225
- echo "Zibby MCP Browser ready!"
226
- echo ""
@@ -1,49 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Run Playwright tests with video recording
4
- # Usage: ./scripts/test-with-video.sh [test-file] [headed]
5
- #
6
- # Examples:
7
- # ./scripts/test-with-video.sh tests/auth/login.spec.js
8
- # ./scripts/test-with-video.sh tests/auth/login.spec.js headed
9
-
10
- TEST_FILE="${1:-tests/}"
11
- HEADED_FLAG=""
12
-
13
- if [ "$2" = "headed" ]; then
14
- HEADED_FLAG="--headed"
15
- fi
16
-
17
- echo "🎥 Running Playwright tests with video recording..."
18
- echo " Test: $TEST_FILE"
19
- echo " Mode: $([ -n "$HEADED_FLAG" ] && echo "Headed (visible)" || echo "Headless")"
20
- echo ""
21
-
22
- # Run tests (video is configured in playwright.config.js)
23
- npx playwright test "$TEST_FILE" --project=chromium $HEADED_FLAG
24
-
25
- echo ""
26
- echo "✅ Tests complete!"
27
- echo ""
28
- echo "📂 Videos saved in: test-results/"
29
- echo ""
30
-
31
- # List videos if any were created
32
- if ls test-results/*/video.webm 2>/dev/null 1>&2; then
33
- echo "🎬 Videos created:"
34
- ls -lh test-results/*/video.webm
35
- echo ""
36
- echo "To view videos:"
37
- echo " 1. Open Finder: open test-results/"
38
- echo " 2. Or play directly:"
39
- for video in test-results/*/video.webm; do
40
- echo " open \"$video\""
41
- done
42
- else
43
- echo "ℹ️ No videos found"
44
- echo ""
45
- echo "Video is configured in playwright.config.js:"
46
- echo " - video: 'on' (always record)"
47
- echo " - video: 'retain-on-failure' (only failed tests)"
48
- fi
49
-