deepagents 1.16.4 → 1.16.5
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/{agent-DOFzksfM.d.cts → agent-Di09Mxb3.d.cts} +34 -1
- package/dist/{agent-BAuGxPZn.d.ts → agent-DiA5yRzO.d.ts} +35 -2
- package/dist/browser.cjs +1 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{langsmith-DfobOVRO.js → langsmith-CH6GPPud.js} +184 -24
- package/dist/langsmith-CH6GPPud.js.map +1 -0
- package/dist/{langsmith-D_tzVwxp.cjs → langsmith-CR3a2-Z7.cjs} +189 -23
- package/dist/langsmith-CR3a2-Z7.cjs.map +1 -0
- package/dist/node.cjs +2 -2
- package/dist/node.d.cts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.js +2 -2
- package/dist/{src-DTOh2Xrc.cjs → src-DeLlHk9u.cjs} +151 -26
- package/dist/src-DeLlHk9u.cjs.map +1 -0
- package/dist/{src-KaJuKnnd.js → src-tRcDW-tU.js} +151 -26
- package/dist/src-tRcDW-tU.js.map +1 -0
- package/package.json +2 -2
- package/dist/langsmith-D_tzVwxp.cjs.map +0 -1
- package/dist/langsmith-DfobOVRO.js.map +0 -1
- package/dist/src-DTOh2Xrc.cjs.map +0 -1
- package/dist/src-KaJuKnnd.js.map +0 -1
|
@@ -28,12 +28,12 @@ let micromatch = require("micromatch");
|
|
|
28
28
|
micromatch = __toESM(micromatch, 1);
|
|
29
29
|
let node_crypto = require("node:crypto");
|
|
30
30
|
let _langchain_core_messages = require("@langchain/core/messages");
|
|
31
|
+
let _langchain_core_runnables = require("@langchain/core/runnables");
|
|
31
32
|
let zod = require("zod");
|
|
32
33
|
zod = __toESM(zod, 1);
|
|
33
34
|
let langchain_chat_models_universal = require("langchain/chat_models/universal");
|
|
34
35
|
let yaml = require("yaml");
|
|
35
36
|
yaml = __toESM(yaml, 1);
|
|
36
|
-
let _langchain_core_runnables = require("@langchain/core/runnables");
|
|
37
37
|
let _langchain_core_tools = require("@langchain/core/tools");
|
|
38
38
|
let _langchain_core_language_models_base = require("@langchain/core/language_models/base");
|
|
39
39
|
let _langchain_core_utils_function_calling = require("@langchain/core/utils/function_calling");
|
|
@@ -57,6 +57,20 @@ function setRealpath(target, fn) {
|
|
|
57
57
|
configurable: true
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
+
// src/backends/pin.ts
|
|
61
|
+
const PIN = Symbol.for("deepagents.pin");
|
|
62
|
+
function getPin(backend) {
|
|
63
|
+
if (typeof backend !== "object" || backend === null) return;
|
|
64
|
+
const fn = backend[PIN];
|
|
65
|
+
return typeof fn === "function" ? fn : void 0;
|
|
66
|
+
}
|
|
67
|
+
function setPin(target, fn) {
|
|
68
|
+
Object.defineProperty(target, PIN, {
|
|
69
|
+
value: fn,
|
|
70
|
+
enumerable: false,
|
|
71
|
+
configurable: true
|
|
72
|
+
});
|
|
73
|
+
}
|
|
60
74
|
// src/backends/utils.ts
|
|
61
75
|
/**
|
|
62
76
|
* Shared utility functions for memory backend implementations.
|
|
@@ -690,6 +704,8 @@ function adaptBackendProtocol(backend) {
|
|
|
690
704
|
}
|
|
691
705
|
const realpath = getRealpath(backend);
|
|
692
706
|
if (realpath !== void 0) setRealpath(adapted, realpath);
|
|
707
|
+
const pin = getPin(backend);
|
|
708
|
+
if (pin !== void 0) setPin(adapted, pin);
|
|
693
709
|
const resolveBackendForPath = backend.resolveBackendForPath;
|
|
694
710
|
if (typeof resolveBackendForPath === "function") Object.defineProperty(adapted, "resolveBackendForPath", {
|
|
695
711
|
value: (path) => resolveBackendForPath.call(backend, path),
|
|
@@ -1742,6 +1758,7 @@ var CompositeBackend = class {
|
|
|
1742
1758
|
this.routes = Object.fromEntries(Object.entries(routes).map(([k, v]) => [k.endsWith("/") ? k : `${k}/`, isSandboxProtocol(v) ? adaptSandboxProtocol(v) : adaptBackendProtocol(v)]));
|
|
1743
1759
|
this.sortedRoutes = Object.entries(this.routes).sort((a, b) => b[0].length - a[0].length);
|
|
1744
1760
|
setRealpath(this, (path) => this.resolveRealPath(path));
|
|
1761
|
+
setPin(this, (path, options, authorize, operation) => this.runPinned(path, options, authorize, operation));
|
|
1745
1762
|
}
|
|
1746
1763
|
/** Delegates to default backend's id if it is a sandbox, otherwise empty string. */
|
|
1747
1764
|
get id() {
|
|
@@ -1783,6 +1800,22 @@ var CompositeBackend = class {
|
|
|
1783
1800
|
return realpath === void 0 ? path : await realpath(path);
|
|
1784
1801
|
}
|
|
1785
1802
|
/**
|
|
1803
|
+
* Pin via the backend that owns `path`, re-adding the route prefix to the
|
|
1804
|
+
* real path it authorizes. Runs `operation` unpinned when that backend has
|
|
1805
|
+
* no pin hook.
|
|
1806
|
+
*/
|
|
1807
|
+
runPinned(path, options, authorize, operation) {
|
|
1808
|
+
for (const [routePrefix, backend] of this.sortedRoutes) if (this.isPathWithinRoute(path, routePrefix)) {
|
|
1809
|
+
const pin = getPin(backend);
|
|
1810
|
+
if (pin === void 0) return operation();
|
|
1811
|
+
const prefix = routePrefix.slice(0, -1);
|
|
1812
|
+
const suffix = path.substring(routePrefix.length);
|
|
1813
|
+
return pin(suffix ? "/" + suffix : "/", options, (realPath) => authorize(prefix + realPath), operation);
|
|
1814
|
+
}
|
|
1815
|
+
const pin = getPin(this.default);
|
|
1816
|
+
return pin === void 0 ? operation() : pin(path, options, authorize, operation);
|
|
1817
|
+
}
|
|
1818
|
+
/**
|
|
1786
1819
|
* Determine which backend handles this key and strip prefix.
|
|
1787
1820
|
*
|
|
1788
1821
|
* @param key - Original file path
|
|
@@ -2588,11 +2621,15 @@ async function resolveRealPath(backend, canonical) {
|
|
|
2588
2621
|
/**
|
|
2589
2622
|
* Check whether `path` is permitted under `rules` for `operation`.
|
|
2590
2623
|
*
|
|
2591
|
-
* Returns the canonical path to hand the backend
|
|
2592
|
-
*
|
|
2593
|
-
*
|
|
2594
|
-
* backend has a realpath hook, the
|
|
2595
|
-
* touch. A deny on either blocks the
|
|
2624
|
+
* Returns the canonical path, the `target` to hand the backend for a
|
|
2625
|
+
* single-file operation, or an error string to surface to the model. The
|
|
2626
|
+
* decision covers every form of the target: the lexical canonical path (dot
|
|
2627
|
+
* and empty segments dropped) and, when the backend has a realpath hook, the
|
|
2628
|
+
* symlink-resolved path it would actually touch. A deny on either blocks the
|
|
2629
|
+
* call.
|
|
2630
|
+
*
|
|
2631
|
+
* `target` is the path with its parent resolved once and checked, so a
|
|
2632
|
+
* symlink swapped after the check cannot redirect the operation.
|
|
2596
2633
|
*
|
|
2597
2634
|
* Never throws: an invalid path (non-absolute, or containing `..` or `~`), one
|
|
2598
2635
|
* the backend cannot resolve, or a denied one is a recoverable tool error, not
|
|
@@ -2601,18 +2638,64 @@ async function resolveRealPath(backend, canonical) {
|
|
|
2601
2638
|
* @internal
|
|
2602
2639
|
*/
|
|
2603
2640
|
async function checkPermission(backend, rules, operation, path) {
|
|
2604
|
-
if (rules.length === 0) return {
|
|
2641
|
+
if (rules.length === 0) return {
|
|
2642
|
+
path,
|
|
2643
|
+
target: path
|
|
2644
|
+
};
|
|
2605
2645
|
let canonical;
|
|
2646
|
+
let target;
|
|
2606
2647
|
let real;
|
|
2607
2648
|
try {
|
|
2608
2649
|
canonical = validatePath(path);
|
|
2609
2650
|
if (decidePathAccess(rules, operation, canonical) === "deny") return { error: `Error: permission denied for ${operation} on ${canonical}` };
|
|
2610
|
-
|
|
2651
|
+
target = await resolveParentRealPath(backend, canonical);
|
|
2652
|
+
real = await resolveRealPath(backend, target);
|
|
2611
2653
|
} catch (error) {
|
|
2612
2654
|
return { error: `Error: ${getErrorMessage$1(error)}` };
|
|
2613
2655
|
}
|
|
2656
|
+
if (crossesRoute(backend, canonical, target)) return { error: `Error: ${canonical} resolves to ${target}, which is served by a different backend` };
|
|
2614
2657
|
if (real !== canonical && decidePathAccess(rules, operation, real) === "deny") return { error: `Error: permission denied for ${operation} on ${canonical} (resolves to ${real})` };
|
|
2615
|
-
return {
|
|
2658
|
+
return {
|
|
2659
|
+
path: canonical,
|
|
2660
|
+
target
|
|
2661
|
+
};
|
|
2662
|
+
}
|
|
2663
|
+
/**
|
|
2664
|
+
* Run a single-path `operation` on `target` through the backend's pin hook when
|
|
2665
|
+
* rules are configured and the backend has one, so the final decision is made
|
|
2666
|
+
* on the directory the operation actually uses. `isDenied` receives the real
|
|
2667
|
+
* path. Without a hook, `operation` runs on the path `checkPermission` resolved.
|
|
2668
|
+
*
|
|
2669
|
+
* Errors raised here, rather than by `operation`, start with `errorPrefix` so
|
|
2670
|
+
* they match how the calling tool formats backend errors.
|
|
2671
|
+
*/
|
|
2672
|
+
async function runBoundToTarget(backend, rules, target, options, isDenied, operation) {
|
|
2673
|
+
const pin = rules.length > 0 ? getPin(backend) : void 0;
|
|
2674
|
+
if (pin === void 0) return operation();
|
|
2675
|
+
const { create, describe, errorPrefix } = options;
|
|
2676
|
+
let operationStarted = false;
|
|
2677
|
+
try {
|
|
2678
|
+
return await pin(target, { create }, (realPath) => {
|
|
2679
|
+
const real = validatePath(realPath);
|
|
2680
|
+
return isDenied(real) ? `${errorPrefix}permission denied for ${describe} (resolves to ${real})` : void 0;
|
|
2681
|
+
}, () => {
|
|
2682
|
+
operationStarted = true;
|
|
2683
|
+
return operation();
|
|
2684
|
+
});
|
|
2685
|
+
} catch (error) {
|
|
2686
|
+
if (operationStarted) throw error;
|
|
2687
|
+
return { error: `${errorPrefix}${describe} failed: ${getErrorMessage$1(error)}` };
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
/**
|
|
2691
|
+
* Whether `target` is served by a different `CompositeBackend` route than
|
|
2692
|
+
* `requested`. Symlink resolution must not move an operation to another
|
|
2693
|
+
* backend.
|
|
2694
|
+
*/
|
|
2695
|
+
function crossesRoute(backend, requested, target) {
|
|
2696
|
+
const resolveBackendForPath = backend.resolveBackendForPath;
|
|
2697
|
+
if (typeof resolveBackendForPath !== "function" || requested === target) return false;
|
|
2698
|
+
return resolveBackendForPath.call(backend, requested)[0] !== resolveBackendForPath.call(backend, target)[0];
|
|
2616
2699
|
}
|
|
2617
2700
|
/**
|
|
2618
2701
|
* Build an error {@link ToolMessage} for a denied path or a failed backend
|
|
@@ -2786,10 +2869,11 @@ function parentPath(path) {
|
|
|
2786
2869
|
return `/${parts.slice(0, -1).join("/")}`;
|
|
2787
2870
|
}
|
|
2788
2871
|
/**
|
|
2789
|
-
* Resolve
|
|
2790
|
-
*
|
|
2872
|
+
* Resolve symlinks in the parent of `target`, keeping its leaf as given.
|
|
2873
|
+
* Backends refuse to follow (or, for delete, unlink) a symlinked leaf, so this
|
|
2874
|
+
* is the path a single-file operation actually touches.
|
|
2791
2875
|
*/
|
|
2792
|
-
async function
|
|
2876
|
+
async function resolveParentRealPath(backend, target) {
|
|
2793
2877
|
const parts = posixParts(target);
|
|
2794
2878
|
if (parts.length === 0) return resolveRealPath(backend, target);
|
|
2795
2879
|
return validatePath(`${await resolveRealPath(backend, parentPath(target))}/${parts[parts.length - 1]}`);
|
|
@@ -2956,7 +3040,11 @@ function createReadFileTool(backend, options) {
|
|
|
2956
3040
|
if (permission.error !== void 0) return toolError(runtime, "read_file", permission.error);
|
|
2957
3041
|
const { file_path, offset: requestedOffset = 0, limit: requestedLimit = 100 } = input;
|
|
2958
3042
|
const { offset, limit } = normalizeReadPagination(requestedOffset, requestedLimit);
|
|
2959
|
-
const readResult = await resolvedBackend
|
|
3043
|
+
const readResult = await runBoundToTarget(resolvedBackend, permissions, permission.target, {
|
|
3044
|
+
create: false,
|
|
3045
|
+
describe: `read on ${permission.path}`,
|
|
3046
|
+
errorPrefix: ""
|
|
3047
|
+
}, (real) => decidePathAccess(permissions, "read", real) === "deny", async () => resolvedBackend.read(permission.target, offset, limit));
|
|
2960
3048
|
if (readResult.error) return toolError(runtime, "read_file", `Error: ${readResult.error}`);
|
|
2961
3049
|
const mimeType = readResult.mimeType ?? getMimeType(file_path);
|
|
2962
3050
|
if (!isTextMimeType(mimeType)) {
|
|
@@ -3040,7 +3128,11 @@ function createWriteFileTool(backend, options) {
|
|
|
3040
3128
|
const permission = await checkPermission(resolvedBackend, permissions, "write", input.file_path);
|
|
3041
3129
|
if (permission.error !== void 0) return toolError(runtime, "write_file", permission.error);
|
|
3042
3130
|
const { file_path, content } = input;
|
|
3043
|
-
const result = await resolvedBackend
|
|
3131
|
+
const result = await runBoundToTarget(resolvedBackend, permissions, permission.target, {
|
|
3132
|
+
create: true,
|
|
3133
|
+
describe: `write on ${permission.path}`,
|
|
3134
|
+
errorPrefix: "Error: "
|
|
3135
|
+
}, (real) => decidePathAccess(permissions, "write", real) === "deny", async () => resolvedBackend.write(permission.target, content));
|
|
3044
3136
|
if (result.error) return toolError(runtime, "write_file", result.error);
|
|
3045
3137
|
const message = new langchain.ToolMessage({
|
|
3046
3138
|
content: `Successfully wrote to '${file_path}'`,
|
|
@@ -3072,7 +3164,11 @@ function createEditFileTool(backend, options) {
|
|
|
3072
3164
|
const permission = await checkPermission(resolvedBackend, permissions, "write", input.file_path);
|
|
3073
3165
|
if (permission.error !== void 0) return toolError(runtime, "edit_file", permission.error);
|
|
3074
3166
|
const { file_path, old_string, new_string, replace_all = false } = input;
|
|
3075
|
-
const result = await resolvedBackend
|
|
3167
|
+
const result = await runBoundToTarget(resolvedBackend, permissions, permission.target, {
|
|
3168
|
+
create: false,
|
|
3169
|
+
describe: `write on ${permission.path}`,
|
|
3170
|
+
errorPrefix: "Error: "
|
|
3171
|
+
}, (real) => decidePathAccess(permissions, "write", real) === "deny", async () => resolvedBackend.edit(permission.target, old_string, new_string, replace_all));
|
|
3076
3172
|
if (result.error) return toolError(runtime, "edit_file", result.error);
|
|
3077
3173
|
const message = new langchain.ToolMessage({
|
|
3078
3174
|
content: `Successfully replaced ${result.occurrences} occurrence(s) in '${file_path}'`,
|
|
@@ -3112,22 +3208,29 @@ function createDeleteTool(backend, options) {
|
|
|
3112
3208
|
const hasDescendants = await deleteTargetMayHaveDescendants(resolvedBackend, validatedPath, permissions.length > 0);
|
|
3113
3209
|
const denyingPatterns = findDeleteDenyPatterns(permissions, validatedPath, hasDescendants);
|
|
3114
3210
|
if (denyingPatterns.length > 0) return toolError(runtime, "delete", `Error: permission denied for write on ${validatedPath} (matches deny rule(s): ${denyingPatterns.join(", ")})`);
|
|
3211
|
+
let deleteTarget = validatedPath;
|
|
3115
3212
|
if (permissions.length > 0) {
|
|
3116
3213
|
let realTarget;
|
|
3117
3214
|
try {
|
|
3118
|
-
realTarget = await
|
|
3215
|
+
realTarget = await resolveParentRealPath(resolvedBackend, validatedPath);
|
|
3119
3216
|
} catch (error) {
|
|
3120
3217
|
return toolError(runtime, "delete", `Error: ${getErrorMessage$1(error)}`);
|
|
3121
3218
|
}
|
|
3219
|
+
if (crossesRoute(resolvedBackend, validatedPath, realTarget)) return toolError(runtime, "delete", `Error: ${validatedPath} resolves to ${realTarget}, which is served by a different backend`);
|
|
3122
3220
|
if (realTarget !== validatedPath) {
|
|
3123
3221
|
if (findDeleteDenyPatterns(permissions, realTarget, hasDescendants).length > 0) return toolError(runtime, "delete", `Error: permission denied for write on ${validatedPath} (resolves to ${realTarget})`);
|
|
3124
3222
|
}
|
|
3223
|
+
deleteTarget = realTarget;
|
|
3125
3224
|
}
|
|
3126
3225
|
if (!supportsDelete(resolvedBackend)) return toolError(runtime, "delete", `Error: deletion is not available for '${validatedPath}'.`);
|
|
3127
|
-
const result = await resolvedBackend
|
|
3226
|
+
const result = await runBoundToTarget(resolvedBackend, permissions, deleteTarget, {
|
|
3227
|
+
create: false,
|
|
3228
|
+
describe: `write on ${validatedPath}`,
|
|
3229
|
+
errorPrefix: "Error: "
|
|
3230
|
+
}, (real) => findDeleteDenyPatterns(permissions, real, hasDescendants).length > 0, async () => resolvedBackend.delete(deleteTarget));
|
|
3128
3231
|
if (result.error) return toolError(runtime, "delete", result.error);
|
|
3129
3232
|
const message = new langchain.ToolMessage({
|
|
3130
|
-
content: `Deleted ${result.path
|
|
3233
|
+
content: `Deleted ${result.path === void 0 || result.path === deleteTarget ? validatedPath : result.path}`,
|
|
3131
3234
|
tool_call_id: runtime.toolCall?.id,
|
|
3132
3235
|
name: "delete",
|
|
3133
3236
|
metadata: result.metadata
|
|
@@ -4563,7 +4666,7 @@ const INVALID_TOOL_MESSAGE_BLOCK_TYPES = [
|
|
|
4563
4666
|
/**
|
|
4564
4667
|
* Create Command with filtered state update from subagent result
|
|
4565
4668
|
*/
|
|
4566
|
-
function returnCommandWithStateUpdate(result, toolCallId) {
|
|
4669
|
+
function returnCommandWithStateUpdate(result, toolCallId, checkpointNs) {
|
|
4567
4670
|
const stateUpdate = filterStateForSubagent(result);
|
|
4568
4671
|
let content;
|
|
4569
4672
|
const refusal = refusalIn(result.messages?.at(-1));
|
|
@@ -4587,10 +4690,66 @@ function returnCommandWithStateUpdate(result, toolCallId) {
|
|
|
4587
4690
|
messages: [new langchain.ToolMessage({
|
|
4588
4691
|
content,
|
|
4589
4692
|
tool_call_id: toolCallId,
|
|
4590
|
-
name: "task"
|
|
4693
|
+
name: "task",
|
|
4694
|
+
...checkpointNs ? { artifact: { checkpoint_ns: checkpointNs } } : {}
|
|
4591
4695
|
})]
|
|
4592
4696
|
} });
|
|
4593
4697
|
}
|
|
4698
|
+
function isCompiledGraph(value) {
|
|
4699
|
+
return typeof value === "object" && value !== null && "lg_is_pregel" in value && value.lg_is_pregel === true;
|
|
4700
|
+
}
|
|
4701
|
+
/**
|
|
4702
|
+
* Whether `value` is a plain `RunnableBinding`, such as `withListeners`
|
|
4703
|
+
* returns, and not a subclass. A subclass can override `invoke` with behaviour
|
|
4704
|
+
* that streaming its inner graph would skip, such as the `RunnableRetry` from
|
|
4705
|
+
* `withRetry`.
|
|
4706
|
+
*/
|
|
4707
|
+
function isPlainRunnableBinding(value) {
|
|
4708
|
+
return value?.constructor === _langchain_core_runnables.RunnableBinding;
|
|
4709
|
+
}
|
|
4710
|
+
/**
|
|
4711
|
+
* The compiled graph behind a subagent: the subagent itself, the `graph` of a
|
|
4712
|
+
* `createAgent` agent, or the graph a plain `RunnableBinding` wraps.
|
|
4713
|
+
* `undefined` for any other runnable.
|
|
4714
|
+
*/
|
|
4715
|
+
function getCompiledGraph(subagent) {
|
|
4716
|
+
const unwrapped = isPlainRunnableBinding(subagent) ? subagent.bound : subagent;
|
|
4717
|
+
if (isCompiledGraph(unwrapped)) return unwrapped;
|
|
4718
|
+
const graph = unwrapped.graph;
|
|
4719
|
+
return isCompiledGraph(graph) ? graph : void 0;
|
|
4720
|
+
}
|
|
4721
|
+
/**
|
|
4722
|
+
* Invoke a subagent, returning its final state and the namespace it
|
|
4723
|
+
* checkpointed under.
|
|
4724
|
+
*
|
|
4725
|
+
* A compiled subagent is streamed rather than invoked so its checkpoint events
|
|
4726
|
+
* report the namespace it saved under. LangGraph changes that namespace from
|
|
4727
|
+
* the `task` call's own for a second run in the same step (`<namespace>|1`)
|
|
4728
|
+
* and for `checkpointer: true` (task ids removed). No checkpoint event means
|
|
4729
|
+
* nothing was saved. Any other runnable is invoked and assumed to save under
|
|
4730
|
+
* the `task` call's namespace.
|
|
4731
|
+
*/
|
|
4732
|
+
async function runSubagent(subagent, state, config) {
|
|
4733
|
+
const graph = getCompiledGraph(subagent);
|
|
4734
|
+
if (graph === void 0) return {
|
|
4735
|
+
result: await subagent.invoke(state, config),
|
|
4736
|
+
checkpointNs: config.configurable?.checkpoint_ns
|
|
4737
|
+
};
|
|
4738
|
+
let result = {};
|
|
4739
|
+
let checkpointNs;
|
|
4740
|
+
const options = {
|
|
4741
|
+
...config,
|
|
4742
|
+
streamMode: ["values", "checkpoints"],
|
|
4743
|
+
outputKeys: graph.outputChannels
|
|
4744
|
+
};
|
|
4745
|
+
const stream = await subagent.stream(state, options);
|
|
4746
|
+
for await (const [mode, chunk] of stream) if (mode === "values") result = chunk;
|
|
4747
|
+
else checkpointNs ??= chunk.config.configurable?.checkpoint_ns;
|
|
4748
|
+
return {
|
|
4749
|
+
result,
|
|
4750
|
+
checkpointNs
|
|
4751
|
+
};
|
|
4752
|
+
}
|
|
4594
4753
|
/** Drop the trailing in-flight AIMessage with unresolved tool_calls. */
|
|
4595
4754
|
function stripInFlightAIMessage(messages) {
|
|
4596
4755
|
const last = messages.at(-1);
|
|
@@ -4778,8 +4937,9 @@ function createTaskTool(options) {
|
|
|
4778
4937
|
}
|
|
4779
4938
|
};
|
|
4780
4939
|
let result;
|
|
4940
|
+
let checkpointNs;
|
|
4781
4941
|
try {
|
|
4782
|
-
result = await subagent
|
|
4942
|
+
({result, checkpointNs} = await runSubagent(subagent, subagentState, subagentConfig));
|
|
4783
4943
|
} catch (error) {
|
|
4784
4944
|
const notice = refusalNoticeFor(error);
|
|
4785
4945
|
if (notice === void 0) throw error;
|
|
@@ -4799,7 +4959,7 @@ function createTaskTool(options) {
|
|
|
4799
4959
|
}
|
|
4800
4960
|
return content;
|
|
4801
4961
|
}
|
|
4802
|
-
return returnCommandWithStateUpdate(result, config.toolCall.id);
|
|
4962
|
+
return returnCommandWithStateUpdate(result, config.toolCall.id, checkpointNs);
|
|
4803
4963
|
}
|
|
4804
4964
|
const taskToolSchema = zod_v4.z.object({
|
|
4805
4965
|
description: zod_v4.z.string().describe("The task to execute with the selected agent"),
|
|
@@ -11272,6 +11432,12 @@ Object.defineProperty(exports, "serializeProfile", {
|
|
|
11272
11432
|
return serializeProfile;
|
|
11273
11433
|
}
|
|
11274
11434
|
});
|
|
11435
|
+
Object.defineProperty(exports, "setPin", {
|
|
11436
|
+
enumerable: true,
|
|
11437
|
+
get: function() {
|
|
11438
|
+
return setPin;
|
|
11439
|
+
}
|
|
11440
|
+
});
|
|
11275
11441
|
Object.defineProperty(exports, "setRealpath", {
|
|
11276
11442
|
enumerable: true,
|
|
11277
11443
|
get: function() {
|
|
@@ -11285,4 +11451,4 @@ Object.defineProperty(exports, "skillsMetadataValue", {
|
|
|
11285
11451
|
}
|
|
11286
11452
|
});
|
|
11287
11453
|
|
|
11288
|
-
//# sourceMappingURL=langsmith-
|
|
11454
|
+
//# sourceMappingURL=langsmith-CR3a2-Z7.cjs.map
|