freestyle-sandboxes 0.0.36 → 0.0.38
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 +1 -1
- package/dist/ai/index.d.cts +12 -2
- package/dist/ai/index.d.mts +12 -2
- package/dist/ai/index.mjs +1 -1
- package/dist/index-CGc0kRd_.cjs +3257 -0
- package/dist/{index-BQHqnjZK.mjs → index-D1ulQeJR.mjs} +17 -1
- package/dist/{index-CEEa9WHp.cjs → index-H7UNEAjs.cjs} +17 -1
- package/dist/index-jh-93svX.mjs +3250 -0
- package/dist/langgraph/index.cjs +1 -1
- package/dist/langgraph/index.mjs +1 -1
- package/dist/mastra/index.cjs +1 -1
- package/dist/mastra/index.mjs +1 -1
- package/dist/{types.gen-DLYohMJT.d.ts → types.gen-CfrGF-JI.d.ts} +1 -1
- package/dist/utils/index.cjs +4 -2
- package/dist/utils/index.mjs +4 -2
- package/package.json +1 -1
- package/src/ai/index.ts +33 -3
- package/src/utils/index.ts +2 -0
- package/dist/types.gen-1sd31qLV.d.ts +0 -172
- package/dist/types.gen-BCdfx7yt.d.ts +0 -760
- package/dist/types.gen-BaMKzqxQ.d.ts +0 -233
- package/dist/types.gen-BtK6PMQy.d.ts +0 -195
- package/dist/types.gen-C03gaIPq.d.ts +0 -297
- package/dist/types.gen-CMuCas4r.d.ts +0 -183
- package/dist/types.gen-CnEkmbco.d.ts +0 -314
- package/dist/types.gen-DHmdEOOa.d.ts +0 -172
- package/dist/types.gen-DbTb_SrD.d.ts +0 -156
- package/dist/types.gen-DyY7Deri.d.ts +0 -138
- package/dist/types.gen-MBZCvIhE.d.ts +0 -311
- package/dist/types.gen-YhJAHBw8.d.ts +0 -233
- package/dist/types.gen-cCnnhnB6.d.ts +0 -182
- package/dist/types.gen-uDTr6v-7.d.ts +0 -731
|
@@ -3167,9 +3167,25 @@ const executeTool = (config) => {
|
|
|
3167
3167
|
return tool({
|
|
3168
3168
|
description: executeCodeDescription(envVars, nodeModules),
|
|
3169
3169
|
parameters: executeCodeSchema,
|
|
3170
|
-
execute: async ({ script }) => {
|
|
3170
|
+
execute: async ({ script, ...otherParams }, { toolCallId }) => {
|
|
3171
3171
|
try {
|
|
3172
3172
|
const res = await api.executeScript(script, config);
|
|
3173
|
+
if (config.onResult) {
|
|
3174
|
+
await config.onResult({
|
|
3175
|
+
toolCallId,
|
|
3176
|
+
result: res,
|
|
3177
|
+
input: {
|
|
3178
|
+
script,
|
|
3179
|
+
...otherParams
|
|
3180
|
+
}
|
|
3181
|
+
});
|
|
3182
|
+
}
|
|
3183
|
+
if (config.truncateOutput) {
|
|
3184
|
+
if ("output" in res) {
|
|
3185
|
+
res.result = JSON.stringify(res.result).slice(0, 1e3);
|
|
3186
|
+
res.logs = res.logs.slice(0, 1e3);
|
|
3187
|
+
}
|
|
3188
|
+
}
|
|
3173
3189
|
return res;
|
|
3174
3190
|
} catch (e) {
|
|
3175
3191
|
console.log("ERROR: ", e.message);
|
|
@@ -3169,9 +3169,25 @@ const executeTool = (config) => {
|
|
|
3169
3169
|
return tool({
|
|
3170
3170
|
description: executeCodeDescription(envVars, nodeModules),
|
|
3171
3171
|
parameters: executeCodeSchema,
|
|
3172
|
-
execute: async ({ script }) => {
|
|
3172
|
+
execute: async ({ script, ...otherParams }, { toolCallId }) => {
|
|
3173
3173
|
try {
|
|
3174
3174
|
const res = await api.executeScript(script, config);
|
|
3175
|
+
if (config.onResult) {
|
|
3176
|
+
await config.onResult({
|
|
3177
|
+
toolCallId,
|
|
3178
|
+
result: res,
|
|
3179
|
+
input: {
|
|
3180
|
+
script,
|
|
3181
|
+
...otherParams
|
|
3182
|
+
}
|
|
3183
|
+
});
|
|
3184
|
+
}
|
|
3185
|
+
if (config.truncateOutput) {
|
|
3186
|
+
if ("output" in res) {
|
|
3187
|
+
res.result = JSON.stringify(res.result).slice(0, 1e3);
|
|
3188
|
+
res.logs = res.logs.slice(0, 1e3);
|
|
3189
|
+
}
|
|
3190
|
+
}
|
|
3175
3191
|
return res;
|
|
3176
3192
|
} catch (e) {
|
|
3177
3193
|
console.log("ERROR: ", e.message);
|