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