@midscene/visualizer 1.0.3 → 1.0.4-beta-20251223112206.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.
@@ -71,6 +71,18 @@ function _object_spread_props(target, source) {
71
71
  });
72
72
  return target;
73
73
  }
74
+ function formatError(error) {
75
+ var _error_dump;
76
+ if (!error) return '';
77
+ if ('string' == typeof error) return error;
78
+ if (null == error ? void 0 : null == (_error_dump = error.dump) ? void 0 : _error_dump.error) return error.dump.error;
79
+ if (error.message) return String(error.message);
80
+ try {
81
+ return JSON.stringify(error);
82
+ } catch (e) {
83
+ return String(error);
84
+ }
85
+ }
74
86
  function buildProgressContent(task) {
75
87
  const action = typeStr(task);
76
88
  const description = paramStr(task);
@@ -142,7 +154,7 @@ function usePlaygroundExecution(playgroundSDK, storage, actionSpace, loading, se
142
154
  content: buildProgressContent(task),
143
155
  timestamp: new Date((null == (_task_timing = task.timing) ? void 0 : _task_timing.start) || Date.now()),
144
156
  result: task.error ? {
145
- error: String(task.error),
157
+ error: formatError(task.error),
146
158
  result: null
147
159
  } : void 0
148
160
  };
@@ -168,11 +180,11 @@ function usePlaygroundExecution(playgroundSDK, storage, actionSpace, loading, se
168
180
  const resultObj = result.result;
169
181
  if (resultObj.dump) result.dump = resultObj.dump;
170
182
  if (resultObj.reportHTML) result.reportHTML = resultObj.reportHTML;
171
- if (resultObj.error) result.error = resultObj.error;
183
+ if (resultObj.error) result.error = formatError(resultObj.error);
172
184
  if (void 0 !== resultObj.result) result.result = resultObj.result;
173
185
  }
174
186
  } catch (e) {
175
- result.error = (null == e ? void 0 : e.message) || String(e);
187
+ result.error = formatError(e);
176
188
  console.error('Playground execution error:', e);
177
189
  if ('object' == typeof e && null !== e) {
178
190
  if (e.dump) result.dump = e.dump;
@@ -99,6 +99,18 @@ function _object_spread_props(target, source) {
99
99
  });
100
100
  return target;
101
101
  }
102
+ function formatError(error) {
103
+ var _error_dump;
104
+ if (!error) return '';
105
+ if ('string' == typeof error) return error;
106
+ if (null == error ? void 0 : null == (_error_dump = error.dump) ? void 0 : _error_dump.error) return error.dump.error;
107
+ if (error.message) return String(error.message);
108
+ try {
109
+ return JSON.stringify(error);
110
+ } catch (e) {
111
+ return String(error);
112
+ }
113
+ }
102
114
  function buildProgressContent(task) {
103
115
  const action = (0, agent_namespaceObject.typeStr)(task);
104
116
  const description = (0, agent_namespaceObject.paramStr)(task);
@@ -170,7 +182,7 @@ function usePlaygroundExecution(playgroundSDK, storage, actionSpace, loading, se
170
182
  content: buildProgressContent(task),
171
183
  timestamp: new Date((null == (_task_timing = task.timing) ? void 0 : _task_timing.start) || Date.now()),
172
184
  result: task.error ? {
173
- error: String(task.error),
185
+ error: formatError(task.error),
174
186
  result: null
175
187
  } : void 0
176
188
  };
@@ -196,11 +208,11 @@ function usePlaygroundExecution(playgroundSDK, storage, actionSpace, loading, se
196
208
  const resultObj = result.result;
197
209
  if (resultObj.dump) result.dump = resultObj.dump;
198
210
  if (resultObj.reportHTML) result.reportHTML = resultObj.reportHTML;
199
- if (resultObj.error) result.error = resultObj.error;
211
+ if (resultObj.error) result.error = formatError(resultObj.error);
200
212
  if (void 0 !== resultObj.result) result.result = resultObj.result;
201
213
  }
202
214
  } catch (e) {
203
- result.error = (null == e ? void 0 : e.message) || String(e);
215
+ result.error = formatError(e);
204
216
  console.error('Playground execution error:', e);
205
217
  if ('object' == typeof e && null !== e) {
206
218
  if (e.dump) result.dump = e.dump;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midscene/visualizer",
3
- "version": "1.0.3",
3
+ "version": "1.0.4-beta-20251223112206.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",
@@ -60,10 +60,10 @@
60
60
  "antd": "^5.21.6",
61
61
  "buffer": "6.0.3",
62
62
  "dayjs": "^1.11.11",
63
- "@midscene/core": "1.0.3",
64
- "@midscene/shared": "1.0.3",
65
- "@midscene/playground": "1.0.3",
66
- "@midscene/web": "1.0.3"
63
+ "@midscene/core": "1.0.4-beta-20251223112206.0",
64
+ "@midscene/playground": "1.0.4-beta-20251223112206.0",
65
+ "@midscene/shared": "1.0.4-beta-20251223112206.0",
66
+ "@midscene/web": "1.0.4-beta-20251223112206.0"
67
67
  },
68
68
  "license": "MIT",
69
69
  "scripts": {