@eko-ai/eko 1.0.7 → 1.0.9

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 (38) hide show
  1. package/README.md +72 -21
  2. package/dist/core/eko.d.ts +3 -2
  3. package/dist/extension/content/index.d.ts +1 -0
  4. package/dist/extension/tools/browser.d.ts +2 -1
  5. package/dist/extension/tools/get_all_tabs.d.ts +9 -0
  6. package/dist/extension/tools/index.d.ts +4 -1
  7. package/dist/extension/tools/request_login.d.ts +10 -0
  8. package/dist/extension/tools/tab_management.d.ts +1 -1
  9. package/dist/extension/utils.d.ts +2 -1
  10. package/dist/extension.cjs.js +797 -209
  11. package/dist/extension.esm.js +797 -209
  12. package/dist/extension_content_script.js +129 -2
  13. package/dist/index.cjs.js +518 -114
  14. package/dist/index.d.ts +2 -1
  15. package/dist/index.esm.js +518 -115
  16. package/dist/models/action.d.ts +9 -4
  17. package/dist/models/workflow.d.ts +8 -3
  18. package/dist/nodejs/script/build_dom_tree.d.ts +1 -0
  19. package/dist/nodejs/tools/browser_use.d.ts +28 -0
  20. package/dist/nodejs/tools/index.d.ts +2 -0
  21. package/dist/nodejs.cjs.js +71638 -12
  22. package/dist/nodejs.esm.js +71632 -6
  23. package/dist/schemas/workflow.schema.d.ts +2 -13
  24. package/dist/services/llm/claude-provider.d.ts +2 -1
  25. package/dist/services/llm/openai-provider.d.ts +2 -1
  26. package/dist/services/parser/workflow-parser.d.ts +0 -7
  27. package/dist/types/action.types.d.ts +8 -3
  28. package/dist/types/tools.types.d.ts +44 -1
  29. package/dist/types/workflow.types.d.ts +22 -9
  30. package/dist/universal_tools/cancel_workflow.d.ts +9 -0
  31. package/dist/universal_tools/human.d.ts +30 -0
  32. package/dist/universal_tools/index.d.ts +4 -0
  33. package/dist/universal_tools/summary_workflow.d.ts +9 -0
  34. package/dist/utils/execution-logger.d.ts +69 -0
  35. package/dist/web/tools/browser.d.ts +2 -1
  36. package/dist/web.cjs.js +29 -17
  37. package/dist/web.esm.js +29 -17
  38. package/package.json +6 -9
@@ -40,6 +40,11 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
40
40
  sendResponse(result);
41
41
  break;
42
42
  }
43
+ case 'request_user_help': {
44
+ request_user_help(request.task_id, request.failure_type, request.failure_message);
45
+ sendResponse(true);
46
+ break;
47
+ }
43
48
  case 'computer:type': {
44
49
  sendResponse(type(request));
45
50
  break;
@@ -204,7 +209,7 @@ function scroll_to(request) {
204
209
  return false;
205
210
  }
206
211
  element.scrollIntoView({
207
- behavior: 'smooth'
212
+ behavior: 'smooth',
208
213
  });
209
214
  }
210
215
  else if (request.xpath) {
@@ -215,7 +220,7 @@ function scroll_to(request) {
215
220
  return false;
216
221
  }
217
222
  element.scrollIntoView({
218
- behavior: 'smooth'
223
+ behavior: 'smooth',
219
224
  });
220
225
  }
221
226
  else {
@@ -277,3 +282,125 @@ function select_dropdown_option(request) {
277
282
  selectedText: option.text.trim(),
278
283
  };
279
284
  }
285
+ function request_user_help(task_id, failure_type, failure_message) {
286
+ const domId = 'eko-request-user-help';
287
+ if (document.getElementById(domId)) {
288
+ return;
289
+ }
290
+ const failureTitleMap = {
291
+ login_required: 'Login Required',
292
+ captcha: 'Captcha Detected',
293
+ blocked: 'Blocked',
294
+ other: 'Error',
295
+ rate_limited: 'Rate Limited',
296
+ };
297
+ const notification = document.createElement('div');
298
+ notification.id = domId;
299
+ notification.style.cssText = `
300
+ position: fixed;
301
+ top: 5px;
302
+ left: 18px;
303
+ z-index: 9999;
304
+ background-color: #FEF0ED;
305
+ color: white;
306
+ padding: 16px;
307
+ border-radius: 12px;
308
+ border: 1px solid #FBB8A5;
309
+ font-family: Arial, sans-serif;
310
+ width: 350px;
311
+ display: flex;
312
+ flex-direction: row;
313
+ gap: 10px;
314
+ cursor: move;
315
+ user-select: none;
316
+ `;
317
+ let isDragging = false;
318
+ let xOffset = 0;
319
+ let yOffset = 0;
320
+ let initialX = 0;
321
+ let initialY = 0;
322
+ notification.addEventListener('mousedown', (e) => {
323
+ isDragging = true;
324
+ initialX = e.clientX - xOffset;
325
+ initialY = e.clientY - yOffset;
326
+ e.preventDefault();
327
+ });
328
+ document.addEventListener('mousemove', (e) => {
329
+ if (!isDragging)
330
+ return;
331
+ const currentX = e.clientX - initialX;
332
+ const currentY = e.clientY - initialY;
333
+ xOffset = currentX;
334
+ yOffset = currentY;
335
+ notification.style.transform = `translate(${xOffset}px, ${yOffset}px)`;
336
+ });
337
+ document.addEventListener('mouseup', () => {
338
+ isDragging = false;
339
+ });
340
+ const leftContainer = document.createElement('div');
341
+ leftContainer.style.cssText = `
342
+ width: 28px;
343
+ height: 28px;
344
+ display: flex;
345
+ flex-direction: column;
346
+ align-items: center;
347
+ border-radius: 99px;
348
+ background: #FDCCCC;
349
+ justify-content: center;
350
+ `;
351
+ leftContainer.innerHTML = ``;
352
+ const rightContainer = document.createElement('div');
353
+ rightContainer.style.cssText = `
354
+ flex: 1;
355
+ display: flex;
356
+ flex-direction: column;
357
+ `;
358
+ const title = document.createElement('div');
359
+ title.style.cssText = `
360
+ font-size: 16px;
361
+ font-weight: 700;
362
+ line-height: 22px;
363
+ color: #DD342D;
364
+ text-align: left;
365
+ `;
366
+ title.innerText = failureTitleMap[failure_type] || failure_type;
367
+ const message2 = document.createElement('div');
368
+ message2.style.cssText = `
369
+ font-size: 16px;
370
+ font-weight: 400;
371
+ line-height: 22px;
372
+ color: #DD342D;
373
+ text-align: left;
374
+ `;
375
+ message2.innerText = failure_message + '\nWhen you resolve the issue, click the button below.';
376
+ const buttonDiv = document.createElement('div');
377
+ buttonDiv.style.cssText = `
378
+ margin-top: 16px;
379
+ display: flex;
380
+ flex-direction: row-reverse;
381
+ justify-content: flex-start;
382
+ align-items: center;
383
+ `;
384
+ const resolvedBut = document.createElement('div');
385
+ resolvedBut.innerText = 'Resolved';
386
+ resolvedBut.style.cssText = `
387
+ border-radius: 8px;
388
+ background: #DD342D;
389
+ color: white;
390
+ padding: 10px;
391
+ border: none;
392
+ cursor: pointer;
393
+ `;
394
+ resolvedBut.onclick = () => {
395
+ chrome.runtime.sendMessage({ type: 'issue_resolved', task_id, failure_type }, () => {
396
+ notification.remove();
397
+ });
398
+ };
399
+ buttonDiv.appendChild(resolvedBut);
400
+ rightContainer.appendChild(title);
401
+ rightContainer.appendChild(message2);
402
+ rightContainer.appendChild(buttonDiv);
403
+ notification.appendChild(leftContainer);
404
+ notification.appendChild(rightContainer);
405
+ document.body.appendChild(notification);
406
+ }