deepagents 1.10.4 → 1.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/{agent-DNSq5NSK.d.cts → agent-2caqZpg2.d.cts} +19 -42
- package/dist/{agent-taGqnaXM.d.ts → agent-DURA4_mf.d.ts} +19 -42
- package/dist/browser.cjs +1 -2
- package/dist/browser.d.cts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js +2 -2
- package/dist/index.cjs +2 -3
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/{langsmith-agEHKB-W.js → langsmith-CbVMIRaK.js} +63 -289
- package/dist/langsmith-CbVMIRaK.js.map +1 -0
- package/dist/{langsmith-D-SD2NFy.cjs → langsmith-Cpzy6cFq.cjs} +60 -292
- package/dist/langsmith-Cpzy6cFq.cjs.map +1 -0
- package/dist/node.cjs +2 -3
- package/dist/node.d.cts +2 -2
- package/dist/node.d.ts +2 -2
- package/dist/node.js +3 -3
- package/dist/{src-i9LWYTHF.js → src-5s_gtczU.js} +3 -3
- package/dist/{src-i9LWYTHF.js.map → src-5s_gtczU.js.map} +1 -1
- package/dist/{src-CZWQ_Lxm.cjs → src-Cu2or9PN.cjs} +3 -3
- package/dist/{src-CZWQ_Lxm.cjs.map → src-Cu2or9PN.cjs.map} +1 -1
- package/package.json +14 -9
- package/dist/langsmith-D-SD2NFy.cjs.map +0 -1
- package/dist/langsmith-agEHKB-W.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AIMessage, HumanMessage, SystemMessage, ToolMessage, anthropicPromptCachingMiddleware, context, countTokensApproximately, createAgent, createMiddleware, humanInTheLoopMiddleware, todoListMiddleware, tool } from "langchain";
|
|
2
|
-
import {
|
|
1
|
+
import { AIMessage, HumanMessage, SystemMessage, ToolMessage, anthropicPromptCachingMiddleware, bedrockPromptCachingMiddleware, context, countTokensApproximately, createAgent, createMiddleware, humanInTheLoopMiddleware, todoListMiddleware, tool } from "langchain";
|
|
2
|
+
import { Command, REMOVE_ALL_MESSAGES, ReducedValue, StateSchema, getConfig, getCurrentTaskInput, getStore, isCommand } from "@langchain/langgraph";
|
|
3
3
|
import { z } from "zod/v4";
|
|
4
4
|
import micromatch from "micromatch";
|
|
5
5
|
import { AIMessage as AIMessage$1, HumanMessage as HumanMessage$1, RemoveMessage, getBufferString } from "@langchain/core/messages";
|
|
@@ -400,16 +400,19 @@ function grepMatchesFromFiles(files, pattern, path = null, glob = null) {
|
|
|
400
400
|
/**
|
|
401
401
|
* Determine MIME type from a file path's extension.
|
|
402
402
|
*
|
|
403
|
-
*
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
403
|
+
* Defaults to "text/plain" for unknown extensions. Only the known non-text
|
|
404
|
+
* formats above (images, audio, video, PDF/PPT) are treated as binary by
|
|
405
|
+
* {@link isTextMimeType}; everything else reads as text, including source files
|
|
406
|
+
* with uncommon extensions (.properties, .scss, .tf) and extension-less files
|
|
407
|
+
* (Dockerfile, mvnw). This avoids base64-encoding text into document blocks,
|
|
408
|
+
* which the model can't read and which the Anthropic provider rejects with a
|
|
409
|
+
* 400.
|
|
407
410
|
*
|
|
408
411
|
* @param filePath - File path to inspect
|
|
409
|
-
* @returns MIME type string (e.g., "image/png", "
|
|
412
|
+
* @returns MIME type string (e.g., "image/png", "text/plain")
|
|
410
413
|
*/
|
|
411
414
|
function getMimeType(filePath) {
|
|
412
|
-
return MIME_TYPES[extname(filePath).toLocaleLowerCase()] || "
|
|
415
|
+
return MIME_TYPES[extname(filePath).toLocaleLowerCase()] || "text/plain";
|
|
413
416
|
}
|
|
414
417
|
/**
|
|
415
418
|
* Check whether a MIME type represents text content.
|
|
@@ -2312,11 +2315,16 @@ function returnCommandWithStateUpdate(result, toolCallId) {
|
|
|
2312
2315
|
let content;
|
|
2313
2316
|
if (result.structuredResponse != null) content = JSON.stringify(result.structuredResponse);
|
|
2314
2317
|
else {
|
|
2315
|
-
const messages = result.messages;
|
|
2316
|
-
content =
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
if (
|
|
2318
|
+
const messages = result.messages ?? [];
|
|
2319
|
+
content = "Task completed";
|
|
2320
|
+
for (let i = messages.length - 1; i >= 0; i -= 1) {
|
|
2321
|
+
const message = messages[i];
|
|
2322
|
+
if (!message || !AIMessage$1.isInstance(message)) continue;
|
|
2323
|
+
const text = typeof message.content === "string" ? message.content.trim() : message.text?.trim() ?? "";
|
|
2324
|
+
if (text) {
|
|
2325
|
+
content = text;
|
|
2326
|
+
break;
|
|
2327
|
+
}
|
|
2320
2328
|
}
|
|
2321
2329
|
}
|
|
2322
2330
|
return new Command({ update: {
|
|
@@ -2678,6 +2686,30 @@ function isAnthropicModel(model) {
|
|
|
2678
2686
|
return model.getName() === "ChatAnthropic";
|
|
2679
2687
|
}
|
|
2680
2688
|
/**
|
|
2689
|
+
* Detect whether a model is an AWS Bedrock Converse model.
|
|
2690
|
+
*
|
|
2691
|
+
* Accepts the wider `RunnableInterface` shape (the type of `request.model`
|
|
2692
|
+
* inside `wrapModelCall`, aliased as `AgentLanguageModelLike` in langchain)
|
|
2693
|
+
* because the function only depends on `.getName()`, which is part of the
|
|
2694
|
+
* Runnable contract. `BaseLanguageModel` extends `Runnable`, so existing
|
|
2695
|
+
* call sites still type-check.
|
|
2696
|
+
*/
|
|
2697
|
+
function isBedrockConverseModel(model) {
|
|
2698
|
+
if (typeof model === "string") {
|
|
2699
|
+
const colonIdx = model.indexOf(":");
|
|
2700
|
+
if (colonIdx !== -1) {
|
|
2701
|
+
const prefix = model.slice(0, colonIdx);
|
|
2702
|
+
if (prefix === "bedrock" || prefix === "aws") return true;
|
|
2703
|
+
}
|
|
2704
|
+
return model.startsWith("amazon.");
|
|
2705
|
+
}
|
|
2706
|
+
if (model.getName() === "ConfigurableModel") {
|
|
2707
|
+
const provider = model._defaultConfig?.modelProvider;
|
|
2708
|
+
return provider === "bedrock" || provider === "aws";
|
|
2709
|
+
}
|
|
2710
|
+
return model.getName() === "ChatBedrockConverse";
|
|
2711
|
+
}
|
|
2712
|
+
/**
|
|
2681
2713
|
* Extract the provider name from a model instance for profile lookup.
|
|
2682
2714
|
*
|
|
2683
2715
|
* Checks `_defaultConfig.modelProvider` (ConfigurableModel) and falls
|
|
@@ -4474,7 +4506,7 @@ const ASYNC_TASK_TOOL_NAMES = [
|
|
|
4474
4506
|
"cancel_async_task",
|
|
4475
4507
|
"list_async_tasks"
|
|
4476
4508
|
];
|
|
4477
|
-
const TERMINAL_STATUSES = new Set([
|
|
4509
|
+
const TERMINAL_STATUSES = /* @__PURE__ */ new Set([
|
|
4478
4510
|
"cancelled",
|
|
4479
4511
|
"success",
|
|
4480
4512
|
"error",
|
|
@@ -5000,271 +5032,6 @@ function createCacheBreakpointMiddleware() {
|
|
|
5000
5032
|
});
|
|
5001
5033
|
}
|
|
5002
5034
|
//#endregion
|
|
5003
|
-
//#region src/stream.ts
|
|
5004
|
-
/**
|
|
5005
|
-
* Deep Agent streaming support (experimental).
|
|
5006
|
-
*
|
|
5007
|
-
* Provides:
|
|
5008
|
-
* - `DeepAgentRunStream` — type overlay that adds `.subagents` to the
|
|
5009
|
-
* `AgentRunStream` shape
|
|
5010
|
-
* - `createSubagentTransformer` — a `__native` transformer whose
|
|
5011
|
-
* projection (`subagents`) lands directly on the `GraphRunStream`
|
|
5012
|
-
* instance via langgraph-core's native transformer support
|
|
5013
|
-
*
|
|
5014
|
-
* See protocol proposal §15 (In-Process Streaming Interface) and §16
|
|
5015
|
-
* (Native Stream Transformers).
|
|
5016
|
-
*/
|
|
5017
|
-
function hasPrefix(ns, prefix) {
|
|
5018
|
-
if (prefix.length > ns.length) return false;
|
|
5019
|
-
for (let i = 0; i < prefix.length; i += 1) if (ns[i] !== prefix[i]) return false;
|
|
5020
|
-
return true;
|
|
5021
|
-
}
|
|
5022
|
-
/**
|
|
5023
|
-
* Native transformer that correlates `task` tool calls into
|
|
5024
|
-
* {@link SubagentRunStream} objects and routes child-namespace
|
|
5025
|
-
* `tools` and `messages` events into per-subagent channels.
|
|
5026
|
-
*
|
|
5027
|
-
* Marked `__native: true` — the `subagents` projection key lands
|
|
5028
|
-
* directly on the `GraphRunStream` instance as `run.subagents`.
|
|
5029
|
-
*/
|
|
5030
|
-
function createSubagentTransformer(path) {
|
|
5031
|
-
return () => {
|
|
5032
|
-
const subagentsLog = StreamChannel.local();
|
|
5033
|
-
const pendingByCallId = /* @__PURE__ */ new Map();
|
|
5034
|
-
const pendingByNamespaceSegment = /* @__PURE__ */ new Map();
|
|
5035
|
-
const latestValuesByNamespaceSegment = /* @__PURE__ */ new Map();
|
|
5036
|
-
const subagentsByName = /* @__PURE__ */ new Map();
|
|
5037
|
-
/** Maps tools-node namespace segment to subagent name. */
|
|
5038
|
-
const toolsNodeToName = /* @__PURE__ */ new Map();
|
|
5039
|
-
const childToolCalls = /* @__PURE__ */ new Map();
|
|
5040
|
-
/** Active ChatModelStreamImpl per subagent (keyed by subagent name). */
|
|
5041
|
-
const activeMessages = /* @__PURE__ */ new Map();
|
|
5042
|
-
function deletePendingSubagent(pending) {
|
|
5043
|
-
pendingByCallId.delete(pending.callId);
|
|
5044
|
-
for (const [segment, entry] of pendingByNamespaceSegment) if (entry === pending) {
|
|
5045
|
-
pendingByNamespaceSegment.delete(segment);
|
|
5046
|
-
latestValuesByNamespaceSegment.delete(segment);
|
|
5047
|
-
}
|
|
5048
|
-
}
|
|
5049
|
-
function subagentSegment(ns) {
|
|
5050
|
-
return ns.length === path.length + 1 ? ns[path.length] : void 0;
|
|
5051
|
-
}
|
|
5052
|
-
function getOrCreateSubagentLogs(name) {
|
|
5053
|
-
let logs = subagentsByName.get(name);
|
|
5054
|
-
if (!logs) {
|
|
5055
|
-
logs = {
|
|
5056
|
-
messagesLog: StreamChannel.local(),
|
|
5057
|
-
toolCallsLog: StreamChannel.local(),
|
|
5058
|
-
nestedSubagentsLog: StreamChannel.local()
|
|
5059
|
-
};
|
|
5060
|
-
subagentsByName.set(name, logs);
|
|
5061
|
-
}
|
|
5062
|
-
return logs;
|
|
5063
|
-
}
|
|
5064
|
-
return {
|
|
5065
|
-
__native: true,
|
|
5066
|
-
init: () => ({ subagents: subagentsLog }),
|
|
5067
|
-
process(event) {
|
|
5068
|
-
if (!hasPrefix(event.params.namespace, path)) return true;
|
|
5069
|
-
const ns = event.params.namespace;
|
|
5070
|
-
const depth = ns.length - path.length;
|
|
5071
|
-
if (depth <= 1 && event.method === "tools") {
|
|
5072
|
-
const data = event.params.data;
|
|
5073
|
-
const toolCallId = data.tool_call_id;
|
|
5074
|
-
const toolName = data.tool_name;
|
|
5075
|
-
if (toolName === "task" && data.event === "tool-started") {
|
|
5076
|
-
const rawInput = data.input;
|
|
5077
|
-
const input = typeof rawInput === "string" ? JSON.parse(rawInput) : rawInput ?? {};
|
|
5078
|
-
const subagentName = input.subagent_type ?? "unknown";
|
|
5079
|
-
const taskDescription = input.description ?? "";
|
|
5080
|
-
let resolveTaskInput;
|
|
5081
|
-
let resolveOutput;
|
|
5082
|
-
let rejectOutput;
|
|
5083
|
-
const taskInput = new Promise((res) => {
|
|
5084
|
-
resolveTaskInput = res;
|
|
5085
|
-
});
|
|
5086
|
-
const output = new Promise((res, rej) => {
|
|
5087
|
-
resolveOutput = res;
|
|
5088
|
-
rejectOutput = rej;
|
|
5089
|
-
});
|
|
5090
|
-
const pending = {
|
|
5091
|
-
name: subagentName,
|
|
5092
|
-
callId: toolCallId,
|
|
5093
|
-
resolveTaskInput,
|
|
5094
|
-
resolveOutput,
|
|
5095
|
-
rejectOutput
|
|
5096
|
-
};
|
|
5097
|
-
if (toolCallId) pendingByCallId.set(toolCallId, pending);
|
|
5098
|
-
resolveTaskInput(taskDescription);
|
|
5099
|
-
if (depth === 1) {
|
|
5100
|
-
toolsNodeToName.set(ns[path.length], subagentName);
|
|
5101
|
-
pendingByNamespaceSegment.set(ns[path.length], pending);
|
|
5102
|
-
}
|
|
5103
|
-
if (toolCallId) {
|
|
5104
|
-
const taskSegment = `tools:${toolCallId}`;
|
|
5105
|
-
toolsNodeToName.set(taskSegment, subagentName);
|
|
5106
|
-
pendingByNamespaceSegment.set(taskSegment, pending);
|
|
5107
|
-
}
|
|
5108
|
-
const logs = getOrCreateSubagentLogs(subagentName);
|
|
5109
|
-
subagentsLog.push({
|
|
5110
|
-
name: subagentName,
|
|
5111
|
-
taskInput,
|
|
5112
|
-
output,
|
|
5113
|
-
messages: logs.messagesLog,
|
|
5114
|
-
toolCalls: logs.toolCallsLog,
|
|
5115
|
-
subagents: logs.nestedSubagentsLog
|
|
5116
|
-
});
|
|
5117
|
-
}
|
|
5118
|
-
if (toolName === "task" && toolCallId) {
|
|
5119
|
-
const pending = pendingByCallId.get(toolCallId);
|
|
5120
|
-
if (pending) {
|
|
5121
|
-
if (data.event === "tool-finished") {
|
|
5122
|
-
pending.resolveOutput(data.output);
|
|
5123
|
-
deletePendingSubagent(pending);
|
|
5124
|
-
} else if (data.event === "tool-error") {
|
|
5125
|
-
const message = data.message ?? "unknown error";
|
|
5126
|
-
pending.rejectOutput(new Error(message));
|
|
5127
|
-
deletePendingSubagent(pending);
|
|
5128
|
-
}
|
|
5129
|
-
}
|
|
5130
|
-
}
|
|
5131
|
-
}
|
|
5132
|
-
const segment = subagentSegment(ns);
|
|
5133
|
-
const pending = segment ? pendingByNamespaceSegment.get(segment) : void 0;
|
|
5134
|
-
if (pending) {
|
|
5135
|
-
if (event.method === "values") latestValuesByNamespaceSegment.set(segment, event.params.data);
|
|
5136
|
-
else if (event.method === "lifecycle") {
|
|
5137
|
-
const data = event.params.data;
|
|
5138
|
-
if (data.event === "completed" || data.event === "interrupted") {
|
|
5139
|
-
pending.resolveOutput(latestValuesByNamespaceSegment.get(segment));
|
|
5140
|
-
deletePendingSubagent(pending);
|
|
5141
|
-
} else if (data.event === "failed") {
|
|
5142
|
-
pending.rejectOutput(/* @__PURE__ */ new Error(`Subagent ${pending.name} failed`));
|
|
5143
|
-
deletePendingSubagent(pending);
|
|
5144
|
-
}
|
|
5145
|
-
}
|
|
5146
|
-
}
|
|
5147
|
-
if (depth >= 2) {
|
|
5148
|
-
const parentSegment = ns[path.length];
|
|
5149
|
-
const subagentName = toolsNodeToName.get(parentSegment);
|
|
5150
|
-
const logs = subagentName ? subagentsByName.get(subagentName) : void 0;
|
|
5151
|
-
if (logs && subagentName) {
|
|
5152
|
-
if (event.method === "tools") {
|
|
5153
|
-
const data = event.params.data;
|
|
5154
|
-
const toolCallId = data.tool_call_id;
|
|
5155
|
-
const toolName = data.tool_name;
|
|
5156
|
-
if (data.event === "tool-started") {
|
|
5157
|
-
let resolveOutput;
|
|
5158
|
-
let rejectOutput;
|
|
5159
|
-
let resolveStatus;
|
|
5160
|
-
let resolveError;
|
|
5161
|
-
const output = new Promise((res, rej) => {
|
|
5162
|
-
resolveOutput = res;
|
|
5163
|
-
rejectOutput = rej;
|
|
5164
|
-
});
|
|
5165
|
-
const status = new Promise((res) => {
|
|
5166
|
-
resolveStatus = res;
|
|
5167
|
-
});
|
|
5168
|
-
const error = new Promise((res) => {
|
|
5169
|
-
resolveError = res;
|
|
5170
|
-
});
|
|
5171
|
-
childToolCalls.set(toolCallId, {
|
|
5172
|
-
resolveOutput,
|
|
5173
|
-
rejectOutput,
|
|
5174
|
-
resolveStatus,
|
|
5175
|
-
resolveError
|
|
5176
|
-
});
|
|
5177
|
-
const rawInput = data.input;
|
|
5178
|
-
const parsedInput = typeof rawInput === "string" ? JSON.parse(rawInput) : rawInput;
|
|
5179
|
-
logs.toolCallsLog.push({
|
|
5180
|
-
name: toolName ?? "unknown",
|
|
5181
|
-
callId: toolCallId,
|
|
5182
|
-
input: parsedInput,
|
|
5183
|
-
output,
|
|
5184
|
-
status,
|
|
5185
|
-
error
|
|
5186
|
-
});
|
|
5187
|
-
}
|
|
5188
|
-
const pending = toolCallId ? childToolCalls.get(toolCallId) : void 0;
|
|
5189
|
-
if (pending) {
|
|
5190
|
-
if (data.event === "tool-finished") {
|
|
5191
|
-
pending.resolveOutput(data.output);
|
|
5192
|
-
pending.resolveStatus("finished");
|
|
5193
|
-
pending.resolveError(void 0);
|
|
5194
|
-
childToolCalls.delete(toolCallId);
|
|
5195
|
-
} else if (data.event === "tool-error") {
|
|
5196
|
-
const message = data.message ?? "unknown error";
|
|
5197
|
-
pending.rejectOutput(new Error(message));
|
|
5198
|
-
pending.resolveStatus("error");
|
|
5199
|
-
pending.resolveError(message);
|
|
5200
|
-
childToolCalls.delete(toolCallId);
|
|
5201
|
-
}
|
|
5202
|
-
}
|
|
5203
|
-
}
|
|
5204
|
-
if (event.method === "messages") {
|
|
5205
|
-
const data = event.params.data;
|
|
5206
|
-
if (data.event === "message-start") {
|
|
5207
|
-
const eventsLog = StreamChannel.local();
|
|
5208
|
-
const stream = new ChatModelStreamImpl(eventsLog);
|
|
5209
|
-
eventsLog.push(data);
|
|
5210
|
-
activeMessages.set(subagentName, {
|
|
5211
|
-
stream,
|
|
5212
|
-
eventsLog
|
|
5213
|
-
});
|
|
5214
|
-
logs.messagesLog.push(stream);
|
|
5215
|
-
} else if (data.event === "message-finish") {
|
|
5216
|
-
const active = activeMessages.get(subagentName);
|
|
5217
|
-
if (active) {
|
|
5218
|
-
active.eventsLog.push(data);
|
|
5219
|
-
active.eventsLog.close();
|
|
5220
|
-
activeMessages.delete(subagentName);
|
|
5221
|
-
}
|
|
5222
|
-
} else activeMessages.get(subagentName)?.eventsLog.push(data);
|
|
5223
|
-
}
|
|
5224
|
-
}
|
|
5225
|
-
}
|
|
5226
|
-
return true;
|
|
5227
|
-
},
|
|
5228
|
-
finalize() {
|
|
5229
|
-
for (const pending of pendingByCallId.values()) pending.resolveOutput(void 0);
|
|
5230
|
-
pendingByCallId.clear();
|
|
5231
|
-
for (const pending of childToolCalls.values()) {
|
|
5232
|
-
pending.resolveOutput(void 0);
|
|
5233
|
-
pending.resolveStatus("finished");
|
|
5234
|
-
pending.resolveError(void 0);
|
|
5235
|
-
}
|
|
5236
|
-
childToolCalls.clear();
|
|
5237
|
-
for (const active of activeMessages.values()) active.eventsLog.fail(/* @__PURE__ */ new Error("run finalized before message completed"));
|
|
5238
|
-
activeMessages.clear();
|
|
5239
|
-
subagentsLog.close();
|
|
5240
|
-
for (const logs of subagentsByName.values()) {
|
|
5241
|
-
logs.toolCallsLog.close();
|
|
5242
|
-
logs.messagesLog.close();
|
|
5243
|
-
logs.nestedSubagentsLog.close();
|
|
5244
|
-
}
|
|
5245
|
-
},
|
|
5246
|
-
fail(err) {
|
|
5247
|
-
for (const pending of pendingByCallId.values()) pending.rejectOutput(err);
|
|
5248
|
-
pendingByCallId.clear();
|
|
5249
|
-
for (const pending of childToolCalls.values()) {
|
|
5250
|
-
pending.rejectOutput(err);
|
|
5251
|
-
pending.resolveStatus("error");
|
|
5252
|
-
pending.resolveError(err instanceof Error ? err.message : String(err));
|
|
5253
|
-
}
|
|
5254
|
-
childToolCalls.clear();
|
|
5255
|
-
for (const active of activeMessages.values()) active.eventsLog.fail(err);
|
|
5256
|
-
activeMessages.clear();
|
|
5257
|
-
subagentsLog.fail(err);
|
|
5258
|
-
for (const logs of subagentsByName.values()) {
|
|
5259
|
-
logs.toolCallsLog.fail(err);
|
|
5260
|
-
logs.messagesLog.fail(err);
|
|
5261
|
-
logs.nestedSubagentsLog.fail(err);
|
|
5262
|
-
}
|
|
5263
|
-
}
|
|
5264
|
-
};
|
|
5265
|
-
};
|
|
5266
|
-
}
|
|
5267
|
-
//#endregion
|
|
5268
5035
|
//#region src/profiles/keys.ts
|
|
5269
5036
|
/**
|
|
5270
5037
|
* Normalize and validate a profile registry key.
|
|
@@ -5305,7 +5072,7 @@ function validateProfileKey(key) {
|
|
|
5305
5072
|
* filesystem permissions.
|
|
5306
5073
|
* - `SubAgentMiddleware` backs the `task` tool for subagent delegation.
|
|
5307
5074
|
*/
|
|
5308
|
-
const REQUIRED_MIDDLEWARE_NAMES = new Set(["FilesystemMiddleware", "SubAgentMiddleware"]);
|
|
5075
|
+
const REQUIRED_MIDDLEWARE_NAMES = /* @__PURE__ */ new Set(["FilesystemMiddleware", "SubAgentMiddleware"]);
|
|
5309
5076
|
/**
|
|
5310
5077
|
* Type guard: is this a fully-constructed HarnessProfile (frozen with
|
|
5311
5078
|
* Set fields) or raw options?
|
|
@@ -5392,7 +5159,7 @@ function createHarnessProfile(options = {}) {
|
|
|
5392
5159
|
const EMPTY_HARNESS_PROFILE = createHarnessProfile();
|
|
5393
5160
|
//#endregion
|
|
5394
5161
|
//#region src/profiles/harness/serialization.ts
|
|
5395
|
-
const POISONED_KEYS = new Set([
|
|
5162
|
+
const POISONED_KEYS = /* @__PURE__ */ new Set([
|
|
5396
5163
|
"__proto__",
|
|
5397
5164
|
"constructor",
|
|
5398
5165
|
"prototype"
|
|
@@ -5968,7 +5735,7 @@ const BASE_AGENT_PROMPT = context`
|
|
|
5968
5735
|
|
|
5969
5736
|
For longer tasks, provide brief progress updates at reasonable intervals — a concise sentence recapping what you've done and what's next.
|
|
5970
5737
|
`;
|
|
5971
|
-
const BUILTIN_TOOL_NAMES = new Set([
|
|
5738
|
+
const BUILTIN_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
5972
5739
|
...FILESYSTEM_TOOL_NAMES,
|
|
5973
5740
|
...ASYNC_TASK_TOOL_NAMES,
|
|
5974
5741
|
"task",
|
|
@@ -6016,10 +5783,17 @@ function createDeepAgent(params = {}) {
|
|
|
6016
5783
|
const toolOverrides = harnessProfile.toolDescriptionOverrides;
|
|
6017
5784
|
const effectiveTools = Object.keys(toolOverrides).length > 0 ? tools.map((t) => t.name in toolOverrides ? Object.assign(Object.create(Object.getPrototypeOf(t)), t, { description: toolOverrides[t.name] }) : t) : tools;
|
|
6018
5785
|
const anthropicModel = isAnthropicModel(model);
|
|
6019
|
-
const
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
5786
|
+
const bedrockModel = isBedrockConverseModel(model);
|
|
5787
|
+
let cacheMiddleware = [];
|
|
5788
|
+
if (anthropicModel) cacheMiddleware = [
|
|
5789
|
+
...cacheMiddleware,
|
|
5790
|
+
anthropicPromptCachingMiddleware({
|
|
5791
|
+
unsupportedModelBehavior: "ignore",
|
|
5792
|
+
minMessagesToCache: 1
|
|
5793
|
+
}),
|
|
5794
|
+
createCacheBreakpointMiddleware()
|
|
5795
|
+
];
|
|
5796
|
+
if (bedrockModel) cacheMiddleware = [...cacheMiddleware, bedrockPromptCachingMiddleware({ unsupportedModelBehavior: "ignore" })];
|
|
6023
5797
|
/**
|
|
6024
5798
|
* Process subagents to add SkillsMiddleware for those with their own skills.
|
|
6025
5799
|
*
|
|
@@ -6161,7 +5935,7 @@ function createDeepAgent(params = {}) {
|
|
|
6161
5935
|
checkpointer,
|
|
6162
5936
|
store,
|
|
6163
5937
|
name,
|
|
6164
|
-
streamTransformers
|
|
5938
|
+
streamTransformers
|
|
6165
5939
|
}).withConfig({
|
|
6166
5940
|
recursionLimit: 1e4,
|
|
6167
5941
|
metadata: {
|
|
@@ -7581,6 +7355,6 @@ var LangSmithSandbox = class LangSmithSandbox extends BaseSandbox {
|
|
|
7581
7355
|
}
|
|
7582
7356
|
};
|
|
7583
7357
|
//#endregion
|
|
7584
|
-
export {
|
|
7358
|
+
export { GENERAL_PURPOSE_SUBAGENT as A, isSandboxProtocol as B, MAX_SKILL_NAME_LENGTH as C, createPatchToolCallsMiddleware as D, filesValue as E, createFilesystemMiddleware as F, getMimeType as G, adaptBackendProtocol as H, CompositeBackend as I, isTextMimeType as K, StateBackend as L, TASK_SYSTEM_PROMPT as M, createSubAgent as N, DEFAULT_GENERAL_PURPOSE_DESCRIPTION as O, createSubAgentMiddleware as P, SandboxError as R, MAX_SKILL_FILE_SIZE as S, createMemoryMiddleware as T, adaptSandboxProtocol as U, resolveBackend as V, checkEmptyContent as W, isAsyncSubAgent as _, createDeepAgent as a, createCompletionCallbackMiddleware as b, generalPurposeSubagentConfigSchema as c, serializeProfile as d, EMPTY_HARNESS_PROFILE as f, createAsyncSubAgentMiddleware as g, ConfigurationError as h, StoreBackend as i, SUBAGENT_RESPONSE_FORMAT_CONFIG_KEY as j, DEFAULT_SUBAGENT_PROMPT as k, harnessProfileConfigSchema as l, REQUIRED_MIDDLEWARE_NAMES as m, BaseSandbox as n, getHarnessProfile as o, createHarnessProfile as p, performStringReplacement as q, ContextHubBackend as r, registerHarnessProfile as s, LangSmithSandbox as t, parseHarnessProfileConfig as u, computeSummarizationDefaults as v, createSkillsMiddleware as w, MAX_SKILL_DESCRIPTION_LENGTH as x, createSummarizationMiddleware as y, isSandboxBackend as z };
|
|
7585
7359
|
|
|
7586
|
-
//# sourceMappingURL=langsmith-
|
|
7360
|
+
//# sourceMappingURL=langsmith-CbVMIRaK.js.map
|