explorbot 0.2.3 → 0.2.5

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 (174) hide show
  1. package/README.md +1 -1
  2. package/bin/explorbot-cli.ts +26 -8
  3. package/boat/api-tester/src/cli.ts +17 -0
  4. package/boat/api-tester/src/config.ts +4 -2
  5. package/boat/doc-collector/bin/doc-collector-cli.ts +2 -0
  6. package/boat/doc-collector/src/ai/documentarian.ts +61 -31
  7. package/boat/doc-collector/src/cli.ts +14 -1
  8. package/boat/doc-collector/src/config.ts +4 -2
  9. package/boat/prima/bin/prima-cli.ts +0 -0
  10. package/boat/prima/src/activity-line.ts +33 -0
  11. package/boat/prima/src/cli.ts +127 -86
  12. package/boat/prima/src/envelope.ts +102 -52
  13. package/boat/prima/src/prima.ts +567 -128
  14. package/boat/prima/src/pw-parser.ts +11 -1
  15. package/boat/prima/src/pw-registry.ts +4 -5
  16. package/boat/prima/src/session-log.ts +126 -0
  17. package/dist/bin/explorbot-cli.js +26 -8
  18. package/dist/boat/api-tester/bin/apibot-cli.js +2 -0
  19. package/dist/boat/api-tester/src/cli.js +17 -0
  20. package/dist/boat/api-tester/src/config.js +4 -2
  21. package/dist/boat/doc-collector/bin/doc-collector-cli.js +2 -0
  22. package/dist/boat/doc-collector/src/ai/documentarian.js +44 -19
  23. package/dist/boat/doc-collector/src/cli.js +14 -1
  24. package/dist/boat/doc-collector/src/config.js +4 -2
  25. package/dist/boat/prima/src/activity-line.js +30 -0
  26. package/dist/boat/prima/src/cli.js +109 -77
  27. package/dist/boat/prima/src/envelope.js +94 -44
  28. package/dist/boat/prima/src/prima.js +533 -119
  29. package/dist/boat/prima/src/pw-parser.js +13 -1
  30. package/dist/boat/prima/src/pw-registry.js +4 -5
  31. package/dist/boat/prima/src/session-log.js +108 -0
  32. package/dist/package.json +3 -2
  33. package/dist/rules/navigator/verification-actions.md +20 -0
  34. package/dist/src/action-result.d.ts +7 -0
  35. package/dist/src/action-result.js +4 -0
  36. package/dist/src/action.d.ts +2 -0
  37. package/dist/src/action.js +41 -2
  38. package/dist/src/ai/captain/web-mode.js +6 -3
  39. package/dist/src/ai/captain.js +2 -0
  40. package/dist/src/ai/navigator.d.ts +34 -0
  41. package/dist/src/ai/navigator.js +237 -181
  42. package/dist/src/ai/pilot.d.ts +7 -0
  43. package/dist/src/ai/pilot.js +90 -2
  44. package/dist/src/ai/provider.d.ts +2 -2
  45. package/dist/src/ai/provider.js +14 -23
  46. package/dist/src/ai/rerunner.js +2 -1
  47. package/dist/src/ai/researcher/cache.d.ts +2 -0
  48. package/dist/src/ai/researcher/cache.js +10 -2
  49. package/dist/src/ai/researcher.js +3 -2
  50. package/dist/src/ai/rules.js +17 -10
  51. package/dist/src/ai/session-analyst.js +2 -0
  52. package/dist/src/ai/task-agent.js +4 -1
  53. package/dist/src/ai/tester.d.ts +6 -3
  54. package/dist/src/ai/tester.js +50 -46
  55. package/dist/src/ai/tools.d.ts +14 -0
  56. package/dist/src/ai/tools.js +117 -37
  57. package/dist/src/commands/config-command.d.ts +51 -0
  58. package/dist/src/commands/config-command.js +117 -0
  59. package/dist/src/commands/index.js +2 -0
  60. package/dist/src/config.d.ts +9 -1
  61. package/dist/src/config.js +53 -4
  62. package/dist/src/execution-controller.d.ts +2 -0
  63. package/dist/src/execution-controller.js +6 -0
  64. package/dist/src/explorbot.d.ts +2 -1
  65. package/dist/src/explorbot.js +7 -2
  66. package/dist/src/explorer.js +2 -3
  67. package/dist/src/playwright-recorder.js +30 -0
  68. package/dist/src/remote.d.ts +55 -0
  69. package/dist/src/remote.js +235 -0
  70. package/dist/src/reporter.d.ts +1 -0
  71. package/dist/src/reporter.js +7 -1
  72. package/dist/src/state-manager.d.ts +2 -1
  73. package/dist/src/state-manager.js +3 -1
  74. package/dist/src/stats.d.ts +1 -0
  75. package/dist/src/stats.js +1 -0
  76. package/dist/src/test-plan.d.ts +3 -0
  77. package/dist/src/test-plan.js +26 -0
  78. package/dist/src/utils/aria.d.ts +2 -8
  79. package/dist/src/utils/aria.js +69 -40
  80. package/dist/src/utils/html.js +1 -0
  81. package/dist/src/utils/logger.d.ts +7 -1
  82. package/dist/src/utils/logger.js +32 -0
  83. package/dist/src/utils/page-readiness.js +18 -1
  84. package/dist/src/utils/url-matcher.js +3 -0
  85. package/dist/src/utils/web-element.d.ts +2 -0
  86. package/dist/src/utils/web-element.js +8 -0
  87. package/dist/src/utils/web-sandbox.d.ts +1 -1
  88. package/dist/src/utils/web-sandbox.js +2 -3
  89. package/docs/api-testing/basics.md +90 -0
  90. package/docs/api-testing/planning.md +57 -0
  91. package/docs/api-testing/running-tests.md +55 -0
  92. package/docs/assets/cloud-report.png +0 -0
  93. package/docs/assets/html-report.png +0 -0
  94. package/docs/assets/langfuse-trace.png +0 -0
  95. package/docs/assets/successful-explore-run.png +0 -0
  96. package/docs/basics/getting-started.md +140 -0
  97. package/docs/basics/prerequisites.md +63 -0
  98. package/docs/basics/providers.md +362 -0
  99. package/docs/basics/running.md +78 -0
  100. package/docs/contributing/ai-integration-tests.md +57 -0
  101. package/docs/contributing/contributing.md +90 -0
  102. package/docs/contributing/demo-videos.md +36 -0
  103. package/docs/contributing/npm-package.md +138 -0
  104. package/docs/contributing/observability.md +227 -0
  105. package/docs/contributing/regression-tests.md +103 -0
  106. package/docs/contributing/testing.md +95 -0
  107. package/docs/doc-collection/basics.md +128 -0
  108. package/docs/doc-collection/crawling.md +67 -0
  109. package/docs/doc-collection/interactive-mode.md +99 -0
  110. package/docs/index.json +87 -0
  111. package/docs/reference/commands.md +997 -0
  112. package/docs/reference/configuration.md +569 -0
  113. package/docs/reference/scripting.md +303 -0
  114. package/docs/reference/websocket.md +50 -0
  115. package/docs/superpowers/plans/2026-08-01-actor-boat.md +925 -0
  116. package/docs/superpowers/plans/2026-08-01-prima-boat.md +1120 -0
  117. package/docs/superpowers/reviews/2026-08-06-prima-vs-playwright-cli.md +268 -0
  118. package/docs/superpowers/specs/2026-08-01-actor-boat-design.md +204 -0
  119. package/docs/superpowers/specs/2026-08-01-prima-boat-design.md +242 -0
  120. package/docs/superpowers/specs/2026-08-03-global-config-design.md +138 -0
  121. package/docs/superpowers/specs/2026-08-07-prima-fixes-design.md +394 -0
  122. package/docs/superpowers/specs/2026-08-18-prima-false-verdicts.md +159 -0
  123. package/docs/web-testing/agents.md +158 -0
  124. package/docs/web-testing/automated-tests.md +134 -0
  125. package/docs/web-testing/basics.md +91 -0
  126. package/docs/web-testing/customization.md +131 -0
  127. package/docs/web-testing/hooks.md +238 -0
  128. package/docs/web-testing/page-interaction.md +84 -0
  129. package/docs/web-testing/planner.md +122 -0
  130. package/docs/web-testing/rerun.md +164 -0
  131. package/docs/web-testing/researcher.md +380 -0
  132. package/docs/workflow/agentic-usage.md +233 -0
  133. package/docs/workflow/application-spec.md +73 -0
  134. package/docs/workflow/ci.md +202 -0
  135. package/docs/workflow/knowledge.md +310 -0
  136. package/docs/workflow/planning-styles.md +67 -0
  137. package/docs/workflow/reporting.md +133 -0
  138. package/docs/workflow/test-plans.md +90 -0
  139. package/package.json +3 -2
  140. package/rules/navigator/verification-actions.md +20 -0
  141. package/src/action-result.ts +11 -0
  142. package/src/action.ts +43 -3
  143. package/src/ai/captain/web-mode.ts +6 -3
  144. package/src/ai/captain.ts +3 -0
  145. package/src/ai/navigator.ts +255 -186
  146. package/src/ai/pilot.ts +104 -2
  147. package/src/ai/provider.ts +14 -24
  148. package/src/ai/rerunner.ts +2 -1
  149. package/src/ai/researcher/cache.ts +12 -2
  150. package/src/ai/researcher.ts +3 -2
  151. package/src/ai/rules.ts +17 -10
  152. package/src/ai/session-analyst.ts +2 -0
  153. package/src/ai/task-agent.ts +3 -1
  154. package/src/ai/tester.ts +52 -45
  155. package/src/ai/tools.ts +136 -37
  156. package/src/commands/config-command.ts +146 -0
  157. package/src/commands/index.ts +2 -0
  158. package/src/config.ts +60 -5
  159. package/src/execution-controller.ts +8 -0
  160. package/src/explorbot.ts +7 -3
  161. package/src/explorer.ts +2 -2
  162. package/src/playwright-recorder.ts +23 -0
  163. package/src/remote.ts +244 -0
  164. package/src/reporter.ts +7 -1
  165. package/src/state-manager.ts +6 -2
  166. package/src/stats.ts +1 -0
  167. package/src/test-plan.ts +29 -0
  168. package/src/utils/aria.ts +65 -45
  169. package/src/utils/html.ts +1 -0
  170. package/src/utils/logger.ts +33 -2
  171. package/src/utils/page-readiness.ts +24 -1
  172. package/src/utils/url-matcher.ts +3 -0
  173. package/src/utils/web-element.ts +9 -0
  174. package/src/utils/web-sandbox.ts +3 -4
@@ -0,0 +1,569 @@
1
+ # Configuration
2
+
3
+ Explorbot reads its settings from `explorbot.config.js` or `explorbot.config.ts` in your project root.
4
+
5
+ ## Quick start
6
+
7
+ ```javascript
8
+ import { createGroq } from '@ai-sdk/groq';
9
+
10
+ const groq = createGroq({
11
+ apiKey: process.env.GROQ_API_KEY,
12
+ });
13
+
14
+ export default {
15
+ web: {
16
+ url: 'http://localhost:3000',
17
+ },
18
+ ai: {
19
+ model: groq('openai/gpt-oss-20b'),
20
+ },
21
+ };
22
+ ```
23
+
24
+ To set up a provider — OpenAI, Anthropic, Groq, Cerebras, Google, or Azure — see [AI providers](../basics/providers.md).
25
+
26
+ ## Rules
27
+
28
+ Rules are markdown files that change how an agent behaves. They live in `rules/`, one folder per agent:
29
+
30
+ ```
31
+ rules/
32
+ researcher/ # Rules for the Researcher agent
33
+ check-tooltips.md
34
+ tester/ # Rules for the Tester agent
35
+ wait-for-toasts.md
36
+ admin-credentials.md
37
+ planner/ # Rules + styles for the Planner agent
38
+ no-delete-tests.md
39
+ styles/
40
+ normal.md
41
+ psycho.md
42
+ curious.md
43
+ ```
44
+
45
+ Each rule file is plain markdown. Its content is appended to the agent's prompt.
46
+
47
+ ### Configuring rules
48
+
49
+ Add a `rules` array to any agent's config. Each entry is either a filename (loads for all URLs) or an object mapping a URL pattern to a filename:
50
+
51
+ ```javascript
52
+ ai: {
53
+ agents: {
54
+ tester: {
55
+ rules: [
56
+ 'wait-for-toasts', // loads rules/tester/wait-for-toasts.md for all URLs
57
+ { '/admin/*': 'admin-credentials' }, // loads rules/tester/admin-credentials.md only on /admin pages
58
+ ],
59
+ },
60
+ researcher: {
61
+ rules: [
62
+ 'check-tooltips', // loads rules/researcher/check-tooltips.md
63
+ { '/users/*': 'user-testing' }, // loads rules/researcher/user-testing.md for /users and subpages
64
+ ],
65
+ },
66
+ planner: {
67
+ rules: [
68
+ { '/checkout/*': 'payment-rules' }, // loads rules/planner/payment-rules.md for checkout pages
69
+ ],
70
+ },
71
+ },
72
+ }
73
+ ```
74
+
75
+ URL patterns work the same as [knowledge files](../workflow/knowledge.md#url-patterns): `*`, `/exact`, `/path/*`, `^regex$`, and glob patterns.
76
+
77
+ ### Planning styles
78
+
79
+ The Planner and Chief agents cycle through styles — different testing approaches applied on each planning round. Built-in styles are `normal`, `psycho` (stress-testing), and `curious` (coverage gaps).
80
+
81
+ To change a style, extract the built-in ones and edit them:
82
+
83
+ ```bash
84
+ npx explorbot extract-rules planner
85
+ ```
86
+
87
+ This copies the planner's built-in rules, including the `styles/` folder, to `rules/planner/`. Edit them freely. Explorbot loads your `rules/` directory first and falls back to the built-in styles.
88
+
89
+ Set which styles to use, and their order, in config:
90
+
91
+ ```javascript
92
+ ai: {
93
+ agents: {
94
+ planner: {
95
+ styles: ['normal', 'psycho', 'curious'], // default order
96
+ },
97
+ },
98
+ }
99
+ ```
100
+
101
+ ### Rules vs knowledge vs systemPrompt
102
+
103
+ | Mechanism | Purpose | URL-aware | File-based |
104
+ |-----------|---------|-----------|------------|
105
+ | **Rules** | Agent-specific instructions | Yes | Yes (`rules/<agent>/`) |
106
+ | **Knowledge** | App domain info (credentials, data) | Yes | Yes (`knowledge/`) |
107
+ | **systemPrompt** | Quick inline instructions | No | No (in config) |
108
+
109
+ Rules and `systemPrompt` work together: rules from files load first, then `systemPrompt` is appended.
110
+
111
+ ## Tips
112
+
113
+ ### Handle slow pages
114
+
115
+ ```javascript
116
+ playwright: {
117
+ timeout: 60000,
118
+ waitForNavigation: 'networkidle',
119
+ }
120
+ ```
121
+
122
+ ### Use cheaper models for simple tasks
123
+
124
+ ```javascript
125
+ ai: {
126
+ model: groq('openai/gpt-oss-20b'), // Default: fast and smart model
127
+ agents: {
128
+ // Fastest model for summarization
129
+ 'experience-compactor': { model: groq('llama-3.1-8b-instant') },
130
+ },
131
+ }
132
+ ```
133
+
134
+ ### Run in Docker or CI
135
+
136
+ ```javascript
137
+ playwright: {
138
+ show: false,
139
+ args: [
140
+ '--no-sandbox',
141
+ '--disable-gpu',
142
+ '--disable-dev-shm-usage',
143
+ ],
144
+ }
145
+ ```
146
+
147
+ ### Trace AI calls with Langfuse
148
+
149
+ ```javascript
150
+ ai: {
151
+ langfuse: {
152
+ enabled: true,
153
+ publicKey: process.env.LANGFUSE_PUBLIC_KEY,
154
+ secretKey: process.env.LANGFUSE_SECRET_KEY,
155
+ },
156
+ }
157
+ ```
158
+
159
+ See [Observability](../contributing/observability.md) for details.
160
+
161
+ ## Agent configuration
162
+
163
+ Each agent takes its own model and system prompt.
164
+
165
+ ### Available agents
166
+
167
+ | Agent | Purpose |
168
+ |-------|---------|
169
+ | `tester` | Executes test scenarios |
170
+ | `planner` | Generates test plans |
171
+ | `researcher` | Analyzes page structure |
172
+ | `navigator` | Handles browser navigation |
173
+ | `pilot` | Supervises test execution, detects stuck patterns |
174
+ | `driller` | Drills page components to learn interactions |
175
+ | `captain` | Orchestrates user commands |
176
+ | `experience-compactor` | Compresses experience data |
177
+ | `quartermaster` | Accessibility analysis |
178
+ | `historian` | Session recording, generates CodeceptJS or Playwright test files |
179
+ | `rerunner` | Heals failing steps when re-running generated tests |
180
+ | `analyst` | Writes the end-of-session markdown report |
181
+ | `fisherman` | Prepares test data through API requests |
182
+ | `chief` | API test planning |
183
+ | `curler` | API test execution |
184
+
185
+ ### Agent options
186
+
187
+ ```javascript
188
+ agents: {
189
+ tester: {
190
+ model: groq('openai/gpt-oss-20b'), // Override default model
191
+ enabled: true, // Enable/disable agent
192
+ rules: ['wait-for-toasts'], // Load rules from rules/tester/
193
+ systemPrompt: '...', // Append to system prompt (inline)
194
+ beforeHook: { /* ... */ }, // Run before agent executes
195
+ afterHook: { /* ... */ }, // Run after agent completes
196
+ },
197
+ }
198
+ ```
199
+
200
+ | Option | Type | Description |
201
+ |--------|------|-------------|
202
+ | `model` | `LanguageModel` | Model instance for this agent (overrides default) |
203
+ | `enabled` | `boolean` | Enable or disable the agent |
204
+ | `rules` | `Array<string \| Record<string, string>>` | Rule files to load from `rules/<agent>/` (URL-aware). See [Rules](#rules) |
205
+ | `systemPrompt` | `string` | Additional instructions appended to the agent's prompt (inline fallback) |
206
+ | `beforeHook` | `Hook \| HookPatternMap` | Code to run before agent execution |
207
+ | `afterHook` | `Hook \| HookPatternMap` | Code to run after agent execution |
208
+
209
+ Some agents take extra options: `pilot` accepts `stepsToReview` (recent steps reviewed per check, default 5); `planner` accepts `styles` (see [Planning styles](#planning-styles)); `rerunner` accepts `healLimit` (max heal attempts, default 3) and `recipes` (custom heal recipes, see [Rerunning Tests](../web-testing/rerun.md)). Researcher and Historian options are documented below.
210
+
211
+ See [Agent hooks](../web-testing/hooks.md) for hook configuration.
212
+
213
+ ### Researcher agent options
214
+
215
+ The Researcher takes all standard agent options plus options that control interactive exploration:
216
+
217
+ | Option | Type | Description |
218
+ |--------|------|-------------|
219
+ | `maxExpandableClicks` | `number` | Maximum expandable elements clicked during deep analysis (default: 10) |
220
+ | `errorPageTimeout` | `number` | Seconds to wait for a loading page to settle before error-page detection (default: 10, `0` disables the wait) |
221
+ | `focusSections` | `string[]` | CSS selectors that narrow research to a matching element when present (e.g. an open modal or drawer). First match wins. Applies only to the per-section fallback used after a truncated research response. |
222
+
223
+ ```javascript
224
+ ai: {
225
+ agents: {
226
+ researcher: {
227
+ maxExpandableClicks: 15,
228
+ focusSections: ['[role="dialog"]'],
229
+ },
230
+ },
231
+ }
232
+ ```
233
+
234
+ See [Researcher agent](../web-testing/researcher.md) for full documentation and examples.
235
+
236
+ ### Historian agent options
237
+
238
+ | Option | Type | Description |
239
+ |--------|------|-------------|
240
+ | `framework` | `'codeceptjs' \| 'playwright'` | Output format for generated test files. Default: `'codeceptjs'`. |
241
+
242
+ ```javascript
243
+ ai: {
244
+ agents: {
245
+ historian: {
246
+ framework: 'playwright',
247
+ },
248
+ },
249
+ }
250
+ ```
251
+
252
+ With `'playwright'`, runs are saved as `@playwright/test` `.spec.ts` files using the actual Playwright calls captured at runtime. See [Automated tests](../web-testing/automated-tests.md).
253
+
254
+ See [AI providers](../basics/providers.md) for recommended models and provider setup.
255
+
256
+ ## Playwright settings
257
+
258
+ ### Browser selection
259
+
260
+ ```javascript
261
+ playwright: {
262
+ browser: 'chromium', // Most compatible
263
+ // browser: 'firefox', // Better privacy testing
264
+ // browser: 'webkit', // Safari/iOS testing
265
+ }
266
+ ```
267
+
268
+ ### Viewport and window size
269
+
270
+ ```javascript
271
+ playwright: {
272
+ windowSize: '1920x1080',
273
+ viewport: {
274
+ width: 1920,
275
+ height: 1080,
276
+ },
277
+ }
278
+ ```
279
+
280
+ ### Browser context options
281
+
282
+ ```javascript
283
+ playwright: {
284
+ ignoreHTTPSErrors: true,
285
+ bypassCSP: true,
286
+ userAgent: 'Mozilla/5.0 (Explorbot)',
287
+ locale: 'en-GB',
288
+ colorScheme: 'dark',
289
+ basicAuth: { username: 'user', password: 'pass' },
290
+ emulate: { ...devices['iPhone 13'] },
291
+ }
292
+ ```
293
+
294
+ The browser session (cookies, localStorage) is restored when you launch with `--session` — see [commands.md](./commands.md#--session).
295
+
296
+ ### Loading Indicators
297
+
298
+ For SPAs, `domcontentloaded` can happen before the application finishes loading page data. Use `spinnerSelectors` to tell Explorbot which loading indicators should be treated as part of page readiness:
299
+
300
+ ```javascript
301
+ playwright: {
302
+ waitForTimeout: 5000,
303
+ spinnerSelectors: ['.spinner', '.loading', '[aria-busy="true"]'],
304
+ }
305
+ ```
306
+
307
+ Explorbot waits for `domcontentloaded`, then races Playwright `networkidle`, visible configured spinners becoming hidden, or timeout before capturing the page state. If no configured spinner is visible on a page, the spinner rule is ignored for that page.
308
+
309
+ ## Directory Structure
310
+
311
+ The default layout:
312
+
313
+ ```
314
+ your-project/
315
+ ├── explorbot.config.js
316
+ ├── knowledge/ # Domain hints (you create these)
317
+ │ └── login.md
318
+ ├── rules/ # Agent-specific rules (you create these)
319
+ │ ├── tester/
320
+ │ │ └── wait-for-toasts.md
321
+ │ └── planner/
322
+ │ └── styles/ # Custom planning styles
323
+ ├── experience/ # Learned patterns (auto-generated)
324
+ │ └── abc123.md
325
+ └── output/ # Test results (auto-generated)
326
+ ├── states/
327
+ ├── research/
328
+ ├── plans/
329
+ ├── tests/
330
+ ├── reports/
331
+ └── docs/
332
+ ```
333
+
334
+ Change the paths:
335
+
336
+ ```javascript
337
+ dirs: {
338
+ spec: './test/spec',
339
+ knowledge: './test/knowledge',
340
+ experience: './test/experience',
341
+ output: './test/output',
342
+ }
343
+ ```
344
+
345
+ ## Environment variables
346
+
347
+ Keep secrets in environment variables:
348
+
349
+ ```bash
350
+ # .env
351
+ GROQ_API_KEY=gsk_...
352
+ LANGFUSE_PUBLIC_KEY=pk-...
353
+ LANGFUSE_SECRET_KEY=sk-...
354
+ ```
355
+
356
+ Reference them in config:
357
+
358
+ ```javascript
359
+ const groq = createGroq({ apiKey: process.env.GROQ_API_KEY });
360
+
361
+ export default {
362
+ ai: {
363
+ model: groq('openai/gpt-oss-20b'),
364
+ langfuse: {
365
+ enabled: true,
366
+ publicKey: process.env.LANGFUSE_PUBLIC_KEY,
367
+ secretKey: process.env.LANGFUSE_SECRET_KEY,
368
+ },
369
+ },
370
+ };
371
+ ```
372
+
373
+ ## Config file locations
374
+
375
+ Explorbot looks for a config file in this order:
376
+
377
+ 1. `explorbot.config.js`
378
+ 2. `explorbot.config.mjs`
379
+ 3. `explorbot.config.ts`
380
+ 4. `config/explorbot.config.js`
381
+ 5. `config/explorbot.config.mjs`
382
+ 6. `config/explorbot.config.ts`
383
+ 7. `src/config/explorbot.config.js`
384
+ 8. `src/config/explorbot.config.mjs`
385
+ 9. `src/config/explorbot.config.ts`
386
+ 10. `~/.explorbot/config.js` (or `.mjs`, `.ts`) — the global installation
387
+
388
+ Or pass a custom path:
389
+
390
+ ```bash
391
+ npx explorbot explore /dashboard --config ./custom/path/config.js
392
+ ```
393
+
394
+ The `EXPLORBOT_*` variables sit between the two files: they are used when the working directory has no config of its own, and they win over the global installation, so a machine-wide setup never overrides what a single command asked for. Whatever wins is used as a whole — configs never merge with each other.
395
+
396
+ Env files fill in rather than override: the `.env` of the working directory is read first, then `~/.explorbot/.env` supplies only the keys still unset, so a project key and a real environment variable both beat a global one.
397
+
398
+ ### Running from anywhere: the global installation
399
+
400
+ `npx explorbot init --global` configures AI models and keys once in `~/.explorbot`, so explorbot commands work in any directory without a project. Every explored site gets its own folder that persists between runs:
401
+
402
+ ```
403
+ ~/.explorbot/
404
+ ├── config.js # AI models and keys, no URL
405
+ ├── .env
406
+ └── sites/
407
+ ├── app.example.com/
408
+ │ ├── site.json # base URL, first and last run
409
+ │ ├── knowledge/
410
+ │ ├── experience/
411
+ │ └── output/ # states, plans, reports, tests
412
+ └── localhost_3000/
413
+ ```
414
+
415
+ The folder name is the host and port of the site, lowercased, with characters invalid in directory names replaced by `_`.
416
+
417
+ Global mode runs with full project semantics — experience is read and written, the Historian saves generated tests, reports land in the site's `output/` — so the tool keeps learning your app across runs.
418
+
419
+ The site comes from the URL of the command, or from `EXPLORBOT_URL`:
420
+
421
+ ```bash
422
+ npx explorbot explore https://app.example.com/login # registers the site on first visit
423
+ npx explorbot explore app.example.com/dashboard # later runs: reference it by host
424
+ npx explorbot sites # list registered sites
425
+ ```
426
+
427
+ A `dirs` section in the global config is ignored in favor of the layout above. A `web.url` is allowed and acts as the default site for commands that pass no URL of their own.
428
+
429
+ ### Running without a config file
430
+
431
+ When the working directory has no config file and `EXPLORBOT_AI_PROVIDER` (or `EXPLORBOT_AI_MODEL`) is set, Explorbot synthesizes a configuration from `EXPLORBOT_*` environment variables, in preference to a global installation. Output goes to the site folder `~/.explorbot/sites/<host>/` (`EXPLORBOT_OUTPUT` overrides it, `EXPLORBOT_EPHEMERAL=1` sends it to a temp directory instead), experience is written there and reused by later runs against the same host unless the run is ephemeral, and the Historian is off. This is meant for one-liner CI jobs, demos, and coding agents — see [Agentic Usage](../workflow/agentic-usage.md) for the variable list and the trade-offs.
432
+
433
+ ## Full configuration reference
434
+
435
+ ```javascript
436
+ export default {
437
+ // Application URL (required — or set playwright.url instead)
438
+ web: {
439
+ url: 'http://localhost:3000',
440
+ },
441
+
442
+ // API testing (optional)
443
+ api: {
444
+ baseEndpoint: 'http://localhost:3000/api/v1',
445
+ spec: ['http://localhost:3000/api/openapi.json'],
446
+ headers: { 'Content-Type': 'application/json' },
447
+ // bootstrap: async ({ headers, baseEndpoint }) => { ... },
448
+ // teardown: async ({ headers, baseEndpoint }) => { ... },
449
+ },
450
+
451
+ // Browser automation settings (url is inherited from web.url if not set)
452
+ playwright: {
453
+ browser: 'chromium', // 'chromium' | 'firefox' | 'webkit'
454
+ show: false, // Show browser window
455
+ windowSize: '1280x720', // Browser window size
456
+ slowMo: 0, // Slow down actions (ms)
457
+ timeout: 30000, // Default timeout (ms)
458
+ waitForNavigation: 'load', // 'load' | 'domcontentloaded' | 'networkidle'
459
+ waitForTimeout: 1000, // Wait after navigation (ms)
460
+ spinnerSelectors: [], // Loading indicators to wait for before page capture
461
+ ignoreHTTPSErrors: false, // Ignore HTTPS certificate errors
462
+ userAgent: 'custom-agent', // Custom user agent string
463
+ viewport: {
464
+ width: 1280,
465
+ height: 720,
466
+ },
467
+ args: ['--disable-gpu'], // Browser launch arguments
468
+ chromium: { args: [] }, // Chromium-specific args
469
+ firefox: { args: [] }, // Firefox-specific args
470
+ webkit: { args: [] }, // WebKit-specific args
471
+ },
472
+
473
+ // AI provider settings
474
+ ai: {
475
+ model: groq('openai/gpt-oss-20b'), // Default model instance (required)
476
+ visionModel: groq('meta-llama/llama-4-scout-17b-16e-instruct'), // Model for screenshot analysis; setting it enables vision features
477
+ config: {}, // Additional provider config
478
+ langfuse: { // Observability settings
479
+ enabled: true,
480
+ publicKey: 'pk-...',
481
+ secretKey: 'sk-...',
482
+ baseUrl: 'https://cloud.langfuse.com',
483
+ },
484
+ agents: { // Per-agent configuration
485
+ tester: {
486
+ model: groq('openai/gpt-oss-20b'),
487
+ enabled: true,
488
+ rules: ['wait-for-toasts', { '/admin/*': 'admin-creds' }],
489
+ systemPrompt: '...', // Inline fallback
490
+ },
491
+ planner: {
492
+ styles: ['normal', 'psycho', 'curious'],
493
+ rules: [{ '/checkout/*': 'payment-rules' }],
494
+ },
495
+ researcher: { // Researcher-specific options
496
+ model: groq('openai/gpt-oss-20b'), // Override default model
497
+ enabled: true, // Enable/disable agent
498
+ systemPrompt: '...', // Additional instructions
499
+ maxExpandableClicks: 10, // Max expandable elements clicked in deep analysis
500
+ errorPageTimeout: 10, // Seconds to wait for page to settle (0 disables)
501
+ focusSections: [], // CSS selectors that narrow per-section research
502
+ },
503
+ pilot: { stepsToReview: 5 }, // Recent steps the Pilot reviews
504
+ navigator: { /* ... */ },
505
+ captain: { /* ... */ },
506
+ driller: { /* ... */ },
507
+ 'experience-compactor': { /* ... */ },
508
+ quartermaster: { /* ... */ },
509
+ historian: { /* ... */ },
510
+ fisherman: { /* ... */ },
511
+ rerunner: { /* ... */ },
512
+ analyst: { /* ... */ },
513
+ },
514
+ },
515
+
516
+ // HTML processing settings
517
+ html: {
518
+ minimal: {
519
+ include: ['form', 'button', 'input'],
520
+ exclude: ['script', 'style'],
521
+ },
522
+ combined: {
523
+ include: ['*'],
524
+ exclude: ['script', 'style', 'svg'],
525
+ },
526
+ text: {
527
+ include: ['p', 'h1', 'h2', 'h3', 'span'],
528
+ exclude: ['nav', 'footer'],
529
+ },
530
+ },
531
+
532
+ // Action execution settings
533
+ action: {
534
+ delay: 1000, // Delay between actions (ms)
535
+ retries: 3, // Retry failed actions
536
+ timeout: 3000, // Max time a single click/fill may block (ms)
537
+ },
538
+
539
+ // Regex to detect dynamic URL segments (IDs, slugs) for plan deduplication
540
+ // Built-in patterns (numeric, UUID, ULID, hex) are always active
541
+ // dynamicPageRegex: 'your-custom-pattern',
542
+
543
+ // Directory paths
544
+ dirs: {
545
+ spec: 'spec', // Application specification bundle
546
+ knowledge: 'knowledge', // Domain knowledge files
547
+ experience: 'experience', // Learned patterns
548
+ output: 'output', // Test results and logs
549
+ },
550
+
551
+ // Experience recording
552
+ experience: {
553
+ disabled: true, // Stop writing experience; reading still works
554
+ maxReadLines: 100, // Lines of experience injected into prompts
555
+ },
556
+ };
557
+ ```
558
+
559
+ ## See also
560
+
561
+ - [API testing](../api-testing/basics.md) — API testing setup and commands
562
+ - [AI providers](../basics/providers.md) — provider setup examples
563
+ - [Agents](../web-testing/agents.md) — agent descriptions and workflows
564
+ - [Agent hooks](../web-testing/hooks.md) — custom code before and after an agent runs
565
+ - [Researcher agent](../web-testing/researcher.md) — Researcher configuration and usage
566
+ - [Planner agent](../web-testing/planner.md) — planning styles and customization
567
+ - [Knowledge files](../workflow/knowledge.md) — domain knowledge format
568
+ - [Application specs](../workflow/application-spec.md) — reusable application documentation format
569
+ - [Observability](../contributing/observability.md) — Langfuse integration