deepagents 1.10.0 → 1.10.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/dist/index.cjs +47 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -6
- package/dist/index.d.ts +43 -6
- package/dist/index.js +47 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -13,7 +13,7 @@ import * as _$_langchain_core_tools0 from "@langchain/core/tools";
|
|
|
13
13
|
import { ClientTool, ServerTool, StructuredTool as StructuredTool$1 } from "@langchain/core/tools";
|
|
14
14
|
import { InteropZodObject } from "@langchain/core/utils/types";
|
|
15
15
|
import { BaseLanguageModel, LanguageModelLike } from "@langchain/core/language_models/base";
|
|
16
|
-
import { CreateSandboxOptions, Sandbox } from "langsmith/experimental/sandbox";
|
|
16
|
+
import { CaptureSnapshotOptions, CaptureSnapshotOptions as LangSmithCaptureSnapshotOptions, CreateSandboxOptions, Sandbox, Snapshot, Snapshot as LangSmithSnapshot, StartSandboxOptions, StartSandboxOptions as LangSmithStartSandboxOptions } from "langsmith/experimental/sandbox";
|
|
17
17
|
import { Runnable } from "@langchain/core/runnables";
|
|
18
18
|
import { BaseChatModel } from "@langchain/core/language_models/chat_models";
|
|
19
19
|
//#region src/backends/v1/protocol.d.ts
|
|
@@ -1703,10 +1703,17 @@ interface LangSmithSandboxOptions {
|
|
|
1703
1703
|
defaultTimeout?: number;
|
|
1704
1704
|
}
|
|
1705
1705
|
/** Options for the `LangSmithSandbox.create()` static factory. */
|
|
1706
|
-
interface LangSmithSandboxCreateOptions extends Omit<CreateSandboxOptions, "name" | "timeout" | "waitForReady"> {
|
|
1706
|
+
interface LangSmithSandboxCreateOptions extends Omit<CreateSandboxOptions, "name" | "timeout" | "waitForReady" | "snapshotName"> {
|
|
1707
|
+
/**
|
|
1708
|
+
* Snapshot ID to boot from.
|
|
1709
|
+
* Mutually exclusive with `templateName`.
|
|
1710
|
+
*/
|
|
1711
|
+
snapshotId?: string;
|
|
1707
1712
|
/**
|
|
1708
1713
|
* Name of the LangSmith sandbox template to use.
|
|
1709
|
-
*
|
|
1714
|
+
* Mutually exclusive with `snapshotId`.
|
|
1715
|
+
* @deprecated Use `snapshotId` instead. Template-based creation will be
|
|
1716
|
+
* removed in a future release.
|
|
1710
1717
|
*/
|
|
1711
1718
|
templateName?: string;
|
|
1712
1719
|
/**
|
|
@@ -1765,6 +1772,33 @@ declare class LangSmithSandbox extends BaseSandbox {
|
|
|
1765
1772
|
* cannot be used again.
|
|
1766
1773
|
*/
|
|
1767
1774
|
close(): Promise<void>;
|
|
1775
|
+
/**
|
|
1776
|
+
* Start a stopped sandbox and wait until it is ready.
|
|
1777
|
+
*
|
|
1778
|
+
* After calling this, `isRunning` will be `true` and the sandbox
|
|
1779
|
+
* can be used for command execution and file operations again.
|
|
1780
|
+
*
|
|
1781
|
+
* @param options - Start options (timeout, signal).
|
|
1782
|
+
*/
|
|
1783
|
+
start(options?: StartSandboxOptions): Promise<void>;
|
|
1784
|
+
/**
|
|
1785
|
+
* Stop the sandbox without deleting it.
|
|
1786
|
+
*
|
|
1787
|
+
* Sandbox files are preserved and the sandbox can be restarted later
|
|
1788
|
+
* with `start()`. After calling this, `isRunning` will be `false`.
|
|
1789
|
+
*/
|
|
1790
|
+
stop(): Promise<void>;
|
|
1791
|
+
/**
|
|
1792
|
+
* Capture a snapshot from this running sandbox.
|
|
1793
|
+
*
|
|
1794
|
+
* Snapshots can be used to create new sandboxes via
|
|
1795
|
+
* `LangSmithSandbox.create({ snapshotId })`.
|
|
1796
|
+
*
|
|
1797
|
+
* @param name - Name for the snapshot.
|
|
1798
|
+
* @param options - Capture options (checkpoint, timeout).
|
|
1799
|
+
* @returns The created Snapshot in "ready" status.
|
|
1800
|
+
*/
|
|
1801
|
+
captureSnapshot(name: string, options?: CaptureSnapshotOptions): Promise<Snapshot>;
|
|
1768
1802
|
/**
|
|
1769
1803
|
* Create and return a new LangSmithSandbox in one step.
|
|
1770
1804
|
*
|
|
@@ -1773,7 +1807,10 @@ declare class LangSmithSandbox extends BaseSandbox {
|
|
|
1773
1807
|
*
|
|
1774
1808
|
* @example
|
|
1775
1809
|
* ```typescript
|
|
1776
|
-
* const sandbox = await LangSmithSandbox.create({
|
|
1810
|
+
* const sandbox = await LangSmithSandbox.create({
|
|
1811
|
+
* snapshotId: "abc-123",
|
|
1812
|
+
* });
|
|
1813
|
+
*
|
|
1777
1814
|
* try {
|
|
1778
1815
|
* const agent = createDeepAgent({ model, backend: sandbox });
|
|
1779
1816
|
* await agent.invoke({ messages: [...] });
|
|
@@ -1782,7 +1819,7 @@ declare class LangSmithSandbox extends BaseSandbox {
|
|
|
1782
1819
|
* }
|
|
1783
1820
|
* ```
|
|
1784
1821
|
*/
|
|
1785
|
-
static create(options
|
|
1822
|
+
static create(options: LangSmithSandboxCreateOptions): Promise<LangSmithSandbox>;
|
|
1786
1823
|
}
|
|
1787
1824
|
//#endregion
|
|
1788
1825
|
//#region src/backends/utils.d.ts
|
|
@@ -3525,5 +3562,5 @@ declare function parseSkillMetadata(skillMdPath: string, source: "user" | "proje
|
|
|
3525
3562
|
*/
|
|
3526
3563
|
declare function listSkills(options: ListSkillsOptions): SkillMetadata[];
|
|
3527
3564
|
//#endregion
|
|
3528
|
-
export { type AgentMemoryMiddlewareOptions, type AnyBackendProtocol, type AnySubAgent, type AsyncSubAgent, type AsyncSubAgentMiddlewareOptions, type AsyncTask, type AsyncTaskStatus, type BackendFactory, type BackendProtocol, type BackendProtocolV1, type BackendProtocolV2, type BackendRuntime, BaseSandbox, type CompiledSubAgent, type CompletionCallbackOptions, CompositeBackend, ConfigurationError, type ConfigurationErrorCode, type CreateDeepAgentParams, DEFAULT_GENERAL_PURPOSE_DESCRIPTION, DEFAULT_SUBAGENT_PROMPT, type DeepAgent, type DeepAgentRunStream, type DeepAgentTypeConfig, type DefaultDeepAgentTypeConfig, type EditResult, type ExecuteResponse, type ExtractSubAgentMiddleware, type FileData, type FileDownloadResponse, type FileInfo, type FileOperationError, type FileUploadResponse, FilesystemBackend, type FilesystemMiddlewareOptions, type FilesystemOperation, type FilesystemPermission, type FlattenSubAgentMiddleware, GENERAL_PURPOSE_SUBAGENT, type GlobResult, type GrepMatch, type GrepResult, type InferDeepAgentSubagents, type InferDeepAgentType, type InferStructuredResponse, type InferSubAgentMiddlewareStates, type InferSubagentByName, type InferSubagentReactAgentType, LangSmithSandbox, type LangSmithSandboxOptions, type ListSkillsOptions, type SkillMetadata as LoaderSkillMetadata, LocalShellBackend, type LocalShellBackendOptions, type LsResult, MAX_SKILL_DESCRIPTION_LENGTH, MAX_SKILL_FILE_SIZE, MAX_SKILL_NAME_LENGTH, type MaybePromise, type MemoryMiddlewareOptions, type MergedDeepAgentState, type PermissionMode, type ReadRawResult, type ReadResult, type ResolveDeepAgentTypeConfig, type SandboxBackendProtocol, type SandboxBackendProtocolV1, type SandboxBackendProtocolV2, type SandboxDeleteOptions, SandboxError, type SandboxErrorCode, type SandboxGetOrCreateOptions, type SandboxInfo, type SandboxListOptions, type SandboxListResponse, type Settings, type SettingsOptions, type SkillMetadata$1 as SkillMetadata, type SkillsMiddlewareOptions, type StateAndStore, StateBackend, StoreBackend, type StoreBackendContext, type StoreBackendNamespaceFactory, type StoreBackendOptions, type SubAgent, type SubAgentMiddlewareOptions, type SubagentRunStream, type SupportedResponseFormat, TASK_SYSTEM_PROMPT, type WriteResult, adaptBackendProtocol, adaptSandboxProtocol, computeSummarizationDefaults, createAgentMemoryMiddleware, createAsyncSubAgentMiddleware, createCompletionCallbackMiddleware, createDeepAgent, createFilesystemMiddleware, createMemoryMiddleware, createPatchToolCallsMiddleware, createSettings, createSkillsMiddleware, createSubAgentMiddleware, createSubagentTransformer, createSummarizationMiddleware, filesValue, findProjectRoot, isAsyncSubAgent, isSandboxBackend, isSandboxProtocol, listSkills, parseSkillMetadata, resolveBackend };
|
|
3565
|
+
export { type AgentMemoryMiddlewareOptions, type AnyBackendProtocol, type AnySubAgent, type AsyncSubAgent, type AsyncSubAgentMiddlewareOptions, type AsyncTask, type AsyncTaskStatus, type BackendFactory, type BackendProtocol, type BackendProtocolV1, type BackendProtocolV2, type BackendRuntime, BaseSandbox, type CompiledSubAgent, type CompletionCallbackOptions, CompositeBackend, ConfigurationError, type ConfigurationErrorCode, type CreateDeepAgentParams, DEFAULT_GENERAL_PURPOSE_DESCRIPTION, DEFAULT_SUBAGENT_PROMPT, type DeepAgent, type DeepAgentRunStream, type DeepAgentTypeConfig, type DefaultDeepAgentTypeConfig, type EditResult, type ExecuteResponse, type ExtractSubAgentMiddleware, type FileData, type FileDownloadResponse, type FileInfo, type FileOperationError, type FileUploadResponse, FilesystemBackend, type FilesystemMiddlewareOptions, type FilesystemOperation, type FilesystemPermission, type FlattenSubAgentMiddleware, GENERAL_PURPOSE_SUBAGENT, type GlobResult, type GrepMatch, type GrepResult, type InferDeepAgentSubagents, type InferDeepAgentType, type InferStructuredResponse, type InferSubAgentMiddlewareStates, type InferSubagentByName, type InferSubagentReactAgentType, type LangSmithCaptureSnapshotOptions, LangSmithSandbox, type LangSmithSandboxCreateOptions, type LangSmithSandboxOptions, type LangSmithSnapshot, type LangSmithStartSandboxOptions, type ListSkillsOptions, type SkillMetadata as LoaderSkillMetadata, LocalShellBackend, type LocalShellBackendOptions, type LsResult, MAX_SKILL_DESCRIPTION_LENGTH, MAX_SKILL_FILE_SIZE, MAX_SKILL_NAME_LENGTH, type MaybePromise, type MemoryMiddlewareOptions, type MergedDeepAgentState, type PermissionMode, type ReadRawResult, type ReadResult, type ResolveDeepAgentTypeConfig, type SandboxBackendProtocol, type SandboxBackendProtocolV1, type SandboxBackendProtocolV2, type SandboxDeleteOptions, SandboxError, type SandboxErrorCode, type SandboxGetOrCreateOptions, type SandboxInfo, type SandboxListOptions, type SandboxListResponse, type Settings, type SettingsOptions, type SkillMetadata$1 as SkillMetadata, type SkillsMiddlewareOptions, type StateAndStore, StateBackend, StoreBackend, type StoreBackendContext, type StoreBackendNamespaceFactory, type StoreBackendOptions, type SubAgent, type SubAgentMiddlewareOptions, type SubagentRunStream, type SupportedResponseFormat, TASK_SYSTEM_PROMPT, type WriteResult, adaptBackendProtocol, adaptSandboxProtocol, computeSummarizationDefaults, createAgentMemoryMiddleware, createAsyncSubAgentMiddleware, createCompletionCallbackMiddleware, createDeepAgent, createFilesystemMiddleware, createMemoryMiddleware, createPatchToolCallsMiddleware, createSettings, createSkillsMiddleware, createSubAgentMiddleware, createSubagentTransformer, createSummarizationMiddleware, filesValue, findProjectRoot, isAsyncSubAgent, isSandboxBackend, isSandboxProtocol, listSkills, parseSkillMetadata, resolveBackend };
|
|
3529
3566
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import * as _messages from "@langchain/core/messages";
|
|
|
7
7
|
import * as z$2 from "zod";
|
|
8
8
|
import { z as z$1 } from "zod";
|
|
9
9
|
import { Client } from "@langchain/langgraph-sdk";
|
|
10
|
-
import { CreateSandboxOptions, Sandbox } from "langsmith/experimental/sandbox";
|
|
10
|
+
import { CaptureSnapshotOptions, CaptureSnapshotOptions as LangSmithCaptureSnapshotOptions, CreateSandboxOptions, Sandbox, Snapshot, Snapshot as LangSmithSnapshot, StartSandboxOptions, StartSandboxOptions as LangSmithStartSandboxOptions } from "langsmith/experimental/sandbox";
|
|
11
11
|
import * as _$zod_v30 from "zod/v3";
|
|
12
12
|
import { BaseCheckpointSaver, BaseStore } from "@langchain/langgraph-checkpoint";
|
|
13
13
|
import * as _$zod_v4_core0 from "zod/v4/core";
|
|
@@ -1705,10 +1705,17 @@ interface LangSmithSandboxOptions {
|
|
|
1705
1705
|
defaultTimeout?: number;
|
|
1706
1706
|
}
|
|
1707
1707
|
/** Options for the `LangSmithSandbox.create()` static factory. */
|
|
1708
|
-
interface LangSmithSandboxCreateOptions extends Omit<CreateSandboxOptions, "name" | "timeout" | "waitForReady"> {
|
|
1708
|
+
interface LangSmithSandboxCreateOptions extends Omit<CreateSandboxOptions, "name" | "timeout" | "waitForReady" | "snapshotName"> {
|
|
1709
|
+
/**
|
|
1710
|
+
* Snapshot ID to boot from.
|
|
1711
|
+
* Mutually exclusive with `templateName`.
|
|
1712
|
+
*/
|
|
1713
|
+
snapshotId?: string;
|
|
1709
1714
|
/**
|
|
1710
1715
|
* Name of the LangSmith sandbox template to use.
|
|
1711
|
-
*
|
|
1716
|
+
* Mutually exclusive with `snapshotId`.
|
|
1717
|
+
* @deprecated Use `snapshotId` instead. Template-based creation will be
|
|
1718
|
+
* removed in a future release.
|
|
1712
1719
|
*/
|
|
1713
1720
|
templateName?: string;
|
|
1714
1721
|
/**
|
|
@@ -1767,6 +1774,33 @@ declare class LangSmithSandbox extends BaseSandbox {
|
|
|
1767
1774
|
* cannot be used again.
|
|
1768
1775
|
*/
|
|
1769
1776
|
close(): Promise<void>;
|
|
1777
|
+
/**
|
|
1778
|
+
* Start a stopped sandbox and wait until it is ready.
|
|
1779
|
+
*
|
|
1780
|
+
* After calling this, `isRunning` will be `true` and the sandbox
|
|
1781
|
+
* can be used for command execution and file operations again.
|
|
1782
|
+
*
|
|
1783
|
+
* @param options - Start options (timeout, signal).
|
|
1784
|
+
*/
|
|
1785
|
+
start(options?: StartSandboxOptions): Promise<void>;
|
|
1786
|
+
/**
|
|
1787
|
+
* Stop the sandbox without deleting it.
|
|
1788
|
+
*
|
|
1789
|
+
* Sandbox files are preserved and the sandbox can be restarted later
|
|
1790
|
+
* with `start()`. After calling this, `isRunning` will be `false`.
|
|
1791
|
+
*/
|
|
1792
|
+
stop(): Promise<void>;
|
|
1793
|
+
/**
|
|
1794
|
+
* Capture a snapshot from this running sandbox.
|
|
1795
|
+
*
|
|
1796
|
+
* Snapshots can be used to create new sandboxes via
|
|
1797
|
+
* `LangSmithSandbox.create({ snapshotId })`.
|
|
1798
|
+
*
|
|
1799
|
+
* @param name - Name for the snapshot.
|
|
1800
|
+
* @param options - Capture options (checkpoint, timeout).
|
|
1801
|
+
* @returns The created Snapshot in "ready" status.
|
|
1802
|
+
*/
|
|
1803
|
+
captureSnapshot(name: string, options?: CaptureSnapshotOptions): Promise<Snapshot>;
|
|
1770
1804
|
/**
|
|
1771
1805
|
* Create and return a new LangSmithSandbox in one step.
|
|
1772
1806
|
*
|
|
@@ -1775,7 +1809,10 @@ declare class LangSmithSandbox extends BaseSandbox {
|
|
|
1775
1809
|
*
|
|
1776
1810
|
* @example
|
|
1777
1811
|
* ```typescript
|
|
1778
|
-
* const sandbox = await LangSmithSandbox.create({
|
|
1812
|
+
* const sandbox = await LangSmithSandbox.create({
|
|
1813
|
+
* snapshotId: "abc-123",
|
|
1814
|
+
* });
|
|
1815
|
+
*
|
|
1779
1816
|
* try {
|
|
1780
1817
|
* const agent = createDeepAgent({ model, backend: sandbox });
|
|
1781
1818
|
* await agent.invoke({ messages: [...] });
|
|
@@ -1784,7 +1821,7 @@ declare class LangSmithSandbox extends BaseSandbox {
|
|
|
1784
1821
|
* }
|
|
1785
1822
|
* ```
|
|
1786
1823
|
*/
|
|
1787
|
-
static create(options
|
|
1824
|
+
static create(options: LangSmithSandboxCreateOptions): Promise<LangSmithSandbox>;
|
|
1788
1825
|
}
|
|
1789
1826
|
//#endregion
|
|
1790
1827
|
//#region src/backends/utils.d.ts
|
|
@@ -3527,5 +3564,5 @@ declare function parseSkillMetadata(skillMdPath: string, source: "user" | "proje
|
|
|
3527
3564
|
*/
|
|
3528
3565
|
declare function listSkills(options: ListSkillsOptions): SkillMetadata[];
|
|
3529
3566
|
//#endregion
|
|
3530
|
-
export { type AgentMemoryMiddlewareOptions, type AnyBackendProtocol, type AnySubAgent, type AsyncSubAgent, type AsyncSubAgentMiddlewareOptions, type AsyncTask, type AsyncTaskStatus, type BackendFactory, type BackendProtocol, type BackendProtocolV1, type BackendProtocolV2, type BackendRuntime, BaseSandbox, type CompiledSubAgent, type CompletionCallbackOptions, CompositeBackend, ConfigurationError, type ConfigurationErrorCode, type CreateDeepAgentParams, DEFAULT_GENERAL_PURPOSE_DESCRIPTION, DEFAULT_SUBAGENT_PROMPT, type DeepAgent, type DeepAgentRunStream, type DeepAgentTypeConfig, type DefaultDeepAgentTypeConfig, type EditResult, type ExecuteResponse, type ExtractSubAgentMiddleware, type FileData, type FileDownloadResponse, type FileInfo, type FileOperationError, type FileUploadResponse, FilesystemBackend, type FilesystemMiddlewareOptions, type FilesystemOperation, type FilesystemPermission, type FlattenSubAgentMiddleware, GENERAL_PURPOSE_SUBAGENT, type GlobResult, type GrepMatch, type GrepResult, type InferDeepAgentSubagents, type InferDeepAgentType, type InferStructuredResponse, type InferSubAgentMiddlewareStates, type InferSubagentByName, type InferSubagentReactAgentType, LangSmithSandbox, type LangSmithSandboxOptions, type ListSkillsOptions, type SkillMetadata as LoaderSkillMetadata, LocalShellBackend, type LocalShellBackendOptions, type LsResult, MAX_SKILL_DESCRIPTION_LENGTH, MAX_SKILL_FILE_SIZE, MAX_SKILL_NAME_LENGTH, type MaybePromise, type MemoryMiddlewareOptions, type MergedDeepAgentState, type PermissionMode, type ReadRawResult, type ReadResult, type ResolveDeepAgentTypeConfig, type SandboxBackendProtocol, type SandboxBackendProtocolV1, type SandboxBackendProtocolV2, type SandboxDeleteOptions, SandboxError, type SandboxErrorCode, type SandboxGetOrCreateOptions, type SandboxInfo, type SandboxListOptions, type SandboxListResponse, type Settings, type SettingsOptions, type SkillMetadata$1 as SkillMetadata, type SkillsMiddlewareOptions, type StateAndStore, StateBackend, StoreBackend, type StoreBackendContext, type StoreBackendNamespaceFactory, type StoreBackendOptions, type SubAgent, type SubAgentMiddlewareOptions, type SubagentRunStream, type SupportedResponseFormat, TASK_SYSTEM_PROMPT, type WriteResult, adaptBackendProtocol, adaptSandboxProtocol, computeSummarizationDefaults, createAgentMemoryMiddleware, createAsyncSubAgentMiddleware, createCompletionCallbackMiddleware, createDeepAgent, createFilesystemMiddleware, createMemoryMiddleware, createPatchToolCallsMiddleware, createSettings, createSkillsMiddleware, createSubAgentMiddleware, createSubagentTransformer, createSummarizationMiddleware, filesValue, findProjectRoot, isAsyncSubAgent, isSandboxBackend, isSandboxProtocol, listSkills, parseSkillMetadata, resolveBackend };
|
|
3567
|
+
export { type AgentMemoryMiddlewareOptions, type AnyBackendProtocol, type AnySubAgent, type AsyncSubAgent, type AsyncSubAgentMiddlewareOptions, type AsyncTask, type AsyncTaskStatus, type BackendFactory, type BackendProtocol, type BackendProtocolV1, type BackendProtocolV2, type BackendRuntime, BaseSandbox, type CompiledSubAgent, type CompletionCallbackOptions, CompositeBackend, ConfigurationError, type ConfigurationErrorCode, type CreateDeepAgentParams, DEFAULT_GENERAL_PURPOSE_DESCRIPTION, DEFAULT_SUBAGENT_PROMPT, type DeepAgent, type DeepAgentRunStream, type DeepAgentTypeConfig, type DefaultDeepAgentTypeConfig, type EditResult, type ExecuteResponse, type ExtractSubAgentMiddleware, type FileData, type FileDownloadResponse, type FileInfo, type FileOperationError, type FileUploadResponse, FilesystemBackend, type FilesystemMiddlewareOptions, type FilesystemOperation, type FilesystemPermission, type FlattenSubAgentMiddleware, GENERAL_PURPOSE_SUBAGENT, type GlobResult, type GrepMatch, type GrepResult, type InferDeepAgentSubagents, type InferDeepAgentType, type InferStructuredResponse, type InferSubAgentMiddlewareStates, type InferSubagentByName, type InferSubagentReactAgentType, type LangSmithCaptureSnapshotOptions, LangSmithSandbox, type LangSmithSandboxCreateOptions, type LangSmithSandboxOptions, type LangSmithSnapshot, type LangSmithStartSandboxOptions, type ListSkillsOptions, type SkillMetadata as LoaderSkillMetadata, LocalShellBackend, type LocalShellBackendOptions, type LsResult, MAX_SKILL_DESCRIPTION_LENGTH, MAX_SKILL_FILE_SIZE, MAX_SKILL_NAME_LENGTH, type MaybePromise, type MemoryMiddlewareOptions, type MergedDeepAgentState, type PermissionMode, type ReadRawResult, type ReadResult, type ResolveDeepAgentTypeConfig, type SandboxBackendProtocol, type SandboxBackendProtocolV1, type SandboxBackendProtocolV2, type SandboxDeleteOptions, SandboxError, type SandboxErrorCode, type SandboxGetOrCreateOptions, type SandboxInfo, type SandboxListOptions, type SandboxListResponse, type Settings, type SettingsOptions, type SkillMetadata$1 as SkillMetadata, type SkillsMiddlewareOptions, type StateAndStore, StateBackend, StoreBackend, type StoreBackendContext, type StoreBackendNamespaceFactory, type StoreBackendOptions, type SubAgent, type SubAgentMiddlewareOptions, type SubagentRunStream, type SupportedResponseFormat, TASK_SYSTEM_PROMPT, type WriteResult, adaptBackendProtocol, adaptSandboxProtocol, computeSummarizationDefaults, createAgentMemoryMiddleware, createAsyncSubAgentMiddleware, createCompletionCallbackMiddleware, createDeepAgent, createFilesystemMiddleware, createMemoryMiddleware, createPatchToolCallsMiddleware, createSettings, createSkillsMiddleware, createSubAgentMiddleware, createSubagentTransformer, createSummarizationMiddleware, filesValue, findProjectRoot, isAsyncSubAgent, isSandboxBackend, isSandboxProtocol, listSkills, parseSkillMetadata, resolveBackend };
|
|
3531
3568
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -6425,7 +6425,7 @@ var BaseSandbox = class {
|
|
|
6425
6425
|
* ```typescript
|
|
6426
6426
|
* import { LangSmithSandbox, createDeepAgent } from "deepagents";
|
|
6427
6427
|
*
|
|
6428
|
-
* const sandbox = await LangSmithSandbox.create({
|
|
6428
|
+
* const sandbox = await LangSmithSandbox.create({ snapshotId: "your-snapshot-id" });
|
|
6429
6429
|
*
|
|
6430
6430
|
* const agent = createDeepAgent({ model, backend: sandbox });
|
|
6431
6431
|
*
|
|
@@ -6549,6 +6549,41 @@ var LangSmithSandbox = class LangSmithSandbox extends BaseSandbox {
|
|
|
6549
6549
|
this.#isRunning = false;
|
|
6550
6550
|
}
|
|
6551
6551
|
/**
|
|
6552
|
+
* Start a stopped sandbox and wait until it is ready.
|
|
6553
|
+
*
|
|
6554
|
+
* After calling this, `isRunning` will be `true` and the sandbox
|
|
6555
|
+
* can be used for command execution and file operations again.
|
|
6556
|
+
*
|
|
6557
|
+
* @param options - Start options (timeout, signal).
|
|
6558
|
+
*/
|
|
6559
|
+
async start(options = {}) {
|
|
6560
|
+
await this.#sandbox.start(options);
|
|
6561
|
+
this.#isRunning = true;
|
|
6562
|
+
}
|
|
6563
|
+
/**
|
|
6564
|
+
* Stop the sandbox without deleting it.
|
|
6565
|
+
*
|
|
6566
|
+
* Sandbox files are preserved and the sandbox can be restarted later
|
|
6567
|
+
* with `start()`. After calling this, `isRunning` will be `false`.
|
|
6568
|
+
*/
|
|
6569
|
+
async stop() {
|
|
6570
|
+
await this.#sandbox.stop();
|
|
6571
|
+
this.#isRunning = false;
|
|
6572
|
+
}
|
|
6573
|
+
/**
|
|
6574
|
+
* Capture a snapshot from this running sandbox.
|
|
6575
|
+
*
|
|
6576
|
+
* Snapshots can be used to create new sandboxes via
|
|
6577
|
+
* `LangSmithSandbox.create({ snapshotId })`.
|
|
6578
|
+
*
|
|
6579
|
+
* @param name - Name for the snapshot.
|
|
6580
|
+
* @param options - Capture options (checkpoint, timeout).
|
|
6581
|
+
* @returns The created Snapshot in "ready" status.
|
|
6582
|
+
*/
|
|
6583
|
+
async captureSnapshot(name, options = {}) {
|
|
6584
|
+
return this.#sandbox.captureSnapshot(name, options);
|
|
6585
|
+
}
|
|
6586
|
+
/**
|
|
6552
6587
|
* Create and return a new LangSmithSandbox in one step.
|
|
6553
6588
|
*
|
|
6554
6589
|
* This is the recommended way to create a sandbox — no need to import
|
|
@@ -6556,7 +6591,10 @@ var LangSmithSandbox = class LangSmithSandbox extends BaseSandbox {
|
|
|
6556
6591
|
*
|
|
6557
6592
|
* @example
|
|
6558
6593
|
* ```typescript
|
|
6559
|
-
* const sandbox = await LangSmithSandbox.create({
|
|
6594
|
+
* const sandbox = await LangSmithSandbox.create({
|
|
6595
|
+
* snapshotId: "abc-123",
|
|
6596
|
+
* });
|
|
6597
|
+
*
|
|
6560
6598
|
* try {
|
|
6561
6599
|
* const agent = createDeepAgent({ model, backend: sandbox });
|
|
6562
6600
|
* await agent.invoke({ messages: [...] });
|
|
@@ -6565,10 +6603,14 @@ var LangSmithSandbox = class LangSmithSandbox extends BaseSandbox {
|
|
|
6565
6603
|
* }
|
|
6566
6604
|
* ```
|
|
6567
6605
|
*/
|
|
6568
|
-
static async create(options
|
|
6569
|
-
const { templateName
|
|
6606
|
+
static async create(options) {
|
|
6607
|
+
const { templateName, apiKey = process.env.LANGSMITH_API_KEY, defaultTimeout, snapshotId, ...createSandboxOptions } = options;
|
|
6608
|
+
if (snapshotId && templateName) throw new Error("snapshotId and templateName are mutually exclusive. Pass only one creation source.");
|
|
6609
|
+
if (!snapshotId && !templateName) throw new Error("Either snapshotId or templateName is required. snapshotId is recommended — template-based creation is deprecated.");
|
|
6610
|
+
const sandboxOptions = { ...createSandboxOptions };
|
|
6611
|
+
if (templateName) sandboxOptions.snapshotName = templateName;
|
|
6570
6612
|
return new LangSmithSandbox({
|
|
6571
|
-
sandbox: await new SandboxClient({ apiKey }).createSandbox(
|
|
6613
|
+
sandbox: await new SandboxClient({ apiKey }).createSandbox(snapshotId, sandboxOptions),
|
|
6572
6614
|
defaultTimeout
|
|
6573
6615
|
});
|
|
6574
6616
|
}
|