misoai-web 1.5.8 → 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 +104 -1
  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 +106 -3
  5. package/dist/es/bridge-mode.js.map +1 -1
  6. package/dist/es/chrome-extension.js +105 -2
  7. package/dist/es/chrome-extension.js.map +1 -1
  8. package/dist/es/index.js +104 -1
  9. package/dist/es/index.js.map +1 -1
  10. package/dist/es/midscene-playground.js +104 -1
  11. package/dist/es/midscene-playground.js.map +1 -1
  12. package/dist/es/playground.js +104 -1
  13. package/dist/es/playground.js.map +1 -1
  14. package/dist/es/playwright.js +104 -1
  15. package/dist/es/playwright.js.map +1 -1
  16. package/dist/es/puppeteer-agent-launcher.js +104 -1
  17. package/dist/es/puppeteer-agent-launcher.js.map +1 -1
  18. package/dist/es/puppeteer.js +104 -1
  19. package/dist/es/puppeteer.js.map +1 -1
  20. package/dist/lib/agent.js +104 -1
  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 +106 -3
  24. package/dist/lib/bridge-mode.js.map +1 -1
  25. package/dist/lib/chrome-extension.js +105 -2
  26. package/dist/lib/chrome-extension.js.map +1 -1
  27. package/dist/lib/index.js +104 -1
  28. package/dist/lib/index.js.map +1 -1
  29. package/dist/lib/midscene-playground.js +104 -1
  30. package/dist/lib/midscene-playground.js.map +1 -1
  31. package/dist/lib/playground.js +104 -1
  32. package/dist/lib/playground.js.map +1 -1
  33. package/dist/lib/playwright.js +104 -1
  34. package/dist/lib/playwright.js.map +1 -1
  35. package/dist/lib/puppeteer-agent-launcher.js +104 -1
  36. package/dist/lib/puppeteer-agent-launcher.js.map +1 -1
  37. package/dist/lib/puppeteer.js +104 -1
  38. package/dist/lib/puppeteer.js.map +1 -1
  39. package/dist/types/agent.d.ts +16 -1
  40. package/package.json +2 -2
@@ -1959,7 +1959,7 @@ var import_js_yaml3 = __toESM(require("js-yaml"));
1959
1959
  var import_semver = __toESM(require("semver"));
1960
1960
 
1961
1961
  // package.json
1962
- var version = "1.5.7";
1962
+ var version = "1.5.8";
1963
1963
 
1964
1964
  // src/common/task-cache.ts
1965
1965
  var debug3 = (0, import_logger3.getDebug)("cache");
@@ -2876,6 +2876,109 @@ ${errors}`);
2876
2876
  clearMemory() {
2877
2877
  this.taskExecutor.clearMemory();
2878
2878
  }
2879
+ /**
2880
+ * Test sonunda kullanım için detaylı hafıza raporu döndürür (JSON formatında)
2881
+ */
2882
+ getMemoryReport() {
2883
+ const memory = this.getMemory();
2884
+ const stats = this.getMemoryStats();
2885
+ return {
2886
+ summary: {
2887
+ totalItems: memory.length,
2888
+ totalTasks: stats.analytics.totalTasks,
2889
+ memoryHits: stats.analytics.memoryHits,
2890
+ memoryMisses: stats.analytics.memoryMisses,
2891
+ memoryEffectiveness: Math.round(stats.analytics.memoryEffectiveness * 100),
2892
+ averageMemorySize: Math.round(stats.analytics.averageMemorySize * 100) / 100
2893
+ },
2894
+ config: stats.config,
2895
+ items: memory.map((item) => ({
2896
+ id: item.id,
2897
+ timestamp: item.timestamp,
2898
+ taskType: item.taskType,
2899
+ summary: item.summary,
2900
+ context: item.context,
2901
+ metadata: item.metadata,
2902
+ tags: item.tags,
2903
+ relativeTime: this.formatRelativeTime(item.timestamp)
2904
+ })),
2905
+ analytics: {
2906
+ taskTypeDistribution: this.getTaskTypeDistribution(memory),
2907
+ successRate: this.calculateSuccessRate(memory),
2908
+ averageExecutionTime: this.calculateAverageExecutionTime(memory),
2909
+ dataExtractionCount: this.countDataExtractions(memory),
2910
+ workflowSteps: this.extractWorkflowSteps(memory)
2911
+ }
2912
+ };
2913
+ }
2914
+ /**
2915
+ * Test sonunda kullanım için basit hafıza özeti döndürür (JSON formatında)
2916
+ */
2917
+ getMemorySummary() {
2918
+ const memory = this.getMemory();
2919
+ const stats = this.getMemoryStats();
2920
+ return {
2921
+ totalItems: memory.length,
2922
+ memoryEffectiveness: `${Math.round(stats.analytics.memoryEffectiveness * 100)}%`,
2923
+ taskTypes: this.getTaskTypeDistribution(memory),
2924
+ recentSteps: memory.slice(-5).map((item) => ({
2925
+ step: item.summary,
2926
+ type: item.taskType,
2927
+ success: item.metadata?.success || false,
2928
+ time: this.formatRelativeTime(item.timestamp)
2929
+ })),
2930
+ dataExtracted: this.getExtractedDataSummary(memory)
2931
+ };
2932
+ }
2933
+ formatRelativeTime(timestamp) {
2934
+ const now = Date.now();
2935
+ const diff = now - timestamp;
2936
+ const seconds = Math.floor(diff / 1e3);
2937
+ const minutes = Math.floor(seconds / 60);
2938
+ const hours = Math.floor(minutes / 60);
2939
+ if (hours > 0)
2940
+ return `${hours}h ${minutes % 60}m ago`;
2941
+ if (minutes > 0)
2942
+ return `${minutes}m ${seconds % 60}s ago`;
2943
+ return `${seconds}s ago`;
2944
+ }
2945
+ getTaskTypeDistribution(memory) {
2946
+ const distribution = {};
2947
+ memory.forEach((item) => {
2948
+ distribution[item.taskType] = (distribution[item.taskType] || 0) + 1;
2949
+ });
2950
+ return distribution;
2951
+ }
2952
+ calculateSuccessRate(memory) {
2953
+ if (memory.length === 0)
2954
+ return 0;
2955
+ const successCount = memory.filter((item) => item.metadata?.success !== false).length;
2956
+ return Math.round(successCount / memory.length * 100);
2957
+ }
2958
+ calculateAverageExecutionTime(memory) {
2959
+ const executionTimes = memory.map((item) => item.metadata?.executionTime).filter((time) => typeof time === "number");
2960
+ if (executionTimes.length === 0)
2961
+ return 0;
2962
+ const average = executionTimes.reduce((sum, time) => sum + time, 0) / executionTimes.length;
2963
+ return Math.round(average);
2964
+ }
2965
+ countDataExtractions(memory) {
2966
+ return memory.filter(
2967
+ (item) => item.context?.dataExtracted || item.taskType === "Insight" && item.summary.includes("Extracted")
2968
+ ).length;
2969
+ }
2970
+ extractWorkflowSteps(memory) {
2971
+ return memory.map((item) => item.summary);
2972
+ }
2973
+ getExtractedDataSummary(memory) {
2974
+ const extractedData = {};
2975
+ memory.forEach((item, index) => {
2976
+ if (item.context?.dataExtracted) {
2977
+ extractedData[`step_${index + 1}`] = item.context.dataExtracted;
2978
+ }
2979
+ });
2980
+ return extractedData;
2981
+ }
2879
2982
  };
2880
2983
 
2881
2984
  // src/playground/agent.ts