@eddym06/custom-chrome-mcp 1.0.8 → 1.1.0

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 (62) hide show
  1. package/CONDITIONAL_DESCRIPTIONS.md +174 -0
  2. package/FUTURE_FEATURES.txt +1503 -0
  3. package/README.md +300 -3
  4. package/TEST_WORKFLOW.md +311 -0
  5. package/USAGE_GUIDE.md +393 -0
  6. package/demo_features.ts +115 -0
  7. package/dist/chrome-connector.d.ts +10 -0
  8. package/dist/chrome-connector.d.ts.map +1 -1
  9. package/dist/chrome-connector.js +44 -0
  10. package/dist/chrome-connector.js.map +1 -1
  11. package/dist/index.js +22 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/tests/execute-script-tests.d.ts +62 -0
  14. package/dist/tests/execute-script-tests.d.ts.map +1 -0
  15. package/dist/tests/execute-script-tests.js +280 -0
  16. package/dist/tests/execute-script-tests.js.map +1 -0
  17. package/dist/tests/run-execute-tests.d.ts +7 -0
  18. package/dist/tests/run-execute-tests.d.ts.map +1 -0
  19. package/dist/tests/run-execute-tests.js +88 -0
  20. package/dist/tests/run-execute-tests.js.map +1 -0
  21. package/dist/tools/advanced-network.backup.d.ts +245 -0
  22. package/dist/tools/advanced-network.backup.d.ts.map +1 -0
  23. package/dist/tools/advanced-network.backup.js +996 -0
  24. package/dist/tools/advanced-network.backup.js.map +1 -0
  25. package/dist/tools/advanced-network.d.ts +580 -0
  26. package/dist/tools/advanced-network.d.ts.map +1 -0
  27. package/dist/tools/advanced-network.js +1325 -0
  28. package/dist/tools/advanced-network.js.map +1 -0
  29. package/dist/tools/anti-detection.js +5 -5
  30. package/dist/tools/anti-detection.js.map +1 -1
  31. package/dist/tools/capture.d.ts +7 -1
  32. package/dist/tools/capture.d.ts.map +1 -1
  33. package/dist/tools/capture.js +8 -4
  34. package/dist/tools/capture.js.map +1 -1
  35. package/dist/tools/interaction.d.ts +82 -8
  36. package/dist/tools/interaction.d.ts.map +1 -1
  37. package/dist/tools/interaction.js +75 -28
  38. package/dist/tools/interaction.js.map +1 -1
  39. package/dist/tools/navigation.js +7 -7
  40. package/dist/tools/navigation.js.map +1 -1
  41. package/dist/tools/network-accessibility.d.ts +67 -0
  42. package/dist/tools/network-accessibility.d.ts.map +1 -0
  43. package/dist/tools/network-accessibility.js +367 -0
  44. package/dist/tools/network-accessibility.js.map +1 -0
  45. package/dist/tools/playwright-launcher.js +4 -4
  46. package/dist/tools/playwright-launcher.js.map +1 -1
  47. package/dist/tools/service-worker.js +10 -10
  48. package/dist/tools/service-worker.js.map +1 -1
  49. package/dist/tools/session.js +9 -9
  50. package/dist/tools/session.js.map +1 -1
  51. package/dist/tools/system.js +3 -3
  52. package/dist/tools/system.js.map +1 -1
  53. package/dist/utils/truncate.d.ts +29 -0
  54. package/dist/utils/truncate.d.ts.map +1 -0
  55. package/dist/utils/truncate.js +46 -0
  56. package/dist/utils/truncate.js.map +1 -0
  57. package/dist/verify-tools.d.ts +7 -0
  58. package/dist/verify-tools.d.ts.map +1 -0
  59. package/dist/verify-tools.js +137 -0
  60. package/dist/verify-tools.js.map +1 -0
  61. package/package.json +2 -2
  62. package/recordings/demo_recording.har +3036 -0
@@ -0,0 +1,174 @@
1
+ # Conditional Description Patterns for All Tools
2
+
3
+ ## Philosophy: "When to Use" > "What it Does"
4
+
5
+ AI models make better tool selection decisions when descriptions focus on **triggers** and **context** rather than just functionality.
6
+
7
+ ---
8
+
9
+ ## Pattern Templates
10
+
11
+ ### Pattern 1: Navigation Tools
12
+ ```
13
+ [Tool Name] - [Primary Action]
14
+
15
+ USE THIS WHEN:
16
+ - User says "[trigger phrase 1]"
17
+ - User says "[trigger phrase 2]"
18
+ - [Contextual condition]
19
+
20
+ WORKFLOW:
21
+ 1️⃣ [This tool] → 2️⃣ [Next logical step] → 3️⃣ [Then action]
22
+
23
+ ❌ DO NOT USE when [anti-pattern]
24
+ ✅ USE when [correct pattern]
25
+ ```
26
+
27
+ ### Pattern 2: Interaction Tools
28
+ ```
29
+ [Tool Name] - [Primary Action]
30
+
31
+ ⚠️ PREREQUISITE: [Required step before this tool]
32
+
33
+ USE THIS WHEN:
34
+ - [User intent 1]
35
+ - [User intent 2]
36
+
37
+ PROPER WORKFLOW:
38
+ 1️⃣ [Analysis step] → 2️⃣ [This tool] → 3️⃣ [Verification]
39
+
40
+ COMMON MISTAKE: [What AI typically gets wrong]
41
+ ```
42
+
43
+ ### Pattern 3: Analysis/Inspection Tools
44
+ ```
45
+ [Tool Name] - [Primary Action]
46
+
47
+ 🔍 USE THIS WHEN:
48
+ - [Symptom 1] (e.g., "content missing after click")
49
+ - [Symptom 2] (e.g., "page loads but data empty")
50
+ - [Symptom 3]
51
+
52
+ WHY CRITICAL: [Explains the "why" - what's invisible without this tool]
53
+
54
+ WHEN NOT TO USE: [Situations where simpler tool suffices]
55
+ ```
56
+
57
+ ### Pattern 4: Network/Debugging Tools
58
+ ```
59
+ [Tool Name] - [Primary Action]
60
+
61
+ 🚨 USE THIS WHEN:
62
+ - After [action], expected [result] doesn't appear
63
+ - Suspecting [technical condition]
64
+ - Need to [specific diagnostic]
65
+
66
+ WORKFLOW STEP: [X] of [Y]
67
+ PREVIOUS: [What should have been done before]
68
+ NEXT: [What to do after]
69
+
70
+ TROUBLESHOOTING: If [problem], this tool reveals [hidden information]
71
+ ```
72
+
73
+ ### Pattern 5: Configuration/Setup Tools
74
+ ```
75
+ [Tool Name] - [Primary Action]
76
+
77
+ ⚙️ CONFIGURE BEFORE: [Type of operation]
78
+
79
+ PARAMETERS AI SHOULD SET:
80
+ - [param1]: [guidance on value selection]
81
+ - [param2]: [guidance on value selection]
82
+
83
+ TYPICAL VALUES:
84
+ - Simple operations: [value]
85
+ - Complex operations: [value]
86
+ - Heavy operations: [value]
87
+ ```
88
+
89
+ ---
90
+
91
+ ## Application Strategy
92
+
93
+ ### Phase 1: Critical Path Tools (HIGH PRIORITY)
94
+ Tools that are most commonly used and most likely to be misused:
95
+ - ✅ navigate (DONE)
96
+ - ✅ create_tab (DONE)
97
+ - ✅ click (DONE)
98
+ - ✅ type (DONE)
99
+ - ✅ get_html (DONE)
100
+ - ✅ screenshot (DONE)
101
+ - ✅ execute_script (DONE)
102
+ - ✅ enable_response_interception (DONE)
103
+ - ✅ list_intercepted_responses (DONE)
104
+
105
+ ### Phase 2: Analysis & Debugging (MEDIUM PRIORITY)
106
+ - get_text
107
+ - get_attribute
108
+ - wait_for_selector
109
+ - list_tabs
110
+ - get_url
111
+ - get_cookies
112
+ - list_all_targets
113
+ - connect_to_target
114
+ - execute_in_target
115
+
116
+ ### Phase 3: Advanced Network (MEDIUM PRIORITY)
117
+ - modify_intercepted_response (partially done)
118
+ - create_mock_endpoint
119
+ - enable_websocket_interception
120
+ - start_har_recording
121
+ - export_har_file
122
+ - inject_css_global
123
+ - inject_js_global
124
+
125
+ ### Phase 4: Specialized Tools (LOWER PRIORITY)
126
+ - Anti-detection tools
127
+ - Service worker tools
128
+ - Session management
129
+ - Print to PDF
130
+ - Storage tools
131
+
132
+ ---
133
+
134
+ ## Key Principles
135
+
136
+ 1. **Start with "WHEN"**: What triggers using this tool?
137
+ 2. **Explain "WHY"**: What's invisible/unclear without it?
138
+ 3. **Show "HOW"**: What's the workflow?
139
+ 4. **Warn against anti-patterns**: What mistakes do AIs make?
140
+ 5. **Guide parameters**: What values should AI choose?
141
+
142
+ ---
143
+
144
+ ## Examples Applied
145
+
146
+ ### Before (generic):
147
+ ```typescript
148
+ name: 'get_cookies',
149
+ description: 'Get all cookies for the current domain'
150
+ ```
151
+
152
+ ### After (conditional):
153
+ ```typescript
154
+ name: 'get_cookies',
155
+ description: `🔍 Retrieves browser cookies for current domain.
156
+
157
+ USE THIS WHEN:
158
+ - Debugging authentication issues (checking if auth token exists)
159
+ - Session not persisting (verify session cookies)
160
+ - Login appears successful but features unavailable (check cookie values)
161
+ - Need to verify third-party cookies loaded
162
+
163
+ WHY: Cookies often contain hidden auth/session data not visible in HTML.
164
+ Many login/auth issues are cookie-related (expired, wrong domain, httpOnly).
165
+
166
+ COMMON ISSUES DIAGNOSED:
167
+ - "User logged in but still see login page" → Check auth cookie
168
+ - "Cart items disappear" → Check session cookie
169
+ - "Preferences not saving" → Check settings cookie`
170
+ ```
171
+
172
+ ---
173
+
174
+ This pattern should be applied to ALL 84+ tools systematically.