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.
Files changed (288) hide show
  1. package/README.md +14 -14
  2. package/bin/explorbot-cli.ts +4 -3
  3. package/boat/doc-collector/src/ai/documentarian.ts +22 -27
  4. package/boat/doc-collector/src/ai/tools.ts +67 -10
  5. package/boat/doc-collector/src/docbot.ts +28 -7
  6. package/boat/doc-collector/src/docs-renderer.ts +19 -24
  7. package/boat/doc-collector/src/screenshots.ts +33 -1
  8. package/boat/doc-collector/src/state-diagram.ts +281 -0
  9. package/dist/bin/explorbot-cli.js +3 -3
  10. package/dist/boat/doc-collector/src/ai/documentarian.js +16 -6
  11. package/dist/boat/doc-collector/src/ai/tools.js +47 -10
  12. package/dist/boat/doc-collector/src/docbot.js +25 -6
  13. package/dist/boat/doc-collector/src/docs-renderer.js +18 -3
  14. package/dist/boat/doc-collector/src/screenshots.js +29 -0
  15. package/dist/boat/doc-collector/src/state-diagram.js +200 -0
  16. package/dist/package.json +8 -6
  17. package/dist/src/action-result.d.ts +131 -0
  18. package/dist/src/action-result.js +82 -159
  19. package/dist/src/action.d.ts +43 -0
  20. package/dist/src/action.js +18 -106
  21. package/dist/src/activity.d.ts +26 -0
  22. package/dist/src/ai/agent.d.ts +3 -0
  23. package/dist/src/ai/captain/file-tools.d.ts +28 -0
  24. package/dist/src/ai/captain/idle-mode.d.ts +11 -0
  25. package/dist/src/ai/captain/mixin.d.ts +10 -0
  26. package/dist/src/ai/captain/test-mode.d.ts +13 -0
  27. package/dist/src/ai/captain/web-mode.d.ts +13 -0
  28. package/dist/src/ai/captain/web-mode.js +0 -7
  29. package/dist/src/ai/captain.d.ts +141 -0
  30. package/dist/src/ai/captain.js +4 -19
  31. package/dist/src/ai/conversation.d.ts +28 -0
  32. package/dist/src/ai/conversation.js +9 -28
  33. package/dist/src/ai/driller.d.ts +157 -0
  34. package/dist/src/ai/driller.js +3 -12
  35. package/dist/src/ai/experience-compactor.d.ts +53 -0
  36. package/dist/src/ai/experience-compactor.js +16 -33
  37. package/dist/src/ai/fisherman-tools.d.ts +90 -0
  38. package/dist/src/ai/fisherman-tools.js +1 -1
  39. package/dist/src/ai/fisherman.d.ts +29 -0
  40. package/dist/src/ai/fisherman.js +0 -3
  41. package/dist/src/ai/historian/codeceptjs.d.ts +17 -0
  42. package/dist/src/ai/historian/codeceptjs.js +3 -2
  43. package/dist/src/ai/historian/experience.d.ts +40 -0
  44. package/dist/src/ai/historian/mixin.d.ts +2 -0
  45. package/dist/src/ai/historian/playwright.d.ts +22 -0
  46. package/dist/src/ai/historian/playwright.js +3 -2
  47. package/dist/src/ai/historian/screencast.d.ts +32 -0
  48. package/dist/src/ai/historian/utils.d.ts +3 -0
  49. package/dist/src/ai/historian/utils.js +0 -1
  50. package/dist/src/ai/historian.d.ts +109 -0
  51. package/dist/src/ai/historian.js +1 -5
  52. package/dist/src/ai/navigator.d.ts +54 -0
  53. package/dist/src/ai/navigator.js +11 -46
  54. package/dist/src/ai/pilot.d.ts +81 -0
  55. package/dist/src/ai/pilot.js +6 -17
  56. package/dist/src/ai/planner/session-dedup.d.ts +12 -0
  57. package/dist/src/ai/planner/styles.d.ts +6 -0
  58. package/dist/src/ai/planner/subpages.d.ts +35 -0
  59. package/dist/src/ai/planner.d.ts +79 -0
  60. package/dist/src/ai/planner.js +49 -37
  61. package/dist/src/ai/provider.d.ts +53 -0
  62. package/dist/src/ai/provider.js +78 -130
  63. package/dist/src/ai/quartermaster.d.ts +56 -0
  64. package/dist/src/ai/quartermaster.js +4 -10
  65. package/dist/src/ai/rerunner.d.ts +48 -0
  66. package/dist/src/ai/rerunner.js +14 -22
  67. package/dist/src/ai/researcher/cache.d.ts +6 -0
  68. package/dist/src/ai/researcher/cache.js +11 -18
  69. package/dist/src/ai/researcher/coordinates.d.ts +56 -0
  70. package/dist/src/ai/researcher/deep-analysis.d.ts +74 -0
  71. package/dist/src/ai/researcher/deep-analysis.js +3 -6
  72. package/dist/src/ai/researcher/fingerprint-worker.d.ts +1 -0
  73. package/dist/src/ai/researcher/focus.d.ts +8 -0
  74. package/dist/src/ai/researcher/locators.d.ts +36 -0
  75. package/dist/src/ai/researcher/mixin.d.ts +2 -0
  76. package/dist/src/ai/researcher/parser.d.ts +35 -0
  77. package/dist/src/ai/researcher/parser.js +1 -1
  78. package/dist/src/ai/researcher/research-result.d.ts +15 -0
  79. package/dist/src/ai/researcher/research-result.js +0 -19
  80. package/dist/src/ai/researcher/sections.d.ts +19 -0
  81. package/dist/src/ai/researcher/sections.js +5 -1
  82. package/dist/src/ai/researcher.js +12 -53
  83. package/dist/src/ai/rules.d.ts +16 -0
  84. package/dist/src/ai/rules.js +22 -15
  85. package/dist/src/ai/session-analyst.d.ts +11 -0
  86. package/dist/src/ai/session-analyst.js +8 -5
  87. package/dist/src/ai/task-agent.d.ts +28 -0
  88. package/dist/src/ai/task-agent.js +2 -27
  89. package/dist/src/ai/tester.d.ts +101 -0
  90. package/dist/src/ai/tester.js +10 -61
  91. package/dist/src/ai/tools.d.ts +52 -0
  92. package/dist/src/ai/tools.js +119 -101
  93. package/dist/src/api/api-client.d.ts +17 -0
  94. package/dist/src/api/request-result.d.ts +44 -0
  95. package/dist/src/api/request-store.d.ts +29 -0
  96. package/dist/src/api/spec-reader.d.ts +5 -0
  97. package/dist/src/api/xhr-capture.d.ts +10 -0
  98. package/dist/src/browser-server.d.ts +10 -0
  99. package/dist/src/command-handler.d.ts +68 -0
  100. package/dist/src/commands/add-rule-command.d.ts +11 -0
  101. package/dist/src/commands/base-command.d.ts +26 -0
  102. package/dist/src/commands/clean-command.d.ts +12 -0
  103. package/dist/src/commands/compact-command.d.ts +20 -0
  104. package/dist/src/commands/compact-command.js +6 -6
  105. package/dist/src/commands/context-aria-command.d.ts +6 -0
  106. package/dist/src/commands/context-command.d.ts +11 -0
  107. package/dist/src/commands/context-command.js +1 -1
  108. package/dist/src/commands/context-data-command.d.ts +6 -0
  109. package/dist/src/commands/context-experience-command.d.ts +6 -0
  110. package/dist/src/commands/context-html-command.d.ts +6 -0
  111. package/dist/src/commands/context-knowledge-command.d.ts +6 -0
  112. package/dist/src/commands/context-knowledge-command.js +1 -1
  113. package/dist/src/commands/debug-command.d.ts +6 -0
  114. package/dist/src/commands/drill-command.d.ts +10 -0
  115. package/dist/src/commands/exit-command.d.ts +7 -0
  116. package/dist/src/commands/experience-command.d.ts +15 -0
  117. package/dist/src/commands/experience-command.js +1 -1
  118. package/dist/src/commands/explore-command.d.ts +51 -0
  119. package/dist/src/commands/freesail-command.d.ts +12 -0
  120. package/dist/src/commands/help-command.d.ts +6 -0
  121. package/dist/src/commands/index.d.ts +4 -0
  122. package/dist/src/commands/init-command.d.ts +7 -0
  123. package/dist/src/commands/knows-command.d.ts +10 -0
  124. package/dist/src/commands/knows-command.js +1 -1
  125. package/dist/src/commands/learn-command.d.ts +7 -0
  126. package/dist/src/commands/learn-command.js +3 -1
  127. package/dist/src/commands/navigate-command.d.ts +7 -0
  128. package/dist/src/commands/path-command.d.ts +10 -0
  129. package/dist/src/commands/plan-clear-command.d.ts +7 -0
  130. package/dist/src/commands/plan-command.d.ts +14 -0
  131. package/dist/src/commands/plan-edit-command.d.ts +7 -0
  132. package/dist/src/commands/plan-load-command.d.ts +7 -0
  133. package/dist/src/commands/plan-reload-command.d.ts +7 -0
  134. package/dist/src/commands/plan-save-command.d.ts +7 -0
  135. package/dist/src/commands/plans-command.d.ts +21 -0
  136. package/dist/src/commands/rerun-command.d.ts +7 -0
  137. package/dist/src/commands/research-command.d.ts +11 -0
  138. package/dist/src/commands/runs-command.d.ts +7 -0
  139. package/dist/src/commands/start-command.d.ts +7 -0
  140. package/dist/src/commands/status-command.d.ts +6 -0
  141. package/dist/src/commands/test-command.d.ts +11 -0
  142. package/dist/src/components/ActivityPane.d.ts +6 -0
  143. package/dist/src/components/AddKnowledge.d.ts +10 -0
  144. package/dist/src/components/AddKnowledge.js +3 -7
  145. package/dist/src/components/AddRule.d.ts +9 -0
  146. package/dist/src/components/App.d.ts +9 -0
  147. package/dist/src/components/App.js +2 -2
  148. package/dist/src/components/Autocomplete.d.ts +3 -0
  149. package/dist/src/components/InputPane.d.ts +13 -0
  150. package/dist/src/components/InputReadline.d.ts +17 -0
  151. package/dist/src/components/LogPane.d.ts +6 -0
  152. package/dist/src/components/PlanEditor.d.ts +9 -0
  153. package/dist/src/components/PlanPane.d.ts +13 -0
  154. package/dist/src/components/SessionTimer.d.ts +6 -0
  155. package/dist/src/components/StateTransitionPane.d.ts +8 -0
  156. package/dist/src/components/StatusPane.d.ts +4 -0
  157. package/dist/src/components/TaskPane.d.ts +9 -0
  158. package/dist/src/components/Welcome.d.ts +3 -0
  159. package/dist/src/components/WelcomeChecklist.d.ts +9 -0
  160. package/dist/src/components/WelcomeCommands.d.ts +6 -0
  161. package/dist/src/components/autocomplete-store.d.ts +10 -0
  162. package/dist/src/components/parse-keypress.d.ts +12 -0
  163. package/dist/src/config.d.ts +253 -0
  164. package/dist/src/config.js +12 -0
  165. package/dist/src/execution-controller.d.ts +25 -0
  166. package/dist/src/experience-tracker.d.ts +112 -0
  167. package/dist/src/experience-tracker.js +83 -155
  168. package/dist/src/explorbot.d.ts +106 -0
  169. package/dist/src/explorbot.js +17 -51
  170. package/dist/src/explorer.d.ts +129 -0
  171. package/dist/src/explorer.js +31 -77
  172. package/dist/src/index.d.ts +6 -0
  173. package/dist/src/index.js +2 -55
  174. package/dist/src/knowledge-tracker.d.ts +33 -0
  175. package/dist/src/knowledge-tracker.js +47 -47
  176. package/dist/src/observability.d.ts +13 -0
  177. package/dist/src/observability.js +2 -1
  178. package/dist/src/playwright-recorder.d.ts +31 -0
  179. package/dist/src/reporter.d.ts +34 -0
  180. package/dist/src/state-manager.d.ts +160 -0
  181. package/dist/src/state-manager.js +10 -136
  182. package/dist/src/stats.d.ts +24 -0
  183. package/dist/src/suite.d.ts +24 -0
  184. package/dist/src/test-plan.d.ts +166 -0
  185. package/dist/src/utils/aria.d.ts +25 -0
  186. package/dist/src/utils/aria.js +4 -1
  187. package/dist/src/utils/browser-errors.d.ts +8 -0
  188. package/dist/src/utils/cache.d.ts +15 -0
  189. package/dist/src/utils/cache.js +34 -0
  190. package/dist/src/utils/cli-name.d.ts +1 -0
  191. package/dist/src/utils/code-extractor.d.ts +1 -0
  192. package/dist/src/utils/context-formatter.d.ts +31 -0
  193. package/dist/src/utils/context-formatter.js +15 -27
  194. package/dist/src/utils/error-page.d.ts +12 -0
  195. package/dist/src/utils/expandable.d.ts +4 -0
  196. package/dist/src/utils/hooks-runner.d.ts +15 -0
  197. package/dist/src/utils/html-diff.d.ts +19 -0
  198. package/dist/src/utils/html.d.ts +129 -0
  199. package/dist/src/utils/html.js +71 -0
  200. package/dist/src/utils/log-filters.d.ts +6 -0
  201. package/dist/src/utils/logger.d.ts +35 -0
  202. package/dist/src/utils/loop.d.ts +35 -0
  203. package/dist/src/utils/markdown-files.d.ts +10 -0
  204. package/dist/src/utils/markdown-files.js +21 -0
  205. package/dist/src/utils/markdown-parser.d.ts +17 -0
  206. package/dist/src/utils/markdown-query.d.ts +46 -0
  207. package/dist/src/utils/markdown-query.js +14 -1
  208. package/dist/src/utils/markdown-terminal.d.ts +1 -0
  209. package/dist/src/utils/next-steps.d.ts +11 -0
  210. package/dist/src/utils/page-readiness.d.ts +7 -0
  211. package/dist/src/utils/page-readiness.js +1 -1
  212. package/dist/src/utils/research-parser.d.ts +1 -0
  213. package/dist/src/utils/retry.d.ts +8 -0
  214. package/dist/src/utils/rules-loader.d.ts +12 -0
  215. package/dist/src/utils/secrets.d.ts +4 -0
  216. package/dist/src/utils/secrets.js +28 -0
  217. package/dist/src/utils/step-analyzer.d.ts +11 -0
  218. package/dist/src/utils/strings.d.ts +5 -0
  219. package/dist/src/utils/strings.js +10 -0
  220. package/dist/src/utils/test-files.d.ts +3 -0
  221. package/dist/src/utils/test-plan-markdown.d.ts +9 -0
  222. package/dist/src/utils/throttle.d.ts +2 -0
  223. package/dist/src/utils/unique-names.d.ts +2 -0
  224. package/dist/src/utils/url-matcher.d.ts +6 -0
  225. package/dist/src/utils/web-element.d.ts +45 -0
  226. package/dist/src/utils/web-element.js +3 -0
  227. package/dist/src/utils/web-sandbox.d.ts +4 -0
  228. package/dist/src/utils/web-sandbox.js +37 -0
  229. package/dist/src/utils/xpath.d.ts +17 -0
  230. package/package.json +8 -6
  231. package/src/action-result.ts +80 -168
  232. package/src/action.ts +16 -123
  233. package/src/ai/captain/web-mode.ts +0 -7
  234. package/src/ai/captain.ts +5 -17
  235. package/src/ai/conversation.ts +9 -32
  236. package/src/ai/driller.ts +3 -16
  237. package/src/ai/experience-compactor.ts +16 -35
  238. package/src/ai/fisherman-tools.ts +1 -1
  239. package/src/ai/fisherman.ts +0 -4
  240. package/src/ai/historian/codeceptjs.ts +4 -2
  241. package/src/ai/historian/playwright.ts +4 -2
  242. package/src/ai/historian/utils.ts +0 -1
  243. package/src/ai/historian.ts +4 -7
  244. package/src/ai/navigator.ts +13 -49
  245. package/src/ai/pilot.ts +6 -16
  246. package/src/ai/planner.ts +56 -44
  247. package/src/ai/provider.ts +86 -139
  248. package/src/ai/quartermaster.ts +34 -41
  249. package/src/ai/rerunner.ts +17 -21
  250. package/src/ai/researcher/cache.ts +10 -16
  251. package/src/ai/researcher/deep-analysis.ts +3 -6
  252. package/src/ai/researcher/parser.ts +1 -1
  253. package/src/ai/researcher/research-result.ts +0 -18
  254. package/src/ai/researcher/sections.ts +5 -1
  255. package/src/ai/researcher.ts +11 -59
  256. package/src/ai/rules.ts +24 -13
  257. package/src/ai/session-analyst.ts +8 -5
  258. package/src/ai/task-agent.ts +3 -30
  259. package/src/ai/tester.ts +12 -73
  260. package/src/ai/tools.ts +119 -106
  261. package/src/commands/compact-command.ts +7 -8
  262. package/src/commands/context-command.ts +1 -1
  263. package/src/commands/context-knowledge-command.ts +1 -1
  264. package/src/commands/experience-command.ts +1 -1
  265. package/src/commands/knows-command.ts +1 -1
  266. package/src/commands/learn-command.ts +3 -1
  267. package/src/components/AddKnowledge.tsx +5 -7
  268. package/src/components/App.tsx +2 -2
  269. package/src/config.ts +12 -0
  270. package/src/experience-tracker.ts +90 -152
  271. package/src/explorbot.ts +17 -51
  272. package/src/explorer.ts +34 -81
  273. package/src/index.ts +9 -0
  274. package/src/knowledge-tracker.ts +49 -50
  275. package/src/observability.ts +2 -1
  276. package/src/state-manager.ts +15 -164
  277. package/src/utils/aria.ts +11 -2
  278. package/src/utils/cache.ts +40 -0
  279. package/src/utils/context-formatter.ts +12 -15
  280. package/src/utils/html.ts +79 -0
  281. package/src/utils/markdown-files.ts +30 -0
  282. package/src/utils/markdown-query.ts +15 -1
  283. package/src/utils/page-readiness.ts +1 -1
  284. package/src/utils/secrets.ts +28 -0
  285. package/src/utils/strings.ts +12 -0
  286. package/src/utils/web-element.ts +4 -0
  287. package/src/utils/web-sandbox.ts +43 -0
  288. package/src/index.tsx +0 -62
@@ -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 '../experience-tracker.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
+ }
@@ -1,8 +1,8 @@
1
1
  import { basename } from 'node:path';
2
2
  import chalk from 'chalk';
3
+ import { COMPACT_MAX_LENGTH } from '../ai/experience-compactor.js';
3
4
  import { tag } from '../utils/logger.js';
4
5
  import { BaseCommand } from './base-command.js';
5
- const COMPACT_THRESHOLD = 5000;
6
6
  export class CompactCommand extends BaseCommand {
7
7
  name = 'compact';
8
8
  description = 'Compact stored experience files; optionally filtered by filename or URL substring';
@@ -16,7 +16,7 @@ export class CompactCommand extends BaseCommand {
16
16
  const target = remaining[0];
17
17
  const dryRun = !!opts.dryRun;
18
18
  const merge = opts.merge !== false;
19
- const tracker = this.explorBot.getExperienceTracker();
19
+ const tracker = this.explorBot.experienceTracker();
20
20
  const files = this.resolveTarget(tracker, target);
21
21
  if (files === null) {
22
22
  tag('info').log('No experience files found.');
@@ -51,7 +51,7 @@ export class CompactCommand extends BaseCommand {
51
51
  buildDryRunSuggestions(compactor, files, target) {
52
52
  const wouldTouch = files.filter((f) => {
53
53
  const stripped = compactor.stripNonUsefulEntries(f.content);
54
- return stripped !== f.content || stripped.length >= COMPACT_THRESHOLD || compactor.isRecent(f);
54
+ return stripped !== f.content || stripped.length >= COMPACT_MAX_LENGTH || compactor.isRecent(f);
55
55
  });
56
56
  if (wouldTouch.length === 0)
57
57
  return [];
@@ -62,7 +62,7 @@ export class CompactCommand extends BaseCommand {
62
62
  async runFullSweep(compactor, merge) {
63
63
  if (!merge) {
64
64
  tag('info').log('Compacting all experience files (merge skipped)…');
65
- const compacted = await compactor.compactFiles(this.explorBot.getExperienceTracker().getAllExperience());
65
+ const compacted = await compactor.compactFiles(this.explorBot.experienceTracker().getAllExperience());
66
66
  return { merged: 0, compacted };
67
67
  }
68
68
  tag('info').log('Merging experience files with similar URLs, then compacting all…');
@@ -101,7 +101,7 @@ export class CompactCommand extends BaseCommand {
101
101
  const charsRemoved = chars - strippedChars;
102
102
  const willStrip = stripped !== file.content;
103
103
  const willReview = compactor.isRecent(file);
104
- const willAi = strippedChars >= COMPACT_THRESHOLD;
104
+ const willAi = strippedChars >= COMPACT_MAX_LENGTH;
105
105
  if (willStrip)
106
106
  wouldStrip++;
107
107
  if (willReview)
@@ -131,7 +131,7 @@ export class CompactCommand extends BaseCommand {
131
131
  lines.push(` ${chalk.dim('Files matched:')} ${chalk.bold(String(files.length))}`);
132
132
  lines.push(` ${chalk.dim('Would strip:')} ${chalk.bold(String(wouldStrip))} ${chalk.dim('(remove legacy / FAILED / Visual click, rename to FLOW/ACTION)')}`);
133
133
  lines.push(` ${chalk.dim('Would ai-review:')} ${chalk.bold(String(wouldAiReview))} ${chalk.dim('(recent files ≤30d — quality/reusability check)')}`);
134
- lines.push(` ${chalk.dim('Would ai-compact:')} ${chalk.bold(String(wouldAiCompact))} ${chalk.dim(`(over ${COMPACT_THRESHOLD} chars after strip)`)}`);
134
+ lines.push(` ${chalk.dim('Would ai-compact:')} ${chalk.bold(String(wouldAiCompact))} ${chalk.dim(`(over ${COMPACT_MAX_LENGTH} chars after strip)`)}`);
135
135
  lines.push(` ${chalk.dim('Total chars:')} ${chalk.bold(String(totalChars))}`);
136
136
  tag('info').log(lines.join('\n'));
137
137
  }
@@ -0,0 +1,6 @@
1
+ import { BaseCommand } from './base-command.js';
2
+ export declare class ContextAriaCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ execute(_args: string): Promise<void>;
6
+ }
@@ -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
+ }
@@ -36,7 +36,7 @@ export class ContextCommand extends BaseCommand {
36
36
  }
37
37
  const actionResult = await explorer.createAction().capturePageState({ includeScreenshot: isVisual });
38
38
  const experienceTracker = explorer.getStateManager().getExperienceTracker();
39
- const knowledgeTracker = this.explorBot.getKnowledgeTracker();
39
+ const knowledgeTracker = this.explorBot.knowledgeTracker();
40
40
  let mode = 'compact';
41
41
  if (opts.full) {
42
42
  mode = 'full';
@@ -0,0 +1,6 @@
1
+ import { BaseCommand } from './base-command.js';
2
+ export declare class ContextDataCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ execute(_args: string): Promise<void>;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { BaseCommand } from './base-command.js';
2
+ export declare class ContextExperienceCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ execute(_args: string): Promise<void>;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { BaseCommand } from './base-command.js';
2
+ export declare class ContextHtmlCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ execute(_args: string): Promise<void>;
6
+ }
@@ -0,0 +1,6 @@
1
+ import { BaseCommand } from './base-command.js';
2
+ export declare class ContextKnowledgeCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ execute(_args: string): Promise<void>;
6
+ }
@@ -13,7 +13,7 @@ export class ContextKnowledgeCommand extends BaseCommand {
13
13
  throw new Error('No active page');
14
14
  }
15
15
  const actionResult = ActionResult.fromState(state);
16
- const knowledgeTracker = this.explorBot.getKnowledgeTracker();
16
+ const knowledgeTracker = this.explorBot.knowledgeTracker();
17
17
  const knowledge = knowledgeTracker.getRelevantKnowledge(actionResult);
18
18
  if (knowledge.length === 0) {
19
19
  tag('info').log(`No knowledge found for: ${actionResult.url}`);
@@ -0,0 +1,6 @@
1
+ import { BaseCommand } from './base-command.js';
2
+ export declare class DebugCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ execute(_args: string): Promise<void>;
6
+ }
@@ -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,7 @@
1
+ import { BaseCommand } from './base-command.js';
2
+ export declare class ExitCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ aliases: string[];
6
+ execute(_args: string): Promise<void>;
7
+ }
@@ -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
+ }
@@ -16,7 +16,7 @@ export class ExperienceCommand extends BaseCommand {
16
16
  return;
17
17
  }
18
18
  const recency = opts.recent ? 'recent' : opts.old ? 'old' : undefined;
19
- const tracker = this.explorBot.getExperienceTracker();
19
+ const tracker = this.explorBot.experienceTracker();
20
20
  const [first, second] = remaining;
21
21
  const combinedRef = first?.match(/^([A-Z]+)[.\-]?(\d+)$/i);
22
22
  if (combinedRef) {
@@ -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 {};
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from './base-command.js';
2
+ export declare class FreesailCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ aliases: string[];
6
+ tuiEnabled: boolean;
7
+ options: {
8
+ flags: string;
9
+ description: string;
10
+ }[];
11
+ execute(args: string): Promise<void>;
12
+ }
@@ -0,0 +1,6 @@
1
+ import { BaseCommand } from './base-command.js';
2
+ export declare class HelpCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ execute(_args: string): Promise<void>;
6
+ }
@@ -0,0 +1,4 @@
1
+ import type { ExplorBot } from '../explorbot.js';
2
+ import type { BaseCommand } from './base-command.js';
3
+ export { BaseCommand } from './base-command.js';
4
+ export declare function createCommands(explorBot: ExplorBot): BaseCommand[];
@@ -0,0 +1,7 @@
1
+ export declare function runInitCommand(options: InitCommandOptions): void;
2
+ type InitCommandOptions = {
3
+ configPath?: string;
4
+ force?: boolean;
5
+ path?: string;
6
+ };
7
+ export {};
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from './base-command.js';
2
+ export declare function formatKnowledgeList(knowledge: Array<{
3
+ url: string;
4
+ firstLine: string;
5
+ }>, limit?: number): string;
6
+ export declare class KnowsCommand extends BaseCommand {
7
+ name: string;
8
+ description: string;
9
+ execute(args: string, limit?: number): Promise<void>;
10
+ }
@@ -17,7 +17,7 @@ export class KnowsCommand extends BaseCommand {
17
17
  description = 'List all knowledge URLs or show matching knowledge for a URL';
18
18
  async execute(args, limit = 0) {
19
19
  const url = args.trim();
20
- const tracker = this.explorBot.getKnowledgeTracker();
20
+ const tracker = this.explorBot.knowledgeTracker();
21
21
  if (!url) {
22
22
  const allKnowledge = tracker.listAllKnowledge();
23
23
  if (allKnowledge.length === 0) {
@@ -0,0 +1,7 @@
1
+ import { BaseCommand, type Suggestion } from './base-command.js';
2
+ export declare class LearnCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ suggestions: Suggestion[];
6
+ execute(args: string): Promise<void>;
7
+ }
@@ -10,10 +10,12 @@ export class LearnCommand extends BaseCommand {
10
10
  const note = args.trim();
11
11
  if (!note) {
12
12
  const AddKnowledge = (await import('../components/AddKnowledge.js')).default;
13
- const state = this.explorBot.getExplorer().getStateManager().getCurrentState();
13
+ const explorer = this.explorBot.getExplorer();
14
+ const state = explorer.getStateManager().getCurrentState();
14
15
  const initialUrl = state?.url || '';
15
16
  const { unmount } = render(React.createElement(AddKnowledge, {
16
17
  initialUrl,
18
+ knowledgeTracker: explorer.getKnowledgeTracker(),
17
19
  onComplete: () => unmount(),
18
20
  onCancel: () => unmount(),
19
21
  }), {
@@ -0,0 +1,7 @@
1
+ import { BaseCommand, type Suggestion } from './base-command.js';
2
+ export declare class NavigateCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ suggestions: Suggestion[];
6
+ execute(args: string): Promise<void>;
7
+ }
@@ -0,0 +1,10 @@
1
+ import { BaseCommand } from './base-command.js';
2
+ export declare class PathCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ options: {
6
+ flags: string;
7
+ description: string;
8
+ }[];
9
+ execute(args: string): Promise<void>;
10
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseCommand, type Suggestion } from './base-command.js';
2
+ export declare class PlanClearCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ suggestions: Suggestion[];
6
+ execute(args: string): Promise<void>;
7
+ }
@@ -0,0 +1,14 @@
1
+ import { BaseCommand, type Suggestion } from './base-command.js';
2
+ export declare class PlanCommand 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
+ printNextSteps(): void;
12
+ printPlanSummary(): void;
13
+ updateSuggestions(): void;
14
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseCommand, type Suggestion } from './base-command.js';
2
+ export declare class PlanEditCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ suggestions: Suggestion[];
6
+ execute(_args: string): Promise<void>;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseCommand, type Suggestion } from './base-command.js';
2
+ export declare class PlanLoadCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ suggestions: Suggestion[];
6
+ execute(args: string): Promise<void>;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseCommand, type Suggestion } from './base-command.js';
2
+ export declare class PlanReloadCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ suggestions: Suggestion[];
6
+ execute(args: string): Promise<void>;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseCommand, type Suggestion } from './base-command.js';
2
+ export declare class PlanSaveCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ suggestions: Suggestion[];
6
+ execute(args: string): Promise<void>;
7
+ }
@@ -0,0 +1,21 @@
1
+ import { Plan } from '../test-plan.js';
2
+ import { BaseCommand } from './base-command.js';
3
+ export declare class PlansCommand extends BaseCommand {
4
+ name: string;
5
+ description: string;
6
+ options: {
7
+ flags: string;
8
+ description: string;
9
+ }[];
10
+ execute(args: string): Promise<void>;
11
+ getPlanFiles(): PlanFile[];
12
+ printPlans(files: PlanFile[]): void;
13
+ printPlanDetails(plan: Plan, file: PlanFile): void;
14
+ resolvePlanFile(target: string, files: PlanFile[]): PlanFile;
15
+ }
16
+ interface PlanFile {
17
+ name: string;
18
+ path: string;
19
+ modifiedAt: number;
20
+ }
21
+ export {};
@@ -0,0 +1,7 @@
1
+ import { BaseCommand } from './base-command.js';
2
+ export declare class RerunCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ tuiEnabled: boolean;
6
+ execute(args: string): Promise<void>;
7
+ }
@@ -0,0 +1,11 @@
1
+ import { BaseCommand, type Suggestion } from './base-command.js';
2
+ export declare class ResearchCommand 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,7 @@
1
+ import { BaseCommand } from './base-command.js';
2
+ export declare class RunsCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ tuiEnabled: boolean;
6
+ execute(args: string): Promise<void>;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseCommand, type Suggestion } from './base-command.js';
2
+ export declare class StartCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ suggestions: Suggestion[];
6
+ execute(args: string): Promise<void>;
7
+ }
@@ -0,0 +1,6 @@
1
+ import { BaseCommand } from './base-command.js';
2
+ export declare class StatusCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ execute(_args: string): Promise<void>;
6
+ }
@@ -0,0 +1,11 @@
1
+ import { BaseCommand, type Suggestion } from './base-command.js';
2
+ export declare class TestCommand extends BaseCommand {
3
+ name: string;
4
+ description: string;
5
+ options: {
6
+ flags: string;
7
+ description: string;
8
+ }[];
9
+ suggestions: Suggestion[];
10
+ execute(args: string): Promise<void>;
11
+ }
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ interface ActivityPaneProps {
3
+ isInputVisible?: boolean;
4
+ }
5
+ declare const ActivityPane: React.FC<ActivityPaneProps>;
6
+ export default ActivityPane;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { KnowledgeTracker } from '../knowledge-tracker.js';
3
+ interface AddKnowledgeProps {
4
+ initialUrl?: string;
5
+ knowledgeTracker: KnowledgeTracker;
6
+ onComplete?: () => void;
7
+ onCancel?: () => void;
8
+ }
9
+ declare const AddKnowledge: React.FC<AddKnowledgeProps>;
10
+ export default AddKnowledge;