deepagentsdk 0.14.0 → 0.15.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.
- package/dist/adapters/elements/index.cjs +1 -1
- package/dist/adapters/elements/index.d.cts +1 -1
- package/dist/adapters/elements/index.d.mts +1 -1
- package/dist/{agent-D0bKkNI-.d.mts → agent-DHUp_-Fx.d.mts} +135 -25
- package/dist/{agent-DwAj5emJ.d.cts → agent-tfRthBvX.d.cts} +135 -25
- package/dist/{chunk-C5azi7Hr.cjs → chunk-DUZBydyJ.cjs} +7 -0
- package/dist/cli/index.cjs +2 -2
- package/dist/cli/index.mjs +1 -1
- package/dist/{file-saver-Hj5so3dV.mjs → file-saver-CQWTIr8z.mjs} +87 -4
- package/dist/file-saver-CQWTIr8z.mjs.map +1 -0
- package/dist/{file-saver-BYPKakT4.cjs → file-saver-ZDVH1zHI.cjs} +84 -4
- package/dist/file-saver-ZDVH1zHI.cjs.map +1 -0
- package/dist/index.cjs +27508 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +301 -4
- package/dist/index.d.mts +301 -4
- package/dist/index.mjs +27499 -4
- package/dist/index.mjs.map +1 -1
- package/dist/{load-BrRAKlO6.cjs → load-BnaAQyCo.cjs} +4 -4
- package/dist/{load-BrRAKlO6.cjs.map → load-BnaAQyCo.cjs.map} +1 -1
- package/dist/load-CLVcFzo7.cjs +4 -0
- package/dist/{load-BDxe6Cet.mjs → load-DRzSpESX.mjs} +1 -1
- package/dist/{load-BBYEnMwz.mjs → load-FjxJSusX.mjs} +2 -2
- package/dist/{load-BBYEnMwz.mjs.map → load-FjxJSusX.mjs.map} +1 -1
- package/package.json +5 -1
- package/dist/file-saver-BYPKakT4.cjs.map +0 -1
- package/dist/file-saver-Hj5so3dV.mjs.map +0 -1
- package/dist/load-DqllBbDc.cjs +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-
|
|
1
|
+
const require_chunk = require('./chunk-DUZBydyJ.cjs');
|
|
2
2
|
let ai = require("ai");
|
|
3
3
|
let zod = require("zod");
|
|
4
4
|
let micromatch = require("micromatch");
|
|
@@ -200,7 +200,7 @@ var init_events = require_chunk.__esmMin((() => {}));
|
|
|
200
200
|
* Type guard to check if a backend is a SandboxBackendProtocol.
|
|
201
201
|
*/
|
|
202
202
|
function isSandboxBackend(backend) {
|
|
203
|
-
return typeof backend.execute === "function" && typeof backend.id === "string";
|
|
203
|
+
return typeof backend.execute === "function" && typeof backend.uploadFiles === "function" && typeof backend.downloadFiles === "function" && typeof backend.id === "string";
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
//#endregion
|
|
@@ -2288,7 +2288,7 @@ var DeepAgent = class {
|
|
|
2288
2288
|
* Supports both legacy skillsDir and new agentId modes.
|
|
2289
2289
|
*/
|
|
2290
2290
|
async loadSkills(options) {
|
|
2291
|
-
const { listSkills } = await Promise.resolve().then(() => require("./load-
|
|
2291
|
+
const { listSkills } = await Promise.resolve().then(() => require("./load-CLVcFzo7.cjs"));
|
|
2292
2292
|
this.skillsMetadata = (await listSkills(options.agentId ? { agentId: options.agentId } : { projectSkillsDir: options.skillsDir })).map((s) => ({
|
|
2293
2293
|
name: s.name,
|
|
2294
2294
|
description: s.description,
|
|
@@ -2887,6 +2887,18 @@ function createDeepAgent(params) {
|
|
|
2887
2887
|
init_errors();
|
|
2888
2888
|
init_limits();
|
|
2889
2889
|
/**
|
|
2890
|
+
* Map error messages to FileOperationError literals.
|
|
2891
|
+
*
|
|
2892
|
+
* This provides structured error handling that LLMs can understand and potentially fix.
|
|
2893
|
+
*/
|
|
2894
|
+
function mapErrorToOperationError(errorMessage, path$1) {
|
|
2895
|
+
const lowerError = errorMessage.toLowerCase();
|
|
2896
|
+
if (lowerError.includes("no such file") || lowerError.includes("not found") || lowerError.includes("cannot find")) return "file_not_found";
|
|
2897
|
+
if (lowerError.includes("permission denied") || lowerError.includes("access denied") || lowerError.includes("read-only")) return "permission_denied";
|
|
2898
|
+
if (lowerError.includes("is a directory") || lowerError.includes("directory not empty")) return "is_directory";
|
|
2899
|
+
return "invalid_path";
|
|
2900
|
+
}
|
|
2901
|
+
/**
|
|
2890
2902
|
* Encode string to base64 for safe shell transmission.
|
|
2891
2903
|
*/
|
|
2892
2904
|
function toBase64(str) {
|
|
@@ -2925,6 +2937,74 @@ function buildNodeScript(script, args) {
|
|
|
2925
2937
|
* ```
|
|
2926
2938
|
*/
|
|
2927
2939
|
var BaseSandbox = class {
|
|
2940
|
+
/**
|
|
2941
|
+
* Upload multiple files to the sandbox.
|
|
2942
|
+
*
|
|
2943
|
+
* Default implementation uses base64 encoding via shell commands.
|
|
2944
|
+
* Subclasses can override if they have a native file upload API.
|
|
2945
|
+
*
|
|
2946
|
+
* This API is designed to allow partial success - individual uploads may fail
|
|
2947
|
+
* without affecting others. Check the error field in each response.
|
|
2948
|
+
*/
|
|
2949
|
+
async uploadFiles(files) {
|
|
2950
|
+
const responses = [];
|
|
2951
|
+
for (const [path$1, content] of files) try {
|
|
2952
|
+
const base64Content = Buffer.from(content).toString("base64");
|
|
2953
|
+
const escapedPath = path$1.replace(/'/g, "'\\''");
|
|
2954
|
+
const result = await this.execute(`echo '${base64Content}' | base64 -d > '${escapedPath}'`);
|
|
2955
|
+
if (result.exitCode !== 0) responses.push({
|
|
2956
|
+
path: path$1,
|
|
2957
|
+
error: mapErrorToOperationError(result.output, path$1)
|
|
2958
|
+
});
|
|
2959
|
+
else responses.push({
|
|
2960
|
+
path: path$1,
|
|
2961
|
+
error: null
|
|
2962
|
+
});
|
|
2963
|
+
} catch (error) {
|
|
2964
|
+
responses.push({
|
|
2965
|
+
path: path$1,
|
|
2966
|
+
error: "permission_denied"
|
|
2967
|
+
});
|
|
2968
|
+
}
|
|
2969
|
+
return responses;
|
|
2970
|
+
}
|
|
2971
|
+
/**
|
|
2972
|
+
* Download multiple files from the sandbox.
|
|
2973
|
+
*
|
|
2974
|
+
* Default implementation uses base64 encoding via shell commands.
|
|
2975
|
+
* Subclasses can override if they have a native file download API.
|
|
2976
|
+
*
|
|
2977
|
+
* This API is designed to allow partial success - individual downloads may fail
|
|
2978
|
+
* without affecting others. Check the error field in each response.
|
|
2979
|
+
*/
|
|
2980
|
+
async downloadFiles(paths) {
|
|
2981
|
+
const responses = [];
|
|
2982
|
+
for (const path$1 of paths) try {
|
|
2983
|
+
const escapedPath = path$1.replace(/'/g, "'\\''");
|
|
2984
|
+
const result = await this.execute(`base64 '${escapedPath}'`);
|
|
2985
|
+
if (result.exitCode !== 0) responses.push({
|
|
2986
|
+
path: path$1,
|
|
2987
|
+
content: null,
|
|
2988
|
+
error: mapErrorToOperationError(result.output, path$1)
|
|
2989
|
+
});
|
|
2990
|
+
else {
|
|
2991
|
+
const base64Content = result.output.trim();
|
|
2992
|
+
const content = Buffer.from(base64Content, "base64");
|
|
2993
|
+
responses.push({
|
|
2994
|
+
path: path$1,
|
|
2995
|
+
content,
|
|
2996
|
+
error: null
|
|
2997
|
+
});
|
|
2998
|
+
}
|
|
2999
|
+
} catch (error) {
|
|
3000
|
+
responses.push({
|
|
3001
|
+
path: path$1,
|
|
3002
|
+
content: null,
|
|
3003
|
+
error: "permission_denied"
|
|
3004
|
+
});
|
|
3005
|
+
}
|
|
3006
|
+
return responses;
|
|
3007
|
+
}
|
|
2928
3008
|
/**
|
|
2929
3009
|
* List files and directories in a path.
|
|
2930
3010
|
*/
|
|
@@ -3987,4 +4067,4 @@ Object.defineProperty(exports, 'write_todos', {
|
|
|
3987
4067
|
return write_todos;
|
|
3988
4068
|
}
|
|
3989
4069
|
});
|
|
3990
|
-
//# sourceMappingURL=file-saver-
|
|
4070
|
+
//# sourceMappingURL=file-saver-ZDVH1zHI.cjs.map
|