managed-deepagents 0.0.3-dev.16 → 0.0.3-dev.18
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/connectors.d.ts +114 -0
- package/dist/connectors.d.ts.map +1 -0
- package/dist/connectors.js +86 -0
- package/dist/connectors.js.map +1 -0
- package/dist/define-deep-agent.d.ts.map +1 -1
- package/dist/define-deep-agent.js +18 -1
- package/dist/define-deep-agent.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/runtime/connectors-manager.d.ts +12 -0
- package/dist/runtime/connectors-manager.d.ts.map +1 -0
- package/dist/runtime/connectors-manager.js +77 -0
- package/dist/runtime/connectors-manager.js.map +1 -0
- package/dist/runtime/index.d.ts +167 -5
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +230 -11
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/sandbox-manager.d.ts +10 -0
- package/dist/runtime/sandbox-manager.d.ts.map +1 -1
- package/dist/runtime/sandbox-manager.js +42 -6
- package/dist/runtime/sandbox-manager.js.map +1 -1
- package/dist/runtime/types.d.ts +15 -3
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/types.d.ts +13 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +10 -14
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The managed `connectors/` declaration primitive.
|
|
3
|
+
*
|
|
4
|
+
* For the first connector iteration, a connector means exactly one thing: MCP
|
|
5
|
+
* servers. A Managed Deep Agent declares the remote MCP servers whose tools it
|
|
6
|
+
* wants in `connectors/mcp.ts` by exporting a named `mcp` from
|
|
7
|
+
* {@link defineMcpServers}. MDA discovers that declaration, creates the
|
|
8
|
+
* `@langchain/mcp-adapters` client, loads the tools, and adds them to the Deep
|
|
9
|
+
* Agent at runtime — the author never imports the MCP client or calls
|
|
10
|
+
* `getTools()`.
|
|
11
|
+
*
|
|
12
|
+
* Only remote MCP servers over HTTP/SSE are supported. Stdio MCP servers are
|
|
13
|
+
* intentionally out of scope: they introduce process management, packaging, and
|
|
14
|
+
* sandboxing concerns beyond this POC.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* // connectors/mcp.ts
|
|
19
|
+
* import { defineMcpServers } from "managed-deepagents";
|
|
20
|
+
*
|
|
21
|
+
* export const mcp = defineMcpServers({
|
|
22
|
+
* useStandardContentBlocks: true,
|
|
23
|
+
* prefixToolNameWithServerName: true,
|
|
24
|
+
* throwOnLoadError: true,
|
|
25
|
+
* mcpServers: {
|
|
26
|
+
* docs: {
|
|
27
|
+
* transport: "http",
|
|
28
|
+
* url: "https://docs.example.com/mcp",
|
|
29
|
+
* },
|
|
30
|
+
* },
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
/** Streamable HTTP MCP server connection. */
|
|
35
|
+
export interface HttpMcpServerConfig {
|
|
36
|
+
/** Remote transport. `"http"` selects Streamable HTTP. */
|
|
37
|
+
transport: "http";
|
|
38
|
+
/** URL of the remote MCP server endpoint. */
|
|
39
|
+
url: string;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the client may fall back to SSE if the server does not support
|
|
42
|
+
* Streamable HTTP. Defaults to the behavior of `@langchain/mcp-adapters`.
|
|
43
|
+
*/
|
|
44
|
+
automaticSSEFallback?: boolean;
|
|
45
|
+
/** Optional static headers sent when connecting to the MCP server. */
|
|
46
|
+
headers?: Record<string, string>;
|
|
47
|
+
/** Default timeout, in milliseconds, for tools loaded from this server. */
|
|
48
|
+
defaultToolTimeout?: number;
|
|
49
|
+
}
|
|
50
|
+
/** Legacy SSE MCP server connection. */
|
|
51
|
+
export interface SseMcpServerConfig {
|
|
52
|
+
/** Remote transport. `"sse"` selects legacy SSE. */
|
|
53
|
+
transport: "sse";
|
|
54
|
+
/** URL of the remote SSE MCP server endpoint. */
|
|
55
|
+
url: string;
|
|
56
|
+
/** Optional static headers sent when connecting to the MCP server. */
|
|
57
|
+
headers?: Record<string, string>;
|
|
58
|
+
/** Reconnection behavior for SSE MCP servers. */
|
|
59
|
+
reconnect?: {
|
|
60
|
+
enabled: boolean;
|
|
61
|
+
maxAttempts?: number;
|
|
62
|
+
delayMs?: number;
|
|
63
|
+
};
|
|
64
|
+
/** Default timeout, in milliseconds, for tools loaded from this server. */
|
|
65
|
+
defaultToolTimeout?: number;
|
|
66
|
+
}
|
|
67
|
+
/** A remote MCP server connection. Stdio servers are intentionally excluded. */
|
|
68
|
+
export type RemoteMcpServerConfig = HttpMcpServerConfig | SseMcpServerConfig;
|
|
69
|
+
/** Configuration accepted by {@link defineMcpServers}. */
|
|
70
|
+
export interface McpServersConfig {
|
|
71
|
+
/**
|
|
72
|
+
* MCP servers to connect to. Each key is the logical server name MDA uses
|
|
73
|
+
* for validation, tracing metadata, and tool-name prefixing.
|
|
74
|
+
*/
|
|
75
|
+
mcpServers: Record<string, RemoteMcpServerConfig>;
|
|
76
|
+
/**
|
|
77
|
+
* Whether tool names should be prefixed with the MCP server name (e.g.
|
|
78
|
+
* `docs__search`). Defaults to `true`, which avoids collisions between
|
|
79
|
+
* authored tools and common MCP tool names like `search` or `read`.
|
|
80
|
+
*/
|
|
81
|
+
prefixToolNameWithServerName?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Whether tool loading should fail if a tool cannot be loaded. Defaults to
|
|
84
|
+
* `true` — a managed deployment should fail rather than start with a
|
|
85
|
+
* partially loaded tool surface.
|
|
86
|
+
*/
|
|
87
|
+
throwOnLoadError?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Whether MCP tool outputs should be converted to LangChain standard content
|
|
90
|
+
* blocks. Defaults to `true` for new managed agents.
|
|
91
|
+
*/
|
|
92
|
+
useStandardContentBlocks?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Behavior when an MCP server cannot be connected. Only `"throw"` is
|
|
95
|
+
* supported for the POC — a failed connection fails the deployment.
|
|
96
|
+
*/
|
|
97
|
+
onConnectionError?: "throw";
|
|
98
|
+
}
|
|
99
|
+
/** The object exported from `connectors/mcp.ts`. */
|
|
100
|
+
export interface McpServersDefinition extends McpServersConfig {
|
|
101
|
+
/** Internal discriminator used by the MDA loader. */
|
|
102
|
+
readonly kind: "mcp_servers";
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Declare the MCP servers whose tools should be loaded and added to the managed
|
|
106
|
+
* Deep Agent at runtime.
|
|
107
|
+
*
|
|
108
|
+
* Validates the config eagerly so misconfiguration surfaces at module load
|
|
109
|
+
* (build/dev startup) rather than mid-run: at least one server must be
|
|
110
|
+
* declared, and every server must use a remote transport (`"http"` or
|
|
111
|
+
* `"sse"`). Stdio servers are rejected with a clear error.
|
|
112
|
+
*/
|
|
113
|
+
export declare function defineMcpServers(config: McpServersConfig): McpServersDefinition;
|
|
114
|
+
//# sourceMappingURL=connectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectors.d.ts","sourceRoot":"","sources":["../src/connectors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,6CAA6C;AAC7C,MAAM,WAAW,mBAAmB;IAClC,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,2EAA2E;IAC3E,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wCAAwC;AACxC,MAAM,WAAW,kBAAkB;IACjC,oDAAoD;IACpD,SAAS,EAAE,KAAK,CAAC;IACjB,iDAAiD;IACjD,GAAG,EAAE,MAAM,CAAC;IACZ,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,iDAAiD;IACjD,SAAS,CAAC,EAAE;QACV,OAAO,EAAE,OAAO,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,2EAA2E;IAC3E,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,gFAAgF;AAChF,MAAM,MAAM,qBAAqB,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AAE7E,0DAA0D;AAC1D,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAClD;;;;OAIG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,oDAAoD;AACpD,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D,qDAAqD;IACrD,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,oBAAoB,CAuB/E"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The managed `connectors/` declaration primitive.
|
|
3
|
+
*
|
|
4
|
+
* For the first connector iteration, a connector means exactly one thing: MCP
|
|
5
|
+
* servers. A Managed Deep Agent declares the remote MCP servers whose tools it
|
|
6
|
+
* wants in `connectors/mcp.ts` by exporting a named `mcp` from
|
|
7
|
+
* {@link defineMcpServers}. MDA discovers that declaration, creates the
|
|
8
|
+
* `@langchain/mcp-adapters` client, loads the tools, and adds them to the Deep
|
|
9
|
+
* Agent at runtime — the author never imports the MCP client or calls
|
|
10
|
+
* `getTools()`.
|
|
11
|
+
*
|
|
12
|
+
* Only remote MCP servers over HTTP/SSE are supported. Stdio MCP servers are
|
|
13
|
+
* intentionally out of scope: they introduce process management, packaging, and
|
|
14
|
+
* sandboxing concerns beyond this POC.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* // connectors/mcp.ts
|
|
19
|
+
* import { defineMcpServers } from "managed-deepagents";
|
|
20
|
+
*
|
|
21
|
+
* export const mcp = defineMcpServers({
|
|
22
|
+
* useStandardContentBlocks: true,
|
|
23
|
+
* prefixToolNameWithServerName: true,
|
|
24
|
+
* throwOnLoadError: true,
|
|
25
|
+
* mcpServers: {
|
|
26
|
+
* docs: {
|
|
27
|
+
* transport: "http",
|
|
28
|
+
* url: "https://docs.example.com/mcp",
|
|
29
|
+
* },
|
|
30
|
+
* },
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Declare the MCP servers whose tools should be loaded and added to the managed
|
|
36
|
+
* Deep Agent at runtime.
|
|
37
|
+
*
|
|
38
|
+
* Validates the config eagerly so misconfiguration surfaces at module load
|
|
39
|
+
* (build/dev startup) rather than mid-run: at least one server must be
|
|
40
|
+
* declared, and every server must use a remote transport (`"http"` or
|
|
41
|
+
* `"sse"`). Stdio servers are rejected with a clear error.
|
|
42
|
+
*/
|
|
43
|
+
export function defineMcpServers(config) {
|
|
44
|
+
const provided = config;
|
|
45
|
+
const servers = provided.mcpServers;
|
|
46
|
+
if (servers === null || typeof servers !== "object" || Array.isArray(servers)) {
|
|
47
|
+
throw new Error("defineMcpServers(...) requires an `mcpServers` object mapping server " +
|
|
48
|
+
"names to remote MCP server configs.");
|
|
49
|
+
}
|
|
50
|
+
const entries = Object.entries(servers);
|
|
51
|
+
if (entries.length === 0) {
|
|
52
|
+
throw new Error("defineMcpServers(...) requires at least one entry in `mcpServers`.");
|
|
53
|
+
}
|
|
54
|
+
for (const [name, server] of entries) {
|
|
55
|
+
validateRemoteServer(name, server);
|
|
56
|
+
}
|
|
57
|
+
return { kind: "mcp_servers", ...config };
|
|
58
|
+
}
|
|
59
|
+
/** Allowed remote transports. Stdio is intentionally unsupported in v0. */
|
|
60
|
+
const REMOTE_TRANSPORTS = new Set(["http", "sse"]);
|
|
61
|
+
/**
|
|
62
|
+
* Validate a single MCP server config, rejecting stdio servers and anything
|
|
63
|
+
* that is not a remote HTTP/SSE connection with a `url`.
|
|
64
|
+
*/
|
|
65
|
+
function validateRemoteServer(name, server) {
|
|
66
|
+
if (server === null || typeof server !== "object") {
|
|
67
|
+
throw new Error(`MCP server "${name}" must be a configuration object.`);
|
|
68
|
+
}
|
|
69
|
+
const config = server;
|
|
70
|
+
// A stdio server is identified by transport or by a `command` field. Reject
|
|
71
|
+
// it with guidance toward the supported remote transports.
|
|
72
|
+
if (config.transport === "stdio" || "command" in config) {
|
|
73
|
+
throw new Error(`MCP server "${name}" uses a stdio transport, which is not supported. ` +
|
|
74
|
+
"Managed Deep Agents support remote MCP servers over HTTP/SSE only; " +
|
|
75
|
+
"expose the server over HTTP or write a normal authored tool instead.");
|
|
76
|
+
}
|
|
77
|
+
const transport = config.transport;
|
|
78
|
+
if (typeof transport !== "string" || !REMOTE_TRANSPORTS.has(transport)) {
|
|
79
|
+
throw new Error(`MCP server "${name}" must declare a remote transport ` +
|
|
80
|
+
`("http" or "sse"); got ${JSON.stringify(transport)}.`);
|
|
81
|
+
}
|
|
82
|
+
if (typeof config.url !== "string" || config.url.trim().length === 0) {
|
|
83
|
+
throw new Error(`MCP server "${name}" must declare a non-empty \`url\`.`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=connectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectors.js","sourceRoot":"","sources":["../src/connectors.ts"],"names":[],"mappings":"AAAA;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AAC;QACxD,MAAM,IAAI,KAAK,CACb,eAAe,IAAI,oDAAoD;YACrE,qEAAqE;YACrE,sEAAsE,CACzE,CAAC;IACJ,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;IACnC,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;QACvE,MAAM,IAAI,KAAK,CACb,eAAe,IAAI,oCAAoC;YACrD,0BAA0B,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,CACzD,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,MAAM,CAAC,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrE,MAAM,IAAI,KAAK,CAAC,eAAe,IAAI,qCAAqC,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-deep-agent.d.ts","sourceRoot":"","sources":["../src/define-deep-agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,mBAAmB,
|
|
1
|
+
{"version":3,"file":"define-deep-agent.d.ts","sourceRoot":"","sources":["../src/define-deep-agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,mBAAmB,CAgClF"}
|
|
@@ -24,9 +24,26 @@
|
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
26
|
export function defineDeepAgent(config) {
|
|
27
|
+
// Runtime enforcement of the managed-key contract. The types forbid these keys
|
|
28
|
+
// at compile time, but JS callers and untyped config can bypass that — so
|
|
29
|
+
// mirror the Python `define_deep_agent` checks here.
|
|
30
|
+
const provided = config;
|
|
31
|
+
if ("systemPrompt" in provided) {
|
|
32
|
+
throw new Error("systemPrompt is managed by MDA and cannot be set in defineDeepAgent(...). " +
|
|
33
|
+
"Write your agent's system prompt in instructions.md next to agent.ts; " +
|
|
34
|
+
"the CLI embeds it at deploy time.");
|
|
35
|
+
}
|
|
36
|
+
const managed = ["backend", "store", "checkpointer", "memory", "skills"].filter((key) => key in provided);
|
|
37
|
+
if (managed.length > 0) {
|
|
38
|
+
throw new Error(`${managed.join(", ")} ${managed.length === 1 ? "is" : "are"} owned by the ` +
|
|
39
|
+
"managed runtime and cannot be set in defineDeepAgent(...). Configure the " +
|
|
40
|
+
"sandbox under sandbox/; the store and checkpointer are wired automatically.");
|
|
41
|
+
}
|
|
42
|
+
const { disableMemory = false, ...agentConfig } = config;
|
|
27
43
|
return {
|
|
28
44
|
kind: "deep-agent",
|
|
29
|
-
config:
|
|
45
|
+
config: agentConfig,
|
|
46
|
+
disableMemory,
|
|
30
47
|
};
|
|
31
48
|
}
|
|
32
49
|
//# sourceMappingURL=define-deep-agent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-deep-agent.js","sourceRoot":"","sources":["../src/define-deep-agent.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,eAAe,CAAC,MAA6B;IAC3D,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"define-deep-agent.js","sourceRoot":"","sources":["../src/define-deep-agent.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,eAAe,CAAC,MAA6B;IAC3D,+EAA+E;IAC/E,0EAA0E;IAC1E,qDAAqD;IACrD,MAAM,QAAQ,GAAG,MAAiC,CAAC;IAEnD,IAAI,cAAc,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CACb,4EAA4E;YAC1E,wEAAwE;YACxE,mCAAmC,CACtC,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAI,CAAC,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,CAAW,CAAC,MAAM,CACxF,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,QAAQ,CACzB,CAAC;IACF,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,gBAAgB;YAC1E,2EAA2E;YAC3E,6EAA6E,CAChF,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,aAAa,GAAG,KAAK,EAAE,GAAG,WAAW,EAAE,GAAG,MAAM,CAAC;IAEzD,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,WAA4C;QACpD,aAAa;KACd,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { defineDeepAgent } from "./define-deep-agent.js";
|
|
2
|
+
export { defineMcpServers } from "./connectors.js";
|
|
2
3
|
export { defineSandbox } from "./sandbox.js";
|
|
4
|
+
export type { HttpMcpServerConfig, McpServersConfig, McpServersDefinition, RemoteMcpServerConfig, SseMcpServerConfig, } from "./connectors.js";
|
|
3
5
|
export type { ChannelAttachment, ChannelDestination, ChannelEvent, ChannelMessage, ChannelPostOptions, DeepAgentDefinition, DefineDeepAgentConfig, ManagedDeepAgentKey, PostedChannelMessage, Runtime, RuntimeChannel, } from "./types.js";
|
|
4
6
|
export type { DefineSandboxOptions, ManagedSandboxOptionKey, SandboxDefinition, SandboxProviderClass, SandboxProviderOptions, SandboxScope, } from "./sandbox.js";
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,OAAO,EACP,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,GACb,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,YAAY,EACV,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAEzB,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,OAAO,EACP,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,GACb,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { McpServersDefinition } from "../connectors.js";
|
|
2
|
+
/**
|
|
3
|
+
* Load (and cache) the MCP tools declared in `connectors/mcp.ts`.
|
|
4
|
+
*
|
|
5
|
+
* A failed load is never cached, so a transient connection error on the first
|
|
6
|
+
* run can be retried on the next, but a misconfigured deployment surfaces the
|
|
7
|
+
* error rather than silently starting with no tools.
|
|
8
|
+
*/
|
|
9
|
+
export declare function loadManagedMcpTools(connectors: McpServersDefinition): Promise<unknown[]>;
|
|
10
|
+
/** Clear the process-level MCP tool cache. Test-only. */
|
|
11
|
+
export declare function clearManagedMcpToolsCacheForTests(): void;
|
|
12
|
+
//# sourceMappingURL=connectors-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectors-manager.d.ts","sourceRoot":"","sources":["../../src/runtime/connectors-manager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAa7D;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAQxF;AAED,yDAAyD;AACzD,wBAAgB,iCAAiC,IAAI,IAAI,CAExD"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { MultiServerMCPClient } from "@langchain/mcp-adapters";
|
|
2
|
+
/**
|
|
3
|
+
* MCP tools loaded for this runtime process, cached for its lifetime.
|
|
4
|
+
*
|
|
5
|
+
* The compiled entry's graph factory runs `compileManagedAgent` on every
|
|
6
|
+
* invocation, but the MCP connection and tool surface are stable for the life
|
|
7
|
+
* of the deployment — so the client is created and its tools loaded exactly
|
|
8
|
+
* once, and every subsequent run reuses them. Storing the in-flight promise
|
|
9
|
+
* also dedupes concurrent first runs.
|
|
10
|
+
*/
|
|
11
|
+
let cachedTools;
|
|
12
|
+
/**
|
|
13
|
+
* Load (and cache) the MCP tools declared in `connectors/mcp.ts`.
|
|
14
|
+
*
|
|
15
|
+
* A failed load is never cached, so a transient connection error on the first
|
|
16
|
+
* run can be retried on the next, but a misconfigured deployment surfaces the
|
|
17
|
+
* error rather than silently starting with no tools.
|
|
18
|
+
*/
|
|
19
|
+
export function loadManagedMcpTools(connectors) {
|
|
20
|
+
if (!cachedTools) {
|
|
21
|
+
cachedTools = createClientAndLoadTools(connectors).catch((error) => {
|
|
22
|
+
cachedTools = undefined;
|
|
23
|
+
throw error;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return cachedTools;
|
|
27
|
+
}
|
|
28
|
+
/** Clear the process-level MCP tool cache. Test-only. */
|
|
29
|
+
export function clearManagedMcpToolsCacheForTests() {
|
|
30
|
+
cachedTools = undefined;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create the `@langchain/mcp-adapters` client from the declaration and load its
|
|
34
|
+
* tools, applying the managed defaults the spec recommends.
|
|
35
|
+
*
|
|
36
|
+
* `@langchain/mcp-adapters` is a direct dependency of `managed-deepagents`, so
|
|
37
|
+
* the client is imported statically at the top of the module.
|
|
38
|
+
*/
|
|
39
|
+
async function createClientAndLoadTools(connectors) {
|
|
40
|
+
const prefixToolNameWithServerName = connectors.prefixToolNameWithServerName ?? true;
|
|
41
|
+
const client = new MultiServerMCPClient({
|
|
42
|
+
mcpServers: connectors.mcpServers,
|
|
43
|
+
prefixToolNameWithServerName,
|
|
44
|
+
throwOnLoadError: connectors.throwOnLoadError ?? true,
|
|
45
|
+
useStandardContentBlocks: connectors.useStandardContentBlocks ?? true,
|
|
46
|
+
onConnectionError: connectors.onConnectionError ?? "throw",
|
|
47
|
+
});
|
|
48
|
+
const tools = await client.getTools();
|
|
49
|
+
// When prefixing is disabled, names can collide with authored tools or across
|
|
50
|
+
// servers. The spec only allows opting out if MDA validates no collisions.
|
|
51
|
+
if (!prefixToolNameWithServerName) {
|
|
52
|
+
assertNoToolNameCollisions(tools);
|
|
53
|
+
}
|
|
54
|
+
return tools;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Reject duplicate tool names among the loaded MCP tools. Only reached when the
|
|
58
|
+
* author opted out of server-name prefixing.
|
|
59
|
+
*/
|
|
60
|
+
function assertNoToolNameCollisions(tools) {
|
|
61
|
+
const seen = new Set();
|
|
62
|
+
const collisions = new Set();
|
|
63
|
+
for (const tool of tools) {
|
|
64
|
+
const name = tool.name;
|
|
65
|
+
if (typeof name !== "string")
|
|
66
|
+
continue;
|
|
67
|
+
if (seen.has(name))
|
|
68
|
+
collisions.add(name);
|
|
69
|
+
seen.add(name);
|
|
70
|
+
}
|
|
71
|
+
if (collisions.size > 0) {
|
|
72
|
+
throw new Error(`MCP tool name collision: ${[...collisions].sort().join(", ")}. ` +
|
|
73
|
+
"Set `prefixToolNameWithServerName: true` (the default) so each tool is " +
|
|
74
|
+
"namespaced by its server, or rename the conflicting tools.");
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=connectors-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectors-manager.js","sourceRoot":"","sources":["../../src/runtime/connectors-manager.ts"],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AI,GAAG,EAAU,CAAC;IACrC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,IAAI,GAAI,IAA2B,CAAC,IAAI,CAAC;QAC/C,IAAI,OAAO,IAAI,KAAK,QAAQ;YAAE,SAAS;QACvC,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACzC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IACD,IAAI,UAAU,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,4BAA4B,CAAC,GAAG,UAAU,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YAC/D,yEAAyE;YACzE,4DAA4D,CAC/D,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -5,10 +5,172 @@ export { announceSandboxPlan } from "./sandbox-manager.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* Compile a {@link DeepAgentDefinition} into a runnable Deep Agent.
|
|
7
7
|
*
|
|
8
|
-
* This is the seam where MDA injects
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* entry module
|
|
8
|
+
* This is the seam where MDA injects platform-owned runtime configuration:
|
|
9
|
+
* Context Hub-backed deployed context, the configured sandbox, StateBackend
|
|
10
|
+
* scratch fallback, and managed memory/skills. It is consumed only by the
|
|
11
|
+
* generated entry module; agent authors never call it.
|
|
12
12
|
*/
|
|
13
|
-
export declare function compileManagedAgent(definition: DeepAgentDefinition, config?: ManagedRunConfig, options?: ManagedAgentOptions): Promise<
|
|
13
|
+
export declare function compileManagedAgent(definition: DeepAgentDefinition, config?: ManagedRunConfig, options?: ManagedAgentOptions): Promise<import("deepagents").DeepAgent<import("deepagents").DeepAgentTypeConfig<import("langchain").ResponseFormatUndefined, undefined, import("@langchain/core/utils/types").InteropZodObject, readonly [import("langchain").AgentMiddleware<import("zod/v3").ZodObject<{
|
|
14
|
+
todos: import("zod/v3").ZodDefault<import("zod/v3").ZodArray<import("zod/v3").ZodObject<{
|
|
15
|
+
content: import("zod/v3").ZodString;
|
|
16
|
+
status: import("zod/v3").ZodEnum<["pending", "in_progress", "completed"]>;
|
|
17
|
+
}, "strip", import("zod/v3").ZodTypeAny, {
|
|
18
|
+
content: string;
|
|
19
|
+
status: "completed" | "in_progress" | "pending";
|
|
20
|
+
}, {
|
|
21
|
+
content: string;
|
|
22
|
+
status: "completed" | "in_progress" | "pending";
|
|
23
|
+
}>, "many">>;
|
|
24
|
+
}, "strip", import("zod/v3").ZodTypeAny, {
|
|
25
|
+
todos: {
|
|
26
|
+
content: string;
|
|
27
|
+
status: "completed" | "in_progress" | "pending";
|
|
28
|
+
}[];
|
|
29
|
+
}, {
|
|
30
|
+
todos?: {
|
|
31
|
+
content: string;
|
|
32
|
+
status: "completed" | "in_progress" | "pending";
|
|
33
|
+
}[] | undefined;
|
|
34
|
+
}>, undefined, unknown, readonly [import("langchain").DynamicStructuredTool<import("zod/v3").ZodObject<{
|
|
35
|
+
todos: import("zod/v3").ZodArray<import("zod/v3").ZodObject<{
|
|
36
|
+
content: import("zod/v3").ZodString;
|
|
37
|
+
status: import("zod/v3").ZodEnum<["pending", "in_progress", "completed"]>;
|
|
38
|
+
}, "strip", import("zod/v3").ZodTypeAny, {
|
|
39
|
+
content: string;
|
|
40
|
+
status: "completed" | "in_progress" | "pending";
|
|
41
|
+
}, {
|
|
42
|
+
content: string;
|
|
43
|
+
status: "completed" | "in_progress" | "pending";
|
|
44
|
+
}>, "many">;
|
|
45
|
+
}, "strip", import("zod/v3").ZodTypeAny, {
|
|
46
|
+
todos: {
|
|
47
|
+
content: string;
|
|
48
|
+
status: "completed" | "in_progress" | "pending";
|
|
49
|
+
}[];
|
|
50
|
+
}, {
|
|
51
|
+
todos: {
|
|
52
|
+
content: string;
|
|
53
|
+
status: "completed" | "in_progress" | "pending";
|
|
54
|
+
}[];
|
|
55
|
+
}>, {
|
|
56
|
+
todos: {
|
|
57
|
+
content: string;
|
|
58
|
+
status: "completed" | "in_progress" | "pending";
|
|
59
|
+
}[];
|
|
60
|
+
}, {
|
|
61
|
+
todos: {
|
|
62
|
+
content: string;
|
|
63
|
+
status: "completed" | "in_progress" | "pending";
|
|
64
|
+
}[];
|
|
65
|
+
}, import("@langchain/langgraph").Command<unknown, {
|
|
66
|
+
todos: {
|
|
67
|
+
content: string;
|
|
68
|
+
status: "completed" | "in_progress" | "pending";
|
|
69
|
+
}[];
|
|
70
|
+
messages: import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>[];
|
|
71
|
+
}, string>, unknown, "write_todos">], readonly []>, import("langchain").AgentMiddleware<import("@langchain/langgraph").StateSchema<{
|
|
72
|
+
files: import("@langchain/langgraph").ReducedValue<{
|
|
73
|
+
[x: string]: import("deepagents").FileData;
|
|
74
|
+
} | undefined, {
|
|
75
|
+
[x: string]: import("deepagents").FileData | null;
|
|
76
|
+
} | undefined>;
|
|
77
|
+
}>, undefined, unknown, (import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
78
|
+
path: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
79
|
+
}, import("zod/v4/core").$strip>, {
|
|
80
|
+
path: string;
|
|
81
|
+
}, {
|
|
82
|
+
path?: string | undefined;
|
|
83
|
+
}, string, unknown, "ls"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
84
|
+
file_path: import("zod").ZodString;
|
|
85
|
+
offset: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>>;
|
|
86
|
+
limit: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>>;
|
|
87
|
+
}, import("zod/v4/core").$strip>, {
|
|
88
|
+
file_path: string;
|
|
89
|
+
offset: number;
|
|
90
|
+
limit: number;
|
|
91
|
+
}, {
|
|
92
|
+
file_path: string;
|
|
93
|
+
offset?: unknown;
|
|
94
|
+
limit?: unknown;
|
|
95
|
+
}, {
|
|
96
|
+
type: string;
|
|
97
|
+
text: string;
|
|
98
|
+
}[] | {
|
|
99
|
+
type: string;
|
|
100
|
+
mimeType: string;
|
|
101
|
+
data: string;
|
|
102
|
+
}[], unknown, "read_file"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
103
|
+
file_path: import("zod").ZodString;
|
|
104
|
+
content: import("zod").ZodDefault<import("zod").ZodString>;
|
|
105
|
+
}, import("zod/v4/core").$strip>, {
|
|
106
|
+
file_path: string;
|
|
107
|
+
content: string;
|
|
108
|
+
}, {
|
|
109
|
+
file_path: string;
|
|
110
|
+
content?: string | undefined;
|
|
111
|
+
}, string | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>> | import("@langchain/langgraph").Command<unknown, {
|
|
112
|
+
files: Record<string, import("deepagents").FileData>;
|
|
113
|
+
messages: import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>[];
|
|
114
|
+
}, string>, unknown, "write_file"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
115
|
+
file_path: import("zod").ZodString;
|
|
116
|
+
old_string: import("zod").ZodString;
|
|
117
|
+
new_string: import("zod").ZodString;
|
|
118
|
+
replace_all: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
|
|
119
|
+
}, import("zod/v4/core").$strip>, {
|
|
120
|
+
file_path: string;
|
|
121
|
+
old_string: string;
|
|
122
|
+
new_string: string;
|
|
123
|
+
replace_all: boolean;
|
|
124
|
+
}, {
|
|
125
|
+
file_path: string;
|
|
126
|
+
old_string: string;
|
|
127
|
+
new_string: string;
|
|
128
|
+
replace_all?: boolean | undefined;
|
|
129
|
+
}, string | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>> | import("@langchain/langgraph").Command<unknown, {
|
|
130
|
+
files: Record<string, import("deepagents").FileData>;
|
|
131
|
+
messages: import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>[];
|
|
132
|
+
}, string>, unknown, "edit_file"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
133
|
+
pattern: import("zod").ZodString;
|
|
134
|
+
path: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
135
|
+
}, import("zod/v4/core").$strip>, {
|
|
136
|
+
pattern: string;
|
|
137
|
+
path: string;
|
|
138
|
+
}, {
|
|
139
|
+
pattern: string;
|
|
140
|
+
path?: string | undefined;
|
|
141
|
+
}, string, unknown, "glob"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
142
|
+
pattern: import("zod").ZodString;
|
|
143
|
+
path: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
144
|
+
glob: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>>;
|
|
145
|
+
}, import("zod/v4/core").$strip>, {
|
|
146
|
+
pattern: string;
|
|
147
|
+
path: string;
|
|
148
|
+
glob: string | null;
|
|
149
|
+
}, {
|
|
150
|
+
pattern: string;
|
|
151
|
+
path?: string | undefined;
|
|
152
|
+
glob?: string | null | undefined;
|
|
153
|
+
}, string, unknown, "grep"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
154
|
+
command: import("zod").ZodString;
|
|
155
|
+
}, import("zod/v4/core").$strip>, {
|
|
156
|
+
command: string;
|
|
157
|
+
}, {
|
|
158
|
+
command: string;
|
|
159
|
+
}, string, unknown, "execute">)[], readonly []>, import("langchain").AgentMiddleware<undefined, undefined, unknown, readonly [import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
160
|
+
description: import("zod").ZodString;
|
|
161
|
+
subagent_type: import("zod").ZodString;
|
|
162
|
+
}, import("zod/v4/core").$strip>, {
|
|
163
|
+
description: string;
|
|
164
|
+
subagent_type: string;
|
|
165
|
+
}, {
|
|
166
|
+
description: string;
|
|
167
|
+
subagent_type: string;
|
|
168
|
+
}, string | import("@langchain/langgraph").Command<unknown, Record<string, unknown>, string>, unknown, "task">], readonly []>, import("langchain").AgentMiddleware<import("zod").ZodObject<{
|
|
169
|
+
_summarizationSessionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
170
|
+
_summarizationEvent: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
171
|
+
cutoffIndex: import("zod").ZodNumber;
|
|
172
|
+
summaryMessage: import("zod").ZodCustom<import("langchain").HumanMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, import("langchain").HumanMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>>;
|
|
173
|
+
filePath: import("zod").ZodNullable<import("zod").ZodString>;
|
|
174
|
+
}, import("zod/v4/core").$strip>>;
|
|
175
|
+
}, import("zod/v4/core").$strip>, undefined, unknown, readonly (import("@langchain/core/tools").ClientTool | import("@langchain/core/tools").ServerTool)[], readonly []>, import("langchain").AgentMiddleware<undefined, undefined, unknown, readonly (import("@langchain/core/tools").ClientTool | import("@langchain/core/tools").ServerTool)[], readonly []>], readonly [], readonly [], readonly []>>>;
|
|
14
176
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAExE,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,mBAAmB,EAC/B,MAAM,CAAC,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2YAmD9B"}
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,25 +1,244 @@
|
|
|
1
|
-
import { createDeepAgent } from "deepagents";
|
|
1
|
+
import { CompositeBackend, ContextHubBackend, StateBackend, createDeepAgent } from "deepagents";
|
|
2
|
+
import { loadManagedMcpTools } from "./connectors-manager.js";
|
|
2
3
|
import { resolveManagedSandbox } from "./sandbox-manager.js";
|
|
3
4
|
export { announceSandboxPlan } from "./sandbox-manager.js";
|
|
4
5
|
/**
|
|
5
6
|
* Compile a {@link DeepAgentDefinition} into a runnable Deep Agent.
|
|
6
7
|
*
|
|
7
|
-
* This is the seam where MDA injects
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* entry module
|
|
8
|
+
* This is the seam where MDA injects platform-owned runtime configuration:
|
|
9
|
+
* Context Hub-backed deployed context, the configured sandbox, StateBackend
|
|
10
|
+
* scratch fallback, and managed memory/skills. It is consumed only by the
|
|
11
|
+
* generated entry module; agent authors never call it.
|
|
11
12
|
*/
|
|
12
13
|
export async function compileManagedAgent(definition, config, options) {
|
|
13
|
-
const { systemPrompt, sandbox, setupScript } = options ?? {};
|
|
14
|
+
const { systemPrompt, contextRepo, hasSkills = false, sandbox, setupScript, connectors } = options ?? {};
|
|
14
15
|
const params = {
|
|
15
16
|
...definition.config,
|
|
16
|
-
...(systemPrompt !== undefined ? { systemPrompt } : {}),
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Loading MCP connector tools is an independent network round-trip, so kick
|
|
20
|
+
* it off up front and let it run concurrently with backend resolution below.
|
|
21
|
+
*
|
|
22
|
+
* Connectors: MCP tools declared in `connectors/mcp.ts` are appended to the
|
|
23
|
+
* authored tools. The author never imports the MCP client or calls
|
|
24
|
+
* `getTools()` — MDA owns the client lifecycle.
|
|
25
|
+
*/
|
|
26
|
+
const mcpToolsPromise = connectors ? loadManagedMcpTools(connectors) : undefined;
|
|
27
|
+
const sandboxBackend = sandbox ? managedSandboxBackend(sandbox, setupScript, config) : undefined;
|
|
28
|
+
if (contextRepo) {
|
|
29
|
+
const contextBackend = new ContextHubBackend(contextRepo);
|
|
30
|
+
const hubPrompt = await readInstructions(contextBackend);
|
|
31
|
+
if (hubPrompt !== undefined) {
|
|
32
|
+
params.systemPrompt = hubPrompt;
|
|
33
|
+
}
|
|
34
|
+
params.backend = managedContextBackend(contextBackend, sandboxBackend);
|
|
35
|
+
params.permissions = managedContextPermissions(params.permissions);
|
|
36
|
+
if (hasSkills) {
|
|
37
|
+
params.skills = ["/skills/"];
|
|
38
|
+
}
|
|
39
|
+
if (!definition.disableMemory) {
|
|
40
|
+
params.memory = ["/memories/AGENTS.md"];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
if (systemPrompt !== undefined) {
|
|
45
|
+
params.systemPrompt = systemPrompt;
|
|
46
|
+
}
|
|
47
|
+
if (sandboxBackend) {
|
|
48
|
+
params.backend = sandboxBackend;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const mcpTools = await mcpToolsPromise;
|
|
52
|
+
if (mcpTools) {
|
|
53
|
+
const authoredTools = Array.isArray(params.tools) ? params.tools : [];
|
|
54
|
+
params.tools = [...authoredTools, ...mcpTools];
|
|
22
55
|
}
|
|
23
56
|
return createDeepAgent(params);
|
|
24
57
|
}
|
|
58
|
+
async function readInstructions(backend) {
|
|
59
|
+
const result = await backend.read("/instructions.md");
|
|
60
|
+
if (result.error || result.content === undefined) {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
if (typeof result.content === "string") {
|
|
64
|
+
return result.content;
|
|
65
|
+
}
|
|
66
|
+
return new TextDecoder().decode(result.content);
|
|
67
|
+
}
|
|
68
|
+
function managedSandboxBackend(sandbox, setupScript, graphConfig) {
|
|
69
|
+
return (runtime) => resolveManagedSandbox(sandbox, setupScript, managedConfigFromRuntime(runtime) ?? graphConfig);
|
|
70
|
+
}
|
|
71
|
+
function managedContextBackend(contextBackend, sandboxBackend) {
|
|
72
|
+
// `ContextHubPathBackend` duck-types the backend protocol with intentionally
|
|
73
|
+
// looser return types, so cast at this boundary to the real backend types.
|
|
74
|
+
const routes = managedContextRoutes(contextBackend);
|
|
75
|
+
if (sandboxBackend) {
|
|
76
|
+
return async (runtime) => new CompositeBackend((await resolveBackendFactory(sandboxBackend, runtime)), routes);
|
|
77
|
+
}
|
|
78
|
+
return () => new CompositeBackend(new StateBackend(), routes);
|
|
79
|
+
}
|
|
80
|
+
function managedContextRoutes(contextBackend) {
|
|
81
|
+
return {
|
|
82
|
+
"/instructions.md": ContextHubPathBackend.file(contextBackend, "instructions.md", "/instructions.md"),
|
|
83
|
+
"/skills/": ContextHubPathBackend.directory(contextBackend, "skills", "/skills"),
|
|
84
|
+
"/memories/": ContextHubPathBackend.directory(contextBackend, "memories", "/memories"),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
class ContextHubPathBackend {
|
|
88
|
+
backend;
|
|
89
|
+
target;
|
|
90
|
+
constructor(backend, target) {
|
|
91
|
+
this.backend = backend;
|
|
92
|
+
this.target = target;
|
|
93
|
+
}
|
|
94
|
+
static directory(backend, repoPrefix, visiblePrefix) {
|
|
95
|
+
return new ContextHubPathBackend(backend, {
|
|
96
|
+
repoPrefix: trimSlashes(repoPrefix),
|
|
97
|
+
visiblePrefix: stripTrailingSlash(ensureAbsolute(visiblePrefix)),
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
static file(backend, repoFile, visibleFile) {
|
|
101
|
+
return new ContextHubPathBackend(backend, {
|
|
102
|
+
repoFile: trimSlashes(repoFile),
|
|
103
|
+
visibleFile: ensureAbsolute(visibleFile),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
async ls(path = "/") {
|
|
107
|
+
const result = await this.required("ls")(this.toRepoPath(path));
|
|
108
|
+
return this.remapPathCollections(result);
|
|
109
|
+
}
|
|
110
|
+
async read(filePath, offset, limit) {
|
|
111
|
+
return this.backend.read(this.toRepoPath(filePath), offset, limit);
|
|
112
|
+
}
|
|
113
|
+
async readRaw(filePath) {
|
|
114
|
+
return this.required("readRaw")(this.toRepoPath(filePath));
|
|
115
|
+
}
|
|
116
|
+
async grep(pattern, path, glob) {
|
|
117
|
+
const result = await this.required("grep")(pattern, path === undefined || path === null ? path : this.toRepoPath(path), glob ? this.toRepoGlob(glob) : glob);
|
|
118
|
+
return this.remapPathCollections(result);
|
|
119
|
+
}
|
|
120
|
+
async glob(pattern, path = "/") {
|
|
121
|
+
const result = await this.required("glob")(this.toRepoGlob(pattern), this.toRepoPath(path));
|
|
122
|
+
return this.remapPathCollections(result);
|
|
123
|
+
}
|
|
124
|
+
async write(filePath, content) {
|
|
125
|
+
const result = await this.required("write")(this.toRepoPath(filePath), content);
|
|
126
|
+
return this.withVisiblePath(result, filePath);
|
|
127
|
+
}
|
|
128
|
+
async edit(filePath, oldString, newString, replaceAll = false) {
|
|
129
|
+
const result = await this.required("edit")(this.toRepoPath(filePath), oldString, newString, replaceAll);
|
|
130
|
+
return this.withVisiblePath(result, filePath);
|
|
131
|
+
}
|
|
132
|
+
async uploadFiles(files) {
|
|
133
|
+
const result = await this.required("uploadFiles")(files.map(([path, content]) => [this.toRepoPath(path), content]));
|
|
134
|
+
return result.map((entry, index) => this.withVisiblePath(entry, files[index]?.[0] ?? "/"));
|
|
135
|
+
}
|
|
136
|
+
async downloadFiles(paths) {
|
|
137
|
+
const result = await this.required("downloadFiles")(paths.map((path) => this.toRepoPath(path)));
|
|
138
|
+
return result.map((entry, index) => this.withVisiblePath(entry, paths[index] ?? "/"));
|
|
139
|
+
}
|
|
140
|
+
required(method) {
|
|
141
|
+
const fn = this.backend[method];
|
|
142
|
+
if (typeof fn !== "function") {
|
|
143
|
+
throw new Error(`Context Hub backend does not support ${String(method)}`);
|
|
144
|
+
}
|
|
145
|
+
return fn.bind(this.backend);
|
|
146
|
+
}
|
|
147
|
+
toRepoPath(path) {
|
|
148
|
+
if ("repoFile" in this.target) {
|
|
149
|
+
return ensureAbsolute(this.target.repoFile);
|
|
150
|
+
}
|
|
151
|
+
const suffix = trimSlashes(path);
|
|
152
|
+
const joined = suffix ? `${this.target.repoPrefix}/${suffix}` : this.target.repoPrefix;
|
|
153
|
+
return ensureAbsolute(joined);
|
|
154
|
+
}
|
|
155
|
+
toRepoGlob(pattern) {
|
|
156
|
+
if ("repoFile" in this.target) {
|
|
157
|
+
return pattern;
|
|
158
|
+
}
|
|
159
|
+
const suffix = trimSlashes(pattern);
|
|
160
|
+
return suffix ? `${this.target.repoPrefix}/${suffix}` : this.target.repoPrefix;
|
|
161
|
+
}
|
|
162
|
+
remapPathCollections(result) {
|
|
163
|
+
const copy = { ...result };
|
|
164
|
+
remapPathArray(copy, "files", (path) => this.fromRepoPath(path));
|
|
165
|
+
remapPathArray(copy, "entries", (path) => this.fromRepoPath(path));
|
|
166
|
+
remapPathArray(copy, "matches", (path) => this.fromRepoPath(path));
|
|
167
|
+
return copy;
|
|
168
|
+
}
|
|
169
|
+
withVisiblePath(result, backendPath) {
|
|
170
|
+
if (!("path" in result)) {
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
173
|
+
return { ...result, path: this.toVisiblePath(backendPath) };
|
|
174
|
+
}
|
|
175
|
+
fromRepoPath(path) {
|
|
176
|
+
const normalized = ensureAbsolute(path);
|
|
177
|
+
if ("repoFile" in this.target) {
|
|
178
|
+
return normalized === ensureAbsolute(this.target.repoFile) ? "/" : normalized;
|
|
179
|
+
}
|
|
180
|
+
const prefix = ensureAbsolute(this.target.repoPrefix);
|
|
181
|
+
if (normalized === prefix) {
|
|
182
|
+
return "/";
|
|
183
|
+
}
|
|
184
|
+
if (normalized.startsWith(`${prefix}/`)) {
|
|
185
|
+
return ensureAbsolute(normalized.slice(prefix.length));
|
|
186
|
+
}
|
|
187
|
+
return normalized;
|
|
188
|
+
}
|
|
189
|
+
toVisiblePath(path) {
|
|
190
|
+
if ("visibleFile" in this.target) {
|
|
191
|
+
return this.target.visibleFile;
|
|
192
|
+
}
|
|
193
|
+
const suffix = trimSlashes(path);
|
|
194
|
+
return suffix
|
|
195
|
+
? `${this.target.visiblePrefix}/${suffix}`
|
|
196
|
+
: this.target.visiblePrefix;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
async function resolveBackendFactory(backend, runtime) {
|
|
200
|
+
return typeof backend === "function" ? await backend(runtime) : backend;
|
|
201
|
+
}
|
|
202
|
+
function managedContextPermissions(existing) {
|
|
203
|
+
const managed = [
|
|
204
|
+
{
|
|
205
|
+
operations: ["write"],
|
|
206
|
+
paths: ["/instructions.md", "/skills/**"],
|
|
207
|
+
mode: "deny",
|
|
208
|
+
},
|
|
209
|
+
];
|
|
210
|
+
return Array.isArray(existing) ? [...managed, ...existing] : managed;
|
|
211
|
+
}
|
|
212
|
+
function managedConfigFromRuntime(runtime) {
|
|
213
|
+
const rt = runtime;
|
|
214
|
+
if (rt.config) {
|
|
215
|
+
return rt.config;
|
|
216
|
+
}
|
|
217
|
+
if (rt.configurable) {
|
|
218
|
+
return { configurable: rt.configurable };
|
|
219
|
+
}
|
|
220
|
+
return undefined;
|
|
221
|
+
}
|
|
222
|
+
function remapPathArray(result, key, remap) {
|
|
223
|
+
const value = result[key];
|
|
224
|
+
if (!Array.isArray(value)) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
result[key] = value.map((entry) => {
|
|
228
|
+
if (!entry || typeof entry !== "object") {
|
|
229
|
+
return entry;
|
|
230
|
+
}
|
|
231
|
+
const item = entry;
|
|
232
|
+
return typeof item.path === "string" ? { ...item, path: remap(item.path) } : item;
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
function ensureAbsolute(path) {
|
|
236
|
+
return `/${trimSlashes(path)}`;
|
|
237
|
+
}
|
|
238
|
+
function trimSlashes(path) {
|
|
239
|
+
return path.replace(/^\/+|\/+$/g, "");
|
|
240
|
+
}
|
|
241
|
+
function stripTrailingSlash(path) {
|
|
242
|
+
return path.length > 1 ? path.replace(/\/+$/g, "") : path;
|
|
243
|
+
}
|
|
25
244
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAIhG,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAI7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,UAA+B,EAC/B,MAAyB,EACzB,OAA6B;IAE7B,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,GACtF,OAAO,IAAI,EAAE,CAAC;IAEhB,MAAM,MAAM,GAA4B;QACtC,GAAG,UAAU,CAA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,EACpC,KAA+B;IAE/B,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO;IACT,CAAC;IACD,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QAChC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YACxC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,IAAI,GAAG,KAAiB,CAAC;QAC/B,OAAO,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACpF,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;AACjC,CAAC;AAED,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AACxC,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5D,CAAC"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { SandboxDefinition } from "../sandbox.js";
|
|
2
2
|
import type { ManagedRunConfig, ManagedSandboxBackend } from "./types.js";
|
|
3
|
+
type LangSmithSandboxClientLoader = () => Promise<{
|
|
4
|
+
SandboxClient: new (options?: {
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
}) => {
|
|
7
|
+
createSandbox(options?: Record<string, unknown>): Promise<unknown>;
|
|
8
|
+
};
|
|
9
|
+
}>;
|
|
3
10
|
/**
|
|
4
11
|
* Resolve (and cache) the scoped sandbox backend for this run, provisioning it
|
|
5
12
|
* with `setup.sh` the first time it is created.
|
|
@@ -12,6 +19,8 @@ export declare function resolveManagedSandbox(sandbox: SandboxDefinition, setupS
|
|
|
12
19
|
export declare function sandboxScopeKey(sandbox: SandboxDefinition, config: ManagedRunConfig | undefined): string;
|
|
13
20
|
/** Clear the process-level sandbox cache. Test-only. */
|
|
14
21
|
export declare function clearManagedSandboxCacheForTests(): void;
|
|
22
|
+
/** Override the LangSmith SDK loader. Test-only. */
|
|
23
|
+
export declare function setLangSmithSandboxClientLoaderForTests(loader?: LangSmithSandboxClientLoader): void;
|
|
15
24
|
/**
|
|
16
25
|
* Eagerly resolve the `mda dev` sandbox at startup so the developer sees the
|
|
17
26
|
* definitive decision — local vs. the configured provider, and the temp dir
|
|
@@ -27,4 +36,5 @@ export declare function clearManagedSandboxCacheForTests(): void;
|
|
|
27
36
|
* No-op outside `mda dev`, so the generated entry can always call it.
|
|
28
37
|
*/
|
|
29
38
|
export declare function announceSandboxPlan(sandbox: SandboxDefinition, setupScript?: string): Promise<void>;
|
|
39
|
+
export {};
|
|
30
40
|
//# sourceMappingURL=sandbox-manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-manager.d.ts","sourceRoot":"","sources":["../../src/runtime/sandbox-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAKvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAoB1E;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,iBAAiB,EAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,MAAM,EAAE,gBAAgB,GAAG,SAAS,GACnC,OAAO,CAAC,qBAAqB,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EAAE,4BAA4B,GACpC,IAAI,CAEN;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,iBAAiB,EAC1B,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isDevMode, providerCredentialStatus } from "./credentials.js";
|
|
1
|
+
import { isDevMode, providerCredentialStatus, providerKey } from "./credentials.js";
|
|
2
2
|
import { logDevSandboxNoticeOnce } from "./dev-notice.js";
|
|
3
3
|
import { createLocalDevSandbox } from "./local-dev-sandbox.js";
|
|
4
4
|
import { runSetupScript, runSetupScriptInline } from "./setup-script.js";
|
|
@@ -18,6 +18,11 @@ const managedSandboxes = new Map();
|
|
|
18
18
|
* reuse it instead of provisioning a second one.
|
|
19
19
|
*/
|
|
20
20
|
const DEV_SANDBOX_SCOPE_KEY = "__mda_dev__";
|
|
21
|
+
const defaultLangSmithSandboxClientLoader = async () => {
|
|
22
|
+
const dynamicImport = new Function("specifier", "return import(specifier)");
|
|
23
|
+
return (await dynamicImport("langsmith/sandbox"));
|
|
24
|
+
};
|
|
25
|
+
let langSmithSandboxClientLoader = defaultLangSmithSandboxClientLoader;
|
|
21
26
|
/**
|
|
22
27
|
* Resolve (and cache) the scoped sandbox backend for this run, provisioning it
|
|
23
28
|
* with `setup.sh` the first time it is created.
|
|
@@ -56,6 +61,10 @@ export function sandboxScopeKey(sandbox, config) {
|
|
|
56
61
|
export function clearManagedSandboxCacheForTests() {
|
|
57
62
|
managedSandboxes.clear();
|
|
58
63
|
}
|
|
64
|
+
/** Override the LangSmith SDK loader. Test-only. */
|
|
65
|
+
export function setLangSmithSandboxClientLoaderForTests(loader) {
|
|
66
|
+
langSmithSandboxClientLoader = loader ?? defaultLangSmithSandboxClientLoader;
|
|
67
|
+
}
|
|
59
68
|
/**
|
|
60
69
|
* Eagerly resolve the `mda dev` sandbox at startup so the developer sees the
|
|
61
70
|
* definitive decision — local vs. the configured provider, and the temp dir
|
|
@@ -82,14 +91,14 @@ function createManagedSandbox(sandbox, setupScript) {
|
|
|
82
91
|
// silently downgraded to local shell execution.
|
|
83
92
|
return isDevMode()
|
|
84
93
|
? createDevSandbox(sandbox, setupScript)
|
|
85
|
-
: createProviderSandbox(sandbox, setupScript);
|
|
94
|
+
: createProviderSandbox(sandbox, setupScript, { useDefaultLangSmithRuntime: true });
|
|
86
95
|
}
|
|
87
96
|
/**
|
|
88
97
|
* Production path: construct the configured provider's sandbox and provision it.
|
|
89
98
|
* Any failure propagates — a misconfigured deployment must surface, not degrade.
|
|
90
99
|
*/
|
|
91
|
-
async function createProviderSandbox(sandbox, setupScript) {
|
|
92
|
-
const backend = await createProviderBackend(sandbox);
|
|
100
|
+
async function createProviderSandbox(sandbox, setupScript, options) {
|
|
101
|
+
const backend = await createProviderBackend(sandbox, options);
|
|
93
102
|
if (setupScript && setupScript.trim().length > 0) {
|
|
94
103
|
await runSetupScript(backend, setupScript);
|
|
95
104
|
}
|
|
@@ -107,7 +116,9 @@ async function createDevSandbox(sandbox, setupScript) {
|
|
|
107
116
|
const cred = providerCredentialStatus(sandbox.provider);
|
|
108
117
|
if (cred.status !== "missing") {
|
|
109
118
|
try {
|
|
110
|
-
const backend = await createProviderSandbox(sandbox, setupScript
|
|
119
|
+
const backend = await createProviderSandbox(sandbox, setupScript, {
|
|
120
|
+
useDefaultLangSmithRuntime: false,
|
|
121
|
+
});
|
|
111
122
|
logDevSandboxNoticeOnce(cred.status === "available"
|
|
112
123
|
? `[mda dev] using the configured ${cred.provider} sandbox.`
|
|
113
124
|
: `[mda dev] using the configured sandbox provider (${cred.provider}).`);
|
|
@@ -131,12 +142,37 @@ async function createLocalSandbox(setupScript, reason) {
|
|
|
131
142
|
return backend;
|
|
132
143
|
}
|
|
133
144
|
/** Construct the configured provider's backend, stripping MDA-managed knobs. */
|
|
134
|
-
async function createProviderBackend(sandbox) {
|
|
145
|
+
async function createProviderBackend(sandbox, options) {
|
|
146
|
+
if (options.useDefaultLangSmithRuntime && providerKey(sandbox.provider) === "LangSmithSandbox") {
|
|
147
|
+
return createLangSmithSandboxBackend(sandbox);
|
|
148
|
+
}
|
|
135
149
|
const { scope: _scope, idleTtlSeconds: _idleTtlSeconds, ...providerOptions } = sandbox.options ?? {};
|
|
136
150
|
void _scope;
|
|
137
151
|
void _idleTtlSeconds;
|
|
138
152
|
return (await sandbox.provider.create(providerOptions));
|
|
139
153
|
}
|
|
154
|
+
async function createLangSmithSandboxBackend(sandbox) {
|
|
155
|
+
const { scope: _scope, apiKey = process.env.LANGSMITH_API_KEY, defaultTimeout, templateName, snapshotId, ...createSandboxOptions } = sandbox.options ?? {};
|
|
156
|
+
void _scope;
|
|
157
|
+
if (snapshotId && templateName) {
|
|
158
|
+
throw new Error("snapshotId and templateName are mutually exclusive. Pass only one creation source.");
|
|
159
|
+
}
|
|
160
|
+
if (templateName) {
|
|
161
|
+
createSandboxOptions.snapshotName = templateName;
|
|
162
|
+
}
|
|
163
|
+
const { SandboxClient } = await langSmithSandboxClientLoader();
|
|
164
|
+
if (snapshotId) {
|
|
165
|
+
createSandboxOptions.snapshotId = snapshotId;
|
|
166
|
+
}
|
|
167
|
+
const sdkOptions = stringOption(apiKey);
|
|
168
|
+
const client = new SandboxClient(sdkOptions ? { apiKey: sdkOptions } : undefined);
|
|
169
|
+
const langSmithSandbox = await client.createSandbox(createSandboxOptions);
|
|
170
|
+
const Backend = sandbox.provider;
|
|
171
|
+
return new Backend({ sandbox: langSmithSandbox, defaultTimeout });
|
|
172
|
+
}
|
|
173
|
+
function stringOption(value) {
|
|
174
|
+
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
175
|
+
}
|
|
140
176
|
function errorMessage(error) {
|
|
141
177
|
return error instanceof Error ? error.message : String(error);
|
|
142
178
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-manager.js","sourceRoot":"","sources":["../../src/runtime/sandbox-manager.ts"],"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AAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAChE,CAAC"}
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { McpServersDefinition } from "../connectors.js";
|
|
1
2
|
import type { SandboxDefinition } from "../sandbox.js";
|
|
2
3
|
/**
|
|
3
4
|
* The LangGraph runnable config passed to a graph factory at invocation time.
|
|
@@ -12,12 +13,18 @@ export interface ManagedRunConfig {
|
|
|
12
13
|
/**
|
|
13
14
|
* Managed values the CLI injects into the generated entry module.
|
|
14
15
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* Local build/dev entries may embed the system prompt directly. Deploy entries
|
|
17
|
+
* pass Context Hub metadata so the runtime can read deployed instructions,
|
|
18
|
+
* skills, and memories from the Hub repo.
|
|
18
19
|
*/
|
|
19
20
|
export interface ManagedAgentOptions {
|
|
20
21
|
systemPrompt?: string;
|
|
22
|
+
/** Context Hub repo handle for deployed runtime context. */
|
|
23
|
+
contextRepo?: string;
|
|
24
|
+
/** Latest synced Context Hub commit hash, used as deploy metadata. */
|
|
25
|
+
contextCommit?: string;
|
|
26
|
+
/** Whether the synced Context Hub repo contains deploy-owned skills. */
|
|
27
|
+
hasSkills?: boolean;
|
|
21
28
|
/** The `sandbox/index.ts` declaration, if the project configures a sandbox. */
|
|
22
29
|
sandbox?: SandboxDefinition;
|
|
23
30
|
/**
|
|
@@ -25,6 +32,11 @@ export interface ManagedAgentOptions {
|
|
|
25
32
|
* the first time a sandbox is provisioned for a given scope.
|
|
26
33
|
*/
|
|
27
34
|
setupScript?: string;
|
|
35
|
+
/**
|
|
36
|
+
* The `connectors/mcp.ts` declaration, if the project declares MCP servers.
|
|
37
|
+
* The runtime loads their tools and appends them to the agent's tools.
|
|
38
|
+
*/
|
|
39
|
+
connectors?: McpServersDefinition;
|
|
28
40
|
}
|
|
29
41
|
/**
|
|
30
42
|
* The subset of a created sandbox backend the managed runtime relies on to run
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/runtime/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/runtime/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sEAAsE;IACtE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,oBAAoB,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAChE,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAC1B,CAAC,CAAC;IACH,WAAW,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACpE"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { CreateDeepAgentParams } from "deepagents";
|
|
2
2
|
/**
|
|
3
3
|
* Properties the managed runtime owns. Agent authors never set these — MDA
|
|
4
|
-
* wires the backend, store,
|
|
5
|
-
*
|
|
4
|
+
* wires the backend, store, checkpointer, memory, skills, and system prompt at
|
|
5
|
+
* deploy time.
|
|
6
6
|
*/
|
|
7
|
-
export type ManagedDeepAgentKey = "backend" | "store" | "checkpointer" | "systemPrompt";
|
|
7
|
+
export type ManagedDeepAgentKey = "backend" | "store" | "checkpointer" | "systemPrompt" | "memory" | "skills";
|
|
8
8
|
/**
|
|
9
9
|
* Configuration accepted by {@link defineDeepAgent}.
|
|
10
10
|
*
|
|
@@ -19,11 +19,20 @@ export type DefineDeepAgentConfig = Omit<CreateDeepAgentParams, ManagedDeepAgent
|
|
|
19
19
|
store?: never;
|
|
20
20
|
/** Managed: the runtime owns the checkpointer. */
|
|
21
21
|
checkpointer?: never;
|
|
22
|
+
/** Managed: agent memory is stored under Context Hub `memories/`. */
|
|
23
|
+
memory?: never;
|
|
24
|
+
/** Managed: skills are loaded from Context Hub `skills/`. */
|
|
25
|
+
skills?: never;
|
|
22
26
|
/**
|
|
23
27
|
* Managed: the system prompt is embedded from `instructions.md` next to the
|
|
24
28
|
* agent file at deploy time. Write your prompt there instead.
|
|
25
29
|
*/
|
|
26
30
|
systemPrompt?: never;
|
|
31
|
+
/**
|
|
32
|
+
* Disable managed agent memory only. Scratch state, checkpointers, skills,
|
|
33
|
+
* instructions, and sandbox files still work.
|
|
34
|
+
*/
|
|
35
|
+
disableMemory?: boolean;
|
|
27
36
|
};
|
|
28
37
|
/**
|
|
29
38
|
* The pre-runtime spec returned by {@link defineDeepAgent}.
|
|
@@ -35,6 +44,7 @@ export type DefineDeepAgentConfig = Omit<CreateDeepAgentParams, ManagedDeepAgent
|
|
|
35
44
|
export interface DeepAgentDefinition {
|
|
36
45
|
readonly kind: "deep-agent";
|
|
37
46
|
readonly config: Omit<CreateDeepAgentParams, ManagedDeepAgentKey>;
|
|
47
|
+
readonly disableMemory: boolean;
|
|
38
48
|
}
|
|
39
49
|
/**
|
|
40
50
|
* Metadata about the inbound channel event that created or resumed a run.
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,OAAO,GACP,cAAc,GACd,cAAc,GACd,QAAQ,GACR,QAAQ,CAAC;AAEb;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,EAAE,mBAAmB,CAAC,GAAG;IACrF,4EAA4E;IAC5E,OAAO,CAAC,E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IAClC,EAAE,CAAC,EAAE,kBAAkB,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,UAAU,CAAC;IAC1E,KAAK,EAAE,YAAY,CAAC;IACpB,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAC5F;AAED;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,cAAc,CAAC;CACzB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "managed-deepagents",
|
|
3
|
-
"version": "0.0.3-dev.
|
|
3
|
+
"version": "0.0.3-dev.18",
|
|
4
4
|
"description": "Managed Deep Agents — the `defineDeepAgent` authoring interface plus the CLI that compiles and deploys a code-first Deep Agent repository to a managed LangGraph runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"langchain",
|
|
@@ -45,21 +45,17 @@
|
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=18"
|
|
47
47
|
},
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
"peerDependenciesMeta": {
|
|
52
|
-
"deepagents": {
|
|
53
|
-
"optional": true
|
|
54
|
-
}
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@langchain/mcp-adapters": "^1.1.3",
|
|
50
|
+
"deepagents": "^1.10.4"
|
|
55
51
|
},
|
|
56
52
|
"optionalDependencies": {
|
|
57
|
-
"@langchain/managed-deepagents-darwin-arm64": "0.0.3-dev.
|
|
58
|
-
"@langchain/managed-deepagents-darwin-x64": "0.0.3-dev.
|
|
59
|
-
"@langchain/managed-deepagents-linux-arm64": "0.0.3-dev.
|
|
60
|
-
"@langchain/managed-deepagents-linux-x64": "0.0.3-dev.
|
|
61
|
-
"@langchain/managed-deepagents-win32-x64": "0.0.3-dev.
|
|
62
|
-
"@langchain/managed-deepagents-win32-arm64": "0.0.3-dev.
|
|
53
|
+
"@langchain/managed-deepagents-darwin-arm64": "0.0.3-dev.18",
|
|
54
|
+
"@langchain/managed-deepagents-darwin-x64": "0.0.3-dev.18",
|
|
55
|
+
"@langchain/managed-deepagents-linux-arm64": "0.0.3-dev.18",
|
|
56
|
+
"@langchain/managed-deepagents-linux-x64": "0.0.3-dev.18",
|
|
57
|
+
"@langchain/managed-deepagents-win32-x64": "0.0.3-dev.18",
|
|
58
|
+
"@langchain/managed-deepagents-win32-arm64": "0.0.3-dev.18"
|
|
63
59
|
},
|
|
64
60
|
"devDependencies": {
|
|
65
61
|
"@types/node": "^20.0.0",
|