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