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