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.
Files changed (177) hide show
  1. package/dist/boat/api-tester/example/apibot.config.js +30 -0
  2. package/dist/package.json +10 -25
  3. package/dist/src/action-result.d.ts +133 -0
  4. package/dist/src/action-result.js +22 -7
  5. package/dist/src/action.d.ts +50 -0
  6. package/dist/src/action.js +10 -5
  7. package/dist/src/activity.d.ts +26 -0
  8. package/dist/src/ai/agent.d.ts +3 -0
  9. package/dist/src/ai/captain/file-tools.d.ts +28 -0
  10. package/dist/src/ai/captain/idle-mode.d.ts +11 -0
  11. package/dist/src/ai/captain/mixin.d.ts +10 -0
  12. package/dist/src/ai/captain/test-mode.d.ts +13 -0
  13. package/dist/src/ai/captain/web-mode.d.ts +13 -0
  14. package/dist/src/ai/captain.d.ts +143 -0
  15. package/dist/src/ai/conversation.d.ts +31 -0
  16. package/dist/src/ai/driller.d.ts +161 -0
  17. package/dist/src/ai/experience-compactor.d.ts +53 -0
  18. package/dist/src/ai/fisherman-tools.d.ts +90 -0
  19. package/dist/src/ai/fisherman.d.ts +30 -0
  20. package/dist/src/ai/historian/codeceptjs.d.ts +15 -0
  21. package/dist/src/ai/historian/experience.d.ts +40 -0
  22. package/dist/src/ai/historian/mixin.d.ts +2 -0
  23. package/dist/src/ai/historian/playwright.d.ts +20 -0
  24. package/dist/src/ai/historian/screencast.d.ts +32 -0
  25. package/dist/src/ai/historian/utils.d.ts +4 -0
  26. package/dist/src/ai/historian.d.ts +108 -0
  27. package/dist/src/ai/navigator.d.ts +56 -0
  28. package/dist/src/ai/pilot.d.ts +83 -0
  29. package/dist/src/ai/planner/session-dedup.d.ts +12 -0
  30. package/dist/src/ai/planner/styles.d.ts +6 -0
  31. package/dist/src/ai/planner/subpages.d.ts +35 -0
  32. package/dist/src/ai/planner.d.ts +79 -0
  33. package/dist/src/ai/provider.d.ts +50 -0
  34. package/dist/src/ai/provider.js +10 -3
  35. package/dist/src/ai/quartermaster.d.ts +57 -0
  36. package/dist/src/ai/rerunner.d.ts +49 -0
  37. package/dist/src/ai/researcher/cache.d.ts +6 -0
  38. package/dist/src/ai/researcher/coordinates.d.ts +56 -0
  39. package/dist/src/ai/researcher/deep-analysis.d.ts +74 -0
  40. package/dist/src/ai/researcher/fingerprint-worker.d.ts +1 -0
  41. package/dist/src/ai/researcher/focus.d.ts +8 -0
  42. package/dist/src/ai/researcher/locators.d.ts +36 -0
  43. package/dist/src/ai/researcher/mixin.d.ts +2 -0
  44. package/dist/src/ai/researcher/parser.d.ts +35 -0
  45. package/dist/src/ai/researcher/research-result.d.ts +16 -0
  46. package/dist/src/ai/researcher/sections.d.ts +19 -0
  47. package/dist/src/ai/rules.d.ts +15 -0
  48. package/dist/src/ai/session-analyst.d.ts +11 -0
  49. package/dist/src/ai/task-agent.d.ts +28 -0
  50. package/dist/src/ai/tester.d.ts +103 -0
  51. package/dist/src/ai/tools.d.ts +41 -0
  52. package/dist/src/api/api-client.d.ts +17 -0
  53. package/dist/src/api/request-result.d.ts +44 -0
  54. package/dist/src/api/request-store.d.ts +29 -0
  55. package/dist/src/api/spec-reader.d.ts +5 -0
  56. package/dist/src/api/xhr-capture.d.ts +10 -0
  57. package/dist/src/browser-server.d.ts +10 -0
  58. package/dist/src/command-handler.d.ts +68 -0
  59. package/dist/src/commands/add-rule-command.d.ts +11 -0
  60. package/dist/src/commands/base-command.d.ts +26 -0
  61. package/dist/src/commands/clean-command.d.ts +12 -0
  62. package/dist/src/commands/compact-command.d.ts +20 -0
  63. package/dist/src/commands/context-aria-command.d.ts +6 -0
  64. package/dist/src/commands/context-command.d.ts +11 -0
  65. package/dist/src/commands/context-data-command.d.ts +6 -0
  66. package/dist/src/commands/context-experience-command.d.ts +6 -0
  67. package/dist/src/commands/context-html-command.d.ts +6 -0
  68. package/dist/src/commands/context-knowledge-command.d.ts +6 -0
  69. package/dist/src/commands/debug-command.d.ts +6 -0
  70. package/dist/src/commands/drill-command.d.ts +10 -0
  71. package/dist/src/commands/exit-command.d.ts +7 -0
  72. package/dist/src/commands/experience-command.d.ts +15 -0
  73. package/dist/src/commands/explore-command.d.ts +51 -0
  74. package/dist/src/commands/freesail-command.d.ts +12 -0
  75. package/dist/src/commands/help-command.d.ts +6 -0
  76. package/dist/src/commands/index.d.ts +4 -0
  77. package/dist/src/commands/init-command.d.ts +7 -0
  78. package/dist/src/commands/knows-command.d.ts +10 -0
  79. package/dist/src/commands/learn-command.d.ts +7 -0
  80. package/dist/src/commands/navigate-command.d.ts +7 -0
  81. package/dist/src/commands/path-command.d.ts +10 -0
  82. package/dist/src/commands/plan-clear-command.d.ts +7 -0
  83. package/dist/src/commands/plan-command.d.ts +14 -0
  84. package/dist/src/commands/plan-edit-command.d.ts +7 -0
  85. package/dist/src/commands/plan-load-command.d.ts +7 -0
  86. package/dist/src/commands/plan-reload-command.d.ts +7 -0
  87. package/dist/src/commands/plan-save-command.d.ts +7 -0
  88. package/dist/src/commands/plans-command.d.ts +21 -0
  89. package/dist/src/commands/rerun-command.d.ts +7 -0
  90. package/dist/src/commands/research-command.d.ts +11 -0
  91. package/dist/src/commands/runs-command.d.ts +7 -0
  92. package/dist/src/commands/start-command.d.ts +7 -0
  93. package/dist/src/commands/status-command.d.ts +6 -0
  94. package/dist/src/commands/test-command.d.ts +11 -0
  95. package/dist/src/components/ActivityPane.d.ts +6 -0
  96. package/dist/src/components/AddKnowledge.d.ts +8 -0
  97. package/dist/src/components/AddRule.d.ts +9 -0
  98. package/dist/src/components/App.d.ts +9 -0
  99. package/dist/src/components/Autocomplete.d.ts +3 -0
  100. package/dist/src/components/InputPane.d.ts +13 -0
  101. package/dist/src/components/InputReadline.d.ts +17 -0
  102. package/dist/src/components/LogPane.d.ts +6 -0
  103. package/dist/src/components/PlanEditor.d.ts +9 -0
  104. package/dist/src/components/PlanPane.d.ts +13 -0
  105. package/dist/src/components/SessionTimer.d.ts +6 -0
  106. package/dist/src/components/StateTransitionPane.d.ts +8 -0
  107. package/dist/src/components/StatusPane.d.ts +4 -0
  108. package/dist/src/components/TaskPane.d.ts +9 -0
  109. package/dist/src/components/Welcome.d.ts +3 -0
  110. package/dist/src/components/WelcomeChecklist.d.ts +9 -0
  111. package/dist/src/components/WelcomeCommands.d.ts +6 -0
  112. package/dist/src/components/autocomplete-store.d.ts +10 -0
  113. package/dist/src/components/parse-keypress.d.ts +12 -0
  114. package/dist/src/config.d.ts +251 -0
  115. package/dist/src/execution-controller.d.ts +25 -0
  116. package/dist/src/experience-tracker.d.ts +107 -0
  117. package/dist/src/experience-tracker.js +2 -1
  118. package/dist/src/explorbot.d.ts +107 -0
  119. package/dist/src/explorer.d.ts +140 -0
  120. package/dist/src/explorer.js +13 -9
  121. package/dist/src/index.d.ts +6 -0
  122. package/dist/src/index.js +2 -55
  123. package/dist/src/knowledge-tracker.d.ts +33 -0
  124. package/dist/src/knowledge-tracker.js +9 -2
  125. package/dist/src/observability.d.ts +13 -0
  126. package/dist/src/observability.js +2 -1
  127. package/dist/src/playwright-recorder.d.ts +31 -0
  128. package/dist/src/reporter.d.ts +34 -0
  129. package/dist/src/state-manager.d.ts +185 -0
  130. package/dist/src/state-manager.js +0 -7
  131. package/dist/src/stats.d.ts +24 -0
  132. package/dist/src/suite.d.ts +24 -0
  133. package/dist/src/test-plan.d.ts +166 -0
  134. package/dist/src/utils/aria.d.ts +20 -0
  135. package/dist/src/utils/browser-errors.d.ts +8 -0
  136. package/dist/src/utils/cli-name.d.ts +1 -0
  137. package/dist/src/utils/code-extractor.d.ts +1 -0
  138. package/dist/src/utils/context-formatter.d.ts +25 -0
  139. package/dist/src/utils/error-page.d.ts +12 -0
  140. package/dist/src/utils/expandable.d.ts +4 -0
  141. package/dist/src/utils/hooks-runner.d.ts +15 -0
  142. package/dist/src/utils/html-diff.d.ts +19 -0
  143. package/dist/src/utils/html.d.ts +124 -0
  144. package/dist/src/utils/log-filters.d.ts +6 -0
  145. package/dist/src/utils/logger.d.ts +35 -0
  146. package/dist/src/utils/loop.d.ts +35 -0
  147. package/dist/src/utils/markdown-parser.d.ts +17 -0
  148. package/dist/src/utils/markdown-query.d.ts +40 -0
  149. package/dist/src/utils/markdown-terminal.d.ts +1 -0
  150. package/dist/src/utils/next-steps.d.ts +11 -0
  151. package/dist/src/utils/page-readiness.d.ts +6 -0
  152. package/dist/src/utils/research-parser.d.ts +1 -0
  153. package/dist/src/utils/retry.d.ts +8 -0
  154. package/dist/src/utils/rules-loader.d.ts +12 -0
  155. package/dist/src/utils/secrets.d.ts +4 -0
  156. package/dist/src/utils/secrets.js +28 -0
  157. package/dist/src/utils/step-analyzer.d.ts +11 -0
  158. package/dist/src/utils/strings.d.ts +3 -0
  159. package/dist/src/utils/test-files.d.ts +3 -0
  160. package/dist/src/utils/test-plan-markdown.d.ts +9 -0
  161. package/dist/src/utils/throttle.d.ts +2 -0
  162. package/dist/src/utils/unique-names.d.ts +2 -0
  163. package/dist/src/utils/url-matcher.d.ts +6 -0
  164. package/dist/src/utils/web-element.d.ts +44 -0
  165. package/dist/src/utils/xpath.d.ts +17 -0
  166. package/package.json +10 -25
  167. package/src/action-result.ts +22 -7
  168. package/src/action.ts +12 -5
  169. package/src/ai/provider.ts +10 -3
  170. package/src/experience-tracker.ts +2 -1
  171. package/src/explorer.ts +14 -9
  172. package/src/index.ts +9 -0
  173. package/src/knowledge-tracker.ts +7 -1
  174. package/src/observability.ts +2 -1
  175. package/src/state-manager.ts +0 -8
  176. package/src/utils/secrets.ts +29 -0
  177. package/src/index.tsx +0 -62
@@ -1,4 +1,5 @@
1
1
  import { type Span, trace } from '@opentelemetry/api';
2
+ import { redactSecrets } from './utils/secrets.js';
2
3
 
3
4
  type TelemetryMetadata = Record<string, unknown>;
4
5
 
@@ -84,7 +85,7 @@ function buildRootSpanAttributes(name: string, metadata: TelemetryMetadata): Rec
84
85
  attributes['langfuse.trace.tags'] = metadata.tags as string[];
85
86
  }
86
87
  if (metadata.input !== undefined) {
87
- attributes['langfuse.trace.input'] = JSON.stringify(metadata.input);
88
+ attributes['langfuse.trace.input'] = redactSecrets(JSON.stringify(metadata.input));
88
89
  }
89
90
 
90
91
  return attributes;
@@ -5,7 +5,6 @@ import { ActionResult } from './action-result.js';
5
5
  import { ConfigParser, outputPath } from './config.js';
6
6
  import { ExperienceTracker } from './experience-tracker.js';
7
7
  import { detectFocusArea } from './utils/aria.js';
8
- import { htmlTextSnapshot } from './utils/html.js';
9
8
  import { createDebug, tag } from './utils/logger.js';
10
9
  import { extractStatePath } from './utils/url-matcher.js';
11
10
 
@@ -126,13 +125,6 @@ export class StateManager {
126
125
  * Emit state change event to all listeners
127
126
  */
128
127
  private emitStateChange(event: StateTransition): void {
129
- // Log HTML content when state changes
130
- if (event.toState.html && event.toState.html !== event.fromState?.html) {
131
- let htmlContent = event?.toState?.html ?? '';
132
- htmlContent = htmlTextSnapshot(htmlContent);
133
- // tag('html').log(`Page HTML for ${event.toState.url}:\n${htmlContent}`);
134
- }
135
-
136
128
  this.stateChangeListeners.forEach((listener) => {
137
129
  try {
138
130
  listener(event);
@@ -0,0 +1,29 @@
1
+ const MIN_SECRET_LENGTH = 4;
2
+ const secretValues = new Set<string>();
3
+
4
+ export function registerSecret(value: string): void {
5
+ if (!value) return;
6
+ if (value.length < MIN_SECRET_LENGTH) return;
7
+ secretValues.add(value);
8
+ }
9
+
10
+ export function redactSecrets(text: string): string {
11
+ if (!text) return text;
12
+ let result = text;
13
+ for (const value of secretValues) {
14
+ if (!result.includes(value)) continue;
15
+ result = result.split(value).join('***REDACTED***');
16
+ }
17
+ return result;
18
+ }
19
+
20
+ export function clearRegisteredSecrets(): void {
21
+ secretValues.clear();
22
+ }
23
+
24
+ const SECRET_NAME_TOKENS = ['password', 'passwd', 'secret', 'token', 'apikey', 'api_key', 'credential', 'private_key', 'privatekey', 'access_key'];
25
+
26
+ export function isSecretName(name: string): boolean {
27
+ const lower = name.toLowerCase();
28
+ return SECRET_NAME_TOKENS.some((token) => lower.includes(token));
29
+ }
package/src/index.tsx DELETED
@@ -1,62 +0,0 @@
1
- #!/usr/bin/env node
2
- import { Command } from 'commander';
3
- import { addKnowledgeCommand } from './commands/add-knowledge.js';
4
- import { cleanCommand } from './commands/clean.js';
5
- import { exploreCommand } from './commands/explore.js';
6
- import { initCommand } from './commands/init.js';
7
-
8
- const program = new Command();
9
-
10
- program
11
- .name('explorbot')
12
- .description('AI-powered web exploration tool')
13
- .option('-f, --from <url>', 'Start exploration from a specific URL')
14
- .option('-v, --verbose', 'Enable verbose logging')
15
- .option('--debug', 'Enable debug logging (same as --verbose)')
16
- .option('-c, --config <path>', 'Path to configuration file')
17
- .option('-p, --path <path>', 'Working directory path')
18
- .helpOption('-h, --help', 'Show this help message');
19
-
20
- program
21
- .command('clean')
22
- .description('Clean up artifacts or experience folders')
23
- .option('-t, --type <type>', 'Type of cleanup (artifacts|experience|all)', 'artifacts')
24
- .option('-p, --path <path>', 'Custom path to clean')
25
- .action(async (options, command) => {
26
- const globalOptions = command.parent.opts();
27
- const allOptions = { ...globalOptions, ...options };
28
- await cleanCommand(allOptions);
29
- });
30
-
31
- program
32
- .command('init')
33
- .description('Initialize a new project with configuration')
34
- .option('-c, --config-path <path>', 'Path for the config file', './explorbot.config.js')
35
- .option('-f, --force', 'Overwrite existing config file', false)
36
- .option('-p, --path <path>', 'Working directory for initialization')
37
- .action(async (options, command) => {
38
- const globalOptions = command.parent.opts();
39
- const allOptions = { ...globalOptions, ...options };
40
- await initCommand(allOptions);
41
- });
42
-
43
- program
44
- .command('add-knowledge')
45
- .alias('learn')
46
- .description('Add knowledge for specific URLs')
47
- .option('-p, --path <path>', 'Knowledge directory path')
48
- .action(async (options) => {
49
- await addKnowledgeCommand(options);
50
- });
51
-
52
- program.parse();
53
-
54
- const options = program.opts();
55
- const command = program.args[0];
56
-
57
- if (command === 'clean' || command === 'init' || command === 'add-knowledge' || command === 'learn') {
58
- // These commands are handled by their respective actions
59
- } else {
60
- // Default to explore command
61
- exploreCommand(options);
62
- }