freestyle-sandboxes 0.0.1-1 → 0.0.1-2
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 +6 -2
- package/dist/ai/index.d.cts +3 -3
- package/dist/ai/index.d.mts +3 -3
- package/dist/ai/index.mjs +6 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/ai/index.ts +6 -2
- package/src/index.ts +2 -1
package/dist/ai/index.cjs
CHANGED
|
@@ -7,7 +7,7 @@ require('@hey-api/client-fetch');
|
|
|
7
7
|
|
|
8
8
|
const executeTool = (config) => {
|
|
9
9
|
const api = new index.FreestyleSandboxes({
|
|
10
|
-
|
|
10
|
+
...config
|
|
11
11
|
});
|
|
12
12
|
return ai.tool({
|
|
13
13
|
description: "Execute a JavaScript or TypeScript script",
|
|
@@ -29,7 +29,11 @@ const executeTool = (config) => {
|
|
|
29
29
|
`)
|
|
30
30
|
}),
|
|
31
31
|
execute: async ({ script }) => {
|
|
32
|
-
|
|
32
|
+
try {
|
|
33
|
+
return api.executeScript(script, config);
|
|
34
|
+
} catch (e) {
|
|
35
|
+
return e.message;
|
|
36
|
+
}
|
|
33
37
|
}
|
|
34
38
|
});
|
|
35
39
|
};
|
package/dist/ai/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
|
-
import { F as FreestyleExecuteScriptParamsConfiguration
|
|
2
|
+
import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-BoJEFWW-.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -20,10 +20,10 @@ declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration &
|
|
|
20
20
|
script?: string;
|
|
21
21
|
}, {
|
|
22
22
|
script?: string;
|
|
23
|
-
}>,
|
|
23
|
+
}>, any> & {
|
|
24
24
|
execute: (args: {
|
|
25
25
|
script?: string;
|
|
26
|
-
}, options: ai.ToolExecutionOptions) => PromiseLike<
|
|
26
|
+
}, options: ai.ToolExecutionOptions) => PromiseLike<any>;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export { executeTool };
|
package/dist/ai/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
|
-
import { F as FreestyleExecuteScriptParamsConfiguration
|
|
2
|
+
import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-BoJEFWW-.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -20,10 +20,10 @@ declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration &
|
|
|
20
20
|
script?: string;
|
|
21
21
|
}, {
|
|
22
22
|
script?: string;
|
|
23
|
-
}>,
|
|
23
|
+
}>, any> & {
|
|
24
24
|
execute: (args: {
|
|
25
25
|
script?: string;
|
|
26
|
-
}, options: ai.ToolExecutionOptions) => PromiseLike<
|
|
26
|
+
}, options: ai.ToolExecutionOptions) => PromiseLike<any>;
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export { executeTool };
|
package/dist/ai/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import '@hey-api/client-fetch';
|
|
|
5
5
|
|
|
6
6
|
const executeTool = (config) => {
|
|
7
7
|
const api = new FreestyleSandboxes({
|
|
8
|
-
|
|
8
|
+
...config
|
|
9
9
|
});
|
|
10
10
|
return tool({
|
|
11
11
|
description: "Execute a JavaScript or TypeScript script",
|
|
@@ -27,7 +27,11 @@ const executeTool = (config) => {
|
|
|
27
27
|
`)
|
|
28
28
|
}),
|
|
29
29
|
execute: async ({ script }) => {
|
|
30
|
-
|
|
30
|
+
try {
|
|
31
|
+
return api.executeScript(script, config);
|
|
32
|
+
} catch (e) {
|
|
33
|
+
return e.message;
|
|
34
|
+
}
|
|
31
35
|
}
|
|
32
36
|
});
|
|
33
37
|
};
|
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
package/src/ai/index.ts
CHANGED
|
@@ -19,7 +19,7 @@ export const executeTool = (
|
|
|
19
19
|
}
|
|
20
20
|
) => {
|
|
21
21
|
const api = new FreestyleSandboxes({
|
|
22
|
-
|
|
22
|
+
...config,
|
|
23
23
|
});
|
|
24
24
|
return tool({
|
|
25
25
|
description: "Execute a JavaScript or TypeScript script",
|
|
@@ -41,7 +41,11 @@ export const executeTool = (
|
|
|
41
41
|
`),
|
|
42
42
|
}),
|
|
43
43
|
execute: async ({ script }) => {
|
|
44
|
-
|
|
44
|
+
try {
|
|
45
|
+
return api.executeScript(script, config);
|
|
46
|
+
} catch (e) {
|
|
47
|
+
return e.message;
|
|
48
|
+
}
|
|
45
49
|
},
|
|
46
50
|
});
|
|
47
51
|
};
|
package/src/index.ts
CHANGED
|
@@ -34,10 +34,11 @@ export class FreestyleSandboxes {
|
|
|
34
34
|
config: config,
|
|
35
35
|
},
|
|
36
36
|
});
|
|
37
|
+
|
|
37
38
|
if (response.data) {
|
|
38
39
|
return response.data;
|
|
39
40
|
} else {
|
|
40
|
-
throw new Error("Failed to execute script");
|
|
41
|
+
throw new Error("Failed to execute script: " + response.error);
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
|