freestyle-sandboxes 0.0.28 → 0.0.30
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 +4 -5
- package/dist/ai/index.d.cts +10 -4
- package/dist/ai/index.d.mts +10 -4
- package/dist/ai/index.mjs +4 -5
- package/dist/index.cjs +5 -4
- package/dist/index.mjs +5 -4
- package/dist/langgraph/index.mjs +1 -1
- package/dist/mastra/index.d.cts +3 -2
- package/dist/mastra/index.d.mts +3 -2
- package/package.json +2 -2
- package/src/ai/index.ts +4 -1
- package/src/index.ts +8 -4
- package/src/mastra/index.ts +3 -3
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
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
Error: ${e.message}`;
|
|
46
|
+
return {
|
|
47
|
+
message: e.message,
|
|
48
|
+
error: e.error
|
|
49
|
+
};
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
52
|
});
|
package/dist/ai/index.d.cts
CHANGED
|
@@ -20,16 +20,22 @@ declare const executeCodeDescription: (envVars: string, nodeModules: string) =>
|
|
|
20
20
|
*/
|
|
21
21
|
declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration & {
|
|
22
22
|
apiKey: string;
|
|
23
|
-
}) => ai.
|
|
23
|
+
}) => ai.Tool<z.ZodObject<{
|
|
24
24
|
script: z.ZodString;
|
|
25
25
|
}, "strip", z.ZodTypeAny, {
|
|
26
26
|
script?: string;
|
|
27
27
|
}, {
|
|
28
28
|
script?: string;
|
|
29
|
-
}>,
|
|
29
|
+
}>, FreestyleExecuteScriptResultSuccess | {
|
|
30
|
+
message: any;
|
|
31
|
+
error: any;
|
|
32
|
+
}> & {
|
|
30
33
|
execute: (args: {
|
|
31
34
|
script?: string;
|
|
32
|
-
}, options: ai.ToolExecutionOptions) => PromiseLike<
|
|
35
|
+
}, options: ai.ToolExecutionOptions) => PromiseLike<FreestyleExecuteScriptResultSuccess | {
|
|
36
|
+
message: any;
|
|
37
|
+
error: any;
|
|
38
|
+
}>;
|
|
33
39
|
};
|
|
34
40
|
/**
|
|
35
41
|
* Deploy a Web project
|
|
@@ -38,7 +44,7 @@ declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration &
|
|
|
38
44
|
*/
|
|
39
45
|
declare const deployWebTool: (config: FreestyleExecuteScriptParamsConfiguration & {
|
|
40
46
|
apiKey: string;
|
|
41
|
-
}) => ai.
|
|
47
|
+
}) => ai.Tool<z.ZodObject<{
|
|
42
48
|
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
43
49
|
}, "strip", z.ZodTypeAny, {
|
|
44
50
|
files?: Record<string, string>;
|
package/dist/ai/index.d.mts
CHANGED
|
@@ -20,16 +20,22 @@ declare const executeCodeDescription: (envVars: string, nodeModules: string) =>
|
|
|
20
20
|
*/
|
|
21
21
|
declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration & {
|
|
22
22
|
apiKey: string;
|
|
23
|
-
}) => ai.
|
|
23
|
+
}) => ai.Tool<z.ZodObject<{
|
|
24
24
|
script: z.ZodString;
|
|
25
25
|
}, "strip", z.ZodTypeAny, {
|
|
26
26
|
script?: string;
|
|
27
27
|
}, {
|
|
28
28
|
script?: string;
|
|
29
|
-
}>,
|
|
29
|
+
}>, FreestyleExecuteScriptResultSuccess | {
|
|
30
|
+
message: any;
|
|
31
|
+
error: any;
|
|
32
|
+
}> & {
|
|
30
33
|
execute: (args: {
|
|
31
34
|
script?: string;
|
|
32
|
-
}, options: ai.ToolExecutionOptions) => PromiseLike<
|
|
35
|
+
}, options: ai.ToolExecutionOptions) => PromiseLike<FreestyleExecuteScriptResultSuccess | {
|
|
36
|
+
message: any;
|
|
37
|
+
error: any;
|
|
38
|
+
}>;
|
|
33
39
|
};
|
|
34
40
|
/**
|
|
35
41
|
* Deploy a Web project
|
|
@@ -38,7 +44,7 @@ declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration &
|
|
|
38
44
|
*/
|
|
39
45
|
declare const deployWebTool: (config: FreestyleExecuteScriptParamsConfiguration & {
|
|
40
46
|
apiKey: string;
|
|
41
|
-
}) => ai.
|
|
47
|
+
}) => ai.Tool<z.ZodObject<{
|
|
42
48
|
files: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
43
49
|
}, "strip", z.ZodTypeAny, {
|
|
44
50
|
files?: Record<string, string>;
|
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
|
|
45
|
-
|
|
46
|
-
|
|
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
|
|
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
|
|
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/dist/langgraph/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FreestyleSandboxes } from '../index.mjs';
|
|
2
2
|
import { DynamicStructuredTool } from '@langchain/core/tools';
|
|
3
|
-
import {
|
|
3
|
+
import { executeCodeSchema, executeCodeDescription } from '../ai/index.mjs';
|
|
4
4
|
import '@hey-api/client-fetch';
|
|
5
5
|
import 'ai';
|
|
6
6
|
import 'zod';
|
package/dist/mastra/index.d.cts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import * as _mastra_core_tools from '@mastra/core/tools';
|
|
1
2
|
import * as _mastra_core from '@mastra/core';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-BzRtj_TA.js';
|
|
4
5
|
|
|
5
6
|
declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration & {
|
|
6
7
|
apiKey: string;
|
|
7
|
-
}) =>
|
|
8
|
+
}) => _mastra_core_tools.Tool<z.ZodObject<{
|
|
8
9
|
script: z.ZodString;
|
|
9
10
|
}, "strip", z.ZodTypeAny, {
|
|
10
11
|
script?: string;
|
|
@@ -40,6 +41,6 @@ declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration &
|
|
|
40
41
|
script?: string;
|
|
41
42
|
}, {
|
|
42
43
|
script?: string;
|
|
43
|
-
}
|
|
44
|
+
}>>, unknown>;
|
|
44
45
|
|
|
45
46
|
export { executeTool };
|
package/dist/mastra/index.d.mts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import * as _mastra_core_tools from '@mastra/core/tools';
|
|
1
2
|
import * as _mastra_core from '@mastra/core';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { F as FreestyleExecuteScriptParamsConfiguration } from '../types.gen-BzRtj_TA.js';
|
|
4
5
|
|
|
5
6
|
declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration & {
|
|
6
7
|
apiKey: string;
|
|
7
|
-
}) =>
|
|
8
|
+
}) => _mastra_core_tools.Tool<z.ZodObject<{
|
|
8
9
|
script: z.ZodString;
|
|
9
10
|
}, "strip", z.ZodTypeAny, {
|
|
10
11
|
script?: string;
|
|
@@ -40,6 +41,6 @@ declare const executeTool: (config: FreestyleExecuteScriptParamsConfiguration &
|
|
|
40
41
|
script?: string;
|
|
41
42
|
}, {
|
|
42
43
|
script?: string;
|
|
43
|
-
}
|
|
44
|
+
}>>, unknown>;
|
|
44
45
|
|
|
45
46
|
export { executeTool };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "freestyle-sandboxes",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.30",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@hey-api/client-fetch": "^0.5.7",
|
|
74
74
|
"@langchain/core": "^0.3.38",
|
|
75
75
|
"@langchain/langgraph": "^0.2.44",
|
|
76
|
-
"@mastra/core": "^0.
|
|
76
|
+
"@mastra/core": "^0.6.0",
|
|
77
77
|
"ai": "^4.0.25",
|
|
78
78
|
"glob": "^11.0.1",
|
|
79
79
|
"humanlayer": "^0.7.0",
|
package/src/ai/index.ts
CHANGED
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
|
|
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
|
/**
|
package/src/mastra/index.ts
CHANGED
|
@@ -7,11 +7,11 @@ import { FreestyleSandboxes } from "..";
|
|
|
7
7
|
export const executeTool = (
|
|
8
8
|
config: FreestyleExecuteScriptParamsConfiguration & {
|
|
9
9
|
apiKey: string;
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
11
|
) => {
|
|
12
12
|
const description = executeCodeDescription(
|
|
13
13
|
Object.keys(config.envVars ?? {}).join(", "),
|
|
14
|
-
Object.keys(config.nodeModules ?? {}).join(", ")
|
|
14
|
+
Object.keys(config.nodeModules ?? {}).join(", ")
|
|
15
15
|
);
|
|
16
16
|
|
|
17
17
|
const client = new FreestyleSandboxes({
|
|
@@ -30,7 +30,7 @@ export const executeTool = (
|
|
|
30
30
|
z.object({
|
|
31
31
|
message: z.string(),
|
|
32
32
|
type: z.string(),
|
|
33
|
-
})
|
|
33
|
+
})
|
|
34
34
|
),
|
|
35
35
|
result: z.unknown(),
|
|
36
36
|
}),
|