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