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
@@ -1973,7 +1973,7 @@ var import_js_yaml3 = __toESM(require("js-yaml"));
1973
1973
  var import_semver = __toESM(require("semver"));
1974
1974
 
1975
1975
  // package.json
1976
- var version = "1.5.7";
1976
+ var version = "1.5.8";
1977
1977
 
1978
1978
  // src/common/task-cache.ts
1979
1979
  var debug3 = (0, import_logger3.getDebug)("cache");
@@ -2890,6 +2890,109 @@ ${errors}`);
2890
2890
  clearMemory() {
2891
2891
  this.taskExecutor.clearMemory();
2892
2892
  }
2893
+ /**
2894
+ * Test sonunda kullanım için detaylı hafıza raporu döndürür (JSON formatında)
2895
+ */
2896
+ getMemoryReport() {
2897
+ const memory = this.getMemory();
2898
+ const stats = this.getMemoryStats();
2899
+ return {
2900
+ summary: {
2901
+ totalItems: memory.length,
2902
+ totalTasks: stats.analytics.totalTasks,
2903
+ memoryHits: stats.analytics.memoryHits,
2904
+ memoryMisses: stats.analytics.memoryMisses,
2905
+ memoryEffectiveness: Math.round(stats.analytics.memoryEffectiveness * 100),
2906
+ averageMemorySize: Math.round(stats.analytics.averageMemorySize * 100) / 100
2907
+ },
2908
+ config: stats.config,
2909
+ items: memory.map((item) => ({
2910
+ id: item.id,
2911
+ timestamp: item.timestamp,
2912
+ taskType: item.taskType,
2913
+ summary: item.summary,
2914
+ context: item.context,
2915
+ metadata: item.metadata,
2916
+ tags: item.tags,
2917
+ relativeTime: this.formatRelativeTime(item.timestamp)
2918
+ })),
2919
+ analytics: {
2920
+ taskTypeDistribution: this.getTaskTypeDistribution(memory),
2921
+ successRate: this.calculateSuccessRate(memory),
2922
+ averageExecutionTime: this.calculateAverageExecutionTime(memory),
2923
+ dataExtractionCount: this.countDataExtractions(memory),
2924
+ workflowSteps: this.extractWorkflowSteps(memory)
2925
+ }
2926
+ };
2927
+ }
2928
+ /**
2929
+ * Test sonunda kullanım için basit hafıza özeti döndürür (JSON formatında)
2930
+ */
2931
+ getMemorySummary() {
2932
+ const memory = this.getMemory();
2933
+ const stats = this.getMemoryStats();
2934
+ return {
2935
+ totalItems: memory.length,
2936
+ memoryEffectiveness: `${Math.round(stats.analytics.memoryEffectiveness * 100)}%`,
2937
+ taskTypes: this.getTaskTypeDistribution(memory),
2938
+ recentSteps: memory.slice(-5).map((item) => ({
2939
+ step: item.summary,
2940
+ type: item.taskType,
2941
+ success: item.metadata?.success || false,
2942
+ time: this.formatRelativeTime(item.timestamp)
2943
+ })),
2944
+ dataExtracted: this.getExtractedDataSummary(memory)
2945
+ };
2946
+ }
2947
+ formatRelativeTime(timestamp) {
2948
+ const now = Date.now();
2949
+ const diff = now - timestamp;
2950
+ const seconds = Math.floor(diff / 1e3);
2951
+ const minutes = Math.floor(seconds / 60);
2952
+ const hours = Math.floor(minutes / 60);
2953
+ if (hours > 0)
2954
+ return `${hours}h ${minutes % 60}m ago`;
2955
+ if (minutes > 0)
2956
+ return `${minutes}m ${seconds % 60}s ago`;
2957
+ return `${seconds}s ago`;
2958
+ }
2959
+ getTaskTypeDistribution(memory) {
2960
+ const distribution = {};
2961
+ memory.forEach((item) => {
2962
+ distribution[item.taskType] = (distribution[item.taskType] || 0) + 1;
2963
+ });
2964
+ return distribution;
2965
+ }
2966
+ calculateSuccessRate(memory) {
2967
+ if (memory.length === 0)
2968
+ return 0;
2969
+ const successCount = memory.filter((item) => item.metadata?.success !== false).length;
2970
+ return Math.round(successCount / memory.length * 100);
2971
+ }
2972
+ calculateAverageExecutionTime(memory) {
2973
+ const executionTimes = memory.map((item) => item.metadata?.executionTime).filter((time) => typeof time === "number");
2974
+ if (executionTimes.length === 0)
2975
+ return 0;
2976
+ const average = executionTimes.reduce((sum, time) => sum + time, 0) / executionTimes.length;
2977
+ return Math.round(average);
2978
+ }
2979
+ countDataExtractions(memory) {
2980
+ return memory.filter(
2981
+ (item) => item.context?.dataExtracted || item.taskType === "Insight" && item.summary.includes("Extracted")
2982
+ ).length;
2983
+ }
2984
+ extractWorkflowSteps(memory) {
2985
+ return memory.map((item) => item.summary);
2986
+ }
2987
+ getExtractedDataSummary(memory) {
2988
+ const extractedData = {};
2989
+ memory.forEach((item, index) => {
2990
+ if (item.context?.dataExtracted) {
2991
+ extractedData[`step_${index + 1}`] = item.context.dataExtracted;
2992
+ }
2993
+ });
2994
+ return extractedData;
2995
+ }
2893
2996
  };
2894
2997
 
2895
2998
  // src/playground/agent.ts