Skip to content
14 changes: 7 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ ExplorBot (DI Container)
├── Planner
├── Pilot ←──────────┐
├── Tester ──────────┘ (Pilot supervises Tester)
├── Bosun → Researcher, Navigator drill components to learn interactions
├── Driller -> Navigator - drill components to learn interactions
├── Captain
├── Historian
├── ExperienceCompactor
Expand Down Expand Up @@ -255,7 +255,7 @@ All agents implement the `Agent` interface. Task-executing agents (Tester, Capta
- Planner — generate test scenarios
- Pilot — supervise test execution, detect stuck patterns, request user help
- Tester → Researcher, Navigator, Pilot, Historian*, Quartermaster* — execute tests with AI tools
- Bosun → Researcher, Navigator drill page components to learn interactions
- Driller -> Navigator - drill page components to learn interactions
- Captain → Historian*, Quartermaster* — handle user commands in TUI
- Historian — save test sessions, generate code, report to Testomatio
- ExperienceCompactor — compress experience files
Expand Down Expand Up @@ -412,10 +412,10 @@ import React from 'react';

There are application commands available in TUI

- /research [uri] - performs research on a current page or navigate to [uri] if uri is provided
- /plan <feature> - plan testing feature starting from current page
- /navigate <uri_or_state> - move to other page. Use AI to complete navigation
- /drill [--knowledge <path>] [--max <n>] - drill all components on page to learn interactions
* /research [uri] - performs research on a current page or navigate to [uri] if uri is provided
* /plan <feature> - plan testing feature starting from current page
* /navigate <uri_or_state> - move to other page. Use AI to complete navigation
* /drill [--knowledge <path>] [--max-components <n>] - drill all components on page to learn interactions

There are also CodeceptJS commands available:

Expand Down Expand Up @@ -451,7 +451,7 @@ explorbot plan /login authentication # plan with focus on authentication

```bash
explorbot drill <url> # drill all components on page
explorbot drill /components --max 10 # limit to 10 components
explorbot drill /components --max-components 10 # limit to 10 components
explorbot drill /login --knowledge /login # save to knowledge file
```

Expand Down
42 changes: 21 additions & 21 deletions bin/explorbot-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,32 +586,32 @@ addCommonOptions(program.command('research <url>').description('Research a page
}
);

addCommonOptions(program.command('drill <url>').description('Drill all components on a page to learn interactions').option('--knowledge <path>', 'Save learned interactions to knowledge file at this URL path').option('--max <count>', 'Maximum number of components to drill', '20')).action(
async (url, options) => {
try {
const explorBot = new ExplorBot(buildExplorBotOptions(url, options));
await explorBot.start();
addCommonOptions(
program.command('drill <url>').alias('driller').description('Drill all components on a page to learn interactions').option('--knowledge <path>', 'Save learned interactions to knowledge file at this URL path').option('--max-components <count>', 'Maximum number of components to drill')
).action(async (url, options) => {
try {
const explorBot = new ExplorBot(buildExplorBotOptions(url, options));
await explorBot.start();

await explorBot.visit(url);
await explorBot.visit(url);

const plan = await explorBot.agentBosun().drill({
knowledgePath: options.knowledge,
maxComponents: Number.parseInt(options.max, 10),
interactive: false,
});
const plan = await explorBot.agentDriller().drill({
knowledgePath: options.knowledge,
maxComponents: Number.parseInt(options.maxComponents || '30', 10),
interactive: false,
});

console.log(`\nDrill completed: ${plan.tests.length} components`);
console.log(`Successful: ${plan.tests.filter((t) => t.isSuccessful).length}`);
console.log(`Failed: ${plan.tests.filter((t) => t.hasFailed).length}`);
console.log(`\nDrill completed: ${plan.tests.length} components`);
console.log(`Successful: ${plan.tests.filter((t) => t.isSuccessful).length}`);
console.log(`Failed: ${plan.tests.filter((t) => t.hasFailed).length}`);

await explorBot.stop();
await showStatsAndExit(0);
} catch (error) {
console.error('Failed:', error instanceof Error ? error.message : 'Unknown error');
await showStatsAndExit(1);
}
await explorBot.stop();
await showStatsAndExit(0);
} catch (error) {
console.error('Failed:', error instanceof Error ? error.message : 'Unknown error');
await showStatsAndExit(1);
}
);
});

program
.command('context <url>')
Expand Down
3 changes: 2 additions & 1 deletion src/action-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,9 @@ export class ActionResult implements ActionResultData {
try {
const urlObj = new URL(this.url);
const path = urlObj.pathname.replace(/\/$/, '') || '/';
const search = urlObj.search || '';
const hash = urlObj.hash || '';
return path + hash;
return path + search + hash;
} catch {
// If URL parsing fails, assume it's already a relative URL
return this.url;
Expand Down
Loading
Loading