deepagents 1.7.0 → 1.7.1

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/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  <div align="center">
2
2
  <a href="https://docs.langchain.com/oss/python/deepagents/overview#deep-agents-overview">
3
3
  <picture>
4
- <source media="(prefers-color-scheme: light)" srcset=".github/images/logo-dark.svg">
5
- <source media="(prefers-color-scheme: dark)" srcset=".github/images/logo-light.svg">
6
- <img alt="Deep Agents Logo" src=".github/images/logo-dark.svg" width="80%">
4
+ <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/langchain-ai/deepagentsjs/refs/heads/main/.github/images/logo-dark.svg">
5
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/langchain-ai/deepagentsjs/refs/heads/main/.github/images/logo-light.svg">
6
+ <img alt="Deep Agents Logo" src="https://raw.githubusercontent.com/langchain-ai/deepagentsjs/refs/heads/main/.github/images/logo-dark.svg" width="80%">
7
7
  </picture>
8
8
  </a>
9
9
  </div>
package/dist/index.cjs CHANGED
@@ -61,6 +61,55 @@ node_os = __toESM(node_os);
61
61
  function isSandboxBackend(backend) {
62
62
  return typeof backend.execute === "function" && typeof backend.id === "string";
63
63
  }
64
+ const SANDBOX_ERROR_SYMBOL = Symbol.for("sandbox.error");
65
+ /**
66
+ * Custom error class for sandbox operations.
67
+ *
68
+ * @param message - Human-readable error description
69
+ * @param code - Structured error code for programmatic handling
70
+ * @returns SandboxError with message and code
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * try {
75
+ * await sandbox.execute("some command");
76
+ * } catch (error) {
77
+ * if (error instanceof SandboxError) {
78
+ * switch (error.code) {
79
+ * case "NOT_INITIALIZED":
80
+ * await sandbox.initialize();
81
+ * break;
82
+ * case "COMMAND_TIMEOUT":
83
+ * console.error("Command took too long");
84
+ * break;
85
+ * default:
86
+ * throw error;
87
+ * }
88
+ * }
89
+ * }
90
+ * ```
91
+ */
92
+ var SandboxError = class SandboxError extends Error {
93
+ /** Symbol for identifying sandbox error instances */
94
+ [SANDBOX_ERROR_SYMBOL] = true;
95
+ /** Error name for instanceof checks and logging */
96
+ name = "SandboxError";
97
+ /**
98
+ * Creates a new SandboxError.
99
+ *
100
+ * @param message - Human-readable error description
101
+ * @param code - Structured error code for programmatic handling
102
+ */
103
+ constructor(message, code, cause) {
104
+ super(message);
105
+ this.code = code;
106
+ this.cause = cause;
107
+ Object.setPrototypeOf(this, SandboxError.prototype);
108
+ }
109
+ static isInstance(error) {
110
+ return typeof error === "object" && error !== null && error[SANDBOX_ERROR_SYMBOL] === true;
111
+ }
112
+ };
64
113
 
65
114
  //#endregion
66
115
  //#region src/backends/utils.ts
@@ -4326,6 +4375,7 @@ exports.GENERAL_PURPOSE_SUBAGENT = GENERAL_PURPOSE_SUBAGENT;
4326
4375
  exports.MAX_SKILL_DESCRIPTION_LENGTH = MAX_SKILL_DESCRIPTION_LENGTH;
4327
4376
  exports.MAX_SKILL_FILE_SIZE = MAX_SKILL_FILE_SIZE;
4328
4377
  exports.MAX_SKILL_NAME_LENGTH = MAX_SKILL_NAME_LENGTH;
4378
+ exports.SandboxError = SandboxError;
4329
4379
  exports.StateBackend = StateBackend;
4330
4380
  exports.StoreBackend = StoreBackend;
4331
4381
  exports.TASK_SYSTEM_PROMPT = TASK_SYSTEM_PROMPT;