misoai-web 1.5.7 → 1.5.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 (40) hide show
  1. package/dist/es/agent.js +410 -25
  2. package/dist/es/agent.js.map +1 -1
  3. package/dist/es/bridge-mode-browser.js +3 -3
  4. package/dist/es/bridge-mode.js +412 -27
  5. package/dist/es/bridge-mode.js.map +1 -1
  6. package/dist/es/chrome-extension.js +411 -26
  7. package/dist/es/chrome-extension.js.map +1 -1
  8. package/dist/es/index.js +410 -25
  9. package/dist/es/index.js.map +1 -1
  10. package/dist/es/midscene-playground.js +410 -25
  11. package/dist/es/midscene-playground.js.map +1 -1
  12. package/dist/es/playground.js +410 -25
  13. package/dist/es/playground.js.map +1 -1
  14. package/dist/es/playwright.js +410 -25
  15. package/dist/es/playwright.js.map +1 -1
  16. package/dist/es/puppeteer-agent-launcher.js +410 -25
  17. package/dist/es/puppeteer-agent-launcher.js.map +1 -1
  18. package/dist/es/puppeteer.js +410 -25
  19. package/dist/es/puppeteer.js.map +1 -1
  20. package/dist/lib/agent.js +410 -25
  21. package/dist/lib/agent.js.map +1 -1
  22. package/dist/lib/bridge-mode-browser.js +3 -3
  23. package/dist/lib/bridge-mode.js +412 -27
  24. package/dist/lib/bridge-mode.js.map +1 -1
  25. package/dist/lib/chrome-extension.js +411 -26
  26. package/dist/lib/chrome-extension.js.map +1 -1
  27. package/dist/lib/index.js +410 -25
  28. package/dist/lib/index.js.map +1 -1
  29. package/dist/lib/midscene-playground.js +410 -25
  30. package/dist/lib/midscene-playground.js.map +1 -1
  31. package/dist/lib/playground.js +410 -25
  32. package/dist/lib/playground.js.map +1 -1
  33. package/dist/lib/playwright.js +410 -25
  34. package/dist/lib/playwright.js.map +1 -1
  35. package/dist/lib/puppeteer-agent-launcher.js +410 -25
  36. package/dist/lib/puppeteer-agent-launcher.js.map +1 -1
  37. package/dist/lib/puppeteer.js +410 -25
  38. package/dist/lib/puppeteer.js.map +1 -1
  39. package/dist/types/agent.d.ts +107 -2
  40. package/package.json +2 -2
@@ -660,6 +660,94 @@ var replanningCountLimit = 10;
660
660
  var isAndroidPage = (page) => {
661
661
  return page.pageType === "android";
662
662
  };
663
+ var WorkflowMemory = class {
664
+ constructor(config) {
665
+ this.workflows = /* @__PURE__ */ new Map();
666
+ this.config = config;
667
+ }
668
+ /**
669
+ * İş akışı hafızasını getirir
670
+ */
671
+ getWorkflowMemory(workflowId = "default") {
672
+ const workflow = this.workflows.get(workflowId);
673
+ return workflow?.memory || [];
674
+ }
675
+ /**
676
+ * İş akışı verilerini getirir
677
+ */
678
+ getWorkflowData(workflowId = "default") {
679
+ return this.workflows.get(workflowId) || this.createEmptyWorkflowData(workflowId);
680
+ }
681
+ /**
682
+ * İş akışı hafızasını kaydeder
683
+ */
684
+ saveWorkflowMemory(memory, workflowId = "default") {
685
+ const workflow = this.workflows.get(workflowId) || this.createEmptyWorkflowData(workflowId);
686
+ workflow.memory = [...memory];
687
+ workflow.metadata.totalSteps = workflow.steps.length;
688
+ workflow.metadata.completedSteps = workflow.steps.filter((s) => s.status === "completed").length;
689
+ workflow.metadata.failedSteps = workflow.steps.filter((s) => s.status === "failed").length;
690
+ this.workflows.set(workflowId, workflow);
691
+ this.enforceRetentionPolicy();
692
+ }
693
+ /**
694
+ * İş akışı bağlamını günceller
695
+ */
696
+ updateWorkflowContext(context, workflowId = "default") {
697
+ const workflow = this.workflows.get(workflowId) || this.createEmptyWorkflowData(workflowId);
698
+ workflow.context = { ...workflow.context, ...context };
699
+ if (context.currentStep) {
700
+ const existingStep = workflow.steps.find((s) => s.stepName === context.currentStep);
701
+ if (!existingStep) {
702
+ workflow.steps.push({
703
+ stepId: `step_${workflow.steps.length + 1}`,
704
+ stepName: context.currentStep,
705
+ timestamp: context.timestamp,
706
+ status: "running",
707
+ memoryItems: []
708
+ });
709
+ }
710
+ }
711
+ this.workflows.set(workflowId, workflow);
712
+ }
713
+ /**
714
+ * İş akışını temizler
715
+ */
716
+ clearWorkflow(workflowId = "default") {
717
+ this.workflows.delete(workflowId);
718
+ }
719
+ /**
720
+ * Tüm iş akışlarını temizler
721
+ */
722
+ clearAll() {
723
+ this.workflows.clear();
724
+ }
725
+ createEmptyWorkflowData(workflowId) {
726
+ return {
727
+ workflowId,
728
+ steps: [],
729
+ memory: [],
730
+ context: {
731
+ pageInfo: { url: "", title: "" },
732
+ timestamp: Date.now()
733
+ },
734
+ metadata: {
735
+ totalSteps: 0,
736
+ completedSteps: 0,
737
+ failedSteps: 0,
738
+ startTime: Date.now()
739
+ }
740
+ };
741
+ }
742
+ enforceRetentionPolicy() {
743
+ const maxWorkflows = 10;
744
+ if (this.workflows.size > maxWorkflows) {
745
+ const sortedWorkflows = Array.from(this.workflows.entries()).sort(([, a], [, b]) => (b.metadata.endTime || b.metadata.startTime) - (a.metadata.endTime || a.metadata.startTime));
746
+ const toDelete = sortedWorkflows.slice(maxWorkflows);
747
+ toDelete.forEach(([workflowId]) => this.workflows.delete(workflowId));
748
+ }
749
+ }
750
+ };
663
751
  var PageTaskExecutor = class {
664
752
  constructor(page, insight, opts) {
665
753
  this.conversationHistory = [];
@@ -667,6 +755,25 @@ var PageTaskExecutor = class {
667
755
  this.insight = insight;
668
756
  this.taskCache = opts.taskCache;
669
757
  this.onTaskStartCallback = opts?.onTaskStart;
758
+ this.memoryConfig = {
759
+ maxItems: 100,
760
+ maxAge: 2 * 60 * 60 * 1e3,
761
+ // 2 saat
762
+ enablePersistence: true,
763
+ enableAnalytics: true,
764
+ filterStrategy: "hybrid",
765
+ ...opts?.memoryConfig
766
+ };
767
+ this.sessionContext = {
768
+ sessionId: opts?.sessionId || this.generateSessionId(),
769
+ workflowId: opts?.workflowId,
770
+ startTime: Date.now(),
771
+ pageInfo: {
772
+ url: "",
773
+ title: ""
774
+ }
775
+ };
776
+ this.workflowMemory = new WorkflowMemory(this.memoryConfig);
670
777
  }
671
778
  async recordScreenshot(timing) {
672
779
  const base64 = await this.page.screenshotBase64();
@@ -879,8 +986,11 @@ var PageTaskExecutor = class {
879
986
  insightDump = dump;
880
987
  };
881
988
  this.insight.onceDumpUpdatedFn = dumpCollector;
989
+ const memoryContext = this.getMemoryAsContext();
882
990
  const assertion = await this.insight.assert(
883
- assertPlan.param.assertion
991
+ assertPlan.param.assertion,
992
+ memoryContext
993
+ // Hafıza bağlamını geç
884
994
  );
885
995
  if (!assertion.pass) {
886
996
  if (plan2.type === "Assert") {
@@ -1366,25 +1476,146 @@ var PageTaskExecutor = class {
1366
1476
  };
1367
1477
  return task;
1368
1478
  }
1479
+ /**
1480
+ * Persistent executor'ı getirir veya oluşturur
1481
+ */
1482
+ getPersistentExecutor() {
1483
+ if (!this.persistentExecutor || this.persistentExecutor.status === "error") {
1484
+ const previousMemory = this.workflowMemory.getWorkflowMemory(this.sessionContext.workflowId);
1485
+ this.persistentExecutor = new import_misoai_core.Executor("Persistent Task Executor", {
1486
+ onTaskStart: this.onTaskStartCallback,
1487
+ initialMemory: previousMemory
1488
+ });
1489
+ }
1490
+ return this.persistentExecutor;
1491
+ }
1492
+ /**
1493
+ * Sayfa bağlamını günceller
1494
+ */
1495
+ async updatePageContext() {
1496
+ try {
1497
+ if (this.page.url) {
1498
+ this.sessionContext.pageInfo.url = await this.page.url();
1499
+ }
1500
+ if (this.page.pageType === "puppeteer" || this.page.pageType === "playwright") {
1501
+ this.sessionContext.pageInfo.title = await this.page.title();
1502
+ }
1503
+ } catch (e) {
1504
+ }
1505
+ }
1506
+ /**
1507
+ * Hafızayı temizler
1508
+ */
1509
+ clearMemory() {
1510
+ if (this.persistentExecutor) {
1511
+ this.persistentExecutor.clearMemory();
1512
+ }
1513
+ this.workflowMemory.clearWorkflow(this.sessionContext.workflowId || "default");
1514
+ }
1515
+ /**
1516
+ * Mevcut hafızayı döndürür
1517
+ */
1518
+ getMemory() {
1519
+ return this.persistentExecutor?.getMemory() || [];
1520
+ }
1521
+ /**
1522
+ * İş akışı hafızasını döndürür
1523
+ */
1524
+ getWorkflowMemory() {
1525
+ return this.workflowMemory.getWorkflowData(this.sessionContext.workflowId || "default");
1526
+ }
1527
+ /**
1528
+ * Hafıza istatistiklerini döndürür
1529
+ */
1530
+ getMemoryStats() {
1531
+ return this.persistentExecutor?.getMemoryStats() || {
1532
+ totalItems: 0,
1533
+ analytics: { totalTasks: 0, memoryHits: 0, memoryMisses: 0, averageMemorySize: 0, memoryEffectiveness: 0 },
1534
+ config: this.memoryConfig
1535
+ };
1536
+ }
1537
+ /**
1538
+ * Hafıza konfigürasyonunu günceller
1539
+ */
1540
+ updateMemoryConfig(config) {
1541
+ this.memoryConfig = { ...this.memoryConfig, ...config };
1542
+ if (this.persistentExecutor) {
1543
+ this.persistentExecutor.updateMemoryConfig(this.memoryConfig);
1544
+ }
1545
+ }
1546
+ /**
1547
+ * Oturum ID'sini oluşturur
1548
+ */
1549
+ generateSessionId() {
1550
+ return `session_${Date.now()}_${Math.random().toString(36).substr(2, 8)}`;
1551
+ }
1552
+ /**
1553
+ * Hafızayı bağlam olarak formatlar
1554
+ */
1555
+ getMemoryAsContext() {
1556
+ const memory = this.getMemory();
1557
+ if (memory.length === 0) {
1558
+ return "";
1559
+ }
1560
+ const recentMemory = memory.slice(-5);
1561
+ return recentMemory.map((item) => `- ${item.summary}`).join("\n");
1562
+ }
1369
1563
  async runPlans(title, plans, opts) {
1370
- const taskExecutor = new import_misoai_core.Executor(title, {
1371
- onTaskStart: this.onTaskStartCallback
1372
- });
1564
+ await this.updatePageContext();
1565
+ const useMemory = opts?.useMemory !== false;
1566
+ let taskExecutor;
1567
+ if (useMemory) {
1568
+ taskExecutor = this.getPersistentExecutor();
1569
+ this.workflowMemory.updateWorkflowContext({
1570
+ currentStep: title,
1571
+ pageInfo: this.sessionContext.pageInfo,
1572
+ timestamp: Date.now()
1573
+ }, this.sessionContext.workflowId || "default");
1574
+ } else {
1575
+ taskExecutor = new import_misoai_core.Executor(title, {
1576
+ onTaskStart: this.onTaskStartCallback
1577
+ });
1578
+ }
1373
1579
  const { tasks } = await this.convertPlanToExecutable(plans, opts);
1580
+ tasks.forEach((task) => {
1581
+ task.context = {
1582
+ ...task.context,
1583
+ ...this.sessionContext.pageInfo,
1584
+ workflowId: this.sessionContext.workflowId,
1585
+ sessionId: this.sessionContext.sessionId
1586
+ };
1587
+ });
1374
1588
  await taskExecutor.append(tasks);
1375
1589
  const result = await taskExecutor.flush();
1590
+ if (useMemory) {
1591
+ this.workflowMemory.saveWorkflowMemory(
1592
+ taskExecutor.getMemory(),
1593
+ this.sessionContext.workflowId || "default"
1594
+ );
1595
+ }
1376
1596
  return {
1377
1597
  output: result,
1378
1598
  executor: taskExecutor
1379
1599
  };
1380
1600
  }
1381
1601
  async action(userPrompt, actionContext, opts) {
1382
- const taskExecutor = new import_misoai_core.Executor(taskTitleStr("Action", userPrompt), {
1383
- onTaskStart: this.onTaskStartCallback
1384
- });
1385
- let planningTask = this.planningTaskFromPrompt(userPrompt, void 0, actionContext);
1602
+ const useMemory = true;
1603
+ let taskExecutor;
1604
+ if (useMemory) {
1605
+ taskExecutor = this.getPersistentExecutor();
1606
+ } else {
1607
+ taskExecutor = new import_misoai_core.Executor(taskTitleStr("Action", userPrompt), {
1608
+ onTaskStart: this.onTaskStartCallback
1609
+ });
1610
+ }
1611
+ const memoryContext = this.getMemoryAsContext();
1612
+ const initialLog = memoryContext ? memoryContext : void 0;
1613
+ let planningTask = this.planningTaskFromPrompt(userPrompt, initialLog, actionContext);
1386
1614
  let replanCount = 0;
1387
1615
  const logList = [];
1616
+ if (memoryContext) {
1617
+ logList.push(memoryContext);
1618
+ }
1388
1619
  const yamlFlow = [];
1389
1620
  while (planningTask) {
1390
1621
  if (replanCount > replanningCountLimit) {
@@ -1494,15 +1725,21 @@ var PageTaskExecutor = class {
1494
1725
  };
1495
1726
  }
1496
1727
  async createTypeQueryTask(type, demand, opt) {
1497
- const taskExecutor = new import_misoai_core.Executor(
1498
- taskTitleStr(
1499
- type,
1500
- typeof demand === "string" ? demand : JSON.stringify(demand)
1501
- ),
1502
- {
1503
- onTaskStart: this.onTaskStartCallback
1504
- }
1505
- );
1728
+ const useMemory = true;
1729
+ let taskExecutor;
1730
+ if (useMemory) {
1731
+ taskExecutor = this.getPersistentExecutor();
1732
+ } else {
1733
+ taskExecutor = new import_misoai_core.Executor(
1734
+ taskTitleStr(
1735
+ type,
1736
+ typeof demand === "string" ? demand : JSON.stringify(demand)
1737
+ ),
1738
+ {
1739
+ onTaskStart: this.onTaskStartCallback
1740
+ }
1741
+ );
1742
+ }
1506
1743
  const queryTask = {
1507
1744
  type: "Insight",
1508
1745
  subType: type,
@@ -1524,9 +1761,12 @@ var PageTaskExecutor = class {
1524
1761
  result: `${type}, ${demand}`
1525
1762
  };
1526
1763
  }
1764
+ const memoryContext = this.getMemoryAsContext();
1527
1765
  const { data, usage } = await this.insight.extract(
1528
1766
  demandInput,
1529
- opt
1767
+ opt,
1768
+ memoryContext
1769
+ // Hafıza bağlamını geç
1530
1770
  );
1531
1771
  let outputResult = data;
1532
1772
  if (ifTypeRestricted) {
@@ -1559,11 +1799,17 @@ var PageTaskExecutor = class {
1559
1799
  async string(prompt, opt) {
1560
1800
  return this.createTypeQueryTask("String", prompt, opt);
1561
1801
  }
1562
- async assert(assertion) {
1802
+ async assert(assertion, memoryContext) {
1563
1803
  const description = `assert: ${assertion}`;
1564
- const taskExecutor = new import_misoai_core.Executor(taskTitleStr("Assert", description), {
1565
- onTaskStart: this.onTaskStartCallback
1566
- });
1804
+ const useMemory = true;
1805
+ let taskExecutor;
1806
+ if (useMemory) {
1807
+ taskExecutor = this.getPersistentExecutor();
1808
+ } else {
1809
+ taskExecutor = new import_misoai_core.Executor(taskTitleStr("Assert", description), {
1810
+ onTaskStart: this.onTaskStartCallback
1811
+ });
1812
+ }
1567
1813
  const assertionPlan = {
1568
1814
  type: "Assert",
1569
1815
  param: {
@@ -1773,7 +2019,7 @@ var import_js_yaml3 = __toESM(require("js-yaml"));
1773
2019
  var import_semver = __toESM(require("semver"));
1774
2020
 
1775
2021
  // package.json
1776
- var version = "1.0.3";
2022
+ var version = "1.5.8";
1777
2023
 
1778
2024
  // src/common/task-cache.ts
1779
2025
  var debug3 = (0, import_logger3.getDebug)("cache");
@@ -2260,7 +2506,13 @@ var PageAgent = class {
2260
2506
  metadata: metadata2
2261
2507
  };
2262
2508
  }
2263
- const { output, executor } = await (isVlmUiTars ? this.taskExecutor.actionToGoal(taskPrompt, { cacheable }) : this.taskExecutor.action(taskPrompt, this.opts.aiActionContext, {
2509
+ const memoryContext = this.getMemoryAsContext();
2510
+ const enhancedActionContext = this.opts.aiActionContext ? `${this.opts.aiActionContext}
2511
+
2512
+ Previous workflow steps:
2513
+ ${memoryContext}` : memoryContext ? `Previous workflow steps:
2514
+ ${memoryContext}` : void 0;
2515
+ const { output, executor } = await (isVlmUiTars ? this.taskExecutor.actionToGoal(taskPrompt, { cacheable }) : this.taskExecutor.action(taskPrompt, enhancedActionContext, {
2264
2516
  cacheable
2265
2517
  }));
2266
2518
  if (this.taskCache && output?.yamlFlow && cacheable !== false) {
@@ -2406,8 +2658,9 @@ var PageAgent = class {
2406
2658
  } catch (e) {
2407
2659
  }
2408
2660
  }
2661
+ const memoryContext = this.getMemoryAsContext();
2409
2662
  const assertionWithContext = currentUrl ? `For the page at URL "${currentUrl}", ${assertion}` : assertion;
2410
- const { output, executor } = await this.taskExecutor.assert(assertionWithContext);
2663
+ const { output, executor } = await this.taskExecutor.assert(assertionWithContext, memoryContext);
2411
2664
  const metadata = this.afterTaskRunning(executor, true);
2412
2665
  if (output && opt?.keepRawResponse) {
2413
2666
  return {
@@ -2654,6 +2907,138 @@ ${errors}`);
2654
2907
  async destroy() {
2655
2908
  await this.page.destroy();
2656
2909
  }
2910
+ /**
2911
+ * Hafızayı bağlam olarak formatlar
2912
+ */
2913
+ getMemoryAsContext() {
2914
+ const memory = this.taskExecutor.getMemory();
2915
+ if (memory.length === 0) {
2916
+ return "";
2917
+ }
2918
+ const recentMemory = memory.slice(-5);
2919
+ return recentMemory.map((item) => `- ${item.summary}`).join("\n");
2920
+ }
2921
+ /**
2922
+ * Mevcut hafızayı döndürür
2923
+ */
2924
+ getMemory() {
2925
+ return this.taskExecutor.getMemory();
2926
+ }
2927
+ /**
2928
+ * Hafıza istatistiklerini döndürür
2929
+ */
2930
+ getMemoryStats() {
2931
+ return this.taskExecutor.getMemoryStats();
2932
+ }
2933
+ /**
2934
+ * Hafızayı temizler
2935
+ */
2936
+ clearMemory() {
2937
+ this.taskExecutor.clearMemory();
2938
+ }
2939
+ /**
2940
+ * Test sonunda kullanım için detaylı hafıza raporu döndürür (JSON formatında)
2941
+ */
2942
+ getMemoryReport() {
2943
+ const memory = this.getMemory();
2944
+ const stats = this.getMemoryStats();
2945
+ return {
2946
+ summary: {
2947
+ totalItems: memory.length,
2948
+ totalTasks: stats.analytics.totalTasks,
2949
+ memoryHits: stats.analytics.memoryHits,
2950
+ memoryMisses: stats.analytics.memoryMisses,
2951
+ memoryEffectiveness: Math.round(stats.analytics.memoryEffectiveness * 100),
2952
+ averageMemorySize: Math.round(stats.analytics.averageMemorySize * 100) / 100
2953
+ },
2954
+ config: stats.config,
2955
+ items: memory.map((item) => ({
2956
+ id: item.id,
2957
+ timestamp: item.timestamp,
2958
+ taskType: item.taskType,
2959
+ summary: item.summary,
2960
+ context: item.context,
2961
+ metadata: item.metadata,
2962
+ tags: item.tags,
2963
+ relativeTime: this.formatRelativeTime(item.timestamp)
2964
+ })),
2965
+ analytics: {
2966
+ taskTypeDistribution: this.getTaskTypeDistribution(memory),
2967
+ successRate: this.calculateSuccessRate(memory),
2968
+ averageExecutionTime: this.calculateAverageExecutionTime(memory),
2969
+ dataExtractionCount: this.countDataExtractions(memory),
2970
+ workflowSteps: this.extractWorkflowSteps(memory)
2971
+ }
2972
+ };
2973
+ }
2974
+ /**
2975
+ * Test sonunda kullanım için basit hafıza özeti döndürür (JSON formatında)
2976
+ */
2977
+ getMemorySummary() {
2978
+ const memory = this.getMemory();
2979
+ const stats = this.getMemoryStats();
2980
+ return {
2981
+ totalItems: memory.length,
2982
+ memoryEffectiveness: `${Math.round(stats.analytics.memoryEffectiveness * 100)}%`,
2983
+ taskTypes: this.getTaskTypeDistribution(memory),
2984
+ recentSteps: memory.slice(-5).map((item) => ({
2985
+ step: item.summary,
2986
+ type: item.taskType,
2987
+ success: item.metadata?.success || false,
2988
+ time: this.formatRelativeTime(item.timestamp)
2989
+ })),
2990
+ dataExtracted: this.getExtractedDataSummary(memory)
2991
+ };
2992
+ }
2993
+ formatRelativeTime(timestamp) {
2994
+ const now = Date.now();
2995
+ const diff = now - timestamp;
2996
+ const seconds = Math.floor(diff / 1e3);
2997
+ const minutes = Math.floor(seconds / 60);
2998
+ const hours = Math.floor(minutes / 60);
2999
+ if (hours > 0)
3000
+ return `${hours}h ${minutes % 60}m ago`;
3001
+ if (minutes > 0)
3002
+ return `${minutes}m ${seconds % 60}s ago`;
3003
+ return `${seconds}s ago`;
3004
+ }
3005
+ getTaskTypeDistribution(memory) {
3006
+ const distribution = {};
3007
+ memory.forEach((item) => {
3008
+ distribution[item.taskType] = (distribution[item.taskType] || 0) + 1;
3009
+ });
3010
+ return distribution;
3011
+ }
3012
+ calculateSuccessRate(memory) {
3013
+ if (memory.length === 0)
3014
+ return 0;
3015
+ const successCount = memory.filter((item) => item.metadata?.success !== false).length;
3016
+ return Math.round(successCount / memory.length * 100);
3017
+ }
3018
+ calculateAverageExecutionTime(memory) {
3019
+ const executionTimes = memory.map((item) => item.metadata?.executionTime).filter((time) => typeof time === "number");
3020
+ if (executionTimes.length === 0)
3021
+ return 0;
3022
+ const average = executionTimes.reduce((sum, time) => sum + time, 0) / executionTimes.length;
3023
+ return Math.round(average);
3024
+ }
3025
+ countDataExtractions(memory) {
3026
+ return memory.filter(
3027
+ (item) => item.context?.dataExtracted || item.taskType === "Insight" && item.summary.includes("Extracted")
3028
+ ).length;
3029
+ }
3030
+ extractWorkflowSteps(memory) {
3031
+ return memory.map((item) => item.summary);
3032
+ }
3033
+ getExtractedDataSummary(memory) {
3034
+ const extractedData = {};
3035
+ memory.forEach((item, index) => {
3036
+ if (item.context?.dataExtracted) {
3037
+ extractedData[`step_${index + 1}`] = item.context.dataExtracted;
3038
+ }
3039
+ });
3040
+ return extractedData;
3041
+ }
2657
3042
  };
2658
3043
 
2659
3044
  // src/chrome-extension/agent.ts
@@ -2871,7 +3256,7 @@ function sleep2(ms) {
2871
3256
  var ChromeExtensionProxyPage = class {
2872
3257
  constructor(forceSameTabNavigation) {
2873
3258
  this.pageType = "chrome-extension-proxy";
2874
- this.version = "1.0.3";
3259
+ this.version = "1.5.8";
2875
3260
  this.activeTabId = null;
2876
3261
  this.tabIdOfDebuggerAttached = null;
2877
3262
  this.attachingDebugger = null;