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
@@ -2001,7 +2001,7 @@ var import_js_yaml3 = __toESM(require("js-yaml"));
2001
2001
  var import_semver = __toESM(require("semver"));
2002
2002
 
2003
2003
  // package.json
2004
- var version = "1.5.7";
2004
+ var version = "1.5.8";
2005
2005
 
2006
2006
  // src/common/task-cache.ts
2007
2007
  var debug3 = (0, import_logger3.getDebug)("cache");
@@ -2918,6 +2918,109 @@ ${errors}`);
2918
2918
  clearMemory() {
2919
2919
  this.taskExecutor.clearMemory();
2920
2920
  }
2921
+ /**
2922
+ * Test sonunda kullanım için detaylı hafıza raporu döndürür (JSON formatında)
2923
+ */
2924
+ getMemoryReport() {
2925
+ const memory = this.getMemory();
2926
+ const stats = this.getMemoryStats();
2927
+ return {
2928
+ summary: {
2929
+ totalItems: memory.length,
2930
+ totalTasks: stats.analytics.totalTasks,
2931
+ memoryHits: stats.analytics.memoryHits,
2932
+ memoryMisses: stats.analytics.memoryMisses,
2933
+ memoryEffectiveness: Math.round(stats.analytics.memoryEffectiveness * 100),
2934
+ averageMemorySize: Math.round(stats.analytics.averageMemorySize * 100) / 100
2935
+ },
2936
+ config: stats.config,
2937
+ items: memory.map((item) => ({
2938
+ id: item.id,
2939
+ timestamp: item.timestamp,
2940
+ taskType: item.taskType,
2941
+ summary: item.summary,
2942
+ context: item.context,
2943
+ metadata: item.metadata,
2944
+ tags: item.tags,
2945
+ relativeTime: this.formatRelativeTime(item.timestamp)
2946
+ })),
2947
+ analytics: {
2948
+ taskTypeDistribution: this.getTaskTypeDistribution(memory),
2949
+ successRate: this.calculateSuccessRate(memory),
2950
+ averageExecutionTime: this.calculateAverageExecutionTime(memory),
2951
+ dataExtractionCount: this.countDataExtractions(memory),
2952
+ workflowSteps: this.extractWorkflowSteps(memory)
2953
+ }
2954
+ };
2955
+ }
2956
+ /**
2957
+ * Test sonunda kullanım için basit hafıza özeti döndürür (JSON formatında)
2958
+ */
2959
+ getMemorySummary() {
2960
+ const memory = this.getMemory();
2961
+ const stats = this.getMemoryStats();
2962
+ return {
2963
+ totalItems: memory.length,
2964
+ memoryEffectiveness: `${Math.round(stats.analytics.memoryEffectiveness * 100)}%`,
2965
+ taskTypes: this.getTaskTypeDistribution(memory),
2966
+ recentSteps: memory.slice(-5).map((item) => ({
2967
+ step: item.summary,
2968
+ type: item.taskType,
2969
+ success: item.metadata?.success || false,
2970
+ time: this.formatRelativeTime(item.timestamp)
2971
+ })),
2972
+ dataExtracted: this.getExtractedDataSummary(memory)
2973
+ };
2974
+ }
2975
+ formatRelativeTime(timestamp) {
2976
+ const now = Date.now();
2977
+ const diff = now - timestamp;
2978
+ const seconds = Math.floor(diff / 1e3);
2979
+ const minutes = Math.floor(seconds / 60);
2980
+ const hours = Math.floor(minutes / 60);
2981
+ if (hours > 0)
2982
+ return `${hours}h ${minutes % 60}m ago`;
2983
+ if (minutes > 0)
2984
+ return `${minutes}m ${seconds % 60}s ago`;
2985
+ return `${seconds}s ago`;
2986
+ }
2987
+ getTaskTypeDistribution(memory) {
2988
+ const distribution = {};
2989
+ memory.forEach((item) => {
2990
+ distribution[item.taskType] = (distribution[item.taskType] || 0) + 1;
2991
+ });
2992
+ return distribution;
2993
+ }
2994
+ calculateSuccessRate(memory) {
2995
+ if (memory.length === 0)
2996
+ return 0;
2997
+ const successCount = memory.filter((item) => item.metadata?.success !== false).length;
2998
+ return Math.round(successCount / memory.length * 100);
2999
+ }
3000
+ calculateAverageExecutionTime(memory) {
3001
+ const executionTimes = memory.map((item) => item.metadata?.executionTime).filter((time) => typeof time === "number");
3002
+ if (executionTimes.length === 0)
3003
+ return 0;
3004
+ const average = executionTimes.reduce((sum, time) => sum + time, 0) / executionTimes.length;
3005
+ return Math.round(average);
3006
+ }
3007
+ countDataExtractions(memory) {
3008
+ return memory.filter(
3009
+ (item) => item.context?.dataExtracted || item.taskType === "Insight" && item.summary.includes("Extracted")
3010
+ ).length;
3011
+ }
3012
+ extractWorkflowSteps(memory) {
3013
+ return memory.map((item) => item.summary);
3014
+ }
3015
+ getExtractedDataSummary(memory) {
3016
+ const extractedData = {};
3017
+ memory.forEach((item, index) => {
3018
+ if (item.context?.dataExtracted) {
3019
+ extractedData[`step_${index + 1}`] = item.context.dataExtracted;
3020
+ }
3021
+ });
3022
+ return extractedData;
3023
+ }
2921
3024
  };
2922
3025
 
2923
3026
  // src/puppeteer/base-page.ts