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