@midscene/visualizer 0.26.7-beta-20250821134240.0 → 0.27.0

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.
@@ -38,12 +38,15 @@ const mergeTwoCameraState = (cameraState1, cameraState2)=>{
38
38
  width: newWidth
39
39
  };
40
40
  };
41
+ const capitalizeFirstLetter = (str)=>{
42
+ if ('string' != typeof str || 0 === str.length) return str;
43
+ return str.charAt(0).toUpperCase() + str.slice(1);
44
+ };
41
45
  const allScriptsFromDump = (dump)=>{
42
46
  let width;
43
47
  let height;
44
48
  let sdkVersion;
45
- const modelName = dump.modelName;
46
- const modelDescription = dump.modelDescription;
49
+ const modelBriefsSet = new Set();
47
50
  dump.executions.forEach((execution)=>{
48
51
  if (execution.sdkVersion) sdkVersion = execution.sdkVersion;
49
52
  execution.tasks.forEach((task)=>{
@@ -60,14 +63,19 @@ const allScriptsFromDump = (dump)=>{
60
63
  return {
61
64
  scripts: [],
62
65
  sdkVersion,
63
- modelName,
64
- modelDescription
66
+ modelBriefs: []
65
67
  };
66
68
  }
67
69
  const allScripts = [];
68
70
  dump.executions.forEach((execution)=>{
69
71
  const scripts = generateAnimationScripts(execution, -1, width, height);
70
72
  if (scripts) allScripts.push(...scripts);
73
+ execution.tasks.forEach((task)=>{
74
+ if (task.usage) {
75
+ const { model_name, model_description, intent } = task.usage;
76
+ if (intent && model_name) modelBriefsSet.add(model_description ? `${capitalizeFirstLetter(intent)}/${model_name}(${model_description})` : model_name);
77
+ }
78
+ });
71
79
  });
72
80
  const allScriptsWithoutIntermediateDoneFrame = allScripts.filter((script, index)=>{
73
81
  if (index !== allScripts.length - 1 && 'Done' === script.title) return false;
@@ -78,8 +86,9 @@ const allScriptsFromDump = (dump)=>{
78
86
  width,
79
87
  height,
80
88
  sdkVersion,
81
- modelName,
82
- modelDescription
89
+ modelBriefs: [
90
+ ...modelBriefsSet
91
+ ]
83
92
  };
84
93
  };
85
94
  const generateAnimationScripts = (execution, task, imageWidth, imageHeight)=>{
@@ -69,12 +69,15 @@ const mergeTwoCameraState = (cameraState1, cameraState2)=>{
69
69
  width: newWidth
70
70
  };
71
71
  };
72
+ const capitalizeFirstLetter = (str)=>{
73
+ if ('string' != typeof str || 0 === str.length) return str;
74
+ return str.charAt(0).toUpperCase() + str.slice(1);
75
+ };
72
76
  const allScriptsFromDump = (dump)=>{
73
77
  let width;
74
78
  let height;
75
79
  let sdkVersion;
76
- const modelName = dump.modelName;
77
- const modelDescription = dump.modelDescription;
80
+ const modelBriefsSet = new Set();
78
81
  dump.executions.forEach((execution)=>{
79
82
  if (execution.sdkVersion) sdkVersion = execution.sdkVersion;
80
83
  execution.tasks.forEach((task)=>{
@@ -91,14 +94,19 @@ const allScriptsFromDump = (dump)=>{
91
94
  return {
92
95
  scripts: [],
93
96
  sdkVersion,
94
- modelName,
95
- modelDescription
97
+ modelBriefs: []
96
98
  };
97
99
  }
98
100
  const allScripts = [];
99
101
  dump.executions.forEach((execution)=>{
100
102
  const scripts = generateAnimationScripts(execution, -1, width, height);
101
103
  if (scripts) allScripts.push(...scripts);
104
+ execution.tasks.forEach((task)=>{
105
+ if (task.usage) {
106
+ const { model_name, model_description, intent } = task.usage;
107
+ if (intent && model_name) modelBriefsSet.add(model_description ? `${capitalizeFirstLetter(intent)}/${model_name}(${model_description})` : model_name);
108
+ }
109
+ });
102
110
  });
103
111
  const allScriptsWithoutIntermediateDoneFrame = allScripts.filter((script, index)=>{
104
112
  if (index !== allScripts.length - 1 && 'Done' === script.title) return false;
@@ -109,8 +117,9 @@ const allScriptsFromDump = (dump)=>{
109
117
  width,
110
118
  height,
111
119
  sdkVersion,
112
- modelName,
113
- modelDescription
120
+ modelBriefs: [
121
+ ...modelBriefsSet
122
+ ]
114
123
  };
115
124
  };
116
125
  const generateAnimationScripts = (execution, task, imageWidth, imageHeight)=>{
@@ -27,8 +27,7 @@ export interface ReplayScriptsInfo {
27
27
  width?: number;
28
28
  height?: number;
29
29
  sdkVersion?: string;
30
- modelName?: string;
31
- modelDescription?: string;
30
+ modelBriefs: string[];
32
31
  }
33
32
  export declare const allScriptsFromDump: (dump: GroupedActionDump) => ReplayScriptsInfo | null;
34
33
  export declare const generateAnimationScripts: (execution: ExecutionDump | null, task: ExecutionTask | number, imageWidth: number, imageHeight: number) => AnimationScript[] | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/visualizer",
3
- "version": "0.26.7-beta-20250821134240.0",
3
+ "version": "0.27.0",
4
4
  "repository": "https://github.com/web-infra-dev/midscene",
5
5
  "homepage": "https://midscenejs.com/",
6
6
  "types": "./dist/types/index.d.ts",
@@ -70,9 +70,9 @@
70
70
  "antd": "^5.21.6",
71
71
  "buffer": "6.0.3",
72
72
  "dayjs": "^1.11.11",
73
- "@midscene/core": "0.26.7-beta-20250821134240.0",
74
- "@midscene/shared": "0.26.7-beta-20250821134240.0",
75
- "@midscene/web": "0.26.7-beta-20250821134240.0"
73
+ "@midscene/shared": "0.27.0",
74
+ "@midscene/core": "0.27.0",
75
+ "@midscene/web": "0.27.0"
76
76
  },
77
77
  "license": "MIT",
78
78
  "scripts": {