freestyle-sandboxes 0.0.28 → 0.0.29

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.
package/dist/ai/index.cjs CHANGED
@@ -43,11 +43,10 @@ const executeTool = (config) => {
43
43
  return res;
44
44
  } catch (e) {
45
45
  console.log("ERROR: ", e.message);
46
- return `Error executing script:
47
-
48
- ${script}
49
-
50
- Error: ${e.message}`;
46
+ return {
47
+ message: e.message,
48
+ error: e.error
49
+ };
51
50
  }
52
51
  }
53
52
  });
@@ -26,10 +26,16 @@ declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration &
26
26
  script?: string;
27
27
  }, {
28
28
  script?: string;
29
- }>, string | FreestyleExecuteScriptResultSuccess> & {
29
+ }>, FreestyleExecuteScriptResultSuccess | {
30
+ message: any;
31
+ error: any;
32
+ }> & {
30
33
  execute: (args: {
31
34
  script?: string;
32
- }, options: ai.ToolExecutionOptions) => PromiseLike<string | FreestyleExecuteScriptResultSuccess>;
35
+ }, options: ai.ToolExecutionOptions) => PromiseLike<FreestyleExecuteScriptResultSuccess | {
36
+ message: any;
37
+ error: any;
38
+ }>;
33
39
  };
34
40
  /**
35
41
  * Deploy a Web project
@@ -26,10 +26,16 @@ declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration &
26
26
  script?: string;
27
27
  }, {
28
28
  script?: string;
29
- }>, string | FreestyleExecuteScriptResultSuccess> & {
29
+ }>, FreestyleExecuteScriptResultSuccess | {
30
+ message: any;
31
+ error: any;
32
+ }> & {
30
33
  execute: (args: {
31
34
  script?: string;
32
- }, options: ai.ToolExecutionOptions) => PromiseLike<string | FreestyleExecuteScriptResultSuccess>;
35
+ }, options: ai.ToolExecutionOptions) => PromiseLike<FreestyleExecuteScriptResultSuccess | {
36
+ message: any;
37
+ error: any;
38
+ }>;
33
39
  };
34
40
  /**
35
41
  * Deploy a Web project
package/dist/ai/index.mjs CHANGED
@@ -41,11 +41,10 @@ const executeTool = (config) => {
41
41
  return res;
42
42
  } catch (e) {
43
43
  console.log("ERROR: ", e.message);
44
- return `Error executing script:
45
-
46
- ${script}
47
-
48
- Error: ${e.message}`;
44
+ return {
45
+ message: e.message,
46
+ error: e.error
47
+ };
49
48
  }
50
49
  }
51
50
  });
package/dist/index.cjs CHANGED
@@ -203,8 +203,8 @@ class FreestyleSandboxes {
203
203
  if (response.data) {
204
204
  return response.data;
205
205
  }
206
- throw new Error(
207
- `Failed to execute script:
206
+ throw {
207
+ message: `Failed to execute script:
208
208
 
209
209
  ${script}
210
210
 
@@ -212,8 +212,9 @@ Error:
212
212
 
213
213
  ${JSON.stringify(
214
214
  response
215
- )}`
216
- );
215
+ )}`,
216
+ error: response.error
217
+ };
217
218
  }
218
219
  /**
219
220
  * Deploy a Web project to a sandbox.
package/dist/index.mjs CHANGED
@@ -201,8 +201,8 @@ class FreestyleSandboxes {
201
201
  if (response.data) {
202
202
  return response.data;
203
203
  }
204
- throw new Error(
205
- `Failed to execute script:
204
+ throw {
205
+ message: `Failed to execute script:
206
206
 
207
207
  ${script}
208
208
 
@@ -210,8 +210,9 @@ Error:
210
210
 
211
211
  ${JSON.stringify(
212
212
  response
213
- )}`
214
- );
213
+ )}`,
214
+ error: response.error
215
+ };
215
216
  }
216
217
  /**
217
218
  * Deploy a Web project to a sandbox.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freestyle-sandboxes",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
package/src/ai/index.ts CHANGED
@@ -62,7 +62,10 @@ export const executeTool = (
62
62
  return res;
63
63
  } catch (e) {
64
64
  console.log("ERROR: ", e.message);
65
- return `Error executing script:\n\n${script}\n\nError: ${e.message}`;
65
+ return {
66
+ message: e.message,
67
+ error: e.error,
68
+ };
66
69
  }
67
70
  },
68
71
  });
package/src/index.ts CHANGED
@@ -118,11 +118,15 @@ export class FreestyleSandboxes {
118
118
  if (response.data) {
119
119
  return response.data;
120
120
  }
121
- throw new Error(
122
- `Failed to execute script: \n\n${script}\n\nError:\n\n${JSON.stringify(
121
+ throw {
122
+ message: `Failed to execute script: \n\n${script}\n\nError:\n\n${JSON.stringify(
123
123
  response
124
- )}`
125
- );
124
+ )}`,
125
+ error: response.error,
126
+ };
127
+ // `Failed to execute script: \n\n${script}\n\nError:\n\n${JSON.stringify(
128
+ // response
129
+ // )}`
126
130
  }
127
131
 
128
132
  /**