explorbot 0.1.31 → 0.2.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.
- package/README.md +14 -14
- package/bin/explorbot-cli.ts +4 -3
- package/boat/doc-collector/src/ai/documentarian.ts +22 -27
- package/boat/doc-collector/src/ai/tools.ts +67 -10
- package/boat/doc-collector/src/docbot.ts +28 -7
- package/boat/doc-collector/src/docs-renderer.ts +19 -24
- package/boat/doc-collector/src/screenshots.ts +33 -1
- package/boat/doc-collector/src/state-diagram.ts +281 -0
- package/dist/bin/explorbot-cli.js +3 -3
- package/dist/boat/doc-collector/src/ai/documentarian.js +16 -6
- package/dist/boat/doc-collector/src/ai/tools.js +47 -10
- package/dist/boat/doc-collector/src/docbot.js +25 -6
- package/dist/boat/doc-collector/src/docs-renderer.js +18 -3
- package/dist/boat/doc-collector/src/screenshots.js +29 -0
- package/dist/boat/doc-collector/src/state-diagram.js +200 -0
- package/dist/package.json +8 -6
- package/dist/src/action-result.d.ts +131 -0
- package/dist/src/action-result.js +82 -159
- package/dist/src/action.d.ts +43 -0
- package/dist/src/action.js +18 -106
- package/dist/src/activity.d.ts +26 -0
- package/dist/src/ai/agent.d.ts +3 -0
- package/dist/src/ai/captain/file-tools.d.ts +28 -0
- package/dist/src/ai/captain/idle-mode.d.ts +11 -0
- package/dist/src/ai/captain/mixin.d.ts +10 -0
- package/dist/src/ai/captain/test-mode.d.ts +13 -0
- package/dist/src/ai/captain/web-mode.d.ts +13 -0
- package/dist/src/ai/captain/web-mode.js +0 -7
- package/dist/src/ai/captain.d.ts +141 -0
- package/dist/src/ai/captain.js +4 -19
- package/dist/src/ai/conversation.d.ts +28 -0
- package/dist/src/ai/conversation.js +9 -28
- package/dist/src/ai/driller.d.ts +157 -0
- package/dist/src/ai/driller.js +3 -12
- package/dist/src/ai/experience-compactor.d.ts +53 -0
- package/dist/src/ai/experience-compactor.js +16 -33
- package/dist/src/ai/fisherman-tools.d.ts +90 -0
- package/dist/src/ai/fisherman-tools.js +1 -1
- package/dist/src/ai/fisherman.d.ts +29 -0
- package/dist/src/ai/fisherman.js +0 -3
- package/dist/src/ai/historian/codeceptjs.d.ts +17 -0
- package/dist/src/ai/historian/codeceptjs.js +3 -2
- package/dist/src/ai/historian/experience.d.ts +40 -0
- package/dist/src/ai/historian/mixin.d.ts +2 -0
- package/dist/src/ai/historian/playwright.d.ts +22 -0
- package/dist/src/ai/historian/playwright.js +3 -2
- package/dist/src/ai/historian/screencast.d.ts +32 -0
- package/dist/src/ai/historian/utils.d.ts +3 -0
- package/dist/src/ai/historian/utils.js +0 -1
- package/dist/src/ai/historian.d.ts +109 -0
- package/dist/src/ai/historian.js +1 -5
- package/dist/src/ai/navigator.d.ts +54 -0
- package/dist/src/ai/navigator.js +11 -46
- package/dist/src/ai/pilot.d.ts +81 -0
- package/dist/src/ai/pilot.js +6 -17
- package/dist/src/ai/planner/session-dedup.d.ts +12 -0
- package/dist/src/ai/planner/styles.d.ts +6 -0
- package/dist/src/ai/planner/subpages.d.ts +35 -0
- package/dist/src/ai/planner.d.ts +79 -0
- package/dist/src/ai/planner.js +49 -37
- package/dist/src/ai/provider.d.ts +53 -0
- package/dist/src/ai/provider.js +78 -130
- package/dist/src/ai/quartermaster.d.ts +56 -0
- package/dist/src/ai/quartermaster.js +4 -10
- package/dist/src/ai/rerunner.d.ts +48 -0
- package/dist/src/ai/rerunner.js +14 -22
- package/dist/src/ai/researcher/cache.d.ts +6 -0
- package/dist/src/ai/researcher/cache.js +11 -18
- package/dist/src/ai/researcher/coordinates.d.ts +56 -0
- package/dist/src/ai/researcher/deep-analysis.d.ts +74 -0
- package/dist/src/ai/researcher/deep-analysis.js +3 -6
- package/dist/src/ai/researcher/fingerprint-worker.d.ts +1 -0
- package/dist/src/ai/researcher/focus.d.ts +8 -0
- package/dist/src/ai/researcher/locators.d.ts +36 -0
- package/dist/src/ai/researcher/mixin.d.ts +2 -0
- package/dist/src/ai/researcher/parser.d.ts +35 -0
- package/dist/src/ai/researcher/parser.js +1 -1
- package/dist/src/ai/researcher/research-result.d.ts +15 -0
- package/dist/src/ai/researcher/research-result.js +0 -19
- package/dist/src/ai/researcher/sections.d.ts +19 -0
- package/dist/src/ai/researcher/sections.js +5 -1
- package/dist/src/ai/researcher.js +12 -53
- package/dist/src/ai/rules.d.ts +16 -0
- package/dist/src/ai/rules.js +22 -15
- package/dist/src/ai/session-analyst.d.ts +11 -0
- package/dist/src/ai/session-analyst.js +8 -5
- package/dist/src/ai/task-agent.d.ts +28 -0
- package/dist/src/ai/task-agent.js +2 -27
- package/dist/src/ai/tester.d.ts +101 -0
- package/dist/src/ai/tester.js +10 -61
- package/dist/src/ai/tools.d.ts +52 -0
- package/dist/src/ai/tools.js +119 -101
- package/dist/src/api/api-client.d.ts +17 -0
- package/dist/src/api/request-result.d.ts +44 -0
- package/dist/src/api/request-store.d.ts +29 -0
- package/dist/src/api/spec-reader.d.ts +5 -0
- package/dist/src/api/xhr-capture.d.ts +10 -0
- package/dist/src/browser-server.d.ts +10 -0
- package/dist/src/command-handler.d.ts +68 -0
- package/dist/src/commands/add-rule-command.d.ts +11 -0
- package/dist/src/commands/base-command.d.ts +26 -0
- package/dist/src/commands/clean-command.d.ts +12 -0
- package/dist/src/commands/compact-command.d.ts +20 -0
- package/dist/src/commands/compact-command.js +6 -6
- package/dist/src/commands/context-aria-command.d.ts +6 -0
- package/dist/src/commands/context-command.d.ts +11 -0
- package/dist/src/commands/context-command.js +1 -1
- package/dist/src/commands/context-data-command.d.ts +6 -0
- package/dist/src/commands/context-experience-command.d.ts +6 -0
- package/dist/src/commands/context-html-command.d.ts +6 -0
- package/dist/src/commands/context-knowledge-command.d.ts +6 -0
- package/dist/src/commands/context-knowledge-command.js +1 -1
- package/dist/src/commands/debug-command.d.ts +6 -0
- package/dist/src/commands/drill-command.d.ts +10 -0
- package/dist/src/commands/exit-command.d.ts +7 -0
- package/dist/src/commands/experience-command.d.ts +15 -0
- package/dist/src/commands/experience-command.js +1 -1
- package/dist/src/commands/explore-command.d.ts +51 -0
- package/dist/src/commands/freesail-command.d.ts +12 -0
- package/dist/src/commands/help-command.d.ts +6 -0
- package/dist/src/commands/index.d.ts +4 -0
- package/dist/src/commands/init-command.d.ts +7 -0
- package/dist/src/commands/knows-command.d.ts +10 -0
- package/dist/src/commands/knows-command.js +1 -1
- package/dist/src/commands/learn-command.d.ts +7 -0
- package/dist/src/commands/learn-command.js +3 -1
- package/dist/src/commands/navigate-command.d.ts +7 -0
- package/dist/src/commands/path-command.d.ts +10 -0
- package/dist/src/commands/plan-clear-command.d.ts +7 -0
- package/dist/src/commands/plan-command.d.ts +14 -0
- package/dist/src/commands/plan-edit-command.d.ts +7 -0
- package/dist/src/commands/plan-load-command.d.ts +7 -0
- package/dist/src/commands/plan-reload-command.d.ts +7 -0
- package/dist/src/commands/plan-save-command.d.ts +7 -0
- package/dist/src/commands/plans-command.d.ts +21 -0
- package/dist/src/commands/rerun-command.d.ts +7 -0
- package/dist/src/commands/research-command.d.ts +11 -0
- package/dist/src/commands/runs-command.d.ts +7 -0
- package/dist/src/commands/start-command.d.ts +7 -0
- package/dist/src/commands/status-command.d.ts +6 -0
- package/dist/src/commands/test-command.d.ts +11 -0
- package/dist/src/components/ActivityPane.d.ts +6 -0
- package/dist/src/components/AddKnowledge.d.ts +10 -0
- package/dist/src/components/AddKnowledge.js +3 -7
- package/dist/src/components/AddRule.d.ts +9 -0
- package/dist/src/components/App.d.ts +9 -0
- package/dist/src/components/App.js +2 -2
- package/dist/src/components/Autocomplete.d.ts +3 -0
- package/dist/src/components/InputPane.d.ts +13 -0
- package/dist/src/components/InputReadline.d.ts +17 -0
- package/dist/src/components/LogPane.d.ts +6 -0
- package/dist/src/components/PlanEditor.d.ts +9 -0
- package/dist/src/components/PlanPane.d.ts +13 -0
- package/dist/src/components/SessionTimer.d.ts +6 -0
- package/dist/src/components/StateTransitionPane.d.ts +8 -0
- package/dist/src/components/StatusPane.d.ts +4 -0
- package/dist/src/components/TaskPane.d.ts +9 -0
- package/dist/src/components/Welcome.d.ts +3 -0
- package/dist/src/components/WelcomeChecklist.d.ts +9 -0
- package/dist/src/components/WelcomeCommands.d.ts +6 -0
- package/dist/src/components/autocomplete-store.d.ts +10 -0
- package/dist/src/components/parse-keypress.d.ts +12 -0
- package/dist/src/config.d.ts +253 -0
- package/dist/src/config.js +12 -0
- package/dist/src/execution-controller.d.ts +25 -0
- package/dist/src/experience-tracker.d.ts +112 -0
- package/dist/src/experience-tracker.js +83 -155
- package/dist/src/explorbot.d.ts +106 -0
- package/dist/src/explorbot.js +17 -51
- package/dist/src/explorer.d.ts +129 -0
- package/dist/src/explorer.js +31 -77
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.js +2 -55
- package/dist/src/knowledge-tracker.d.ts +33 -0
- package/dist/src/knowledge-tracker.js +47 -47
- package/dist/src/observability.d.ts +13 -0
- package/dist/src/observability.js +2 -1
- package/dist/src/playwright-recorder.d.ts +31 -0
- package/dist/src/reporter.d.ts +34 -0
- package/dist/src/state-manager.d.ts +160 -0
- package/dist/src/state-manager.js +10 -136
- package/dist/src/stats.d.ts +24 -0
- package/dist/src/suite.d.ts +24 -0
- package/dist/src/test-plan.d.ts +166 -0
- package/dist/src/utils/aria.d.ts +25 -0
- package/dist/src/utils/aria.js +4 -1
- package/dist/src/utils/browser-errors.d.ts +8 -0
- package/dist/src/utils/cache.d.ts +15 -0
- package/dist/src/utils/cache.js +34 -0
- package/dist/src/utils/cli-name.d.ts +1 -0
- package/dist/src/utils/code-extractor.d.ts +1 -0
- package/dist/src/utils/context-formatter.d.ts +31 -0
- package/dist/src/utils/context-formatter.js +15 -27
- package/dist/src/utils/error-page.d.ts +12 -0
- package/dist/src/utils/expandable.d.ts +4 -0
- package/dist/src/utils/hooks-runner.d.ts +15 -0
- package/dist/src/utils/html-diff.d.ts +19 -0
- package/dist/src/utils/html.d.ts +129 -0
- package/dist/src/utils/html.js +71 -0
- package/dist/src/utils/log-filters.d.ts +6 -0
- package/dist/src/utils/logger.d.ts +35 -0
- package/dist/src/utils/loop.d.ts +35 -0
- package/dist/src/utils/markdown-files.d.ts +10 -0
- package/dist/src/utils/markdown-files.js +21 -0
- package/dist/src/utils/markdown-parser.d.ts +17 -0
- package/dist/src/utils/markdown-query.d.ts +46 -0
- package/dist/src/utils/markdown-query.js +14 -1
- package/dist/src/utils/markdown-terminal.d.ts +1 -0
- package/dist/src/utils/next-steps.d.ts +11 -0
- package/dist/src/utils/page-readiness.d.ts +7 -0
- package/dist/src/utils/page-readiness.js +1 -1
- package/dist/src/utils/research-parser.d.ts +1 -0
- package/dist/src/utils/retry.d.ts +8 -0
- package/dist/src/utils/rules-loader.d.ts +12 -0
- package/dist/src/utils/secrets.d.ts +4 -0
- package/dist/src/utils/secrets.js +28 -0
- package/dist/src/utils/step-analyzer.d.ts +11 -0
- package/dist/src/utils/strings.d.ts +5 -0
- package/dist/src/utils/strings.js +10 -0
- package/dist/src/utils/test-files.d.ts +3 -0
- package/dist/src/utils/test-plan-markdown.d.ts +9 -0
- package/dist/src/utils/throttle.d.ts +2 -0
- package/dist/src/utils/unique-names.d.ts +2 -0
- package/dist/src/utils/url-matcher.d.ts +6 -0
- package/dist/src/utils/web-element.d.ts +45 -0
- package/dist/src/utils/web-element.js +3 -0
- package/dist/src/utils/web-sandbox.d.ts +4 -0
- package/dist/src/utils/web-sandbox.js +37 -0
- package/dist/src/utils/xpath.d.ts +17 -0
- package/package.json +8 -6
- package/src/action-result.ts +80 -168
- package/src/action.ts +16 -123
- package/src/ai/captain/web-mode.ts +0 -7
- package/src/ai/captain.ts +5 -17
- package/src/ai/conversation.ts +9 -32
- package/src/ai/driller.ts +3 -16
- package/src/ai/experience-compactor.ts +16 -35
- package/src/ai/fisherman-tools.ts +1 -1
- package/src/ai/fisherman.ts +0 -4
- package/src/ai/historian/codeceptjs.ts +4 -2
- package/src/ai/historian/playwright.ts +4 -2
- package/src/ai/historian/utils.ts +0 -1
- package/src/ai/historian.ts +4 -7
- package/src/ai/navigator.ts +13 -49
- package/src/ai/pilot.ts +6 -16
- package/src/ai/planner.ts +56 -44
- package/src/ai/provider.ts +86 -139
- package/src/ai/quartermaster.ts +34 -41
- package/src/ai/rerunner.ts +17 -21
- package/src/ai/researcher/cache.ts +10 -16
- package/src/ai/researcher/deep-analysis.ts +3 -6
- package/src/ai/researcher/parser.ts +1 -1
- package/src/ai/researcher/research-result.ts +0 -18
- package/src/ai/researcher/sections.ts +5 -1
- package/src/ai/researcher.ts +11 -59
- package/src/ai/rules.ts +24 -13
- package/src/ai/session-analyst.ts +8 -5
- package/src/ai/task-agent.ts +3 -30
- package/src/ai/tester.ts +12 -73
- package/src/ai/tools.ts +119 -106
- package/src/commands/compact-command.ts +7 -8
- package/src/commands/context-command.ts +1 -1
- package/src/commands/context-knowledge-command.ts +1 -1
- package/src/commands/experience-command.ts +1 -1
- package/src/commands/knows-command.ts +1 -1
- package/src/commands/learn-command.ts +3 -1
- package/src/components/AddKnowledge.tsx +5 -7
- package/src/components/App.tsx +2 -2
- package/src/config.ts +12 -0
- package/src/experience-tracker.ts +90 -152
- package/src/explorbot.ts +17 -51
- package/src/explorer.ts +34 -81
- package/src/index.ts +9 -0
- package/src/knowledge-tracker.ts +49 -50
- package/src/observability.ts +2 -1
- package/src/state-manager.ts +15 -164
- package/src/utils/aria.ts +11 -2
- package/src/utils/cache.ts +40 -0
- package/src/utils/context-formatter.ts +12 -15
- package/src/utils/html.ts +79 -0
- package/src/utils/markdown-files.ts +30 -0
- package/src/utils/markdown-query.ts +15 -1
- package/src/utils/page-readiness.ts +1 -1
- package/src/utils/secrets.ts +28 -0
- package/src/utils/strings.ts +12 -0
- package/src/utils/web-element.ts +4 -0
- package/src/utils/web-sandbox.ts +43 -0
- package/src/index.tsx +0 -62
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Box, Text, useInput } from 'ink';
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
|
-
import { KnowledgeTracker } from '../knowledge-tracker.js';
|
|
4
3
|
import InputReadline from './InputReadline.js';
|
|
5
|
-
const AddKnowledge = ({ initialUrl = '', onComplete, onCancel }) => {
|
|
4
|
+
const AddKnowledge = ({ initialUrl = '', knowledgeTracker, onComplete, onCancel }) => {
|
|
6
5
|
const [urlPattern, setUrlPattern] = useState(initialUrl);
|
|
7
6
|
const [description, setDescription] = useState('');
|
|
8
7
|
const [activeField, setActiveField] = useState(initialUrl ? 'description' : 'url');
|
|
@@ -11,18 +10,16 @@ const AddKnowledge = ({ initialUrl = '', onComplete, onCancel }) => {
|
|
|
11
10
|
const isStandalone = !onComplete;
|
|
12
11
|
useEffect(() => {
|
|
13
12
|
try {
|
|
14
|
-
const knowledgeTracker = new KnowledgeTracker();
|
|
15
13
|
const urls = knowledgeTracker.getExistingUrls();
|
|
16
14
|
setSuggestedUrls(urls);
|
|
17
15
|
}
|
|
18
16
|
catch (error) {
|
|
19
17
|
console.error('Failed to load suggestions:', error);
|
|
20
18
|
}
|
|
21
|
-
}, []);
|
|
19
|
+
}, [knowledgeTracker]);
|
|
22
20
|
useEffect(() => {
|
|
23
21
|
if (urlPattern.trim()) {
|
|
24
22
|
try {
|
|
25
|
-
const knowledgeTracker = new KnowledgeTracker();
|
|
26
23
|
const knowledge = knowledgeTracker.getKnowledgeForUrl(urlPattern);
|
|
27
24
|
setExistingKnowledge(knowledge);
|
|
28
25
|
}
|
|
@@ -34,13 +31,12 @@ const AddKnowledge = ({ initialUrl = '', onComplete, onCancel }) => {
|
|
|
34
31
|
else {
|
|
35
32
|
setExistingKnowledge([]);
|
|
36
33
|
}
|
|
37
|
-
}, [urlPattern]);
|
|
34
|
+
}, [urlPattern, knowledgeTracker]);
|
|
38
35
|
const handleSave = () => {
|
|
39
36
|
if (!urlPattern.trim() || !description.trim()) {
|
|
40
37
|
return;
|
|
41
38
|
}
|
|
42
39
|
try {
|
|
43
|
-
const knowledgeTracker = new KnowledgeTracker();
|
|
44
40
|
const result = knowledgeTracker.addKnowledge(urlPattern.trim(), description.trim());
|
|
45
41
|
const action = result.isNewFile ? 'Created' : 'Updated';
|
|
46
42
|
console.log(`\nKnowledge ${action} in: ${result.filename}`);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ExplorBot } from '../explorbot.js';
|
|
3
|
+
interface AppProps {
|
|
4
|
+
explorBot: ExplorBot;
|
|
5
|
+
initialShowInput?: boolean;
|
|
6
|
+
exitOnEmptyInput?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function App({ explorBot, initialShowInput, exitOnEmptyInput }: AppProps): React.JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -111,7 +111,7 @@ export function App({ explorBot, initialShowInput = false, exitOnEmptyInput = fa
|
|
|
111
111
|
return;
|
|
112
112
|
setChecklistData({
|
|
113
113
|
config: explorBot.getConfig(),
|
|
114
|
-
knowledgeTracker: explorBot.
|
|
114
|
+
knowledgeTracker: explorBot.knowledgeTracker(),
|
|
115
115
|
});
|
|
116
116
|
setShowWelcome(true);
|
|
117
117
|
setShowInput(true);
|
|
@@ -283,7 +283,7 @@ export function App({ explorBot, initialShowInput = false, exitOnEmptyInput = fa
|
|
|
283
283
|
React.createElement(Box, { height: 3, flexDirection: "row", justifyContent: "space-between", alignItems: "center", paddingX: 1 },
|
|
284
284
|
React.createElement(ActivityPane, { isInputVisible: showInput }),
|
|
285
285
|
showSessionTimer && React.createElement(SessionTimer, { startedAt: sessionStartedAtRef.current })),
|
|
286
|
-
showWelcome && React.createElement(WelcomeCommands, { hasKnowledge: explorBot.
|
|
286
|
+
showWelcome && React.createElement(WelcomeCommands, { hasKnowledge: explorBot.knowledgeTracker().listAllKnowledge().length > 0 }),
|
|
287
287
|
showInput && React.createElement(Box, { height: 1 }),
|
|
288
288
|
interruptPrompt && showInput && (React.createElement(Box, { paddingX: 1 },
|
|
289
289
|
React.createElement(Text, { color: "yellow" }, interruptPrompt))),
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CommandHandler } from '../command-handler.js';
|
|
3
|
+
interface InputPaneProps {
|
|
4
|
+
commandHandler: CommandHandler;
|
|
5
|
+
exitOnEmptyInput?: boolean;
|
|
6
|
+
onSubmit?: (value: string) => Promise<void>;
|
|
7
|
+
onCommandStart?: () => void;
|
|
8
|
+
onCommandComplete?: () => void;
|
|
9
|
+
isActive?: boolean;
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const InputPane: React.FC<InputPaneProps>;
|
|
13
|
+
export default InputPane;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CommandHandler } from '../command-handler.js';
|
|
3
|
+
interface InputReadlineProps {
|
|
4
|
+
commandHandler?: CommandHandler;
|
|
5
|
+
exitOnEmptyInput?: boolean;
|
|
6
|
+
onSubmit?: (value: string) => void | Promise<void>;
|
|
7
|
+
onChange?: (value: string) => void;
|
|
8
|
+
onCommandStart?: () => void;
|
|
9
|
+
onCommandComplete?: () => void;
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
visible?: boolean;
|
|
12
|
+
value?: string;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
showPrompt?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const InputReadline: React.FC<InputReadlineProps>;
|
|
17
|
+
export default InputReadline;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface PlanPaneProps {
|
|
3
|
+
completedPlans: PlanSummary[];
|
|
4
|
+
activePlan: PlanSummary | null;
|
|
5
|
+
}
|
|
6
|
+
declare const PlanPane: React.FC<PlanPaneProps>;
|
|
7
|
+
export default PlanPane;
|
|
8
|
+
export interface PlanSummary {
|
|
9
|
+
title: string;
|
|
10
|
+
testCount: number;
|
|
11
|
+
passed: number;
|
|
12
|
+
failed: number;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { StateTransition, WebPageState } from '../state-manager.js';
|
|
3
|
+
interface StateTransitionPaneProps {
|
|
4
|
+
transition?: StateTransition;
|
|
5
|
+
currentState?: WebPageState;
|
|
6
|
+
}
|
|
7
|
+
declare const StateTransitionPane: React.FC<StateTransitionPaneProps>;
|
|
8
|
+
export default StateTransitionPane;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ExplorbotConfig } from '../config.js';
|
|
3
|
+
import type { KnowledgeTracker } from '../knowledge-tracker.js';
|
|
4
|
+
interface WelcomeChecklistProps {
|
|
5
|
+
config: ExplorbotConfig;
|
|
6
|
+
knowledgeTracker: KnowledgeTracker;
|
|
7
|
+
}
|
|
8
|
+
declare const WelcomeChecklist: React.FC<WelcomeChecklistProps>;
|
|
9
|
+
export default WelcomeChecklist;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommandAutocompleteSuggestion } from '../command-handler.js';
|
|
2
|
+
interface AutocompleteState {
|
|
3
|
+
suggestions: CommandAutocompleteSuggestion[];
|
|
4
|
+
argumentHint?: string;
|
|
5
|
+
selectedIndex: number;
|
|
6
|
+
visible: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const setAutocompleteState: (next: AutocompleteState) => void;
|
|
9
|
+
export declare const useAutocompleteState: () => AutocompleteState;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Buffer } from 'node:buffer';
|
|
2
|
+
export declare const nonAlphanumericKeys: string[];
|
|
3
|
+
export default function parseKeypress(value?: string | Buffer): {
|
|
4
|
+
name: string;
|
|
5
|
+
ctrl: boolean;
|
|
6
|
+
meta: boolean;
|
|
7
|
+
shift: boolean;
|
|
8
|
+
option: boolean;
|
|
9
|
+
sequence: string;
|
|
10
|
+
raw: string | undefined;
|
|
11
|
+
code: string | undefined;
|
|
12
|
+
};
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
interface PlaywrightConfig {
|
|
2
|
+
browser: 'chromium' | 'firefox' | 'webkit';
|
|
3
|
+
url: string;
|
|
4
|
+
show?: boolean;
|
|
5
|
+
windowSize?: string;
|
|
6
|
+
slowMo?: number;
|
|
7
|
+
chromium?: {
|
|
8
|
+
args?: string[];
|
|
9
|
+
};
|
|
10
|
+
firefox?: {
|
|
11
|
+
args?: string[];
|
|
12
|
+
};
|
|
13
|
+
webkit?: {
|
|
14
|
+
args?: string[];
|
|
15
|
+
};
|
|
16
|
+
timeout?: number;
|
|
17
|
+
waitForAction?: number;
|
|
18
|
+
waitForNavigation?: 'load' | 'domcontentloaded' | 'networkidle';
|
|
19
|
+
waitForTimeout?: number;
|
|
20
|
+
spinnerSelectors?: string[];
|
|
21
|
+
ignoreHTTPSErrors?: boolean;
|
|
22
|
+
userAgent?: string;
|
|
23
|
+
viewport?: {
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
};
|
|
27
|
+
args?: string[];
|
|
28
|
+
}
|
|
29
|
+
type PlaywrightHookFn = (ctx: {
|
|
30
|
+
page: any;
|
|
31
|
+
url: string;
|
|
32
|
+
}) => Promise<void> | void;
|
|
33
|
+
type CodeceptJSHookFn = (ctx: {
|
|
34
|
+
I: any;
|
|
35
|
+
url: string;
|
|
36
|
+
}) => Promise<void> | void;
|
|
37
|
+
interface PlaywrightHook {
|
|
38
|
+
type: 'playwright';
|
|
39
|
+
hook: PlaywrightHookFn;
|
|
40
|
+
}
|
|
41
|
+
interface CodeceptJSHook {
|
|
42
|
+
type: 'codeceptjs';
|
|
43
|
+
hook: CodeceptJSHookFn;
|
|
44
|
+
}
|
|
45
|
+
type Hook = PlaywrightHook | CodeceptJSHook;
|
|
46
|
+
type HookPatternMap = Record<string, Hook>;
|
|
47
|
+
type HookConfig = Hook | HookPatternMap;
|
|
48
|
+
interface HooksConfig {
|
|
49
|
+
beforeHook?: HookConfig;
|
|
50
|
+
afterHook?: HookConfig;
|
|
51
|
+
}
|
|
52
|
+
interface AgentConfig extends HooksConfig {
|
|
53
|
+
model?: any;
|
|
54
|
+
enabled?: boolean;
|
|
55
|
+
systemPrompt?: string;
|
|
56
|
+
rules?: RuleEntry[];
|
|
57
|
+
providerOptions?: Record<string, any>;
|
|
58
|
+
reasoning?: 'provider-default' | 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
|
|
59
|
+
}
|
|
60
|
+
interface ResearcherAgentConfig extends AgentConfig {
|
|
61
|
+
excludeSelectors?: string[];
|
|
62
|
+
includeSelectors?: string[];
|
|
63
|
+
stopWords?: string[];
|
|
64
|
+
maxElementsToExplore?: number;
|
|
65
|
+
maxExpandableClicks?: number;
|
|
66
|
+
retries?: number;
|
|
67
|
+
sections?: string[];
|
|
68
|
+
focusSections?: string[];
|
|
69
|
+
errorPageTimeout?: number;
|
|
70
|
+
}
|
|
71
|
+
interface TesterAgentConfig extends AgentConfig {
|
|
72
|
+
progressCheckInterval?: number;
|
|
73
|
+
}
|
|
74
|
+
interface PilotAgentConfig extends AgentConfig {
|
|
75
|
+
stepsToReview?: number;
|
|
76
|
+
}
|
|
77
|
+
interface NavigatorAgentConfig extends AgentConfig {
|
|
78
|
+
addHtmlOnTry?: number;
|
|
79
|
+
maxAttempts?: number;
|
|
80
|
+
verifyAttempts?: number;
|
|
81
|
+
verifyTimeout?: number;
|
|
82
|
+
}
|
|
83
|
+
type HealFn = (ctx: {
|
|
84
|
+
I: any;
|
|
85
|
+
}) => Promise<void> | void;
|
|
86
|
+
interface HealRecipe {
|
|
87
|
+
priority?: number;
|
|
88
|
+
steps?: string[];
|
|
89
|
+
fn: (context: {
|
|
90
|
+
step: any;
|
|
91
|
+
error: Error;
|
|
92
|
+
prevSteps?: any[];
|
|
93
|
+
}) => HealFn | Promise<HealFn | null> | null;
|
|
94
|
+
}
|
|
95
|
+
interface RerunnerAgentConfig extends AgentConfig {
|
|
96
|
+
healLimit?: number;
|
|
97
|
+
ariaSnapshotLimit?: number;
|
|
98
|
+
retryFailedStep?: Record<string, any>;
|
|
99
|
+
screenshotOnFail?: Record<string, any>;
|
|
100
|
+
recipes?: Record<string, HealRecipe>;
|
|
101
|
+
}
|
|
102
|
+
interface PlannerAgentConfig extends AgentConfig {
|
|
103
|
+
styles?: string[];
|
|
104
|
+
stylesDir?: string;
|
|
105
|
+
}
|
|
106
|
+
interface ScreencastConfig {
|
|
107
|
+
size?: {
|
|
108
|
+
width: number;
|
|
109
|
+
height: number;
|
|
110
|
+
};
|
|
111
|
+
quality?: number;
|
|
112
|
+
}
|
|
113
|
+
interface HistorianAgentConfig extends AgentConfig {
|
|
114
|
+
framework?: 'codeceptjs' | 'playwright';
|
|
115
|
+
screencast?: boolean | ScreencastConfig;
|
|
116
|
+
}
|
|
117
|
+
interface AgentsConfig {
|
|
118
|
+
tester?: TesterAgentConfig;
|
|
119
|
+
navigator?: NavigatorAgentConfig;
|
|
120
|
+
researcher?: ResearcherAgentConfig;
|
|
121
|
+
planner?: PlannerAgentConfig;
|
|
122
|
+
pilot?: PilotAgentConfig;
|
|
123
|
+
driller?: AgentConfig;
|
|
124
|
+
'experience-compactor'?: AgentConfig;
|
|
125
|
+
captain?: AgentConfig;
|
|
126
|
+
quartermaster?: AgentConfig;
|
|
127
|
+
historian?: HistorianAgentConfig;
|
|
128
|
+
fisherman?: AgentConfig;
|
|
129
|
+
chief?: AgentConfig;
|
|
130
|
+
curler?: AgentConfig;
|
|
131
|
+
rerunner?: RerunnerAgentConfig;
|
|
132
|
+
analyst?: AgentConfig;
|
|
133
|
+
}
|
|
134
|
+
interface AIConfig {
|
|
135
|
+
model: any;
|
|
136
|
+
apiKey?: string;
|
|
137
|
+
config?: Record<string, any>;
|
|
138
|
+
langfuse?: {
|
|
139
|
+
enabled?: boolean;
|
|
140
|
+
publicKey?: string;
|
|
141
|
+
secretKey?: string;
|
|
142
|
+
baseUrl?: string;
|
|
143
|
+
};
|
|
144
|
+
tools?: {
|
|
145
|
+
enabled: boolean;
|
|
146
|
+
maxConcurrency: number;
|
|
147
|
+
timeout: number;
|
|
148
|
+
};
|
|
149
|
+
vision?: boolean;
|
|
150
|
+
visionModel?: any;
|
|
151
|
+
agenticModel?: any;
|
|
152
|
+
maxAttempts?: number;
|
|
153
|
+
retryDelay?: number;
|
|
154
|
+
agents?: AgentsConfig;
|
|
155
|
+
}
|
|
156
|
+
interface HtmlConfig {
|
|
157
|
+
minimal?: {
|
|
158
|
+
include?: string[];
|
|
159
|
+
exclude?: string[];
|
|
160
|
+
};
|
|
161
|
+
combined?: {
|
|
162
|
+
include?: string[];
|
|
163
|
+
exclude?: string[];
|
|
164
|
+
};
|
|
165
|
+
text?: {
|
|
166
|
+
include?: string[];
|
|
167
|
+
exclude?: string[];
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
interface ActionConfig {
|
|
171
|
+
delay?: number;
|
|
172
|
+
retries?: number;
|
|
173
|
+
}
|
|
174
|
+
interface ReporterConfig {
|
|
175
|
+
enabled?: boolean;
|
|
176
|
+
html?: boolean;
|
|
177
|
+
markdown?: boolean;
|
|
178
|
+
runGroup?: string | null;
|
|
179
|
+
}
|
|
180
|
+
type ApiHookFn = (ctx: {
|
|
181
|
+
headers: Record<string, string>;
|
|
182
|
+
baseEndpoint: string;
|
|
183
|
+
}) => Promise<Record<string, string> | undefined> | Record<string, string> | undefined;
|
|
184
|
+
interface ApiConfig {
|
|
185
|
+
baseEndpoint?: string;
|
|
186
|
+
spec?: string[];
|
|
187
|
+
headers?: Record<string, string>;
|
|
188
|
+
bootstrap?: ApiHookFn;
|
|
189
|
+
teardown?: ApiHookFn;
|
|
190
|
+
}
|
|
191
|
+
interface WebConfig {
|
|
192
|
+
url: string;
|
|
193
|
+
}
|
|
194
|
+
interface ExplorbotConfig {
|
|
195
|
+
web?: WebConfig;
|
|
196
|
+
playwright: PlaywrightConfig;
|
|
197
|
+
ai: AIConfig;
|
|
198
|
+
html?: HtmlConfig;
|
|
199
|
+
action?: ActionConfig;
|
|
200
|
+
dirs?: {
|
|
201
|
+
knowledge: string;
|
|
202
|
+
experience: string;
|
|
203
|
+
output: string;
|
|
204
|
+
};
|
|
205
|
+
experience?: {
|
|
206
|
+
maxReadLines?: number;
|
|
207
|
+
};
|
|
208
|
+
reporter?: ReporterConfig;
|
|
209
|
+
api?: ApiConfig;
|
|
210
|
+
stepsFile?: string;
|
|
211
|
+
files?: Record<string, string>;
|
|
212
|
+
dynamicPageRegex?: string;
|
|
213
|
+
}
|
|
214
|
+
type RuleEntry = string | Record<string, string>;
|
|
215
|
+
export declare const EXPLORBOT_CONFIG_PATHS: string[];
|
|
216
|
+
export type { ExplorbotConfig, PlaywrightConfig, AIConfig, HtmlConfig, ActionConfig, AgentConfig, AgentsConfig, HistorianAgentConfig, ResearcherAgentConfig, NavigatorAgentConfig, PlannerAgentConfig, RerunnerAgentConfig, HealRecipe, Hook, HookConfig, HooksConfig, PlaywrightHook, CodeceptJSHook, HookPatternMap, RuleEntry, ReporterConfig, ApiConfig, WebConfig, ApiHookFn, };
|
|
217
|
+
export declare class ConfigParser {
|
|
218
|
+
static instance: ConfigParser;
|
|
219
|
+
config: ExplorbotConfig | null;
|
|
220
|
+
configPath: string | null;
|
|
221
|
+
runtimeBaseUrlOverride: string | null;
|
|
222
|
+
constructor();
|
|
223
|
+
static loadEnv(filePath: string): void;
|
|
224
|
+
static getInstance(): ConfigParser;
|
|
225
|
+
loadConfig(options?: {
|
|
226
|
+
config?: string;
|
|
227
|
+
path?: string;
|
|
228
|
+
baseUrl?: string;
|
|
229
|
+
}): Promise<ExplorbotConfig>;
|
|
230
|
+
getConfig(): ExplorbotConfig;
|
|
231
|
+
getConfigPath(): string | null;
|
|
232
|
+
getOutputDir(): string;
|
|
233
|
+
getProjectRoot(): string;
|
|
234
|
+
resolveProjectDir(relativeDir: string): string;
|
|
235
|
+
getStatesDir(): string;
|
|
236
|
+
getPlansDir(): string;
|
|
237
|
+
getTestsDir(): string;
|
|
238
|
+
static resetForTesting(): void;
|
|
239
|
+
static setupTestConfig(): void;
|
|
240
|
+
static getTestDirectories(): string[];
|
|
241
|
+
static cleanupAllTestDirectories(): void;
|
|
242
|
+
findConfigFile(): string | null;
|
|
243
|
+
loadConfigModule(configPath: string): Promise<any>;
|
|
244
|
+
resolveConfig(config: ExplorbotConfig, options?: {
|
|
245
|
+
baseUrl?: string;
|
|
246
|
+
}): ExplorbotConfig;
|
|
247
|
+
validateConfig(config: ExplorbotConfig): void;
|
|
248
|
+
getNestedValue(obj: any, path: string): any;
|
|
249
|
+
mergeWithDefaults(config: Partial<ExplorbotConfig>): ExplorbotConfig;
|
|
250
|
+
deepMerge(target: any, source: any): any;
|
|
251
|
+
ensureDirectory(path: string): void;
|
|
252
|
+
}
|
|
253
|
+
export declare function outputPath(...segments: string[]): string;
|
package/dist/src/config.js
CHANGED
|
@@ -96,6 +96,18 @@ export class ConfigParser {
|
|
|
96
96
|
throw new Error('Config path not found');
|
|
97
97
|
return path.join(path.dirname(configPath), config.dirs?.output || 'output');
|
|
98
98
|
}
|
|
99
|
+
getProjectRoot() {
|
|
100
|
+
const configPath = this.getConfigPath();
|
|
101
|
+
if (configPath)
|
|
102
|
+
return path.dirname(configPath);
|
|
103
|
+
return process.cwd();
|
|
104
|
+
}
|
|
105
|
+
resolveProjectDir(relativeDir) {
|
|
106
|
+
const configPath = this.getConfigPath();
|
|
107
|
+
if (!configPath)
|
|
108
|
+
return relativeDir;
|
|
109
|
+
return path.join(path.dirname(configPath), relativeDir);
|
|
110
|
+
}
|
|
99
111
|
getStatesDir() {
|
|
100
112
|
return outputPath('states');
|
|
101
113
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EventEmitter } from 'node:events';
|
|
2
|
+
export type InputCallback = (prompt: string) => Promise<string | null>;
|
|
3
|
+
export declare class ExecutionController extends EventEmitter {
|
|
4
|
+
static instance: ExecutionController;
|
|
5
|
+
interrupted: boolean;
|
|
6
|
+
inputCallback: InputCallback | null;
|
|
7
|
+
interruptResolvers: Array<() => void>;
|
|
8
|
+
abortController: AbortController | null;
|
|
9
|
+
awaitingInput: boolean;
|
|
10
|
+
constructor();
|
|
11
|
+
static getInstance(): ExecutionController;
|
|
12
|
+
setInputCallback(callback: InputCallback): void;
|
|
13
|
+
startExecution(): void;
|
|
14
|
+
getAbortSignal(): AbortSignal | undefined;
|
|
15
|
+
interrupt(): void;
|
|
16
|
+
isAwaitingInput(): boolean;
|
|
17
|
+
isInterrupted(): boolean;
|
|
18
|
+
waitForInterrupt(): Promise<void>;
|
|
19
|
+
checkInterrupt(): Promise<string | null>;
|
|
20
|
+
handleInterrupt(prompt?: string): Promise<string | null>;
|
|
21
|
+
requestInput(prompt: string): Promise<string | null>;
|
|
22
|
+
readlineInput(prompt: string): Promise<string | null>;
|
|
23
|
+
reset(): void;
|
|
24
|
+
}
|
|
25
|
+
export declare const executionController: ExecutionController;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { ActionResult } from './action-result.js';
|
|
2
|
+
import { KnowledgeTracker } from './knowledge-tracker.js';
|
|
3
|
+
export declare const RECENT_WINDOW_DAYS = 30;
|
|
4
|
+
/**
|
|
5
|
+
* Stores and reads per-page experience files (`./experience/<stateHash>.md`).
|
|
6
|
+
*
|
|
7
|
+
* Two writers, two contracts:
|
|
8
|
+
*
|
|
9
|
+
* writeFlow(state, body, relatedUrls?) — caller hands in a fully-formatted
|
|
10
|
+
* `## FLOW: <imperative title>` block (multi-step,
|
|
11
|
+
* `*` bullets + optional ```js``` + `>` discovery,
|
|
12
|
+
* ends with `---`). Tracker dedups + prepends.
|
|
13
|
+
* writeAction(state, ActionInput) — `## ACTION: <imperative title>`, single-step,
|
|
14
|
+
* optional `Solution:` line + one ```js``` code block.
|
|
15
|
+
* Title normalized via normalizeTitle().
|
|
16
|
+
*
|
|
17
|
+
* - Always h2. Never h3 for FLOW/ACTION.
|
|
18
|
+
* - On read (getSuccessfulExperience), headings are rendered as
|
|
19
|
+
* `## HOW to <title> (multi-step|single-step)` so prompts get natural phrasing.
|
|
20
|
+
*/
|
|
21
|
+
export declare class ExperienceTracker {
|
|
22
|
+
experienceDir: string;
|
|
23
|
+
disabled: boolean;
|
|
24
|
+
knowledgeTracker: KnowledgeTracker;
|
|
25
|
+
constructor(knowledgeTracker: KnowledgeTracker, options?: {
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
});
|
|
28
|
+
getExperienceDirectories(): string[];
|
|
29
|
+
ensureDirectory(dir: string): void;
|
|
30
|
+
readExperienceFile(stateHash: string): {
|
|
31
|
+
content: string;
|
|
32
|
+
data: any;
|
|
33
|
+
};
|
|
34
|
+
readExperienceFileAt(filePath: string): {
|
|
35
|
+
content: string;
|
|
36
|
+
data: any;
|
|
37
|
+
};
|
|
38
|
+
writeExperienceFile(stateHash: string, content: string, frontmatter?: any): void;
|
|
39
|
+
getExperienceFilePath(stateHash: string): string;
|
|
40
|
+
ensureExperienceFile(state: ActionResult): string;
|
|
41
|
+
updateSummary(state: ActionResult, summary: string): void;
|
|
42
|
+
isWritingDisabled(state: ActionResult): boolean;
|
|
43
|
+
writeAction(state: ActionResult, action: ActionInput): void;
|
|
44
|
+
writeFlow(state: ActionResult, body: string, relatedUrls?: string[]): void;
|
|
45
|
+
getAllExperience(): ExperienceFile[];
|
|
46
|
+
getRelevantExperience(state: ActionResult, options?: {
|
|
47
|
+
includeDescendantExperience?: boolean;
|
|
48
|
+
}): ExperienceFile[];
|
|
49
|
+
getSuccessfulExperience(state: ActionResult, options?: {
|
|
50
|
+
includeDescendants?: boolean;
|
|
51
|
+
stripCode?: boolean;
|
|
52
|
+
}): string[];
|
|
53
|
+
getExperienceTableOfContents(state: ActionResult, options?: {
|
|
54
|
+
includeDescendantExperience?: boolean;
|
|
55
|
+
}): ExperienceTocEntry[];
|
|
56
|
+
renderExperienceTocFor(state: ActionResult): string;
|
|
57
|
+
getExperienceSection(fileTag: string, sectionIndex: number, state: ActionResult, options?: {
|
|
58
|
+
includeDescendantExperience?: boolean;
|
|
59
|
+
}): {
|
|
60
|
+
title: string;
|
|
61
|
+
url: string;
|
|
62
|
+
content: string;
|
|
63
|
+
} | null;
|
|
64
|
+
buildToc(records: ExperienceFile[]): ExperienceTocEntry[];
|
|
65
|
+
readSectionByHash(fileHash: string, sectionIndex: number): {
|
|
66
|
+
title: string;
|
|
67
|
+
body: string;
|
|
68
|
+
} | null;
|
|
69
|
+
findExperienceFileByHash(fileHash: string): string | null;
|
|
70
|
+
listAllExperienceToc(filter?: string, options?: {
|
|
71
|
+
recency?: 'recent' | 'old';
|
|
72
|
+
}): ExperienceTocEntry[];
|
|
73
|
+
getExperienceSectionByTag(fileTag: string, sectionIndex: number, filter?: string): {
|
|
74
|
+
title: string;
|
|
75
|
+
url: string;
|
|
76
|
+
content: string;
|
|
77
|
+
fileHash: string;
|
|
78
|
+
} | null;
|
|
79
|
+
}
|
|
80
|
+
export declare function renderExperienceToc(toc: ExperienceTocEntry[]): string;
|
|
81
|
+
export interface ExperienceFile {
|
|
82
|
+
filePath: string;
|
|
83
|
+
data: {
|
|
84
|
+
url?: string;
|
|
85
|
+
title?: string;
|
|
86
|
+
[key: string]: any;
|
|
87
|
+
};
|
|
88
|
+
content: string;
|
|
89
|
+
mtime: Date;
|
|
90
|
+
}
|
|
91
|
+
export interface ActionInput {
|
|
92
|
+
title: string;
|
|
93
|
+
code: string;
|
|
94
|
+
explanation?: string;
|
|
95
|
+
}
|
|
96
|
+
export interface SessionStep {
|
|
97
|
+
message: string;
|
|
98
|
+
status: 'passed' | 'failed' | 'neutral';
|
|
99
|
+
tool?: string;
|
|
100
|
+
code?: string;
|
|
101
|
+
discovery?: string;
|
|
102
|
+
}
|
|
103
|
+
export interface ExperienceTocEntry {
|
|
104
|
+
fileTag: string;
|
|
105
|
+
fileHash: string;
|
|
106
|
+
url: string;
|
|
107
|
+
sections: {
|
|
108
|
+
index: number;
|
|
109
|
+
level: 2 | 3;
|
|
110
|
+
title: string;
|
|
111
|
+
}[];
|
|
112
|
+
}
|