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