explorbot 0.5.9 → 0.5.10
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 +2 -1
- package/boat/api-tester/src/commands/init-command.ts +2 -0
- package/boat/doc-collector/bin/doc-collector-cli.ts +2 -1
- package/boat/prima/bin/prima-cli.ts +2 -1
- package/dist/bin/explorbot-cli.js +2 -1
- package/dist/boat/api-tester/bin/apibot-cli.js +2 -1
- package/dist/boat/api-tester/src/commands/init-command.js +2 -0
- package/dist/boat/doc-collector/bin/doc-collector-cli.js +2 -1
- package/dist/boat/prima/bin/prima-cli.js +2 -1
- package/dist/package.json +1 -1
- package/dist/src/commands/init-command.js +4 -0
- package/dist/src/commands/options/auth-option.d.ts +6 -0
- package/dist/src/commands/options/auth-option.js +14 -0
- package/dist/src/commands/options/index.d.ts +2 -0
- package/dist/src/commands/options/index.js +2 -0
- package/dist/src/config.js +1 -0
- package/docs/reference/commands.md +12 -0
- package/docs/workflow/agentic-usage.md +7 -0
- package/docs/workflow/knowledge.md +6 -0
- package/package.json +1 -1
- package/src/commands/init-command.ts +5 -0
- package/src/commands/options/auth-option.ts +15 -0
- package/src/commands/options/index.ts +2 -0
- package/src/config.ts +1 -0
package/README.md
CHANGED
|
@@ -137,7 +137,7 @@ For a CI job, a demo, or a coding agent, pass everything as environment variable
|
|
|
137
137
|
```bash
|
|
138
138
|
EXPLORBOT_URL=https://app.example.com \
|
|
139
139
|
EXPLORBOT_AI_PROVIDER=openrouter \
|
|
140
|
-
|
|
140
|
+
EXPLORBOT_AUTH="login: admin@example.com password: secret123" \
|
|
141
141
|
npx explorbot explore /admin/users --max-tests 3
|
|
142
142
|
```
|
|
143
143
|
|
package/bin/explorbot-cli.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { HelpJsonCommand } from '../src/commands/help-json-command.js';
|
|
|
12
12
|
import { RecommendedModelsCommand } from '../src/commands/recommended-models-command.js';
|
|
13
13
|
import { App } from '../src/components/App.js';
|
|
14
14
|
import { StatusPane } from '../src/components/StatusPane.js';
|
|
15
|
-
import { decisionModelOption, knowledgeOption, wsOption } from '../src/commands/options/index.js';
|
|
15
|
+
import { authOption, decisionModelOption, knowledgeOption, wsOption } from '../src/commands/options/index.js';
|
|
16
16
|
import { ConfigParser, EXPLORBOT_ENV_VARS, PROVIDERS, outputPath } from '../src/config.js';
|
|
17
17
|
import { ExplorBot, type ExplorBotOptions } from '../src/explorbot.js';
|
|
18
18
|
import { remote } from '../src/remote.js';
|
|
@@ -35,6 +35,7 @@ const pkgVersion = JSON.parse(fs.readFileSync(pkgPath, 'utf-8')).version as stri
|
|
|
35
35
|
program.name(cli).description('AI-powered web exploration tool').version(pkgVersion, '-V, --version');
|
|
36
36
|
wsOption.register(program);
|
|
37
37
|
knowledgeOption.register(program);
|
|
38
|
+
authOption.register(program);
|
|
38
39
|
decisionModelOption.register(program);
|
|
39
40
|
|
|
40
41
|
process.on('uncaughtException', async (error) => {
|
|
@@ -64,6 +64,8 @@ export async function runInit(options: InitOptions): Promise<void> {
|
|
|
64
64
|
tag('substep').log(chalk.yellow(`${options.prefix} know /users "CRUD endpoint for user management"`));
|
|
65
65
|
log('3. Plan and run tests for one endpoint');
|
|
66
66
|
tag('substep').log(chalk.yellow(`${options.prefix} explore /users`));
|
|
67
|
+
log('4. Pass auth for one run, kept in memory and never saved');
|
|
68
|
+
tag('substep').log(chalk.yellow(`${options.prefix} explore /users --auth 'Bearer: <token>'`));
|
|
67
69
|
|
|
68
70
|
if (process.cwd() !== originalCwd) process.chdir(originalCwd);
|
|
69
71
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { knowledgeOption, wsOption } from '../../../src/commands/options/index.ts';
|
|
2
|
+
import { authOption, knowledgeOption, wsOption } from '../../../src/commands/options/index.ts';
|
|
3
3
|
import { createDocsCommands } from '../src/cli.ts';
|
|
4
4
|
|
|
5
5
|
const program = createDocsCommands('doc-collector');
|
|
6
6
|
wsOption.register(program);
|
|
7
7
|
knowledgeOption.register(program);
|
|
8
|
+
authOption.register(program);
|
|
8
9
|
program.parse();
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { decisionModelOption, knowledgeOption } from '../../../src/commands/options/index.ts';
|
|
2
|
+
import { authOption, decisionModelOption, knowledgeOption } from '../../../src/commands/options/index.ts';
|
|
3
3
|
import { createPrimaCommands } from '../src/cli.ts';
|
|
4
4
|
|
|
5
5
|
const program = createPrimaCommands('prima');
|
|
6
6
|
knowledgeOption.register(program);
|
|
7
|
+
authOption.register(program);
|
|
7
8
|
decisionModelOption.register(program);
|
|
8
9
|
program.parse();
|
|
@@ -12,7 +12,7 @@ import { HelpJsonCommand } from '../src/commands/help-json-command.js';
|
|
|
12
12
|
import { RecommendedModelsCommand } from '../src/commands/recommended-models-command.js';
|
|
13
13
|
import { App } from '../src/components/App.js';
|
|
14
14
|
import { StatusPane } from '../src/components/StatusPane.js';
|
|
15
|
-
import { decisionModelOption, knowledgeOption, wsOption } from '../src/commands/options/index.js';
|
|
15
|
+
import { authOption, decisionModelOption, knowledgeOption, wsOption } from '../src/commands/options/index.js';
|
|
16
16
|
import { ConfigParser, EXPLORBOT_ENV_VARS, PROVIDERS, outputPath } from '../src/config.js';
|
|
17
17
|
import { ExplorBot } from '../src/explorbot.js';
|
|
18
18
|
import { remote } from '../src/remote.js';
|
|
@@ -32,6 +32,7 @@ const pkgVersion = JSON.parse(fs.readFileSync(pkgPath, 'utf-8')).version;
|
|
|
32
32
|
program.name(cli).description('AI-powered web exploration tool').version(pkgVersion, '-V, --version');
|
|
33
33
|
wsOption.register(program);
|
|
34
34
|
knowledgeOption.register(program);
|
|
35
|
+
authOption.register(program);
|
|
35
36
|
decisionModelOption.register(program);
|
|
36
37
|
process.on('uncaughtException', async (error) => {
|
|
37
38
|
tag('error').log(`Uncaught exception: ${error instanceof Error ? `${error.message}\n${error.stack}` : String(error)}`);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { knowledgeOption, wsOption } from "../../../src/commands/options/index.js";
|
|
2
|
+
import { authOption, knowledgeOption, wsOption } from "../../../src/commands/options/index.js";
|
|
3
3
|
import { createApiCommands } from "../src/cli.js";
|
|
4
4
|
const program = createApiCommands('apibot');
|
|
5
5
|
wsOption.register(program);
|
|
6
6
|
knowledgeOption.register(program);
|
|
7
|
+
authOption.register(program);
|
|
7
8
|
program.parse();
|
|
@@ -53,6 +53,8 @@ export async function runInit(options) {
|
|
|
53
53
|
tag('substep').log(chalk.yellow(`${options.prefix} know /users "CRUD endpoint for user management"`));
|
|
54
54
|
log('3. Plan and run tests for one endpoint');
|
|
55
55
|
tag('substep').log(chalk.yellow(`${options.prefix} explore /users`));
|
|
56
|
+
log('4. Pass auth for one run, kept in memory and never saved');
|
|
57
|
+
tag('substep').log(chalk.yellow(`${options.prefix} explore /users --auth 'Bearer: <token>'`));
|
|
56
58
|
if (process.cwd() !== originalCwd)
|
|
57
59
|
process.chdir(originalCwd);
|
|
58
60
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
import { knowledgeOption, wsOption } from "../../../src/commands/options/index.js";
|
|
2
|
+
import { authOption, knowledgeOption, wsOption } from "../../../src/commands/options/index.js";
|
|
3
3
|
import { createDocsCommands } from "../src/cli.js";
|
|
4
4
|
const program = createDocsCommands('doc-collector');
|
|
5
5
|
wsOption.register(program);
|
|
6
6
|
knowledgeOption.register(program);
|
|
7
|
+
authOption.register(program);
|
|
7
8
|
program.parse();
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { decisionModelOption, knowledgeOption } from "../../../src/commands/options/index.js";
|
|
2
|
+
import { authOption, decisionModelOption, knowledgeOption } from "../../../src/commands/options/index.js";
|
|
3
3
|
import { createPrimaCommands } from "../src/cli.js";
|
|
4
4
|
const program = createPrimaCommands('prima');
|
|
5
5
|
knowledgeOption.register(program);
|
|
6
|
+
authOption.register(program);
|
|
6
7
|
decisionModelOption.register(program);
|
|
7
8
|
program.parse();
|
package/dist/package.json
CHANGED
|
@@ -288,6 +288,10 @@ function printInitNextSteps(options) {
|
|
|
288
288
|
}
|
|
289
289
|
if (options.siteCommands)
|
|
290
290
|
sections.push({ label: 'Explore any site', commands: options.siteCommands });
|
|
291
|
+
sections.push({
|
|
292
|
+
label: 'Log in for one run (kept in memory, never saved)',
|
|
293
|
+
commands: [{ command: `${cli} explore /dashboard --auth 'login: admin@example.com password: secret123'` }],
|
|
294
|
+
});
|
|
291
295
|
sections.push({
|
|
292
296
|
label: 'Run it from VS Code',
|
|
293
297
|
commands: [{ command: 'https://testomat.ai/explorbot' }],
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { KnowledgeTracker } from '../../knowledge-tracker.js';
|
|
2
|
+
import { registerSecret } from '../../utils/secrets.js';
|
|
3
|
+
import { BaseOption } from './base-option.js';
|
|
4
|
+
export class AuthOption extends BaseOption {
|
|
5
|
+
flags = '--auth <text>';
|
|
6
|
+
description = 'Auth details for this run only, not saved to disk, in free form (e.g. "login: admin password: secret" or "Bearer: <token>"). Falls back to EXPLORBOT_AUTH';
|
|
7
|
+
apply(options) {
|
|
8
|
+
const auth = options.auth || process.env.EXPLORBOT_AUTH;
|
|
9
|
+
if (!auth)
|
|
10
|
+
return;
|
|
11
|
+
registerSecret(auth);
|
|
12
|
+
KnowledgeTracker.appendSessionKnowledge(auth);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { AuthOption } from './auth-option.js';
|
|
1
2
|
import { DecisionModelOption } from './decision-model-option.js';
|
|
2
3
|
import { KnowledgeOption } from './knowledge-option.js';
|
|
3
4
|
import { WsOption } from './ws-option.js';
|
|
4
5
|
export { BaseOption } from './base-option.js';
|
|
6
|
+
export declare const authOption: AuthOption;
|
|
5
7
|
export declare const decisionModelOption: DecisionModelOption;
|
|
6
8
|
export declare const knowledgeOption: KnowledgeOption;
|
|
7
9
|
export declare const wsOption: WsOption;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { AuthOption } from './auth-option.js';
|
|
1
2
|
import { DecisionModelOption } from './decision-model-option.js';
|
|
2
3
|
import { KnowledgeOption } from './knowledge-option.js';
|
|
3
4
|
import { WsOption } from './ws-option.js';
|
|
4
5
|
export { BaseOption } from './base-option.js';
|
|
6
|
+
export const authOption = new AuthOption();
|
|
5
7
|
export const decisionModelOption = new DecisionModelOption();
|
|
6
8
|
export const knowledgeOption = new KnowledgeOption();
|
|
7
9
|
export const wsOption = new WsOption();
|
package/dist/src/config.js
CHANGED
|
@@ -50,6 +50,7 @@ export const EXPLORBOT_ENV_VARS = [
|
|
|
50
50
|
{ name: 'EXPLORBOT_EPHEMERAL', description: 'Keep no state between runs — output goes to a fresh temp directory instead of the site dir' },
|
|
51
51
|
{ name: 'EXPLORBOT_KNOWLEDGE', description: 'Inline knowledge text, applied to every page' },
|
|
52
52
|
{ name: 'EXPLORBOT_KNOWLEDGE_FILE', description: 'Path to a knowledge markdown file' },
|
|
53
|
+
{ name: 'EXPLORBOT_AUTH', description: 'Auth details in free form (credentials, a token), kept in memory for the run and never written to disk; same as --auth', secret: true },
|
|
53
54
|
{ name: 'EXPLORBOT_SPEC', description: 'Docbot application spec directory or index.md, used as page knowledge' },
|
|
54
55
|
{ name: 'EXPLORBOT_API_SPEC', description: 'OpenAPI spec path for the API boat' },
|
|
55
56
|
{ name: 'EXPLORBOT_API_HEADERS', description: 'Headers sent with every API request, one "Name: value" per line', secret: true },
|
|
@@ -93,6 +93,17 @@ npx explorbot explore /pay --knowledge 'Test card 4111 1111 1111 1111, any futur
|
|
|
93
93
|
|
|
94
94
|
Like `--ws`, it is a program-level option rather than a per-command one: it works on every command — including `api`, `docs` and `prima` — and can go anywhere on the line. It is listed under `npx explorbot --help` rather than in each command's own help.
|
|
95
95
|
|
|
96
|
+
### `--auth`
|
|
97
|
+
|
|
98
|
+
Passes login details to the run in free form — credentials, a token, whatever the app asks for. It joins the run's knowledge on every page and API endpoint, stays in memory, and is never written to disk. `EXPLORBOT_AUTH` does the same from the environment; the flag wins when both are set.
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npx explorbot explore /dashboard --auth 'login: admin@example.com password: secret123'
|
|
102
|
+
npx explorbot api explore /orders --auth 'Bearer: eyJhbGciOi...'
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Like `--knowledge`, it works on every command of `explorbot`, `api`, `docs` and `prima`, and can go anywhere on the line.
|
|
106
|
+
|
|
96
107
|
### `--session`
|
|
97
108
|
|
|
98
109
|
Saves browser state (cookies, localStorage, sessionStorage) to a JSON file. The next run restores the session, so you skip login and setup steps.
|
|
@@ -129,6 +140,7 @@ EXPLORBOT_AI_PROVIDER=openrouter \
|
|
|
129
140
|
| `EXPLORBOT_EPHEMERAL` | Keep no state between runs — output goes to a fresh temp directory instead of the site dir |
|
|
130
141
|
| `EXPLORBOT_KNOWLEDGE` | Inline knowledge text, applied to every page |
|
|
131
142
|
| `EXPLORBOT_KNOWLEDGE_FILE` | Path to a knowledge markdown file |
|
|
143
|
+
| `EXPLORBOT_AUTH` | Auth details in free form (credentials, a token), kept in memory for the run and never written to disk; same as --auth |
|
|
132
144
|
| `EXPLORBOT_SPEC` | Docbot application spec directory or index.md, used as page knowledge |
|
|
133
145
|
| `EXPLORBOT_API_SPEC` | OpenAPI spec path for the API boat |
|
|
134
146
|
| `EXPLORBOT_API_HEADERS` | Headers sent with every API request, one "Name: value" per line |
|
|
@@ -57,6 +57,7 @@ No `init`, no config file, no project directory, no model IDs to look up. These
|
|
|
57
57
|
| `EXPLORBOT_EPHEMERAL` | no | Keep no state between runs — output goes to a fresh temp directory instead of the site dir |
|
|
58
58
|
| `EXPLORBOT_KNOWLEDGE` | no | Inline knowledge text, applied to every page |
|
|
59
59
|
| `EXPLORBOT_KNOWLEDGE_FILE` | no | Path to a knowledge markdown file |
|
|
60
|
+
| `EXPLORBOT_AUTH` | no | Auth details in free form (credentials, a token), kept in memory for the run and never written to disk; same as --auth |
|
|
60
61
|
| `EXPLORBOT_SPEC` | no | Docbot application spec directory or index.md, used as page knowledge |
|
|
61
62
|
| `EXPLORBOT_API_SPEC` | no | OpenAPI spec path for the API boat |
|
|
62
63
|
| `EXPLORBOT_API_HEADERS` | no | Headers sent with every API request, one "Name: value" per line |
|
|
@@ -133,6 +134,12 @@ EXPLORBOT_AI_PROVIDER=openrouter \
|
|
|
133
134
|
npx explorbot explore /admin/users
|
|
134
135
|
```
|
|
135
136
|
|
|
137
|
+
`EXPLORBOT_AUTH` takes the same free-form credentials but keeps them in memory only — nothing lands in the knowledge directory. `--auth` is its flag twin:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
EXPLORBOT_AUTH="login: admin@example.com password: secret123" npx explorbot explore /admin/users
|
|
141
|
+
```
|
|
142
|
+
|
|
136
143
|
`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:
|
|
137
144
|
|
|
138
145
|
```bash
|
|
@@ -88,6 +88,12 @@ Send X-Api-Key: ${env.API_KEY} on every request'
|
|
|
88
88
|
|
|
89
89
|
For runs driven from the environment — config-free, or on the global configuration — `EXPLORBOT_KNOWLEDGE` does the same job for the length of one run. See [Agentic usage](./agentic-usage.md).
|
|
90
90
|
|
|
91
|
+
For credentials alone, `--auth` (or `EXPLORBOT_AUTH`) takes free-form text, applies it everywhere, and never writes it to disk:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npx explorbot explore /dashboard --auth 'login: admin@example.com password: secret123'
|
|
95
|
+
```
|
|
96
|
+
|
|
91
97
|
## URL Patterns
|
|
92
98
|
|
|
93
99
|
| Pattern | Matches |
|
package/package.json
CHANGED
|
@@ -327,6 +327,11 @@ function printInitNextSteps(options: { url?: string; siteCommands?: NextStepComm
|
|
|
327
327
|
|
|
328
328
|
if (options.siteCommands) sections.push({ label: 'Explore any site', commands: options.siteCommands });
|
|
329
329
|
|
|
330
|
+
sections.push({
|
|
331
|
+
label: 'Log in for one run (kept in memory, never saved)',
|
|
332
|
+
commands: [{ command: `${cli} explore /dashboard --auth 'login: admin@example.com password: secret123'` }],
|
|
333
|
+
});
|
|
334
|
+
|
|
330
335
|
sections.push(
|
|
331
336
|
{
|
|
332
337
|
label: 'Run it from VS Code',
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { KnowledgeTracker } from '../../knowledge-tracker.js';
|
|
2
|
+
import { registerSecret } from '../../utils/secrets.js';
|
|
3
|
+
import { BaseOption } from './base-option.js';
|
|
4
|
+
|
|
5
|
+
export class AuthOption extends BaseOption {
|
|
6
|
+
flags = '--auth <text>';
|
|
7
|
+
description = 'Auth details for this run only, not saved to disk, in free form (e.g. "login: admin password: secret" or "Bearer: <token>"). Falls back to EXPLORBOT_AUTH';
|
|
8
|
+
|
|
9
|
+
protected apply(options: Record<string, any>): void {
|
|
10
|
+
const auth = options.auth || process.env.EXPLORBOT_AUTH;
|
|
11
|
+
if (!auth) return;
|
|
12
|
+
registerSecret(auth);
|
|
13
|
+
KnowledgeTracker.appendSessionKnowledge(auth);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { AuthOption } from './auth-option.js';
|
|
1
2
|
import { DecisionModelOption } from './decision-model-option.js';
|
|
2
3
|
import { KnowledgeOption } from './knowledge-option.js';
|
|
3
4
|
import { WsOption } from './ws-option.js';
|
|
4
5
|
|
|
5
6
|
export { BaseOption } from './base-option.js';
|
|
6
7
|
|
|
8
|
+
export const authOption = new AuthOption();
|
|
7
9
|
export const decisionModelOption = new DecisionModelOption();
|
|
8
10
|
export const knowledgeOption = new KnowledgeOption();
|
|
9
11
|
export const wsOption = new WsOption();
|
package/src/config.ts
CHANGED
|
@@ -284,6 +284,7 @@ export const EXPLORBOT_ENV_VARS: EnvVar[] = [
|
|
|
284
284
|
{ name: 'EXPLORBOT_EPHEMERAL', description: 'Keep no state between runs — output goes to a fresh temp directory instead of the site dir' },
|
|
285
285
|
{ name: 'EXPLORBOT_KNOWLEDGE', description: 'Inline knowledge text, applied to every page' },
|
|
286
286
|
{ name: 'EXPLORBOT_KNOWLEDGE_FILE', description: 'Path to a knowledge markdown file' },
|
|
287
|
+
{ name: 'EXPLORBOT_AUTH', description: 'Auth details in free form (credentials, a token), kept in memory for the run and never written to disk; same as --auth', secret: true },
|
|
287
288
|
{ name: 'EXPLORBOT_SPEC', description: 'Docbot application spec directory or index.md, used as page knowledge' },
|
|
288
289
|
{ name: 'EXPLORBOT_API_SPEC', description: 'OpenAPI spec path for the API boat' },
|
|
289
290
|
{ name: 'EXPLORBOT_API_HEADERS', description: 'Headers sent with every API request, one "Name: value" per line', secret: true },
|