@dyyz1993/agent-browser 0.11.0 → 0.11.2

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 (48) hide show
  1. package/bin/agent-browser-linux-x64 +0 -0
  2. package/dist/cli/help.js +1 -1
  3. package/dist/openapi.js +1 -1
  4. package/dist/stream-server-standalone.js +3 -3
  5. package/dist/viewer-script.js +54 -54
  6. package/package.json +1 -1
  7. package/skills/agent-browser/SKILL.md +279 -229
  8. package/skills/agent-browser/references/mobile-viewer.md +188 -0
  9. package/skills/agent-browser/references/viewer-mode.md +148 -0
  10. package/skills/agent-browser/templates/api-interception.sh +3 -1
  11. package/skills/agent-browser/templates/data-extraction.sh +8 -4
  12. package/skills/agent-browser/templates/form-automation.sh +18 -23
  13. package/skills/agent-browser/templates/network-intercept-crawl.sh +1 -0
  14. package/skills/agent-browser/templates/recorder-workflow.sh +51 -0
  15. package/skills/agent-browser/templates/viewer-remote.sh +41 -0
  16. package/bin/agent-browser-darwin-arm64 +0 -0
  17. package/scripts/check_goods_container.js +0 -35
  18. package/scripts/check_page_content.js +0 -36
  19. package/scripts/click_applause_rate.js +0 -30
  20. package/scripts/e2e-test-recorder.ts +0 -584
  21. package/scripts/explore_jd_page.js +0 -31
  22. package/scripts/extract_all_jd_data.js +0 -80
  23. package/scripts/extract_jd_product_detail.js +0 -62
  24. package/scripts/extract_jd_products_correct_links.js +0 -78
  25. package/scripts/extract_jd_products_final.js +0 -80
  26. package/scripts/extract_jd_reviews.js +0 -48
  27. package/scripts/extract_jd_seafood_final.js +0 -78
  28. package/scripts/extract_multiple_products.js +0 -77
  29. package/scripts/extract_products_no_scroll.js +0 -68
  30. package/scripts/extract_products_simple.js +0 -68
  31. package/scripts/find_applause_rate.js +0 -26
  32. package/scripts/find_jd_links.js +0 -28
  33. package/scripts/find_main_content.js +0 -20
  34. package/scripts/find_product_cards.js +0 -38
  35. package/scripts/find_root_content.js +0 -26
  36. package/scripts/find_unique_products.js +0 -55
  37. package/scripts/get_jd_product_detail.js +0 -16
  38. package/scripts/get_jd_products.js +0 -23
  39. package/scripts/get_jd_seafood_products.js +0 -44
  40. package/scripts/get_product_details_from_images.js +0 -54
  41. package/scripts/scroll_and_get_products.js +0 -47
  42. package/scripts/scroll_deep_and_find.js +0 -45
  43. package/scripts/verify-baidu-enter.ts +0 -116
  44. package/scripts/verify-form.sh +0 -67
  45. package/scripts/verify-login.sh +0 -65
  46. package/scripts/verify-recording.sh +0 -80
  47. package/scripts/verify-upload.sh +0 -41
  48. package/skills/agent-browser/references/profiling.md +0 -120
File without changes
package/dist/cli/help.js CHANGED
@@ -1026,6 +1026,6 @@ iOS Simulator (requires Xcode and Appium):
1026
1026
  `);
1027
1027
  }
1028
1028
  export function printVersion() {
1029
- console.log('agent-browser 0.10.0');
1029
+ console.log('agent-browser 0.11.0');
1030
1030
  }
1031
1031
  //# sourceMappingURL=help.js.map
package/dist/openapi.js CHANGED
@@ -5,7 +5,7 @@ export const openApiSpec = {
5
5
  openapi: '3.0.0',
6
6
  info: {
7
7
  title: 'agent-browser API',
8
- version: '0.10.0',
8
+ version: '0.11.0',
9
9
  description: 'Browser automation HTTP API for AI agents. Execute browser commands via REST API.',
10
10
  },
11
11
  servers: [{ url: 'http://localhost:5005', description: 'Local development server' }],
@@ -146,7 +146,7 @@ class StreamServerStandalone {
146
146
  res.writeHead(200, { 'Content-Type': 'application/json' });
147
147
  res.end(JSON.stringify({
148
148
  title: 'agent-browser HTTP API',
149
- version: '0.10.0',
149
+ version: '0.11.0',
150
150
  endpoints: {
151
151
  'POST /api/command': {
152
152
  description: 'Execute a browser command',
@@ -802,7 +802,7 @@ class StreamServerStandalone {
802
802
  connected,
803
803
  screencasting: connected,
804
804
  session,
805
- version: '0.10.0',
805
+ version: '0.11.0',
806
806
  };
807
807
  if (state?.selector && state.elementBox) {
808
808
  msg.element = {
@@ -829,7 +829,7 @@ class StreamServerStandalone {
829
829
  connected,
830
830
  screencasting: connected,
831
831
  session,
832
- version: '0.10.0',
832
+ version: '0.11.0',
833
833
  };
834
834
  if (clientState?.selector && clientState?.elementBox) {
835
835
  message.element = {
@@ -138,6 +138,7 @@ export function buildViewerScript() {
138
138
  };
139
139
 
140
140
  var hiddenInput = null;
141
+ let cursorInitialized = false;
141
142
 
142
143
  const DesktopModule = {
143
144
  attach: function() {
@@ -151,6 +152,59 @@ export function buildViewerScript() {
151
152
  hiddenInput.setAttribute('autocapitalize', 'off');
152
153
  hiddenInput.setAttribute('spellcheck', 'false');
153
154
  document.body.appendChild(hiddenInput);
155
+
156
+ hiddenInput.addEventListener('compositionstart', () => {
157
+ isComposing = true;
158
+ lastInputValue = hiddenInput.value;
159
+ console.log('[Viewer] compositionstart, lastInputValue:', lastInputValue);
160
+ });
161
+
162
+ hiddenInput.addEventListener('compositionend', (e) => {
163
+ isComposing = false;
164
+ const newText = hiddenInput.value.slice(lastInputValue.length);
165
+ console.log('[Viewer] compositionend, newText:', newText, 'hiddenInput.value:', hiddenInput.value);
166
+ if (newText) {
167
+ sendUserActivity();
168
+ safeSend(JSON.stringify({
169
+ type: 'keyboard_insert_text',
170
+ text: newText
171
+ }));
172
+ }
173
+ lastInputValue = '';
174
+ hiddenInput.value = '';
175
+ });
176
+
177
+ hiddenInput.addEventListener('input', (e) => {
178
+ console.log('[Viewer] input event, isComposing:', isComposing, 'hiddenInput.value:', hiddenInput.value);
179
+ if (isComposing) return;
180
+
181
+ const newValue = hiddenInput.value;
182
+ if (newValue.length > 0) {
183
+ sendUserActivity();
184
+ safeSend(JSON.stringify({
185
+ type: 'keyboard_insert_text',
186
+ text: newValue
187
+ }));
188
+ }
189
+ hiddenInput.value = '';
190
+ lastInputValue = '';
191
+ });
192
+
193
+ hiddenInput.addEventListener('paste', (e) => {
194
+ e.preventDefault();
195
+ e.stopPropagation();
196
+
197
+ const text = e.clipboardData.getData('text');
198
+ console.log('[Viewer] paste event, text:', text);
199
+ if (text) {
200
+ sendUserActivity();
201
+ safeSend(JSON.stringify({
202
+ type: 'keyboard_insert_text',
203
+ text: text
204
+ }));
205
+ }
206
+ });
207
+
154
208
  focusHiddenInput();
155
209
  },
156
210
  detach: function() {
@@ -503,58 +557,6 @@ export function buildViewerScript() {
503
557
  e.preventDefault();
504
558
  });
505
559
 
506
- hiddenInput.addEventListener('compositionstart', () => {
507
- isComposing = true;
508
- lastInputValue = hiddenInput.value;
509
- console.log('[Viewer] compositionstart, lastInputValue:', lastInputValue);
510
- });
511
-
512
- hiddenInput.addEventListener('compositionend', (e) => {
513
- isComposing = false;
514
- const newText = hiddenInput.value.slice(lastInputValue.length);
515
- console.log('[Viewer] compositionend, newText:', newText, 'hiddenInput.value:', hiddenInput.value);
516
- if (newText) {
517
- sendUserActivity();
518
- safeSend(JSON.stringify({
519
- type: 'keyboard_insert_text',
520
- text: newText
521
- }));
522
- }
523
- lastInputValue = '';
524
- hiddenInput.value = '';
525
- });
526
-
527
- hiddenInput.addEventListener('input', (e) => {
528
- console.log('[Viewer] input event, isComposing:', isComposing, 'hiddenInput.value:', hiddenInput.value);
529
- if (isComposing) return;
530
-
531
- const newValue = hiddenInput.value;
532
- if (newValue.length > 0) {
533
- sendUserActivity();
534
- safeSend(JSON.stringify({
535
- type: 'keyboard_insert_text',
536
- text: newValue
537
- }));
538
- }
539
- hiddenInput.value = '';
540
- lastInputValue = '';
541
- });
542
-
543
- hiddenInput.addEventListener('paste', (e) => {
544
- e.preventDefault();
545
- e.stopPropagation();
546
-
547
- const text = e.clipboardData.getData('text');
548
- console.log('[Viewer] paste event, text:', text);
549
- if (text) {
550
- sendUserActivity();
551
- safeSend(JSON.stringify({
552
- type: 'keyboard_insert_text',
553
- text: text
554
- }));
555
- }
556
- });
557
-
558
560
  document.addEventListener('keydown', (e) => {
559
561
  console.log('[Viewer] keydown, key:', e.key, 'target:', e.target === hiddenInput ? 'hiddenInput' : 'other', 'metaKey:', e.metaKey, 'ctrlKey:', e.ctrlKey);
560
562
  if (e.target === hiddenInput) {
@@ -625,8 +627,6 @@ export function buildViewerScript() {
625
627
  let touchMoved = false;
626
628
  let twoFingerStartPos = null;
627
629
  let longPressTimer = null;
628
- let longPressHintTimer = null;
629
- let cursorInitialized = false;
630
630
 
631
631
  const CURSOR_SENSITIVITY = 1.5;
632
632
  const WHEEL_SENSITIVITY = 2.0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dyyz1993/agent-browser",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "Headless browser automation CLI for AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/daemon.js",