explorbot 0.1.31 → 0.1.32-beta.1
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/dist/boat/api-tester/example/apibot.config.js +30 -0
- package/dist/package.json +10 -25
- package/dist/src/action-result.d.ts +133 -0
- package/dist/src/action-result.js +22 -7
- package/dist/src/action.d.ts +50 -0
- package/dist/src/action.js +10 -5
- 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.d.ts +143 -0
- package/dist/src/ai/conversation.d.ts +31 -0
- package/dist/src/ai/driller.d.ts +161 -0
- package/dist/src/ai/experience-compactor.d.ts +53 -0
- package/dist/src/ai/fisherman-tools.d.ts +90 -0
- package/dist/src/ai/fisherman.d.ts +30 -0
- package/dist/src/ai/historian/codeceptjs.d.ts +15 -0
- 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 +20 -0
- package/dist/src/ai/historian/screencast.d.ts +32 -0
- package/dist/src/ai/historian/utils.d.ts +4 -0
- package/dist/src/ai/historian.d.ts +108 -0
- package/dist/src/ai/navigator.d.ts +56 -0
- package/dist/src/ai/pilot.d.ts +83 -0
- 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/provider.d.ts +50 -0
- package/dist/src/ai/provider.js +10 -3
- package/dist/src/ai/quartermaster.d.ts +57 -0
- package/dist/src/ai/rerunner.d.ts +49 -0
- package/dist/src/ai/researcher/cache.d.ts +6 -0
- 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/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/research-result.d.ts +16 -0
- package/dist/src/ai/researcher/sections.d.ts +19 -0
- package/dist/src/ai/rules.d.ts +15 -0
- package/dist/src/ai/session-analyst.d.ts +11 -0
- package/dist/src/ai/task-agent.d.ts +28 -0
- package/dist/src/ai/tester.d.ts +103 -0
- package/dist/src/ai/tools.d.ts +41 -0
- 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/context-aria-command.d.ts +6 -0
- package/dist/src/commands/context-command.d.ts +11 -0
- 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/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/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/learn-command.d.ts +7 -0
- 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 +8 -0
- package/dist/src/components/AddRule.d.ts +9 -0
- package/dist/src/components/App.d.ts +9 -0
- 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 +251 -0
- package/dist/src/execution-controller.d.ts +25 -0
- package/dist/src/experience-tracker.d.ts +107 -0
- package/dist/src/experience-tracker.js +2 -1
- package/dist/src/explorbot.d.ts +107 -0
- package/dist/src/explorer.d.ts +140 -0
- package/dist/src/explorer.js +13 -9
- 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 +9 -2
- 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 +185 -0
- package/dist/src/state-manager.js +0 -7
- 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 +20 -0
- package/dist/src/utils/browser-errors.d.ts +8 -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 +25 -0
- 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 +124 -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-parser.d.ts +17 -0
- package/dist/src/utils/markdown-query.d.ts +40 -0
- 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 +6 -0
- 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 +3 -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 +44 -0
- package/dist/src/utils/xpath.d.ts +17 -0
- package/package.json +10 -25
- package/src/action-result.ts +22 -7
- package/src/action.ts +12 -5
- package/src/ai/provider.ts +10 -3
- package/src/experience-tracker.ts +2 -1
- package/src/explorer.ts +14 -9
- package/src/index.ts +9 -0
- package/src/knowledge-tracker.ts +7 -1
- package/src/observability.ts +2 -1
- package/src/state-manager.ts +0 -8
- package/src/utils/secrets.ts +29 -0
- package/src/index.tsx +0 -62
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Locator } from './locators.js';
|
|
2
|
+
import { type ResearchSection } from './parser.js';
|
|
3
|
+
export declare class ResearchResult {
|
|
4
|
+
text: string;
|
|
5
|
+
url: string;
|
|
6
|
+
createdAt: Date;
|
|
7
|
+
locators: Locator[];
|
|
8
|
+
constructor(text: string, url: string);
|
|
9
|
+
parseLocators(): void;
|
|
10
|
+
get containers(): string[];
|
|
11
|
+
get containerLocators(): Locator[];
|
|
12
|
+
updateSection(sectionName: string, locators: Locator[]): void;
|
|
13
|
+
rebuildSectionInText(section: ResearchSection): void;
|
|
14
|
+
cleanup(): void;
|
|
15
|
+
reorderColumns(columns: string[]): string[];
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ActionResult } from '../../action-result.js';
|
|
2
|
+
import type Explorer from '../../explorer.js';
|
|
3
|
+
import type { StateManager } from '../../state-manager.js';
|
|
4
|
+
import type { Provider } from '../provider.js';
|
|
5
|
+
import type { Constructor } from './mixin.js';
|
|
6
|
+
export interface SectionMethods {
|
|
7
|
+
researchBySections(): Promise<string>;
|
|
8
|
+
}
|
|
9
|
+
export declare function WithSections<T extends Constructor>(Base: T): {
|
|
10
|
+
new (...args: any[]): {
|
|
11
|
+
explorer: Explorer;
|
|
12
|
+
provider: Provider;
|
|
13
|
+
stateManager: StateManager;
|
|
14
|
+
actionResult: ActionResult | undefined;
|
|
15
|
+
researchBySections(): Promise<string>;
|
|
16
|
+
_detectFocusCss(): Promise<string | null>;
|
|
17
|
+
_researchSingleSection(name: string, description: string, ariaSnapshot: string, focusCss: string | null): Promise<string>;
|
|
18
|
+
};
|
|
19
|
+
} & T;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const recommendedCodeceptCommands: readonly ["I.click", "I.type", "I.fillField", "I.see", "I.seeElement"];
|
|
2
|
+
export declare const locatorRule: string;
|
|
3
|
+
export declare const fileUploadRule: string;
|
|
4
|
+
export declare const formRequirementsRule: string;
|
|
5
|
+
export declare const protectionRule: string;
|
|
6
|
+
export declare const dataProtectionRules: string;
|
|
7
|
+
export declare const capabilityGroundingRule: string;
|
|
8
|
+
export declare const focusedElementRule: string;
|
|
9
|
+
export declare const unexpectedPopupRule: string;
|
|
10
|
+
export declare const sectionContextRule: string;
|
|
11
|
+
export declare function multipleTabsRule(tabs: Array<{
|
|
12
|
+
url: string;
|
|
13
|
+
title: string;
|
|
14
|
+
}>): string;
|
|
15
|
+
export declare const actionRule: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Test } from '../test-plan.js';
|
|
2
|
+
import type { Agent } from './agent.js';
|
|
3
|
+
import type { Provider } from './provider.js';
|
|
4
|
+
export declare class SessionAnalyst implements Agent {
|
|
5
|
+
emoji: string;
|
|
6
|
+
provider: Provider;
|
|
7
|
+
constructor(provider: Provider);
|
|
8
|
+
analyze(tests: Test[]): Promise<string>;
|
|
9
|
+
writeReport(markdown: string): string;
|
|
10
|
+
serializeTest(test: Test, ref: number): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ActionResult } from '../action-result.js';
|
|
2
|
+
import { type ExperienceTracker } from '../experience-tracker.js';
|
|
3
|
+
import type { KnowledgeTracker } from '../knowledge-tracker.js';
|
|
4
|
+
import { Historian } from './historian.js';
|
|
5
|
+
import type { Navigator } from './navigator.js';
|
|
6
|
+
import type { Provider } from './provider.js';
|
|
7
|
+
import { Quartermaster } from './quartermaster.js';
|
|
8
|
+
export declare function isInteractive(): boolean;
|
|
9
|
+
export declare abstract class TaskAgent {
|
|
10
|
+
consecutiveFailures: number;
|
|
11
|
+
consecutiveEmptyResults: number;
|
|
12
|
+
recentToolCalls: any[];
|
|
13
|
+
readonly ACTION_TOOLS: string[];
|
|
14
|
+
_historian: Historian | null;
|
|
15
|
+
_quartermaster: Quartermaster | null;
|
|
16
|
+
abstract getNavigator(): Navigator;
|
|
17
|
+
abstract getExperienceTracker(): ExperienceTracker;
|
|
18
|
+
abstract getKnowledgeTracker(): KnowledgeTracker;
|
|
19
|
+
abstract getProvider(): Provider;
|
|
20
|
+
getKnowledge(actionResult: ActionResult): string;
|
|
21
|
+
getExperience(actionResult: ActionResult): string;
|
|
22
|
+
setHistorian(historian: Historian): void;
|
|
23
|
+
getHistorian(): Historian;
|
|
24
|
+
setQuartermaster(quartermaster: Quartermaster): void;
|
|
25
|
+
getQuartermaster(): Quartermaster;
|
|
26
|
+
trackToolExecutions(toolExecutions: any[]): void;
|
|
27
|
+
resetFailureCount(): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { ActionResult } from '../action-result.js';
|
|
2
|
+
import type { ExperienceTracker } from '../experience-tracker.js';
|
|
3
|
+
import type Explorer from '../explorer.js';
|
|
4
|
+
import { type Test } from '../test-plan.js';
|
|
5
|
+
import { HooksRunner } from '../utils/hooks-runner.js';
|
|
6
|
+
import type { Agent } from './agent.js';
|
|
7
|
+
import type { Captain } from './captain.js';
|
|
8
|
+
import type { Conversation } from './conversation.js';
|
|
9
|
+
import { Navigator } from './navigator.js';
|
|
10
|
+
import type { Pilot } from './pilot.js';
|
|
11
|
+
import { Provider } from './provider.js';
|
|
12
|
+
import { Researcher } from './researcher.js';
|
|
13
|
+
import { TaskAgent } from './task-agent.js';
|
|
14
|
+
export declare class Tester extends TaskAgent implements Agent {
|
|
15
|
+
readonly ACTION_TOOLS: string[];
|
|
16
|
+
readonly SPECIAL_CONTEXT_ACTION_TOOLS: string[];
|
|
17
|
+
emoji: string;
|
|
18
|
+
explorer: Explorer;
|
|
19
|
+
provider: Provider;
|
|
20
|
+
currentConversation: Conversation | null;
|
|
21
|
+
pilot: Pilot | null;
|
|
22
|
+
captain: Captain | null;
|
|
23
|
+
MAX_ITERATIONS: number;
|
|
24
|
+
MAX_EXTENSIONS: number;
|
|
25
|
+
ASSERTION_TOOLS: string[];
|
|
26
|
+
researcher: Researcher;
|
|
27
|
+
navigator: Navigator;
|
|
28
|
+
agentTools: any;
|
|
29
|
+
executionLogFile: string | null;
|
|
30
|
+
previousUrl: string | null;
|
|
31
|
+
previousStateHash: string | null;
|
|
32
|
+
pageStateHash: string | null;
|
|
33
|
+
pageActionResult: ActionResult | null;
|
|
34
|
+
hooksRunner: HooksRunner;
|
|
35
|
+
seenUiMapUrls: Set<string>;
|
|
36
|
+
lastAnalyzedStateHash: string | null;
|
|
37
|
+
stalledIterations: number;
|
|
38
|
+
readonly MAX_STALLED_ITERATIONS = 3;
|
|
39
|
+
constructor(explorer: Explorer, provider: Provider, researcher: Researcher, navigator: Navigator, agentTools?: any);
|
|
40
|
+
getNavigator(): Navigator;
|
|
41
|
+
getExperienceTracker(): ExperienceTracker;
|
|
42
|
+
getKnowledgeTracker(): import("../knowledge-tracker.js").KnowledgeTracker;
|
|
43
|
+
getProvider(): Provider;
|
|
44
|
+
setPilot(pilot: Pilot): void;
|
|
45
|
+
setCaptain(captain: Captain): void;
|
|
46
|
+
getCurrentState(): ActionResult;
|
|
47
|
+
get progressCheckInterval(): number;
|
|
48
|
+
getConversation(): Conversation | null;
|
|
49
|
+
test(task: Test): Promise<{
|
|
50
|
+
success: boolean;
|
|
51
|
+
}>;
|
|
52
|
+
runTestSession(task: Test, initialState: ActionResult, conversation: Conversation, handlers: TestSessionHandlers): Promise<{
|
|
53
|
+
success: boolean;
|
|
54
|
+
}>;
|
|
55
|
+
shouldAnalyzeProgress(iteration: number, currentState: ActionResult): boolean;
|
|
56
|
+
shouldStopForStalledExecution(task: Test, previousState: ActionResult, toolExecutions: any[]): boolean;
|
|
57
|
+
prepareInstructionsForNextStep(task: Test): Promise<string>;
|
|
58
|
+
reinjectContextIfNeeded(iteration: number, currentState: ActionResult): Promise<string>;
|
|
59
|
+
promptLogStep(task: Test): Promise<string>;
|
|
60
|
+
finishTest(task: Test): void;
|
|
61
|
+
abortStartedTestOnErrorPage(task: Test, actionResult: ActionResult): Promise<{
|
|
62
|
+
success: boolean;
|
|
63
|
+
}>;
|
|
64
|
+
buildStopTestMeta(task: Test): Record<string, string>;
|
|
65
|
+
getSystemMessage(): string;
|
|
66
|
+
buildScenarioBlock(task: Test, actionResult: ActionResult): string;
|
|
67
|
+
getDeletableSessionNames(task: Test): string[];
|
|
68
|
+
buildAvailableFiles(): string;
|
|
69
|
+
buildDeletionScope(task: Test): string;
|
|
70
|
+
createTestFlowTools(task: Test, currentState: ActionResult, conversation: Conversation): {
|
|
71
|
+
reset: import("@ai-sdk/provider-utils").ExecutableTool<import("ai").Tool<{
|
|
72
|
+
reason?: string;
|
|
73
|
+
}, any, import("@ai-sdk/provider-utils").Context>>;
|
|
74
|
+
stop: import("@ai-sdk/provider-utils").ExecutableTool<import("ai").Tool<{
|
|
75
|
+
reason: any;
|
|
76
|
+
}, {
|
|
77
|
+
success: boolean;
|
|
78
|
+
action: string;
|
|
79
|
+
message: any;
|
|
80
|
+
}, import("@ai-sdk/provider-utils").Context>>;
|
|
81
|
+
finish: import("@ai-sdk/provider-utils").ExecutableTool<import("ai").Tool<{
|
|
82
|
+
verify: any;
|
|
83
|
+
}, {
|
|
84
|
+
success: boolean;
|
|
85
|
+
action: string;
|
|
86
|
+
message: any;
|
|
87
|
+
}, import("@ai-sdk/provider-utils").Context>>;
|
|
88
|
+
record: import("@ai-sdk/provider-utils").ExecutableTool<import("ai").Tool<any, {
|
|
89
|
+
success: boolean;
|
|
90
|
+
action: string;
|
|
91
|
+
status: any;
|
|
92
|
+
message: string;
|
|
93
|
+
suggestion: string;
|
|
94
|
+
}, import("@ai-sdk/provider-utils").Context>>;
|
|
95
|
+
};
|
|
96
|
+
handleLoopError(task: Test, error: unknown): Promise<'continue' | 'stop'>;
|
|
97
|
+
shouldStopAfterStalledLoopError(task: Test): boolean;
|
|
98
|
+
cleanupStartedTest(task: Test): Promise<void>;
|
|
99
|
+
}
|
|
100
|
+
interface TestSessionHandlers {
|
|
101
|
+
offFailedRequest?: () => void;
|
|
102
|
+
}
|
|
103
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ActionResult } from '../action-result.js';
|
|
2
|
+
import type { ExperienceTracker } from '../experience-tracker.js';
|
|
3
|
+
import type Explorer from '../explorer.js';
|
|
4
|
+
import { type Task } from '../test-plan.js';
|
|
5
|
+
import { Navigator } from './navigator.js';
|
|
6
|
+
import { Researcher } from './researcher.js';
|
|
7
|
+
export declare const ASSERTION_TOOLS: readonly ["verify"];
|
|
8
|
+
export declare function createCodeceptJSTools(explorer: Explorer, task: Task): {
|
|
9
|
+
click: import("@ai-sdk/provider-utils").ExecutableTool<import("ai").Tool<{
|
|
10
|
+
commands: any;
|
|
11
|
+
explanation: any;
|
|
12
|
+
}, Record<string, any>, import("@ai-sdk/provider-utils").Context>>;
|
|
13
|
+
hover: import("@ai-sdk/provider-utils").ExecutableTool<import("ai").Tool<{
|
|
14
|
+
commands: any;
|
|
15
|
+
explanation: any;
|
|
16
|
+
}, Record<string, any>, import("@ai-sdk/provider-utils").Context>>;
|
|
17
|
+
pressKey: import("@ai-sdk/provider-utils").ExecutableTool<import("ai").Tool<{
|
|
18
|
+
key: string;
|
|
19
|
+
explanation: string;
|
|
20
|
+
modifier?: string | string[];
|
|
21
|
+
}, Record<string, any>, import("@ai-sdk/provider-utils").Context>>;
|
|
22
|
+
form: import("@ai-sdk/provider-utils").ExecutableTool<import("ai").Tool<{
|
|
23
|
+
codeBlock: any;
|
|
24
|
+
explanation: any;
|
|
25
|
+
}, Record<string, any>, import("@ai-sdk/provider-utils").Context>>;
|
|
26
|
+
};
|
|
27
|
+
export declare function createSpecialContextTools(explorer: Explorer, context: 'iframe'): {
|
|
28
|
+
exitIframe?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
exitIframe: import("@ai-sdk/provider-utils").ExecutableTool<import("ai").Tool<{
|
|
31
|
+
reason?: string;
|
|
32
|
+
}, Record<string, any>, import("@ai-sdk/provider-utils").Context>>;
|
|
33
|
+
};
|
|
34
|
+
export declare function createAgentTools({ explorer, researcher, navigator, experienceTracker, getState, supervisor, }: {
|
|
35
|
+
explorer: Explorer;
|
|
36
|
+
researcher: Researcher;
|
|
37
|
+
navigator: Navigator;
|
|
38
|
+
experienceTracker?: ExperienceTracker;
|
|
39
|
+
getState?: () => ActionResult | null;
|
|
40
|
+
supervisor?: boolean;
|
|
41
|
+
}): any;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RequestResult } from './request-result.js';
|
|
2
|
+
export declare class ApiClient {
|
|
3
|
+
baseEndpoint: string;
|
|
4
|
+
defaultHeaders: Record<string, string>;
|
|
5
|
+
constructor(baseEndpoint: string, defaultHeaders?: Record<string, string>);
|
|
6
|
+
setHeaders(headers: Record<string, string>): void;
|
|
7
|
+
getHeaders(): Record<string, string>;
|
|
8
|
+
getBaseEndpoint(): string;
|
|
9
|
+
request(opts: {
|
|
10
|
+
method: string;
|
|
11
|
+
path: string;
|
|
12
|
+
headers?: Record<string, string>;
|
|
13
|
+
body?: any;
|
|
14
|
+
queryParams?: Record<string, string>;
|
|
15
|
+
}): Promise<RequestResult>;
|
|
16
|
+
static resetCounter(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export declare function generateRequestId(method: string, urlPath: string, prefix?: string): string;
|
|
2
|
+
export declare function resetRequestCounter(): void;
|
|
3
|
+
export declare class RequestResult {
|
|
4
|
+
id: string;
|
|
5
|
+
method: string;
|
|
6
|
+
path: string;
|
|
7
|
+
fullUrl: string;
|
|
8
|
+
requestHeaders: Record<string, string>;
|
|
9
|
+
requestBody?: any;
|
|
10
|
+
status: number;
|
|
11
|
+
statusText: string;
|
|
12
|
+
responseHeaders: Record<string, string>;
|
|
13
|
+
timing: number;
|
|
14
|
+
timestamp: Date;
|
|
15
|
+
error?: string;
|
|
16
|
+
requestFile: string;
|
|
17
|
+
responseFile: string;
|
|
18
|
+
_rawResponseBody?: string;
|
|
19
|
+
constructor(opts: {
|
|
20
|
+
id: string;
|
|
21
|
+
method: string;
|
|
22
|
+
path: string;
|
|
23
|
+
fullUrl: string;
|
|
24
|
+
requestHeaders: Record<string, string>;
|
|
25
|
+
requestBody?: any;
|
|
26
|
+
status: number;
|
|
27
|
+
statusText: string;
|
|
28
|
+
responseHeaders: Record<string, string>;
|
|
29
|
+
timing: number;
|
|
30
|
+
timestamp: Date;
|
|
31
|
+
error?: string;
|
|
32
|
+
});
|
|
33
|
+
get rawResponseBody(): string;
|
|
34
|
+
set rawResponseBodyValue(value: string);
|
|
35
|
+
get responseBody(): any;
|
|
36
|
+
save(outputDir: string): void;
|
|
37
|
+
static load(requestFile: string): RequestResult;
|
|
38
|
+
toSummary(): string;
|
|
39
|
+
extractIdAndTitle(): {
|
|
40
|
+
id?: string | number;
|
|
41
|
+
title?: string;
|
|
42
|
+
};
|
|
43
|
+
toCurlCommand(): string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { RequestResult } from './request-result.js';
|
|
2
|
+
export declare class RequestStore {
|
|
3
|
+
capturedRequests: RequestResult[];
|
|
4
|
+
madeRequests: RequestResult[];
|
|
5
|
+
failedRequests: RequestResult[];
|
|
6
|
+
onFailedListeners: Array<(r: RequestResult) => void>;
|
|
7
|
+
outputDir: string;
|
|
8
|
+
constructor(outputDir: string);
|
|
9
|
+
addCapturedRequest(result: RequestResult): void;
|
|
10
|
+
addFailedRequest(result: RequestResult): void;
|
|
11
|
+
getFailedRequests(): RequestResult[];
|
|
12
|
+
onFailedRequest(cb: (r: RequestResult) => void): () => void;
|
|
13
|
+
addMadeRequest(result: RequestResult): void;
|
|
14
|
+
addRequest(result: RequestResult): void;
|
|
15
|
+
getCapturedRequests(): RequestResult[];
|
|
16
|
+
getMadeRequests(): RequestResult[];
|
|
17
|
+
getRequests(): RequestResult[];
|
|
18
|
+
getLastRequest(): RequestResult | undefined;
|
|
19
|
+
getRequestsByEndpoint(pathPrefix: string): RequestResult[];
|
|
20
|
+
getRequestsByMethod(method: string): RequestResult[];
|
|
21
|
+
getRequestsByStatus(status: number): RequestResult[];
|
|
22
|
+
toEndpointList(): string;
|
|
23
|
+
extractAuthHeaders(): Record<string, string>;
|
|
24
|
+
findCapturedRequest(method: string, pathPrefix: string): RequestResult | undefined;
|
|
25
|
+
toLog(): string;
|
|
26
|
+
loadFromDisk(): void;
|
|
27
|
+
getWriteRequestsForScope(scopePath: string): RequestResult[];
|
|
28
|
+
clear(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function validateSpecs(specs?: string[]): void;
|
|
2
|
+
export declare function loadSpec(specPaths: string[], outputDir: string): Promise<any>;
|
|
3
|
+
export declare function extractEndpointDefinition(schema: any, endpoint: string, baseEndpoint?: string): string;
|
|
4
|
+
export declare function searchEndpoints(schema: any, query: string, baseEndpoint?: string): string;
|
|
5
|
+
export declare function listAllEndpoints(schema: any, baseEndpoint?: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RequestStore } from './request-store.js';
|
|
2
|
+
export declare class XhrCapture {
|
|
3
|
+
store: RequestStore;
|
|
4
|
+
baseOrigin: string;
|
|
5
|
+
handler: ((response: any) => Promise<void>) | null;
|
|
6
|
+
constructor(store: RequestStore, baseUrl: string);
|
|
7
|
+
attach(page: any): void;
|
|
8
|
+
detach(page: any): void;
|
|
9
|
+
captureResponse(response: any): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare function getEndpointFilePath(): string;
|
|
2
|
+
declare function readEndpoint(): string | null;
|
|
3
|
+
declare function removeEndpointFile(): void;
|
|
4
|
+
declare function isServerRunning(wsEndpoint: string): Promise<boolean>;
|
|
5
|
+
declare function launchServer(opts: {
|
|
6
|
+
browser?: string;
|
|
7
|
+
show?: boolean;
|
|
8
|
+
}): Promise<any>;
|
|
9
|
+
declare function getAliveEndpoint(): Promise<string | null>;
|
|
10
|
+
export { readEndpoint, removeEndpointFile, isServerRunning, launchServer, getEndpointFilePath, getAliveEndpoint };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type BaseCommand } from './commands/index.js';
|
|
2
|
+
import type { ExplorBot } from './explorbot.js';
|
|
3
|
+
export type InputSubmitCallback = (input: string) => Promise<void>;
|
|
4
|
+
export interface InputManager {
|
|
5
|
+
registerInputPane(addLog: (entry: string) => void, onSubmit: InputSubmitCallback): () => void;
|
|
6
|
+
getAvailableCommands(): string[];
|
|
7
|
+
getFilteredCommands(input: string): string[];
|
|
8
|
+
getAutocomplete(input: string, cursor: number): CommandAutocomplete;
|
|
9
|
+
setExitOnEmptyInput(enabled: boolean): void;
|
|
10
|
+
}
|
|
11
|
+
export interface ParsedCommand {
|
|
12
|
+
name: string;
|
|
13
|
+
args: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface CommandAutocompleteSuggestion {
|
|
16
|
+
value: string;
|
|
17
|
+
display: string;
|
|
18
|
+
description: string;
|
|
19
|
+
argumentHint?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface CommandAutocomplete {
|
|
22
|
+
suggestions: CommandAutocompleteSuggestion[];
|
|
23
|
+
replaceFrom: number;
|
|
24
|
+
replaceTo: number;
|
|
25
|
+
visible: boolean;
|
|
26
|
+
argumentHint?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare class CommandHandler implements InputManager {
|
|
29
|
+
explorBot: ExplorBot;
|
|
30
|
+
commands: BaseCommand[];
|
|
31
|
+
registeredInputPanes: Set<{
|
|
32
|
+
addLog: (entry: string) => void;
|
|
33
|
+
onSubmit: InputSubmitCallback;
|
|
34
|
+
}>;
|
|
35
|
+
exitOnEmptyInput: boolean;
|
|
36
|
+
runningCommands: Set<string>;
|
|
37
|
+
constructor(explorBot: ExplorBot);
|
|
38
|
+
findCommand(name: string): BaseCommand | undefined;
|
|
39
|
+
getAvailableCommands(): string[];
|
|
40
|
+
getAutocomplete(input: string, cursor: number): CommandAutocomplete;
|
|
41
|
+
getCommandDescriptions(): {
|
|
42
|
+
name: string;
|
|
43
|
+
description: string;
|
|
44
|
+
options: string;
|
|
45
|
+
}[];
|
|
46
|
+
executeCommand(input: string): Promise<void>;
|
|
47
|
+
executeBrowserCommand(input: string): Promise<void>;
|
|
48
|
+
isCommand(input: string): boolean;
|
|
49
|
+
registerInputPane(addLog: (entry: string) => void, onSubmit: InputSubmitCallback): () => void;
|
|
50
|
+
getFilteredCommands(input: string): string[];
|
|
51
|
+
setExitOnEmptyInput(enabled: boolean): void;
|
|
52
|
+
submitInput(input: string): Promise<void>;
|
|
53
|
+
getSlashAutocomplete(input: string, cursor: number): CommandAutocomplete | null;
|
|
54
|
+
getCodeceptAutocomplete(input: string, cursor: number): CommandAutocomplete | null;
|
|
55
|
+
getExitAutocomplete(input: string, cursor: number): CommandAutocomplete | null;
|
|
56
|
+
getSlashCommandEntries(): AutocompleteEntry[];
|
|
57
|
+
getCodeceptEntries(): AutocompleteEntry[];
|
|
58
|
+
rankSuggestions(query: string, entries: AutocompleteEntry[]): CommandAutocompleteSuggestion[];
|
|
59
|
+
getMatchScore(query: string, candidate: string): number;
|
|
60
|
+
}
|
|
61
|
+
type AutocompleteEntry = {
|
|
62
|
+
aliases: string[];
|
|
63
|
+
argumentHint?: string;
|
|
64
|
+
canonical: string;
|
|
65
|
+
description: string;
|
|
66
|
+
value: string;
|
|
67
|
+
};
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand, type Suggestion } from './base-command.js';
|
|
2
|
+
export declare class AddRuleCommand extends BaseCommand {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
suggestions: Suggestion[];
|
|
6
|
+
execute(args: string): Promise<void>;
|
|
7
|
+
static createRuleFile(agentName: string, ruleName: string, opts?: {
|
|
8
|
+
content?: string;
|
|
9
|
+
urlPattern?: string;
|
|
10
|
+
}): string | null;
|
|
11
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ExplorBot } from '../explorbot.js';
|
|
2
|
+
export interface CommandOption {
|
|
3
|
+
flags: string;
|
|
4
|
+
description: string;
|
|
5
|
+
}
|
|
6
|
+
export interface Suggestion {
|
|
7
|
+
command?: string;
|
|
8
|
+
hint: string;
|
|
9
|
+
}
|
|
10
|
+
export declare abstract class BaseCommand {
|
|
11
|
+
abstract name: string;
|
|
12
|
+
abstract description: string;
|
|
13
|
+
aliases: string[];
|
|
14
|
+
options: CommandOption[];
|
|
15
|
+
tuiEnabled: boolean;
|
|
16
|
+
suggestions: Suggestion[];
|
|
17
|
+
explorBot: ExplorBot;
|
|
18
|
+
constructor(explorBot: ExplorBot);
|
|
19
|
+
abstract execute(args: string): Promise<void>;
|
|
20
|
+
matches(commandName: string): boolean;
|
|
21
|
+
printSuggestions(): void;
|
|
22
|
+
parseArgs(args: string): {
|
|
23
|
+
opts: Record<string, string | boolean>;
|
|
24
|
+
args: string[];
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand, type Suggestion } from './base-command.js';
|
|
2
|
+
export declare const CLEAN_TARGETS: Record<string, {
|
|
3
|
+
description: string;
|
|
4
|
+
getDir: () => string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare class CleanCommand extends BaseCommand {
|
|
7
|
+
name: string;
|
|
8
|
+
description: string;
|
|
9
|
+
suggestions: Suggestion[];
|
|
10
|
+
execute(args: string): Promise<void>;
|
|
11
|
+
cleanTarget(name: string): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ExperienceFile } from '../ai/experience-compactor.js';
|
|
2
|
+
import type { ExperienceTracker } from '../experience-tracker.js';
|
|
3
|
+
import { BaseCommand, type Suggestion } from './base-command.js';
|
|
4
|
+
export declare class CompactCommand extends BaseCommand {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
options: {
|
|
8
|
+
flags: string;
|
|
9
|
+
description: string;
|
|
10
|
+
}[];
|
|
11
|
+
suggestions: Suggestion[];
|
|
12
|
+
execute(args: string): Promise<void>;
|
|
13
|
+
buildDryRunSuggestions(compactor: ReturnType<typeof this.explorBot.agentExperienceCompactor>, files: ExperienceFile[], target?: string): Suggestion[];
|
|
14
|
+
runFullSweep(compactor: ReturnType<typeof this.explorBot.agentExperienceCompactor>, merge: boolean): Promise<{
|
|
15
|
+
merged: number;
|
|
16
|
+
compacted: number;
|
|
17
|
+
}>;
|
|
18
|
+
resolveTarget(tracker: ExperienceTracker, target?: string): ExperienceFile[] | null;
|
|
19
|
+
printDryRun(compactor: ReturnType<typeof this.explorBot.agentExperienceCompactor>, files: ExperienceFile[], target: string | undefined, willMerge: boolean): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand, type Suggestion } from './base-command.js';
|
|
2
|
+
export declare class ContextCommand extends BaseCommand {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
suggestions: Suggestion[];
|
|
6
|
+
options: {
|
|
7
|
+
flags: string;
|
|
8
|
+
description: string;
|
|
9
|
+
}[];
|
|
10
|
+
execute(args: string): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseCommand, type Suggestion } from './base-command.js';
|
|
2
|
+
export declare class DrillCommand extends BaseCommand {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
aliases: string[];
|
|
6
|
+
suggestions: Suggestion[];
|
|
7
|
+
execute(args: string): Promise<void>;
|
|
8
|
+
parseKnowledgeArg(args: string): string | undefined;
|
|
9
|
+
parseMaxArg(args: string): number | undefined;
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ExperienceTocEntry, ExperienceTracker } from '../experience-tracker.js';
|
|
2
|
+
import { BaseCommand, type Suggestion } from './base-command.js';
|
|
3
|
+
export declare class ExperienceCommand extends BaseCommand {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
options: {
|
|
7
|
+
flags: string;
|
|
8
|
+
description: string;
|
|
9
|
+
}[];
|
|
10
|
+
suggestions: Suggestion[];
|
|
11
|
+
execute(args: string): Promise<void>;
|
|
12
|
+
expand(tracker: ExperienceTracker, fileTag: string, sectionIndex: number, urlFilter?: string): void;
|
|
13
|
+
formatToc(toc: ExperienceTocEntry[], urlFilter?: string, recency?: 'recent' | 'old'): string;
|
|
14
|
+
stripLeadingHeading(body: string): string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type Plan, type Test } from '../test-plan.js';
|
|
2
|
+
import { BaseCommand, type Suggestion } from './base-command.js';
|
|
3
|
+
export declare class ExploreCommand extends BaseCommand {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
options: {
|
|
7
|
+
flags: string;
|
|
8
|
+
description: string;
|
|
9
|
+
}[];
|
|
10
|
+
suggestions: Suggestion[];
|
|
11
|
+
maxTests?: number;
|
|
12
|
+
dryRun: boolean;
|
|
13
|
+
testsRun: number;
|
|
14
|
+
completedPlans: Plan[];
|
|
15
|
+
failedSubPages: Set<string>;
|
|
16
|
+
oldTestRefs: Set<Test>;
|
|
17
|
+
priorityFilter?: Set<string>;
|
|
18
|
+
getCurrentPageUrl(): string | undefined;
|
|
19
|
+
execute(args: string): Promise<void>;
|
|
20
|
+
originLabel(test: Test): string;
|
|
21
|
+
printPreview(label: string, tests: Test[]): void;
|
|
22
|
+
runFreshMode(mainUrl: string | undefined, feature: string | undefined, styles?: string[]): Promise<void>;
|
|
23
|
+
runReuseMode(mainUrl: string | undefined, feature: string | undefined, cfg: ConfigureSpec): Promise<void>;
|
|
24
|
+
discoverNewSubPages(mainPlan: Plan, mainUrl: string | undefined, styles: string[] | undefined, knownUrls: Set<string>): Promise<void>;
|
|
25
|
+
replanAndRun(pageUrl: string | undefined, feature: string | undefined, existingPlan: Plan, styles?: string[]): Promise<void>;
|
|
26
|
+
runAllStyles(pageUrl?: string, feature?: string, parentPlan?: Plan, completedPlans?: Plan[], styles?: string[]): Promise<void>;
|
|
27
|
+
rememberCurrentPlan(): void;
|
|
28
|
+
planWithRetry(feature: string | undefined, opts: {
|
|
29
|
+
fresh: boolean;
|
|
30
|
+
style: string;
|
|
31
|
+
extend?: Plan;
|
|
32
|
+
completedPlans?: Plan[];
|
|
33
|
+
noSave?: boolean;
|
|
34
|
+
}, pageUrl?: string): Promise<void>;
|
|
35
|
+
parseConfigure(raw: string | undefined): ConfigureSpec;
|
|
36
|
+
printResults(): void;
|
|
37
|
+
printNextSteps(savedPlanPath?: string | null): void;
|
|
38
|
+
isLimitReached(): boolean;
|
|
39
|
+
runPendingTests(): Promise<void>;
|
|
40
|
+
runOneTest(test: Test): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
interface ConfigureSpec {
|
|
43
|
+
enabled: boolean;
|
|
44
|
+
newRatio: number;
|
|
45
|
+
fromPath?: string;
|
|
46
|
+
styles?: string[];
|
|
47
|
+
subpages?: 'none' | 'same' | 'new' | 'both';
|
|
48
|
+
pickBy?: 'priority' | 'random' | 'index';
|
|
49
|
+
priorities?: string[];
|
|
50
|
+
}
|
|
51
|
+
export {};
|