explorbot 0.2.3 → 0.2.4
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/README.md +1 -1
- package/bin/explorbot-cli.ts +7 -1
- package/boat/api-tester/src/config.ts +4 -2
- package/boat/doc-collector/bin/doc-collector-cli.ts +2 -0
- package/boat/doc-collector/src/ai/documentarian.ts +61 -31
- package/boat/doc-collector/src/config.ts +4 -2
- package/boat/prima/bin/prima-cli.ts +0 -0
- package/boat/prima/src/activity-line.ts +33 -0
- package/boat/prima/src/cli.ts +115 -86
- package/boat/prima/src/envelope.ts +80 -52
- package/boat/prima/src/prima.ts +547 -128
- package/boat/prima/src/pw-parser.ts +11 -1
- package/boat/prima/src/pw-registry.ts +4 -5
- package/boat/prima/src/session-log.ts +126 -0
- package/dist/bin/explorbot-cli.js +7 -1
- package/dist/boat/api-tester/bin/apibot-cli.js +2 -0
- package/dist/boat/api-tester/src/config.js +4 -2
- package/dist/boat/doc-collector/bin/doc-collector-cli.js +2 -0
- package/dist/boat/doc-collector/src/ai/documentarian.js +44 -19
- package/dist/boat/doc-collector/src/config.js +4 -2
- package/dist/boat/prima/src/activity-line.js +30 -0
- package/dist/boat/prima/src/cli.js +97 -77
- package/dist/boat/prima/src/envelope.js +70 -44
- package/dist/boat/prima/src/prima.js +515 -119
- package/dist/boat/prima/src/pw-parser.js +13 -1
- package/dist/boat/prima/src/pw-registry.js +4 -5
- package/dist/boat/prima/src/session-log.js +108 -0
- package/dist/package.json +3 -2
- package/dist/rules/navigator/verification-actions.md +20 -0
- package/dist/src/action-result.d.ts +7 -0
- package/dist/src/action-result.js +4 -0
- package/dist/src/action.d.ts +2 -0
- package/dist/src/action.js +36 -1
- package/dist/src/ai/captain/web-mode.js +6 -3
- package/dist/src/ai/captain.js +2 -0
- package/dist/src/ai/navigator.d.ts +7 -0
- package/dist/src/ai/navigator.js +10 -6
- package/dist/src/ai/pilot.d.ts +4 -0
- package/dist/src/ai/pilot.js +48 -2
- package/dist/src/ai/provider.js +2 -2
- package/dist/src/ai/rerunner.js +2 -1
- package/dist/src/ai/researcher.js +1 -1
- package/dist/src/ai/rules.js +17 -10
- package/dist/src/ai/task-agent.js +4 -1
- package/dist/src/ai/tester.d.ts +1 -1
- package/dist/src/ai/tester.js +33 -33
- package/dist/src/ai/tools.d.ts +14 -0
- package/dist/src/ai/tools.js +113 -36
- package/dist/src/config.d.ts +1 -0
- package/dist/src/config.js +13 -4
- package/dist/src/execution-controller.d.ts +2 -0
- package/dist/src/execution-controller.js +6 -0
- package/dist/src/explorbot.d.ts +2 -1
- package/dist/src/explorbot.js +3 -1
- package/dist/src/explorer.js +2 -3
- package/dist/src/playwright-recorder.js +30 -0
- package/dist/src/remote.d.ts +54 -0
- package/dist/src/remote.js +229 -0
- package/dist/src/reporter.d.ts +1 -0
- package/dist/src/reporter.js +7 -1
- package/dist/src/state-manager.d.ts +2 -1
- package/dist/src/stats.d.ts +1 -0
- package/dist/src/stats.js +1 -0
- package/dist/src/test-plan.d.ts +2 -0
- package/dist/src/test-plan.js +7 -0
- package/dist/src/utils/aria.d.ts +2 -8
- package/dist/src/utils/aria.js +69 -40
- package/dist/src/utils/html.js +1 -0
- package/dist/src/utils/logger.d.ts +6 -0
- package/dist/src/utils/logger.js +24 -0
- package/dist/src/utils/page-readiness.js +18 -1
- package/dist/src/utils/url-matcher.js +3 -0
- package/dist/src/utils/web-element.d.ts +2 -0
- package/dist/src/utils/web-element.js +8 -0
- package/dist/src/utils/web-sandbox.d.ts +1 -1
- package/dist/src/utils/web-sandbox.js +2 -3
- package/docs/api-testing/basics.md +90 -0
- package/docs/api-testing/planning.md +57 -0
- package/docs/api-testing/running-tests.md +55 -0
- package/docs/assets/cloud-report.png +0 -0
- package/docs/assets/html-report.png +0 -0
- package/docs/assets/langfuse-trace.png +0 -0
- package/docs/assets/successful-explore-run.png +0 -0
- package/docs/basics/getting-started.md +140 -0
- package/docs/basics/prerequisites.md +63 -0
- package/docs/basics/providers.md +362 -0
- package/docs/basics/running.md +78 -0
- package/docs/contributing/ai-integration-tests.md +57 -0
- package/docs/contributing/contributing.md +90 -0
- package/docs/contributing/demo-videos.md +36 -0
- package/docs/contributing/npm-package.md +138 -0
- package/docs/contributing/observability.md +227 -0
- package/docs/contributing/regression-tests.md +103 -0
- package/docs/contributing/testing.md +95 -0
- package/docs/doc-collection/basics.md +128 -0
- package/docs/doc-collection/crawling.md +67 -0
- package/docs/doc-collection/interactive-mode.md +99 -0
- package/docs/index.json +86 -0
- package/docs/reference/commands.md +994 -0
- package/docs/reference/configuration.md +569 -0
- package/docs/reference/scripting.md +303 -0
- package/docs/superpowers/plans/2026-08-01-actor-boat.md +925 -0
- package/docs/superpowers/plans/2026-08-01-prima-boat.md +1120 -0
- package/docs/superpowers/reviews/2026-08-06-prima-vs-playwright-cli.md +268 -0
- package/docs/superpowers/specs/2026-08-01-actor-boat-design.md +204 -0
- package/docs/superpowers/specs/2026-08-01-prima-boat-design.md +242 -0
- package/docs/superpowers/specs/2026-08-03-global-config-design.md +138 -0
- package/docs/superpowers/specs/2026-08-07-prima-fixes-design.md +394 -0
- package/docs/web-testing/agents.md +158 -0
- package/docs/web-testing/automated-tests.md +134 -0
- package/docs/web-testing/basics.md +91 -0
- package/docs/web-testing/customization.md +131 -0
- package/docs/web-testing/hooks.md +238 -0
- package/docs/web-testing/page-interaction.md +84 -0
- package/docs/web-testing/planner.md +122 -0
- package/docs/web-testing/rerun.md +164 -0
- package/docs/web-testing/researcher.md +380 -0
- package/docs/workflow/agentic-usage.md +233 -0
- package/docs/workflow/application-spec.md +73 -0
- package/docs/workflow/ci.md +202 -0
- package/docs/workflow/knowledge.md +310 -0
- package/docs/workflow/planning-styles.md +67 -0
- package/docs/workflow/reporting.md +133 -0
- package/docs/workflow/test-plans.md +90 -0
- package/package.json +3 -2
- package/rules/navigator/verification-actions.md +20 -0
- package/src/action-result.ts +11 -0
- package/src/action.ts +38 -2
- package/src/ai/captain/web-mode.ts +6 -3
- package/src/ai/captain.ts +3 -0
- package/src/ai/navigator.ts +14 -8
- package/src/ai/pilot.ts +53 -2
- package/src/ai/provider.ts +2 -4
- package/src/ai/rerunner.ts +2 -1
- package/src/ai/researcher.ts +1 -1
- package/src/ai/rules.ts +17 -10
- package/src/ai/task-agent.ts +3 -1
- package/src/ai/tester.ts +32 -33
- package/src/ai/tools.ts +132 -36
- package/src/config.ts +15 -4
- package/src/execution-controller.ts +8 -0
- package/src/explorbot.ts +4 -2
- package/src/explorer.ts +2 -2
- package/src/playwright-recorder.ts +23 -0
- package/src/remote.ts +238 -0
- package/src/reporter.ts +7 -1
- package/src/state-manager.ts +2 -1
- package/src/stats.ts +1 -0
- package/src/test-plan.ts +9 -0
- package/src/utils/aria.ts +65 -45
- package/src/utils/html.ts +1 -0
- package/src/utils/logger.ts +24 -1
- package/src/utils/page-readiness.ts +24 -1
- package/src/utils/url-matcher.ts +3 -0
- package/src/utils/web-element.ts +9 -0
- package/src/utils/web-sandbox.ts +3 -4
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
# Agentic Usage
|
|
2
|
+
|
|
3
|
+
Explorbot is a terminal command, so a coding agent — Claude Code, Cursor, Codex, or your own script — can drive it the same way it drives `git` or `npm`. This page covers the two things an agent needs: getting Explorbot configured once, and handing it a test plan it wrote itself.
|
|
4
|
+
|
|
5
|
+
The division of labour that works best: the agent decides *what* to test and writes it down as a plan; Explorbot figures out *how* to click through the app and reports what actually happened.
|
|
6
|
+
|
|
7
|
+
## Start here: the global installation
|
|
8
|
+
|
|
9
|
+
Configure models and keys once for the machine, and every later command works in any directory with no environment variables to remember:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx explorbot init --global --provider openrouter --api-key sk-...
|
|
13
|
+
npx explorbot explore https://app.example.com/login --max-tests 3
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`init --global` writes `~/.explorbot/config.js` with the recommended model ids of this Explorbot version and stores the key in `~/.explorbot/.env`. It needs no terminal — with `--provider` there is no wizard, so an agent can run it unattended.
|
|
17
|
+
|
|
18
|
+
The global config holds models and keys, never a site. Most commands carry the site themselves — `explore`, `plan`, `research`, `navigate`, `context`, `shell`, `freesail`, `docs collect`. The ones that take no URL argument — `test`, `learn`, `knows`, `experience`, `compact` — read it from `EXPLORBOT_URL`, and stop with `No site to explore` when it is unset:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
EXPLORBOT_URL=https://app.example.com npx explorbot learn "/login" 'Sign in as ${env.APP_USER}'
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
This is the form to prefer. Each site explored gets its own folder under `~/.explorbot/sites/<host>/` holding `knowledge/`, `experience/`, and `output/`, so what Explorbot learns about an app is still there on the next run — the agent that explored `/checkout` yesterday does not start from zero today. Later runs can name the site by host instead of repeating the URL:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx explorbot explore app.example.com/dashboard
|
|
28
|
+
npx explorbot sites # what is registered, and when it last ran
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The `EXPLORBOT_*` variables below still win over it: setting `EXPLORBOT_AI_PROVIDER` or `EXPLORBOT_AI_MODEL` builds the configuration from the environment and the global config is skipped. So an agent can install once and still override models or the URL per command.
|
|
32
|
+
|
|
33
|
+
## One-liner API
|
|
34
|
+
|
|
35
|
+
When nothing can be installed — a CI job, a container, someone else's machine — set `EXPLORBOT_AI_PROVIDER` and Explorbot builds a config from `EXPLORBOT_*` environment variables instead. Name a provider and you get its recommended models:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
EXPLORBOT_URL=https://app.example.com \
|
|
39
|
+
EXPLORBOT_AI_PROVIDER=openrouter \
|
|
40
|
+
npx explorbot explore /login --max-tests 3
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
No `init`, no config file, no project directory, no model IDs to look up. These variables win over the global installation, so a run can always be pinned to its own models. A project `explorbot.config.js` still wins over them, so adding these variables never changes the behavior of an existing project.
|
|
44
|
+
|
|
45
|
+
### Variables
|
|
46
|
+
|
|
47
|
+
<!-- START env -->
|
|
48
|
+
| Variable | Required | Meaning |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| `EXPLORBOT_AI_PROVIDER` | yes | Provider name; fills every model role from its recommended models. Turns on config-free mode |
|
|
51
|
+
| `EXPLORBOT_AI_MODEL` | no | Pins the main model — a model id for the provider, or a standalone provider/model-id |
|
|
52
|
+
| `EXPLORBOT_URL` | yes | Base URL to test; the API boat reads it as the base endpoint |
|
|
53
|
+
| `EXPLORBOT_VISION_MODEL` | no | Screenshot analysis; overrides the provider recommendation |
|
|
54
|
+
| `EXPLORBOT_AGENTIC_MODEL` | no | Captain and Pilot decisions; overrides the provider recommendation |
|
|
55
|
+
| `EXPLORBOT_OUTPUT` | no | Output root for states, plans, research, and reports. Defaults to the site dir under ~/.explorbot/sites |
|
|
56
|
+
| `EXPLORBOT_EPHEMERAL` | no | Keep no state between runs — output goes to a fresh temp directory instead of the site dir |
|
|
57
|
+
| `EXPLORBOT_KNOWLEDGE` | no | Inline knowledge text, applied to every page |
|
|
58
|
+
| `EXPLORBOT_KNOWLEDGE_FILE` | no | Path to a knowledge markdown file |
|
|
59
|
+
| `EXPLORBOT_API_SPEC` | no | OpenAPI spec path for the API boat |
|
|
60
|
+
| `EXPLORBOT_NO_BANNER` | no | Suppress the startup banner, for machine-readable output |
|
|
61
|
+
<!-- END env -->
|
|
62
|
+
|
|
63
|
+
`EXPLORBOT_URL` is optional when the command itself carries an absolute URL, as `docs collect https://…` does. The [API boat](../api-testing/basics.md) reads it as the base endpoint.
|
|
64
|
+
|
|
65
|
+
This table is generated from the registry in `src/config.ts`, which also feeds `explorbot --help` — so `npx explorbot --help` lists the same variables on any command, and an agent can discover them without reading these docs.
|
|
66
|
+
|
|
67
|
+
### Naming models
|
|
68
|
+
|
|
69
|
+
Set `EXPLORBOT_AI_PROVIDER` to a provider name and Explorbot uses that provider's recommended model for every role — the same IDs listed in [Providers](../basics/providers.md), maintained in [`models.json`](../../models.json):
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
EXPLORBOT_AI_PROVIDER=openrouter # model, visionModel, and agenticModel all filled in
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
This is the form to reach for when you do not care which model runs, only that the run works. Recommendations change as models are released, so a provider name keeps up while a pinned ID does not.
|
|
76
|
+
|
|
77
|
+
To pin the main model, add `EXPLORBOT_AI_MODEL`. With a provider set, it is the model id for that provider, used verbatim — slashes and all:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
EXPLORBOT_AI_PROVIDER=openrouter \
|
|
81
|
+
EXPLORBOT_AI_MODEL=openai/gpt-oss-120b:nitro \
|
|
82
|
+
npx explorbot explore /checkout
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
On its own, without a provider, `EXPLORBOT_AI_MODEL` must carry the provider as `provider/model-id`, and it sets only the main `model` — `visionModel` and `agenticModel` stay unset unless you add `EXPLORBOT_AI_PROVIDER` or set them explicitly. It splits on the **first** slash, so provider-qualified IDs survive intact:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
openrouter/openai/gpt-oss-120b:nitro → openrouter, model "openai/gpt-oss-120b:nitro"
|
|
89
|
+
groq/openai/gpt-oss-20b → groq, model "openai/gpt-oss-20b"
|
|
90
|
+
anthropic/claude-haiku-4-5-20251001 → anthropic, model "claude-haiku-4-5-20251001"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`EXPLORBOT_VISION_MODEL` and `EXPLORBOT_AGENTIC_MODEL` override those roles the same way — a provider name for its recommendation, or `provider/model-id` to pin one. Mix the forms to take a provider's recommendations and override one role:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
EXPLORBOT_AI_PROVIDER=groq \
|
|
97
|
+
EXPLORBOT_AGENTIC_MODEL=anthropic \
|
|
98
|
+
npx explorbot explore /checkout
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Supported providers: `openai`, `anthropic`, `google`, `groq`, `mistral`, `openrouter`, `sambanova`. Each is created with its conventional API-key variable — `OPENROUTER_API_KEY`, `GROQ_API_KEY`, `MISTRAL_API_KEY`, and so on.
|
|
102
|
+
|
|
103
|
+
Not every provider has a recommendation for every role — Anthropic is recommended only for `agenticModel`, since Claude models are accurate but costly for token-heavy page reading. Naming a provider that has no recommendation for a role you asked for is an error that names the role, so combine providers as in the example above.
|
|
104
|
+
|
|
105
|
+
A `.env` file in the working directory is loaded before the config lookup, so `EXPLORBOT_*` variables and API keys can live there instead of on the command line.
|
|
106
|
+
|
|
107
|
+
### Knowledge without a project
|
|
108
|
+
|
|
109
|
+
Both knowledge variables write into the run's knowledge directory, and both can be set at once.
|
|
110
|
+
|
|
111
|
+
`EXPLORBOT_KNOWLEDGE` is the fast path for credentials — it applies to every page:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
EXPLORBOT_KNOWLEDGE="Log in as admin@example.com / secret123. Dismiss the cookie banner first." \
|
|
115
|
+
EXPLORBOT_URL=https://app.example.com \
|
|
116
|
+
EXPLORBOT_AI_PROVIDER=openrouter \
|
|
117
|
+
npx explorbot explore /admin/users
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
`EXPLORBOT_KNOWLEDGE_FILE` points at a markdown file the agent wrote. Its frontmatter is preserved, so it can target specific URLs — see [Knowledge](./knowledge.md) for the format:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
EXPLORBOT_KNOWLEDGE_FILE=./checkout-knowledge.md npx explorbot explore /checkout
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### What this mode changes
|
|
127
|
+
|
|
128
|
+
Config-free runs leave no trace in the working directory:
|
|
129
|
+
|
|
130
|
+
- **Output goes to the site folder** — `~/.explorbot/sites/<host>/`, the same folder the global installation uses, so states, plans, research, and reports for one app collect in one place however the run was configured. `EXPLORBOT_OUTPUT` points them somewhere else. Read the path Explorbot resolved from the `Configuration built from EXPLORBOT_* environment variables. Output: …` line.
|
|
131
|
+
- **`EXPLORBOT_EPHEMERAL=1` keeps nothing between runs** — output goes to a fresh temp directory instead, for throwaway CI jobs and demos. The [prima boat](../reference/commands.md#prima-boat) exposes the same switch as `--ephemeral`.
|
|
132
|
+
- **Experience is written into the site folder.** What worked on a page is remembered and reused by later runs against the same host. `EXPLORBOT_EPHEMERAL=1` turns writing off, so an ephemeral run stays reproducible.
|
|
133
|
+
- **The Historian is off.** No generated CodeceptJS or Playwright test files — that is the one thing the global installation gives that this mode does not. Plans and reports are still written.
|
|
134
|
+
|
|
135
|
+
### Reading results
|
|
136
|
+
|
|
137
|
+
Everything lands under the output root:
|
|
138
|
+
|
|
139
|
+
| Path | Contents |
|
|
140
|
+
|---|---|
|
|
141
|
+
| `reports/<mode>-<session>.md` | Session report: coverage, defects, execution issues |
|
|
142
|
+
| `plans/<page>.md` | The plan that was generated or executed |
|
|
143
|
+
| `states/` | Per-state HTML, ARIA snapshots, and screenshots |
|
|
144
|
+
| `research/` | UI maps produced by the Researcher |
|
|
145
|
+
|
|
146
|
+
The report is the artifact to parse. It clusters findings by root cause and is written for a reader, not a machine.
|
|
147
|
+
|
|
148
|
+
`explore` and `test` exit `0` whenever the session completes, and non-zero only when the run itself fails to start — a failing scenario is a result, not a crash. Do not read pass/fail from their exit code; read the report. `navigate` is the exception and exits `1` when a URL is unreachable, which makes it a useful pre-flight check.
|
|
149
|
+
|
|
150
|
+
## Running agent-prepared plans
|
|
151
|
+
|
|
152
|
+
A [test plan](./test-plans.md) is plain markdown. An agent that has read the codebase usually knows what a feature is supposed to do better than an agent looking at rendered HTML, so writing the plan and executing it are worth separating.
|
|
153
|
+
|
|
154
|
+
Write the plan:
|
|
155
|
+
|
|
156
|
+
```markdown
|
|
157
|
+
<!-- suite -->
|
|
158
|
+
# Checkout
|
|
159
|
+
|
|
160
|
+
### Prerequisite
|
|
161
|
+
|
|
162
|
+
* URL: /cart
|
|
163
|
+
|
|
164
|
+
<!-- test
|
|
165
|
+
priority: critical
|
|
166
|
+
-->
|
|
167
|
+
# Customer completes checkout with a saved card
|
|
168
|
+
|
|
169
|
+
## Requirements
|
|
170
|
+
/cart
|
|
171
|
+
|
|
172
|
+
## Steps
|
|
173
|
+
* Proceed to checkout from the cart
|
|
174
|
+
* Pick the saved card as the payment method
|
|
175
|
+
* Confirm the order
|
|
176
|
+
|
|
177
|
+
## Expected
|
|
178
|
+
* The order confirmation page shows an order number
|
|
179
|
+
* The cart is empty afterwards
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Then hand it to Explorbot:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
EXPLORBOT_URL=https://app.example.com \
|
|
186
|
+
EXPLORBOT_AI_PROVIDER=openrouter \
|
|
187
|
+
npx explorbot test checkout-plan.md '*'
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
The index argument selects tests: `1`, `1,3`, `1-5`, or `*` for all. The plan file is input only — Explorbot never rewrites it, so plans stay in version control next to the code they cover.
|
|
191
|
+
|
|
192
|
+
Steps are guidance, not a script. The Tester adapts them to what the page actually shows, which is why steps should describe intent rather than selectors. Expected outcomes are the strict part: a test passes only when every one of them is verified. See the [Planner's outcome guidance](../web-testing/planner.md#built-in-styles) for what makes an outcome verifiable.
|
|
193
|
+
|
|
194
|
+
To have Explorbot invent the scenarios instead, run `explorbot plan <path>` and read the generated file from `plans/`.
|
|
195
|
+
|
|
196
|
+
## Inspecting a page without spending tokens
|
|
197
|
+
|
|
198
|
+
Two commands help an agent orient itself before committing to a run:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
npx explorbot context /login # URL, headings, knowledge, interactive elements
|
|
202
|
+
npx explorbot shell /login 'I.click("Sign in")' # run one CodeceptJS command
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
`context` makes no AI calls. Use it to check that a page loads, that login knowledge applies, and that the elements a plan assumes are actually there.
|
|
206
|
+
|
|
207
|
+
## The other boats
|
|
208
|
+
|
|
209
|
+
The same variables drive API testing and doc collection.
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
EXPLORBOT_URL=https://api.example.com \
|
|
213
|
+
EXPLORBOT_API_SPEC=./openapi.yaml \
|
|
214
|
+
EXPLORBOT_AI_PROVIDER=openrouter \
|
|
215
|
+
npx explorbot api explore
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
EXPLORBOT_AI_PROVIDER=openrouter \
|
|
220
|
+
npx explorbot docs collect https://app.example.com/dashboard --max-pages 20
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
`docs collect` takes its base URL from the absolute path argument, so `EXPLORBOT_URL` is optional there.
|
|
224
|
+
|
|
225
|
+
Knowledge written by `EXPLORBOT_KNOWLEDGE` carries `endpoint: '*'` frontmatter alongside `url: '*'`, matching the convention `api init` and `api know` use. The API boat does not read knowledge at runtime yet; the frontmatter is there for when it does, and the web side ignores it.
|
|
226
|
+
|
|
227
|
+
## See Also
|
|
228
|
+
|
|
229
|
+
- [Test Plans](./test-plans.md) — the plan format in full
|
|
230
|
+
- [Knowledge](./knowledge.md) — teaching Explorbot about your app
|
|
231
|
+
- [Commands](../reference/commands.md) — every CLI command
|
|
232
|
+
- [Continuous integration](./ci.md) — scheduled runs with cached experience
|
|
233
|
+
- [Scripting](../reference/scripting.md) — the programmatic API when a CLI call is not enough
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Application Specs
|
|
2
|
+
|
|
3
|
+
An application spec is a versioned Markdown bundle that gives Explorbot previously collected information about an application. It can be produced by Docbot, another documentation tool, or by hand.
|
|
4
|
+
|
|
5
|
+
Live HTML, ARIA, and screenshots remain the source of truth. Explorbot uses matching spec pages as supporting context and does not load the whole bundle into every prompt.
|
|
6
|
+
|
|
7
|
+
## Configure
|
|
8
|
+
|
|
9
|
+
Set the bundle directory in `explorbot.config.js`:
|
|
10
|
+
|
|
11
|
+
```javascript
|
|
12
|
+
export default {
|
|
13
|
+
dirs: {
|
|
14
|
+
spec: 'spec',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Paths are resolved from the project directory. Use `--spec <path>` on a web command to override the configured bundle for one run. Both the bundle directory and its `index.md` path are accepted.
|
|
20
|
+
|
|
21
|
+
## Bundle structure
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
spec/
|
|
25
|
+
|-- index.md
|
|
26
|
+
`-- pages/
|
|
27
|
+
|-- home.md
|
|
28
|
+
`-- users.md
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`index.md` is required and serves as a human-readable entry point. Its contents are not injected into agents. Page files may be nested anywhere below `pages/` and must use the contract below.
|
|
32
|
+
|
|
33
|
+
## Page contract
|
|
34
|
+
|
|
35
|
+
Every page is a Markdown file with YAML front matter:
|
|
36
|
+
|
|
37
|
+
```markdown
|
|
38
|
+
---
|
|
39
|
+
format: explorbot-application-spec
|
|
40
|
+
version: 1
|
|
41
|
+
url: /users
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
# Users
|
|
45
|
+
|
|
46
|
+
## Purpose
|
|
47
|
+
|
|
48
|
+
Lists the application's users.
|
|
49
|
+
|
|
50
|
+
## User Can
|
|
51
|
+
|
|
52
|
+
- user can search users by name
|
|
53
|
+
Proof: A search field is visible above the user list.
|
|
54
|
+
|
|
55
|
+
## User Might
|
|
56
|
+
|
|
57
|
+
- user might export the user list
|
|
58
|
+
Signal: An unlabeled download control is present.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The front matter fields are mandatory:
|
|
62
|
+
|
|
63
|
+
- `format` must be `explorbot-application-spec`.
|
|
64
|
+
- `version` must be `1`.
|
|
65
|
+
- `url` is the URL pattern used to select the page for the current browser state. It supports the same patterns as [knowledge files](./knowledge.md#url-patterns).
|
|
66
|
+
|
|
67
|
+
The Markdown body is supplied to agents as written, so headings beyond those shown above are allowed. Use `User Can` only for observed capabilities and transitions. Put inferred or unverified capabilities under `User Might`; Explorbot will require confirmation from the live UI before relying on them.
|
|
68
|
+
|
|
69
|
+
Screenshots and other relative links may be included for readers, but Explorbot currently consumes the Markdown text only.
|
|
70
|
+
|
|
71
|
+
## Validation
|
|
72
|
+
|
|
73
|
+
Explorbot rejects a bundle when `index.md` or `pages/` is missing, when it contains no page files, or when a page has an unsupported format, version, or missing URL.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# Continuous Integration
|
|
2
|
+
|
|
3
|
+
Once your Explorbot setup works locally — it logs in, explores, and produces sensible tests — the next step is to run it on a schedule, so the whole app gets re-tested continuously without anyone starting it by hand. This page shows what a CI run needs and gives a worked pipeline for the common providers. If you haven't run Explorbot headlessly yet, read [Running Explorbot](../basics/running.md) first.
|
|
4
|
+
|
|
5
|
+
## What a CI run needs
|
|
6
|
+
|
|
7
|
+
- **A provider API key from the environment.** Your local `.env` file is not in the repo; in CI, set the key (for example `OPENROUTER_API_KEY`) as a pipeline secret and pass it as an environment variable.
|
|
8
|
+
- **Playwright browsers.** Install them in the job: `npx playwright install --with-deps chromium`.
|
|
9
|
+
- **A headless browser.** That's the default — don't pass `--show` and there is nothing to configure.
|
|
10
|
+
- **A start path and a test budget.** `npx explorbot explore / --max-tests 10` keeps the run bounded and predictable.
|
|
11
|
+
- **A hard timeout as backstop.** AI runs can stall; a job-level timeout guarantees the pipeline never hangs.
|
|
12
|
+
|
|
13
|
+
For login, commit your `knowledge/` directory to the repo — it's the input you control, and Explorbot reads it on every run. Keep credentials out of the files with `${env.NAME}` interpolation, as described in [Knowledge](./knowledge.md), and set those variables as pipeline secrets too. Add `--session` to the run command so Explorbot logs in once and reuses the saved session.
|
|
14
|
+
|
|
15
|
+
## Cache, commit, or upload
|
|
16
|
+
|
|
17
|
+
Three directories, three fates:
|
|
18
|
+
|
|
19
|
+
- **Commit `knowledge/`.** It's authored by you and versioned like code.
|
|
20
|
+
- **Cache `experience/` and `output/`.** `experience/` carries lessons between runs — fewer repeated failures, faster runs — so a cached CI job gets smarter every night instead of starting from zero. `output/` carries `session.json` plus previous plans and generated tests; with `--configure` the next run reloads a saved plan and re-runs its tests regression-style instead of planning everything fresh (see the [`--configure` reference](../reference/commands.md#explore)).
|
|
21
|
+
- **Upload `output/reports/`, `output/tests/`, and `output/screencasts/` as artifacts.** Reports and screencasts are for humans to review after the run; generated tests are code you may want to review and commit. If you send results to Testomat.io with artifact storage, screencasts are already attached to tests there — see [Reporting on CI](#reporting-on-ci).
|
|
22
|
+
|
|
23
|
+
## Exit codes and gating
|
|
24
|
+
|
|
25
|
+
As covered in [Running Explorbot](../basics/running.md#exit-codes), `explore` exits `1` only when the run itself crashes — bad config, unreachable app, provider failure. Failing tests do not fail the job; they are findings, not crashes. So a green pipeline means "Explorbot ran", not "no bugs found".
|
|
26
|
+
|
|
27
|
+
To see what it found, read the session report in `output/reports/` — the Analyst writes a markdown summary that clusters defects by root cause. For per-test pass/fail in machine-checkable form, enable the markdown test report or send results to Testomat.io with the `TESTOMATIO` project key; both are described in [Reporting](./reporting.md). API tests are stricter: `api test` and `api explore` exit `1` when any test fails, so they gate natively.
|
|
28
|
+
|
|
29
|
+
## Reporting on CI
|
|
30
|
+
|
|
31
|
+
A scheduled run is only worth having if its results are easy to review the next morning. The recommended stack gives you a report you read top-down — start at the overview, drill into a failing test, watch exactly what happened:
|
|
32
|
+
|
|
33
|
+
1. **Send results to Testomat.io.** Add the `TESTOMATIO` project key as a pipeline secret. Every run lands in the dashboard with steps, statuses, and history — nothing to download from CI.
|
|
34
|
+
2. **Enable artifact storage.** Connect an S3-compatible bucket under Settings > Artifacts in Testomat.io (credentials via `S3_*` pipeline variables — see [artifacts in cloud reports](./reporting.md#artifacts-in-cloud-reports)). Screenshots and screencasts attached to tests upload automatically.
|
|
35
|
+
3. **Record screencasts.** Every test becomes a video with the executed actions and the current scenario step overlaid — reviewing one beats clicking through a screenshot trail.
|
|
36
|
+
4. **Enable the Analyst.** Its summary becomes the run description on Testomat.io, so the run opens with defects clustered by root cause, coverage, and what works.
|
|
37
|
+
|
|
38
|
+
The two config switches, next to your reporter settings:
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
export default {
|
|
42
|
+
ai: {
|
|
43
|
+
agents: {
|
|
44
|
+
historian: { screencast: true },
|
|
45
|
+
analyst: { enabled: true },
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
The review flow this buys: open the run, read the Analyst overview in the description, scan the failed tests, open one, watch its screencast.
|
|
52
|
+
|
|
53
|
+
Without the cloud reporter, the fallback is `html: true` and `markdown: true` under `reporter` plus uploading `output/reports/` and `output/screencasts/` as CI artifacts — the pipelines below do. You lose history and the overview-to-video flow, but every run is still reviewable.
|
|
54
|
+
|
|
55
|
+
**API runs** report through the same reporter, so the same `TESTOMATIO` key covers `api test` and `api explore`. There are no screencasts (no browser) and the Analyst covers web sessions only; upload `output/requests/` as a CI artifact instead — every request and response is logged there as YAML.
|
|
56
|
+
|
|
57
|
+
## GitHub Actions
|
|
58
|
+
|
|
59
|
+
A nightly run with caching, artifacts, and a manual trigger:
|
|
60
|
+
|
|
61
|
+
```yaml
|
|
62
|
+
name: Explorbot Nightly
|
|
63
|
+
|
|
64
|
+
on:
|
|
65
|
+
schedule:
|
|
66
|
+
- cron: '0 3 * * *'
|
|
67
|
+
workflow_dispatch:
|
|
68
|
+
|
|
69
|
+
jobs:
|
|
70
|
+
explore:
|
|
71
|
+
runs-on: ubuntu-latest
|
|
72
|
+
timeout-minutes: 60
|
|
73
|
+
steps:
|
|
74
|
+
- uses: actions/checkout@v4
|
|
75
|
+
|
|
76
|
+
- uses: actions/setup-node@v4
|
|
77
|
+
with:
|
|
78
|
+
node-version: 24
|
|
79
|
+
|
|
80
|
+
- run: npm ci
|
|
81
|
+
- run: npx playwright install --with-deps chromium
|
|
82
|
+
|
|
83
|
+
- uses: actions/cache@v4
|
|
84
|
+
with:
|
|
85
|
+
path: |
|
|
86
|
+
experience
|
|
87
|
+
output
|
|
88
|
+
key: explorbot-${{ github.run_id }}
|
|
89
|
+
restore-keys: |
|
|
90
|
+
explorbot-
|
|
91
|
+
|
|
92
|
+
- run: npx explorbot explore / --max-tests 10 --session
|
|
93
|
+
env:
|
|
94
|
+
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
|
|
95
|
+
|
|
96
|
+
- uses: actions/upload-artifact@v4
|
|
97
|
+
if: always()
|
|
98
|
+
with:
|
|
99
|
+
name: explorbot-results
|
|
100
|
+
path: |
|
|
101
|
+
output/reports
|
|
102
|
+
output/tests
|
|
103
|
+
output/screencasts
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The cache key includes the run id, so every run saves an updated cache and the next one restores the latest via `restore-keys`. To report runs to Testomat.io, add `TESTOMATIO: ${{ secrets.TESTOMATIO }}` to the `env` block — see [Reporting](./reporting.md).
|
|
107
|
+
|
|
108
|
+
## GitLab CI
|
|
109
|
+
|
|
110
|
+
Create the schedule under **CI/CD → Pipeline schedules** and set `OPENROUTER_API_KEY` as a masked CI/CD variable. The job itself:
|
|
111
|
+
|
|
112
|
+
```yaml
|
|
113
|
+
explorbot:
|
|
114
|
+
image: node:24
|
|
115
|
+
rules:
|
|
116
|
+
- if: $CI_PIPELINE_SOURCE == "schedule"
|
|
117
|
+
timeout: 1h
|
|
118
|
+
cache:
|
|
119
|
+
key: explorbot
|
|
120
|
+
paths:
|
|
121
|
+
- experience/
|
|
122
|
+
- output/
|
|
123
|
+
script:
|
|
124
|
+
- npm ci
|
|
125
|
+
- npx playwright install --with-deps chromium
|
|
126
|
+
- npx explorbot explore / --max-tests 10 --session
|
|
127
|
+
artifacts:
|
|
128
|
+
when: always
|
|
129
|
+
paths:
|
|
130
|
+
- output/reports/
|
|
131
|
+
- output/tests/
|
|
132
|
+
- output/screencasts/
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Jenkins
|
|
136
|
+
|
|
137
|
+
Jenkins has no built-in cross-run cache, but the workspace persists between builds on the same agent — so `experience/` and `output/` carry over as long as you don't wipe the workspace (skip `cleanWs`, or use the Job Cacher plugin on those two directories).
|
|
138
|
+
|
|
139
|
+
```groovy
|
|
140
|
+
pipeline {
|
|
141
|
+
agent any
|
|
142
|
+
triggers { cron('H 3 * * *') }
|
|
143
|
+
options { timeout(time: 60, unit: 'MINUTES') }
|
|
144
|
+
environment { OPENROUTER_API_KEY = credentials('openrouter-api-key') }
|
|
145
|
+
stages {
|
|
146
|
+
stage('Explore') {
|
|
147
|
+
steps {
|
|
148
|
+
sh 'npm ci'
|
|
149
|
+
sh 'npx playwright install --with-deps chromium'
|
|
150
|
+
sh 'npx explorbot explore / --max-tests 10 --session'
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
post {
|
|
155
|
+
always {
|
|
156
|
+
archiveArtifacts artifacts: 'output/reports/**, output/tests/**, output/screencasts/**', allowEmptyArchive: true
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Azure Pipelines
|
|
163
|
+
|
|
164
|
+
Scheduled triggers are declared in the pipeline itself; `always: true` runs it even without new commits. Set the API key as a secret pipeline variable. Azure caches one path per `Cache@2` task and keys are immutable, so use two tasks with the same rolling-key pattern as the GitHub example.
|
|
165
|
+
|
|
166
|
+
```yaml
|
|
167
|
+
schedules:
|
|
168
|
+
- cron: '0 3 * * *'
|
|
169
|
+
branches:
|
|
170
|
+
include: [main]
|
|
171
|
+
always: true
|
|
172
|
+
|
|
173
|
+
pool:
|
|
174
|
+
vmImage: ubuntu-latest
|
|
175
|
+
|
|
176
|
+
steps:
|
|
177
|
+
- task: NodeTool@0
|
|
178
|
+
inputs:
|
|
179
|
+
versionSpec: '24.x'
|
|
180
|
+
- task: Cache@2
|
|
181
|
+
inputs:
|
|
182
|
+
key: 'explorbot | "$(Build.BuildId)"'
|
|
183
|
+
restoreKeys: 'explorbot'
|
|
184
|
+
path: experience
|
|
185
|
+
- task: Cache@2
|
|
186
|
+
inputs:
|
|
187
|
+
key: 'explorbot-output | "$(Build.BuildId)"'
|
|
188
|
+
restoreKeys: 'explorbot-output'
|
|
189
|
+
path: output
|
|
190
|
+
- script: |
|
|
191
|
+
npm ci
|
|
192
|
+
npx playwright install --with-deps chromium
|
|
193
|
+
npx explorbot explore / --max-tests 10 --session
|
|
194
|
+
timeoutInMinutes: 60
|
|
195
|
+
env:
|
|
196
|
+
OPENROUTER_API_KEY: $(OPENROUTER_API_KEY)
|
|
197
|
+
- task: PublishPipelineArtifact@1
|
|
198
|
+
condition: always()
|
|
199
|
+
inputs:
|
|
200
|
+
targetPath: output/reports
|
|
201
|
+
artifact: explorbot-reports
|
|
202
|
+
```
|