@librechat/agents 4.1.0 → 4.2.0
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/cjs/agents/AgentContext.cjs +9 -1
- package/dist/cjs/agents/AgentContext.cjs.map +1 -1
- package/dist/cjs/common/constants.cjs +2 -0
- package/dist/cjs/common/constants.cjs.map +1 -1
- package/dist/cjs/graphs/Graph.cjs +15 -12
- package/dist/cjs/graphs/Graph.cjs.map +1 -1
- package/dist/cjs/graphs/MultiAgentGraph.cjs +1 -1
- package/dist/cjs/hitl/approvalReview.cjs +10 -2
- package/dist/cjs/hitl/approvalReview.cjs.map +1 -1
- package/dist/cjs/llm/anthropic/defaults.cjs +12 -0
- package/dist/cjs/llm/anthropic/defaults.cjs.map +1 -0
- package/dist/cjs/llm/anthropic/index.cjs +6 -0
- package/dist/cjs/llm/anthropic/index.cjs.map +1 -1
- package/dist/cjs/llm/anthropic/utils/message_inputs.cjs +1 -1
- package/dist/cjs/llm/google/utils/common.cjs +1 -1
- package/dist/cjs/llm/init.cjs +5 -2
- package/dist/cjs/llm/init.cjs.map +1 -1
- package/dist/cjs/llm/invoke.cjs +17 -15
- package/dist/cjs/llm/invoke.cjs.map +1 -1
- package/dist/cjs/llm/openai/index.cjs +1 -1
- package/dist/cjs/llm/openai/utils/index.cjs.map +1 -1
- package/dist/cjs/llm/request.cjs +13 -0
- package/dist/cjs/llm/request.cjs.map +1 -1
- package/dist/cjs/llm/stream/chunkAdapters.cjs +2 -3
- package/dist/cjs/llm/stream/chunkAdapters.cjs.map +1 -1
- package/dist/cjs/llm/truncation.cjs +12 -2
- package/dist/cjs/llm/truncation.cjs.map +1 -1
- package/dist/cjs/main.cjs +7 -4
- package/dist/cjs/messages/core.cjs +1 -1
- package/dist/cjs/messages/format.cjs +1 -1
- package/dist/cjs/messages/index.cjs +1 -1
- package/dist/cjs/messages/prune.cjs +2 -2
- package/dist/cjs/messages/reasoningTypes.cjs +20 -0
- package/dist/cjs/messages/reasoningTypes.cjs.map +1 -1
- package/dist/cjs/messages/recency.cjs +68 -7
- package/dist/cjs/messages/recency.cjs.map +1 -1
- package/dist/cjs/run.cjs +135 -54
- package/dist/cjs/run.cjs.map +1 -1
- package/dist/cjs/session/AgentSession.cjs +7 -10
- package/dist/cjs/session/AgentSession.cjs.map +1 -1
- package/dist/cjs/stream.cjs +3 -2
- package/dist/cjs/stream.cjs.map +1 -1
- package/dist/cjs/summarization/input.cjs +87 -0
- package/dist/cjs/summarization/input.cjs.map +1 -0
- package/dist/cjs/summarization/node.cjs +470 -135
- package/dist/cjs/summarization/node.cjs.map +1 -1
- package/dist/cjs/summarization/retry.cjs +172 -0
- package/dist/cjs/summarization/retry.cjs.map +1 -0
- package/dist/cjs/summarization/shared.cjs +6 -2
- package/dist/cjs/summarization/shared.cjs.map +1 -1
- package/dist/cjs/summarization/toolBudget.cjs +45 -0
- package/dist/cjs/summarization/toolBudget.cjs.map +1 -0
- package/dist/cjs/summarization/usage.cjs +70 -0
- package/dist/cjs/summarization/usage.cjs.map +1 -0
- package/dist/cjs/tools/ToolNode.cjs +46 -16
- package/dist/cjs/tools/ToolNode.cjs.map +1 -1
- package/dist/cjs/tools/cloudflare/CloudflareBridgeRuntime.cjs.map +1 -1
- package/dist/cjs/tools/subagent/SubagentExecutor.cjs +155 -18
- package/dist/cjs/tools/subagent/SubagentExecutor.cjs.map +1 -1
- package/dist/cjs/tools/subagent/SubagentReplay.cjs +6 -1
- package/dist/cjs/tools/subagent/SubagentReplay.cjs.map +1 -1
- package/dist/cjs/tools/subagent/childGraphConfig.cjs +2 -1
- package/dist/cjs/tools/subagent/childGraphConfig.cjs.map +1 -1
- package/dist/cjs/tools/toolBatchReplay.cjs +182 -6
- package/dist/cjs/tools/toolBatchReplay.cjs.map +1 -1
- package/dist/cjs/utils/errors.cjs +21 -0
- package/dist/cjs/utils/errors.cjs.map +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/schema.cjs +17 -0
- package/dist/cjs/utils/schema.cjs.map +1 -1
- package/dist/esm/agents/AgentContext.mjs +9 -1
- package/dist/esm/agents/AgentContext.mjs.map +1 -1
- package/dist/esm/common/constants.mjs +2 -1
- package/dist/esm/common/constants.mjs.map +1 -1
- package/dist/esm/graphs/Graph.mjs +16 -13
- package/dist/esm/graphs/Graph.mjs.map +1 -1
- package/dist/esm/graphs/MultiAgentGraph.mjs +1 -1
- package/dist/esm/hitl/approvalReview.mjs +10 -2
- package/dist/esm/hitl/approvalReview.mjs.map +1 -1
- package/dist/esm/llm/anthropic/defaults.mjs +12 -0
- package/dist/esm/llm/anthropic/defaults.mjs.map +1 -0
- package/dist/esm/llm/anthropic/index.mjs +6 -0
- package/dist/esm/llm/anthropic/index.mjs.map +1 -1
- package/dist/esm/llm/anthropic/utils/message_inputs.mjs +1 -1
- package/dist/esm/llm/google/utils/common.mjs +1 -1
- package/dist/esm/llm/init.mjs +5 -2
- package/dist/esm/llm/init.mjs.map +1 -1
- package/dist/esm/llm/invoke.mjs +18 -16
- package/dist/esm/llm/invoke.mjs.map +1 -1
- package/dist/esm/llm/openai/index.mjs +1 -1
- package/dist/esm/llm/openai/utils/index.mjs.map +1 -1
- package/dist/esm/llm/request.mjs +13 -1
- package/dist/esm/llm/request.mjs.map +1 -1
- package/dist/esm/llm/stream/chunkAdapters.mjs +2 -3
- package/dist/esm/llm/stream/chunkAdapters.mjs.map +1 -1
- package/dist/esm/llm/truncation.mjs +12 -3
- package/dist/esm/llm/truncation.mjs.map +1 -1
- package/dist/esm/main.mjs +8 -8
- package/dist/esm/messages/core.mjs +1 -1
- package/dist/esm/messages/format.mjs +1 -1
- package/dist/esm/messages/index.mjs +1 -1
- package/dist/esm/messages/prune.mjs +2 -2
- package/dist/esm/messages/reasoningTypes.mjs +19 -1
- package/dist/esm/messages/reasoningTypes.mjs.map +1 -1
- package/dist/esm/messages/recency.mjs +68 -8
- package/dist/esm/messages/recency.mjs.map +1 -1
- package/dist/esm/run.mjs +135 -54
- package/dist/esm/run.mjs.map +1 -1
- package/dist/esm/session/AgentSession.mjs +7 -10
- package/dist/esm/session/AgentSession.mjs.map +1 -1
- package/dist/esm/stream.mjs +3 -2
- package/dist/esm/stream.mjs.map +1 -1
- package/dist/esm/summarization/input.mjs +84 -0
- package/dist/esm/summarization/input.mjs.map +1 -0
- package/dist/esm/summarization/node.mjs +469 -133
- package/dist/esm/summarization/node.mjs.map +1 -1
- package/dist/esm/summarization/retry.mjs +169 -0
- package/dist/esm/summarization/retry.mjs.map +1 -0
- package/dist/esm/summarization/shared.mjs +6 -2
- package/dist/esm/summarization/shared.mjs.map +1 -1
- package/dist/esm/summarization/toolBudget.mjs +45 -0
- package/dist/esm/summarization/toolBudget.mjs.map +1 -0
- package/dist/esm/summarization/usage.mjs +69 -0
- package/dist/esm/summarization/usage.mjs.map +1 -0
- package/dist/esm/tools/ToolNode.mjs +46 -16
- package/dist/esm/tools/ToolNode.mjs.map +1 -1
- package/dist/esm/tools/cloudflare/CloudflareBridgeRuntime.mjs.map +1 -1
- package/dist/esm/tools/subagent/SubagentExecutor.mjs +156 -19
- package/dist/esm/tools/subagent/SubagentExecutor.mjs.map +1 -1
- package/dist/esm/tools/subagent/SubagentReplay.mjs +6 -1
- package/dist/esm/tools/subagent/SubagentReplay.mjs.map +1 -1
- package/dist/esm/tools/subagent/childGraphConfig.mjs +2 -1
- package/dist/esm/tools/subagent/childGraphConfig.mjs.map +1 -1
- package/dist/esm/tools/toolBatchReplay.mjs +178 -7
- package/dist/esm/tools/toolBatchReplay.mjs.map +1 -1
- package/dist/esm/utils/errors.mjs +21 -1
- package/dist/esm/utils/errors.mjs.map +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/schema.mjs +17 -0
- package/dist/esm/utils/schema.mjs.map +1 -1
- package/dist/types/agents/AgentContext.d.ts +2 -0
- package/dist/types/common/constants.d.ts +2 -0
- package/dist/types/hitl/approvalReview.d.ts +1 -1
- package/dist/types/llm/anthropic/defaults.d.ts +11 -0
- package/dist/types/llm/init.d.ts +2 -1
- package/dist/types/llm/invoke.d.ts +8 -1
- package/dist/types/llm/request.d.ts +12 -0
- package/dist/types/llm/stream/chunkAdapters.d.ts +1 -1
- package/dist/types/llm/truncation.d.ts +2 -0
- package/dist/types/messages/reasoningTypes.d.ts +6 -0
- package/dist/types/messages/recency.d.ts +2 -0
- package/dist/types/run.d.ts +3 -0
- package/dist/types/summarization/input.d.ts +16 -0
- package/dist/types/summarization/node.d.ts +2 -1
- package/dist/types/summarization/retry.d.ts +22 -0
- package/dist/types/summarization/shared.d.ts +3 -3
- package/dist/types/summarization/toolBudget.d.ts +8 -0
- package/dist/types/summarization/usage.d.ts +9 -0
- package/dist/types/tools/subagent/SubagentReplay.d.ts +3 -1
- package/dist/types/tools/toolBatchReplay.d.ts +14 -1
- package/dist/types/types/graph.d.ts +2 -1
- package/dist/types/types/hitl.d.ts +2 -0
- package/dist/types/types/llm.d.ts +3 -0
- package/dist/types/types/run.d.ts +1 -1
- package/dist/types/types/summarize.d.ts +15 -3
- package/dist/types/utils/errors.d.ts +2 -0
- package/dist/types/utils/schema.d.ts +1 -1
- package/package.json +13 -4
- package/src/agents/AgentContext.ts +7 -0
- package/src/common/constants.ts +3 -0
- package/src/graphs/Graph.ts +16 -21
- package/src/hitl/approvalReview.ts +10 -2
- package/src/llm/anthropic/defaults.ts +22 -0
- package/src/llm/anthropic/index.ts +15 -2
- package/src/llm/init.ts +16 -2
- package/src/llm/invoke.ts +33 -14
- package/src/llm/openai/utils/index.ts +2 -4
- package/src/llm/request.ts +44 -0
- package/src/llm/stream/chunkAdapters.ts +14 -18
- package/src/llm/truncation.ts +33 -17
- package/src/messages/reasoningTypes.ts +71 -0
- package/src/messages/recency.ts +78 -0
- package/src/run.ts +190 -81
- package/src/session/AgentSession.ts +8 -11
- package/src/stream.ts +1 -0
- package/src/summarization/input.ts +98 -0
- package/src/summarization/node.ts +749 -356
- package/src/summarization/retry.ts +294 -0
- package/src/summarization/shared.ts +9 -2
- package/src/summarization/toolBudget.ts +87 -0
- package/src/summarization/usage.ts +117 -0
- package/src/tools/ToolNode.ts +84 -23
- package/src/tools/cloudflare/CloudflareBridgeRuntime.ts +2 -2
- package/src/tools/subagent/SubagentExecutor.ts +227 -32
- package/src/tools/subagent/SubagentReplay.ts +30 -1
- package/src/tools/subagent/childGraphConfig.ts +9 -2
- package/src/tools/toolBatchReplay.ts +237 -7
- package/src/types/graph.ts +2 -1
- package/src/types/hitl.ts +4 -0
- package/src/types/llm.ts +4 -0
- package/src/types/run.ts +6 -3
- package/src/types/summarize.ts +22 -3
- package/src/utils/errors.ts +45 -0
- package/src/utils/schema.ts +26 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolBatchReplay.mjs","names":[],"sources":["../../../src/tools/toolBatchReplay.ts"],"mappings":";;;;;;;;AAyBA,MAAa,wBAAwB;AACrC,MAAM,yBAAyB;AAC/B,MAAM,yBAAyB;AAmC/B,MAAM,aAAa,IAAI,YAAY,CAAC,CAAC;AAErC,SAAS,SAAS,OAAkD;CAClE,OAAO,SAAS,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAC3E;AAEA,SAAS,sBACP,OACA,cACQ;CACR,IAAI;CACJ,IAAI;EACF,WAAW,KAAK,MAAM,KAAK;CAC7B,QAAQ;EACN,OAAO;CACT;CACA,IAAI,CAAC,MAAM,QAAQ,QAAQ,KAAK,SAAS,WAAW,GAClD,OAAO;CAET,OAAO,KAAK,UAAU;EACpB,GAAG;EACH,OAAO,aAAa,YAAY,WAAW,aAAa,UAAU;EAClE,OAAO,aAAa,cAAc,WAAW,aAAa,YAAY;CACxE,CAAC;AACH;AAEA,SAAS,sBACP,OACA,cACkC;CAClC,IAAI,SAAS,MAAM,OAAO,KAAA;CAC1B,OAAO;EACL,GAAG;EACH,eACE,MAAM,iBAAiB,OACnB,KAAA,IACA,sBAAsB,MAAM,eAAe,YAAY;EAC7D,SAAS,MAA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AM,OAAO,OAAO;IACpB,OAAO,OAAO,OAAO;IACrB,QAAQ,OAAO,OAAO;GACxB,CAAC,IACC,OAAO;GACX,OAAO,CACL,MAAM,IACN;IACE,GAAG;IACH,UAAU,OAAO;IACjB;IACA,oBAAoB,OAAO;GAC7B,CACF;EACF,CACF;EACA,OAAO;GACL,OAAO,OAAO;GACd;GACA,WAAW,OAAO;GAClB,gBAAgB,OAAO;EACzB;CACF,CAAC,CACL;AACF"}
|
|
@@ -155,6 +155,26 @@ function extractErrorMessage(error) {
|
|
|
155
155
|
return String(error);
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
+
function hasProviderCancellation(error, depth) {
|
|
159
|
+
if (error == null || depth > MAX_CAUSE_DEPTH) return false;
|
|
160
|
+
const record = asRecord(error);
|
|
161
|
+
const message = record == null ? extractErrorMessage(error) : record.message;
|
|
162
|
+
const text = `${record?.name ?? ""} ${record?.code ?? ""} ${record?.type ?? ""} ${typeof message === "string" ? message : ""}`;
|
|
163
|
+
if (/^(?:AbortError|APIUserAbortError|CanceledError|CancelledError)$/.test(record?.name ?? "") || /^(?:ABORT_ERR|ERR_CANCELED)$/.test(String(record?.code ?? "")) || /\buser (?:aborted|cancelled|canceled)\b/i.test(text) || !/timed?[_ -]?out/i.test(text) && /\bAbortError\b|\b(?:request|operation) (?:was )?(?:aborted|cancelled|canceled)\b/i.test(text)) return true;
|
|
164
|
+
if (record == null) return false;
|
|
165
|
+
for (const nested of [
|
|
166
|
+
record.cause,
|
|
167
|
+
record.error,
|
|
168
|
+
record.body,
|
|
169
|
+
record.data,
|
|
170
|
+
record.response,
|
|
171
|
+
record.$metadata
|
|
172
|
+
]) if (hasProviderCancellation(nested, depth + 1)) return true;
|
|
173
|
+
return false;
|
|
174
|
+
}
|
|
175
|
+
function isProviderCancellation(error) {
|
|
176
|
+
return hasProviderCancellation(error, 0);
|
|
177
|
+
}
|
|
158
178
|
function getContextOverflowInfo(error, context) {
|
|
159
179
|
const provider = context?.provider;
|
|
160
180
|
const haystack = stripUrls(collectErrorText(error));
|
|
@@ -198,6 +218,6 @@ function isLikelyContextOverflowError(error, context) {
|
|
|
198
218
|
return CONTEXT_OVERFLOW_HINT_RE.test(haystack);
|
|
199
219
|
}
|
|
200
220
|
//#endregion
|
|
201
|
-
export { extractErrorMessage, getContextOverflowInfo, isContextOverflowError, isLikelyContextOverflowError };
|
|
221
|
+
export { extractErrorMessage, getContextOverflowInfo, isContextOverflowError, isLikelyContextOverflowError, isProviderCancellation };
|
|
202
222
|
|
|
203
223
|
//# sourceMappingURL=errors.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.mjs","names":[],"sources":["../../../src/utils/errors.ts"],"mappings":";;AA+EA,MAAM,yBAAyB;AAgB/B,MAAM,oBAAgD;CAEpD;EACE,MAAM;EACN,IAAI;EACJ,gBAAgB;EAChB,YAAY;EACZ,uBAAuB;CACzB;CAMA;EACE,MAAM;EACN,IAAI;EACJ,YAAY;EACZ,gBAAgB;EAChB,uBAAuB;CACzB;CAMA;EACE,MAAM;EACN,IAAI;EACJ,YAAY;EACZ,gBAAgB;CAClB;CAMA;EACE,MAAM;EACN,IAAI;EACJ,YAAY;EACZ,gBAAgB;CAClB;CAEA;EACE,MAAM;EACN,IAAI;EACJ,gBAAgB;EAChB,YAAY;EACZ,uBAAuB;CACzB;CAEA;EACE,MAAM;EACN,IAAI;EACJ,YAAY;CACd;CAKA;EACE,MAAM;EACN,IAAI;EACJ,YAAY;EACZ,gBAAgB;CAClB;CAEA;EACE,MAAM;EACN,IAAI;EACJ,YAAY;CACd;CAEA;EACE,MAAM;EACN,IAAI;CACN;CAEA;EACE,MAAM;EACN,IAAI;CACN;CAEA;EACE,MAAM;EACN,IAAI;CACN;CAEA;EACE,MAAM;EACN,IAAI;CACN;CAOA;EACE,MAAM;EACN,IAAI;EACJ,yBAAyB;CAC3B;AACF;AAYA,MAAM,qBACJ;AAMF,MAAM,kBACJ;AAOF,MAAM,iCACJ;AAO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;CAClD,IACE,aAAa,MACb,+BAA+B,KAAK,QAAQ,KAC5C,gBAAgB,KAAK,QAAQ,GAE7B,OAAO;CAET,IAAI,mBAAmB,KAAK,QAAQ,GAClC,OAAO;CAET,OAAO,yBAAyB,KAAK,QAAQ;AAC/C"}
|
package/dist/esm/utils/index.mjs
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
2
|
+
import { isZodSchemaV4 } from "@langchain/core/utils/types";
|
|
3
|
+
import { globalRegistry, registry, toJSONSchema } from "zod";
|
|
2
4
|
//#region src/utils/schema.ts
|
|
5
|
+
const schemaMetadata = registry();
|
|
6
|
+
schemaMetadata.get = (schema) => {
|
|
7
|
+
const annotated = schema;
|
|
8
|
+
return typeof annotated.meta === "function" ? annotated.meta() : globalRegistry.get(schema);
|
|
9
|
+
};
|
|
3
10
|
function isZodSchema(schema) {
|
|
4
11
|
return schema != null && typeof schema === "object" && "_def" in schema;
|
|
5
12
|
}
|
|
6
13
|
function toJsonSchema(schema, name, description) {
|
|
14
|
+
if (isZodSchemaV4(schema)) return {
|
|
15
|
+
...toJSONSchema(schema, {
|
|
16
|
+
target: "draft-7",
|
|
17
|
+
io: "input",
|
|
18
|
+
unrepresentable: "any",
|
|
19
|
+
metadata: schemaMetadata
|
|
20
|
+
}),
|
|
21
|
+
...name != null && name !== "" ? { title: name } : {},
|
|
22
|
+
...description != null && description !== "" ? { description } : {}
|
|
23
|
+
};
|
|
7
24
|
if (isZodSchema(schema)) return zodToJsonSchema(description != null && description !== "" ? schema.describe(description) : schema, name ?? "");
|
|
8
25
|
return schema;
|
|
9
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.mjs","names":["zodSchema"],"sources":["../../../src/utils/schema.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.mjs","names":["zodSchema"],"sources":["../../../src/utils/schema.ts"],"mappings":";;;;AAQA,MAAM,iBAAiB,SAAqB;AAC5C,eAAe,OAAO,WAAmC;CACvD,MAAM,YAAY;CAClB,OAAO,OAAO,UAAU,SAAS,aAC7B,UAAU,KAAK,IACf,eAAe,IAAI,MAAM;AAC/B;AAGA,SAAgB,YAAY,QAAuC;CACjE,OACE,UAAU,QAAQ,OAAO,WAAW,YAAY,UAAW;AAE/D;AAMA,SAAgB,aACd,QACA,MACA,aACyB;CACzB,IAAI,cAAc,MAAM,GACtB,OAAO;EACL,GAAG,aAAa,QAAoB;GAClC,QAAQ;GACR,IAAI;GACJ,iBAAiB;GACjB,UAAU;EACZ,CAAC;EACD,GAAI,QAAQ,QAAQ,SAAS,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;EACrD,GAAI,eAAe,QAAQ,gBAAgB,KAAK,EAAE,YAAY,IAAI,CAAC;CACrE;CAEF,IAAI,YAAY,MAAM,GAQpB,OAAO,gBAHL,eAAe,QAAQ,gBAAgB,KACnCA,OAAU,SAAS,WAAW,IAC9B,QAGJ,QAAQ,EACV;CAEF,OAAO;AACT"}
|
|
@@ -210,6 +210,8 @@ export declare class AgentContext {
|
|
|
210
210
|
* disturbing a `maxContextTokens` that no correction ever touched.
|
|
211
211
|
*/
|
|
212
212
|
private _preOverflowMaxContextTokens?;
|
|
213
|
+
private correctedContextBudgetMode?;
|
|
214
|
+
get summarizationBudgetMode(): t.ContextBudgetMode;
|
|
213
215
|
/**
|
|
214
216
|
* Prompt size, normalized into the local counter's uncalibrated units, at
|
|
215
217
|
* the last overflow correction. Keeping both measurements in the same units
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** Host context preparation and trusted subagent execution identity are supported. */
|
|
2
2
|
export declare const SUBAGENT_CONTEXT_VERSION = 1;
|
|
3
|
+
/** Foreground graph-subagent approval and durable resume support. */
|
|
4
|
+
export declare const GRAPH_SUBAGENT_HITL_VERSION = 1;
|
|
3
5
|
/**
|
|
4
6
|
* Anthropic direct API tool schema overhead multiplier.
|
|
5
7
|
* Empirically calibrated against real MCP tool sets (29 tools).
|
|
@@ -14,7 +14,7 @@ export interface ReviewedToolApproval {
|
|
|
14
14
|
request: ToolApprovalRequest;
|
|
15
15
|
reviewConfig: ToolApprovalReviewConfig;
|
|
16
16
|
}
|
|
17
|
-
/** Detach approval
|
|
17
|
+
/** Detach approval fields without deep-cloning checkpoint-owned metadata. */
|
|
18
18
|
export declare function cloneToolApprovalInterruptPayload<T>(payload: T): T;
|
|
19
19
|
/** Build trusted review evidence from the interrupt restored by `Run`. */
|
|
20
20
|
export declare function createToolApprovalReviewEvidence(interruptId: string | undefined, payload: unknown, owner?: string): ToolApprovalReviewEvidence | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `max_tokens` floor for current-generation Claude models
|
|
3
|
+
* (`claude-<family>-<N>`, N >= 4) when the caller sets none.
|
|
4
|
+
*
|
|
5
|
+
* Upstream's default table is keyed by model prefix and falls back to 4096 for
|
|
6
|
+
* any Claude name it does not list yet, which caps newer models (and thinking,
|
|
7
|
+
* which shares that budget) far below the 16384 it gives every other Claude 4+
|
|
8
|
+
* model. Raising the default further would trip the SDK's non-streaming guard,
|
|
9
|
+
* which rejects `max_tokens` above ~21K.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getCurrentClaudeDefaultMaxTokens(model: string | undefined): number | undefined;
|
package/dist/types/llm/init.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type * as t from '@/types';
|
|
|
3
3
|
type InitializeModelParams<P extends t.ProviderName> = {
|
|
4
4
|
provider: P;
|
|
5
5
|
tools?: t.GraphTools;
|
|
6
|
+
disableToolCalling?: boolean;
|
|
6
7
|
} & ({
|
|
7
8
|
override: t.ChatModelInstance;
|
|
8
9
|
clientOptions?: t.ProviderOptionsFor<P>;
|
|
@@ -21,5 +22,5 @@ type InitializeModelParams<P extends t.ProviderName> = {
|
|
|
21
22
|
* provider, applies provider-specific field assignments, and optionally binds
|
|
22
23
|
* tools.
|
|
23
24
|
*/
|
|
24
|
-
export declare function initializeModel<P extends t.ProviderName>({ provider, clientOptions, tools, override, }: InitializeModelParams<P>): Runnable;
|
|
25
|
+
export declare function initializeModel<P extends t.ProviderName>({ provider, clientOptions, tools, disableToolCalling, override, }: InitializeModelParams<P>): Runnable;
|
|
25
26
|
export {};
|
|
@@ -63,6 +63,8 @@ interface AttemptInvokeCommonParams {
|
|
|
63
63
|
context?: InvokeContext;
|
|
64
64
|
providerTextProtection?: ProviderTextProtection;
|
|
65
65
|
onChunk?: OnChunk;
|
|
66
|
+
/** Observes completed model output synchronously, before terminal validation. */
|
|
67
|
+
onModelComplete?: (message: BaseMessage) => void;
|
|
66
68
|
/**
|
|
67
69
|
* The agent lane this attempt belongs to, as the model node names it. Only
|
|
68
70
|
* read to record a discarded turn, which the node cannot otherwise detect —
|
|
@@ -132,9 +134,12 @@ export declare function getFallbackOverflowCandidates(error: unknown): FallbackO
|
|
|
132
134
|
* behind a later unrelated error would surface a dead end instead. Ordinary
|
|
133
135
|
* failures still throw last-error-wins.
|
|
134
136
|
*/
|
|
135
|
-
export declare function tryFallbackProviders({ fallbacks, tools, messages, config, primaryError, context, onChunk, streamLimitState, providerTextProtection, preemptAgentId, overflowContext, prepareProviderRequest: prepareFallbackRequest, prepareProviderMessages, }: {
|
|
137
|
+
export declare function tryFallbackProviders({ fallbacks, tools, disableToolCalling, messages, config, primaryError, context, onChunk, streamLimitState, providerTextProtection, preemptAgentId, overflowContext, prepareProviderRequest: prepareFallbackRequest, prepareProviderMessages, invokeModel, }: {
|
|
136
138
|
fallbacks: t.FallbackConfig[];
|
|
139
|
+
/** Allows callers to retry or validate a completed provider attempt. */
|
|
140
|
+
invokeModel?: typeof attemptInvoke;
|
|
137
141
|
tools?: t.GraphTools;
|
|
142
|
+
disableToolCalling?: boolean;
|
|
138
143
|
messages: BaseMessage[];
|
|
139
144
|
config?: RunnableConfig;
|
|
140
145
|
primaryError: unknown;
|
|
@@ -166,6 +171,7 @@ export declare function tryFallbackProviders({ fallbacks, tools, messages, confi
|
|
|
166
171
|
provider: t.ProviderName;
|
|
167
172
|
clientOptions?: t.ClientOptions;
|
|
168
173
|
maxContextTokens?: number;
|
|
174
|
+
contextBudgetMode?: t.ContextBudgetMode;
|
|
169
175
|
config?: RunnableConfig;
|
|
170
176
|
}) => PreparedProviderRequest | Promise<PreparedProviderRequest>;
|
|
171
177
|
/** @deprecated Return a `PreparedProviderRequest` instead. */
|
|
@@ -175,6 +181,7 @@ export declare function tryFallbackProviders({ fallbacks, tools, messages, confi
|
|
|
175
181
|
provider: t.ProviderName;
|
|
176
182
|
clientOptions?: t.ClientOptions;
|
|
177
183
|
maxContextTokens?: number;
|
|
184
|
+
contextBudgetMode?: t.ContextBudgetMode;
|
|
178
185
|
config?: RunnableConfig;
|
|
179
186
|
}) => BaseMessage[] | Promise<BaseMessage[]>;
|
|
180
187
|
}): Promise<Partial<t.BaseGraphState> | undefined>;
|
|
@@ -21,3 +21,15 @@ export declare function resolveClientOptionsModel(clientOptions: t.ClientOptions
|
|
|
21
21
|
* use `maxTokens`.
|
|
22
22
|
*/
|
|
23
23
|
export declare function getMaxOutputTokensKey(provider: t.ProviderName): 'maxOutputTokens' | 'maxTokens';
|
|
24
|
+
/**
|
|
25
|
+
* The completion allowance the provider will reserve, under whichever key its
|
|
26
|
+
* client uses. Providers count it against the same ceiling as the prompt, so
|
|
27
|
+
* overflow recovery has to reserve it when the error did not itemize the
|
|
28
|
+
* total. Anthropic clients spread `invocationKwargs` over `max_tokens`, so a
|
|
29
|
+
* `max_tokens` there is the value actually sent. Without an explicit value, the
|
|
30
|
+
* built-in Anthropic client still sends its model default, so that default is
|
|
31
|
+
* reserved instead. Host providers in the Anthropic family may wrap a client
|
|
32
|
+
* with a different default, so they keep reserving nothing they did not
|
|
33
|
+
* configure.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getConfiguredCompletionTokens(provider: t.ProviderName, clientOptions: t.ClientOptions | undefined): number | undefined;
|
|
@@ -25,7 +25,7 @@ export declare function cloneGenerationChunkPiece(chunk: ChatGenerationChunk, pi
|
|
|
25
25
|
* the assembled tool arguments.
|
|
26
26
|
*/
|
|
27
27
|
export declare function hasToolCallChunks(message: AIMessageChunk): boolean;
|
|
28
|
-
export declare function hasReasoningKwargs(message: AIMessageChunk): boolean;
|
|
28
|
+
export declare function hasReasoningKwargs(message: Pick<AIMessageChunk, 'additional_kwargs'>): boolean;
|
|
29
29
|
/**
|
|
30
30
|
* Extracts the visible reasoning text a kwargs-borne delta contributes, so
|
|
31
31
|
* reasoning-only chunks (Gemini thoughts, DeepSeek reasoning_content,
|
|
@@ -6,6 +6,8 @@ import type { ProviderName } from '@/types';
|
|
|
6
6
|
* Google uses `MAX_TOKENS`.
|
|
7
7
|
*/
|
|
8
8
|
export type TruncationStopReason = 'max_tokens' | 'length';
|
|
9
|
+
/** Normalizes native invoke and stream stop reasons without hiding conflicting fields. */
|
|
10
|
+
export declare function getProviderStopReasons(message: Pick<BaseMessage, 'response_metadata' | 'additional_kwargs'> | undefined | null): string[];
|
|
9
11
|
/**
|
|
10
12
|
* Reads the truncation stop reason off a message, covering every provider
|
|
11
13
|
* shape we stream:
|
|
@@ -5,3 +5,9 @@ export declare function isReasoningContentBlock(block: {
|
|
|
5
5
|
export declare function isAnthropicThinkingContentBlock(block: {
|
|
6
6
|
type?: unknown;
|
|
7
7
|
}): boolean;
|
|
8
|
+
/** Checks fulfilled provider payloads, not IDs, statuses or empty markers. */
|
|
9
|
+
export declare function hasMeaningfulReasoningPayload(value: unknown): boolean;
|
|
10
|
+
/** Reasoning role classification alone is not evidence of generated reasoning. */
|
|
11
|
+
export declare function hasMeaningfulReasoningContentBlock(block: {
|
|
12
|
+
type?: unknown;
|
|
13
|
+
}): boolean;
|
|
@@ -78,3 +78,5 @@ export declare function resolveIntraTurnRetainTokens({ tokens, maxContextTokens,
|
|
|
78
78
|
* existing logic.
|
|
79
79
|
*/
|
|
80
80
|
export declare function splitAtRecencyBoundary(messages: BaseMessage[], options?: RecencyWindowOptions): RecencySplit;
|
|
81
|
+
/** Safe suffix starts that keep the newest exchange and its source lineage. */
|
|
82
|
+
export declare function getPairingBalancedSuffixStarts(messages: BaseMessage[], provider?: ProviderName): number[];
|
package/dist/types/run.d.ts
CHANGED
|
@@ -185,6 +185,7 @@ export declare class Run<_T extends t.BaseGraphState> {
|
|
|
185
185
|
private getStreamLangfuseConfig;
|
|
186
186
|
private getStreamToolOutputTracingLangfuseConfig;
|
|
187
187
|
processStream(inputs: t.IState | Command, callerConfig: t.RunStreamConfig, streamOptions?: t.EventStreamOptions): Promise<MessageContentComplex[] | undefined>;
|
|
188
|
+
private getPendingInterruptState;
|
|
188
189
|
/**
|
|
189
190
|
* Returns the pending interrupt captured during the most recent
|
|
190
191
|
* `processStream` (or `resume`) invocation. `undefined` when the run
|
|
@@ -275,6 +276,8 @@ export declare class Run<_T extends t.BaseGraphState> {
|
|
|
275
276
|
* tool-node resume). Intended for custom, Command-routed graphs.
|
|
276
277
|
*/
|
|
277
278
|
resume<TResume = t.ToolApprovalDecision[] | t.ToolApprovalDecisionMap>(resumeValue: TResume, callerConfig: t.RunStreamConfig, streamOptions?: t.EventStreamOptions, commandOptions?: Pick<ConstructorParameters<typeof Command>[0], 'update' | 'goto'>): Promise<MessageContentComplex[] | undefined>;
|
|
279
|
+
private restoreRootReplayConfig;
|
|
280
|
+
private selectInterruptCheckpoint;
|
|
278
281
|
private resolveInterruptResumeConfig;
|
|
279
282
|
private restoreInterruptFromCheckpoint;
|
|
280
283
|
private createSystemCallback;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { BaseMessage } from '@langchain/core/messages';
|
|
2
|
+
import type { ProviderName, TokenCounter } from '@/types';
|
|
3
|
+
export declare const DEFAULT_SUMMARY_OUTPUT_TOKENS = 4096;
|
|
4
|
+
export declare const DEFAULT_RETAIN_RECENT_TOKENS = 16000;
|
|
5
|
+
export declare class SummarizationInputTooLargeError extends Error {
|
|
6
|
+
constructor();
|
|
7
|
+
}
|
|
8
|
+
/** Compresses tool output, then omits only the tail retained verbatim after compaction. */
|
|
9
|
+
export declare function boundSummarizationInput({ messages, tokenCounter, budget, requiredHeadLength, shrink, }: {
|
|
10
|
+
messages: BaseMessage[];
|
|
11
|
+
tokenCounter: TokenCounter;
|
|
12
|
+
budget: number;
|
|
13
|
+
provider: ProviderName;
|
|
14
|
+
requiredHeadLength?: number;
|
|
15
|
+
shrink?: boolean;
|
|
16
|
+
}): BaseMessage[];
|
|
@@ -49,7 +49,7 @@ export declare function createSummarizeNode({ agentContext, graph: adapterGraph,
|
|
|
49
49
|
manualSummary?: string;
|
|
50
50
|
}>;
|
|
51
51
|
/** Creates an `onChunk` callback that dispatches `ON_SUMMARIZE_DELTA` events for streaming. */
|
|
52
|
-
export declare function createSummarizationChunkHandler({ stepId, config, provider, reasoningKey, graph, }: {
|
|
52
|
+
export declare function createSummarizationChunkHandler({ stepId, config, provider, reasoningKey, graph, pendingDeltas, }: {
|
|
53
53
|
stepId?: string;
|
|
54
54
|
config?: RunnableConfig;
|
|
55
55
|
provider?: t.ProviderName;
|
|
@@ -57,6 +57,7 @@ export declare function createSummarizationChunkHandler({ stepId, config, provid
|
|
|
57
57
|
graph?: StreamLimitState & {
|
|
58
58
|
getBreakerController?: () => AbortController;
|
|
59
59
|
};
|
|
60
|
+
pendingDeltas?: t.SummarizeDeltaEvent[];
|
|
60
61
|
}): OnChunk | undefined;
|
|
61
62
|
export declare function applySummarizationHistoryCache(params: {
|
|
62
63
|
messages: BaseMessage[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SummarizationErrorCode } from '@/types/summarize';
|
|
2
|
+
import type * as t from '@/types';
|
|
3
|
+
/** Compaction owns retries; model/transport defaults must not multiply attempts. */
|
|
4
|
+
export declare function withSummarizationRetryOwner<T extends object>(provider: t.ProviderName, clientOptions: T): T & {
|
|
5
|
+
maxRetries: number;
|
|
6
|
+
};
|
|
7
|
+
export declare class ReasoningOnlySummaryError extends Error {
|
|
8
|
+
constructor();
|
|
9
|
+
}
|
|
10
|
+
export interface SummarizationRetryOptions {
|
|
11
|
+
signal?: AbortSignal;
|
|
12
|
+
/** Reports the upcoming attempt (2 or 3), without provider error text. */
|
|
13
|
+
onRetry?: (retry: {
|
|
14
|
+
attempt: number;
|
|
15
|
+
errorCode: SummarizationErrorCode;
|
|
16
|
+
delayMs?: number;
|
|
17
|
+
}) => void;
|
|
18
|
+
}
|
|
19
|
+
/** Maps provider failures to safe event metadata, never provider text. */
|
|
20
|
+
export declare function classifySummarizationError(error: unknown): SummarizationErrorCode;
|
|
21
|
+
/** Runs at most three attempts. Pass the same signal to the provider callback. */
|
|
22
|
+
export declare function withSummarizationRetry<T>(operation: () => Promise<T>, { signal, onRetry }?: SummarizationRetryOptions): Promise<T>;
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function buildSummaryCarrierText(summaryText: string): string;
|
|
17
17
|
/** Structured checkpoint prompt for fresh summarization (no prior summary). */
|
|
18
|
-
export declare const DEFAULT_SUMMARIZATION_PROMPT = "Hold on, before you continue I need you to write me a checkpoint of everything so far. Your context window is filling up and this checkpoint replaces the messages above, so capture everything you need to pick right back up.\n\nDon't second-guess or fact-check anything you did, your tool results reflect exactly what happened. If a tool result appears truncated, that's just a display artifact from context management: the tool executed fully. Just record what you did and what you observed. Only the checkpoint, don't respond to me or continue the conversation.\n\n## Checkpoint\n\n## Goal\nWhat I asked you to do and any sub-goals you identified.\n\n## Constraints & Preferences\nAny rules, preferences, or configuration I established.\n\n## Progress\n### Done\n- What you completed and the outcomes\n\n### In Progress\n- What you're currently working on\n\n## Key Decisions\nDecisions you made and why.\n\n## Next Steps\nConcrete task actions remaining, in priority order.\n\n## Critical Context\nExact identifiers, names, error messages, URLs, and details you need to preserve verbatim.\n\nRules:\n- Record what you did and observed, don't judge or re-evaluate it\n- For each tool call: the tool name, key inputs, and the outcome\n- Preserve exact identifiers, names, errors, and references verbatim\n- Short declarative sentences\n- Skip empty sections";
|
|
18
|
+
export declare const DEFAULT_SUMMARIZATION_PROMPT = "Hold on, before you continue I need you to write me a checkpoint of everything so far. Your context window is filling up and this checkpoint replaces the messages above, so capture everything you need to pick right back up.\n\nDo not call tools, perform calculations, or continue the task. Summarize only the existing transcript.\n\nDon't second-guess or fact-check anything you did, your tool results reflect exactly what happened. If a tool result appears truncated, that's just a display artifact from context management: the tool executed fully. Just record what you did and what you observed. Only the checkpoint, don't respond to me or continue the conversation.\n\n## Checkpoint\n\n## Goal\nWhat I asked you to do and any sub-goals you identified.\n\n## Constraints & Preferences\nAny rules, preferences, or configuration I established.\n\n## Progress\n### Done\n- What you completed and the outcomes\n\n### In Progress\n- What you're currently working on\n\n## Key Decisions\nDecisions you made and why.\n\n## Next Steps\nConcrete task actions remaining, in priority order.\n\n## Critical Context\nExact identifiers, names, error messages, URLs, and details you need to preserve verbatim.\n\nRules:\n- Record what you did and observed, don't judge or re-evaluate it\n- For each tool call: the tool name, key inputs, and the outcome\n- Preserve exact identifiers, names, errors, and references verbatim\n- Short declarative sentences\n- Skip empty sections";
|
|
19
19
|
/** Prompt for re-compaction when a prior summary exists. */
|
|
20
|
-
export declare const DEFAULT_UPDATE_SUMMARIZATION_PROMPT = "Hold on again, update your checkpoint. Merge the new messages into your existing checkpoint and give me a single consolidated replacement.\n\nKeep it roughly the same length as your last checkpoint. Compress older details to make room for what's new, don't just append. Give recent actions more detail, compress older items to one-liners.\n\nDon't fact-check or second-guess anything, your tool results are ground truth. If a tool result appears truncated, that's just a display artifact: the tool executed fully. Only the checkpoint, don't respond to me or continue the conversation.\n\nRules:\n- Merge new progress into existing sections, don't duplicate headers\n- Compress older completed items into one-line entries\n- Move items from \"In Progress\" to \"Done\" when you completed them\n- Update \"Next Steps\" to reflect current task priorities.\n- For each new tool call: the tool name, key inputs, and the outcome\n- Preserve exact identifiers, names, errors, and references verbatim\n- Skip empty sections";
|
|
20
|
+
export declare const DEFAULT_UPDATE_SUMMARIZATION_PROMPT = "Hold on again, update your checkpoint. Merge the new messages into your existing checkpoint and give me a single consolidated replacement.\n\nDo not call tools, perform calculations, or continue the task. Summarize only the existing transcript.\n\nKeep it roughly the same length as your last checkpoint. Compress older details to make room for what's new, don't just append. Give recent actions more detail, compress older items to one-liners.\n\nDon't fact-check or second-guess anything, your tool results are ground truth. If a tool result appears truncated, that's just a display artifact: the tool executed fully. Only the checkpoint, don't respond to me or continue the conversation.\n\nRules:\n- Merge new progress into existing sections, don't duplicate headers\n- Compress older completed items into one-line entries\n- Move items from \"In Progress\" to \"Done\" when you completed them\n- Update \"Next Steps\" to reflect current task priorities.\n- For each new tool call: the tool name, key inputs, and the outcome\n- Preserve exact identifiers, names, errors, and references verbatim\n- Skip empty sections";
|
|
21
21
|
export declare function separateSummarizationParameters(parameters: Record<string, unknown>): {
|
|
22
22
|
llmParams: Record<string, unknown>;
|
|
23
23
|
maxSummaryTokens?: number;
|
|
24
24
|
};
|
|
25
|
-
export declare function buildSummarizationInstruction(promptText: string, updatePromptText: string | undefined, priorSummaryText?: string, semanticIndexAppendix?: string): string;
|
|
25
|
+
export declare function buildSummarizationInstruction(promptText: string, updatePromptText: string | undefined, priorSummaryText?: string, semanticIndexAppendix?: string, priorSummaryInPrefix?: boolean): string;
|
|
26
26
|
/** Why a summarize-only run could not attempt its summary. */
|
|
27
27
|
export type ManualSummarizationSkipReason = 'disabled' | 'exhausted' | 'instructions_exceed_budget' | 'nothing_to_summarize';
|
|
28
28
|
/**
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { GraphTools, ProviderName, ClientOptions, TokenCounter } from '@/types';
|
|
2
|
+
/** Counts only the resolved bound inventory, using the serving model's counter. */
|
|
3
|
+
export declare function countSummarizationToolTokens({ tools, provider, clientOptions, count, }: {
|
|
4
|
+
tools?: GraphTools;
|
|
5
|
+
provider: ProviderName;
|
|
6
|
+
clientOptions?: ClientOptions;
|
|
7
|
+
count: TokenCounter;
|
|
8
|
+
}): number;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UsageMetadata, BaseMessage } from '@langchain/core/messages';
|
|
2
|
+
import type { SummarizationAttemptUsage } from '@/types/summarize';
|
|
3
|
+
export declare function readSummarizationUsage(response: BaseMessage | undefined): Partial<UsageMetadata> | undefined;
|
|
4
|
+
export declare function buildSummarizationStepUsage(attempts: readonly SummarizationAttemptUsage[]): {
|
|
5
|
+
prompt_tokens: number;
|
|
6
|
+
completion_tokens: number;
|
|
7
|
+
total_tokens: number;
|
|
8
|
+
attemptUsage?: readonly SummarizationAttemptUsage[];
|
|
9
|
+
} | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ToolCall, ToolMessage } from '@langchain/core/messages/tool';
|
|
2
2
|
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
3
|
-
import type { FadingTier, FadingTiers, RunStepResumeState, ToolSessionContext } from '@/types';
|
|
3
|
+
import type { FadingTier, FadingTiers, RunStepResumeState, RunInterruptResult, ToolSessionContext } from '@/types';
|
|
4
4
|
import type { ToolOutputReferenceState } from '@/tools/toolOutputReferences';
|
|
5
5
|
import type { ToolApprovalReplaySnapshot } from '@/hooks';
|
|
6
6
|
export declare const SUBAGENT_RESUME_MANIFEST_CONFIG_KEY = "__librechat_subagent_resume_manifest";
|
|
@@ -62,6 +62,8 @@ export interface SubagentResumeExecution {
|
|
|
62
62
|
checkpoints: SubagentCheckpointReference[];
|
|
63
63
|
graphState: SubagentGraphResumeState;
|
|
64
64
|
approvalReplays: ToolApprovalReplaySnapshot[];
|
|
65
|
+
pendingInterruptIds?: string[];
|
|
66
|
+
pendingInterrupts?: Array<Pick<RunInterruptResult<unknown>, 'interruptId' | 'payload'>>;
|
|
65
67
|
descendant?: SubagentResumeManifest;
|
|
66
68
|
}
|
|
67
69
|
/** Private checkpoint payload linking a parent pause to every child state. */
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Command } from '@langchain/langgraph';
|
|
2
|
-
import type { BaseMessage } from '@langchain/core/messages';
|
|
3
2
|
import type { RunnableConfig } from '@langchain/core/runnables';
|
|
3
|
+
import type { BaseMessage } from '@langchain/core/messages';
|
|
4
|
+
import type { Interrupt } from '@langchain/langgraph';
|
|
4
5
|
import type { SubagentToolNodeResumeState } from '@/tools/subagent/SubagentReplay';
|
|
5
6
|
import type { ToolOutputReferenceState } from '@/tools/toolOutputReferences';
|
|
7
|
+
import type { ToolApprovalReviewEvidence } from '@/hitl/approvalReview';
|
|
6
8
|
export declare const TOOL_BATCH_REPLAY_KEY = "__librechat_tool_batch_replay";
|
|
9
|
+
export declare const TOOL_REPLAY_CONFIGS_KEY = "__librechat_tool_replay_configs";
|
|
10
|
+
export declare const TOOL_PENDING_APPROVAL_KEY = "__librechat_tool_pending_approval";
|
|
7
11
|
export interface SettledToolBatchResult {
|
|
8
12
|
proposal: {
|
|
9
13
|
name: string;
|
|
@@ -35,8 +39,17 @@ interface ToolBatchReplayState {
|
|
|
35
39
|
records: ToolBatchReplayRecord[];
|
|
36
40
|
wrappedPayload?: boolean;
|
|
37
41
|
}
|
|
42
|
+
interface CheckpointPendingApproval extends ToolApprovalReviewEvidence {
|
|
43
|
+
value: Interrupt['value'];
|
|
44
|
+
}
|
|
45
|
+
export declare function getCheckpointPendingApproval(config: RunnableConfig): CheckpointPendingApproval | undefined;
|
|
38
46
|
/** The only host-to-runtime entry point for checkpoint-owned tool replay state. */
|
|
39
47
|
export declare function restoreToolReplayConfig(configurable: Record<string, unknown>, interruptId: string | undefined, payload: unknown): void;
|
|
48
|
+
/** Restore each checkpointed interrupt without sharing member authorization. */
|
|
49
|
+
export declare function restoreToolReplayConfigs(configurable: NonNullable<RunnableConfig['configurable']>, interrupts: readonly Interrupt[], sourceScope: string, destinationScope: string, destinationThreadId: string, resumedInterruptIds: ReadonlySet<string>): void;
|
|
50
|
+
export declare function matchesToolReplayBatch(saved: string, current: string | undefined, messageId?: string): boolean;
|
|
51
|
+
/** Select a member's evidence before the unchanged owner/proposal safeguards. */
|
|
52
|
+
export declare function getToolReplayConfig(config: RunnableConfig, owner: string, batch?: string, messageId?: string): RunnableConfig;
|
|
40
53
|
/**
|
|
41
54
|
* Resume maps identify the checkpointed interrupt, while the task scratchpad
|
|
42
55
|
* identifies the node that can consume it. Config survives into later graph
|
|
@@ -527,7 +527,8 @@ export interface SingleAgentSubagentConfig extends SubagentConfig {
|
|
|
527
527
|
}
|
|
528
528
|
export interface GraphSubagentConfig extends SubagentConfigBase {
|
|
529
529
|
kind: 'graph';
|
|
530
|
-
|
|
530
|
+
/** Host revision for executable implementations. Required for HITL executable tools, functional prompts, and opaque member options. */
|
|
531
|
+
configId?: string;
|
|
531
532
|
resolveAgentInputs?: never;
|
|
532
533
|
hostArgs?: never;
|
|
533
534
|
allowNested?: false;
|
|
@@ -411,4 +411,6 @@ export interface RunInterruptResult<TPayload = HumanInterruptPayload> {
|
|
|
411
411
|
checkpointNs?: string;
|
|
412
412
|
/** Structured payload describing what needs human input. */
|
|
413
413
|
payload: TPayload;
|
|
414
|
+
/** All pending proposals keyed by the interrupt IDs accepted by `Run.resume()`. */
|
|
415
|
+
pendingInterrupts?: Array<Pick<RunInterruptResult<TPayload>, 'interruptId' | 'payload'>>;
|
|
414
416
|
}
|
|
@@ -162,9 +162,12 @@ export type ProviderClientOptionsConfig = {
|
|
|
162
162
|
provider: RuntimeProviderName;
|
|
163
163
|
clientOptions: ClientOptions;
|
|
164
164
|
};
|
|
165
|
+
export type ContextBudgetMode = 'input' | 'window';
|
|
165
166
|
export type FallbackConfig = ProviderClientOptionsConfig & {
|
|
166
167
|
/** Context window used to corroborate ambiguous fallback overflow errors. */
|
|
167
168
|
maxContextTokens?: number;
|
|
169
|
+
/** Applies to an explicit maxContextTokens; inherited ceilings retain their source units. */
|
|
170
|
+
contextBudgetMode?: ContextBudgetMode;
|
|
168
171
|
};
|
|
169
172
|
type LLMConfigFor<P extends CustomProviderName> = SharedLLMConfig<P> & CustomProviderOptionsMap[P] & {
|
|
170
173
|
/** Optional provider fallbacks in order of attempt */
|
|
@@ -11,7 +11,7 @@ import type * as s from '@/types/stream';
|
|
|
11
11
|
import type * as e from '@/common/enum';
|
|
12
12
|
import type * as g from '@/types/graph';
|
|
13
13
|
import type * as l from '@/types/llm';
|
|
14
|
-
export type ZodObjectAny = z.ZodObject
|
|
14
|
+
export type ZodObjectAny = z.ZodObject;
|
|
15
15
|
export type BaseGraphConfig = {
|
|
16
16
|
llmConfig: l.LLMConfig;
|
|
17
17
|
provider?: l.ProviderName;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { UsageMetadata, BaseMessage } from '@langchain/core/messages';
|
|
2
|
+
import type { ProviderName, ContextBudgetMode } from '@/types/llm';
|
|
1
3
|
import type { SummaryContentBlock } from '@/types/stream';
|
|
2
|
-
import type { ProviderName } from '@/types/llm';
|
|
3
4
|
export type SummarizationTrigger = {
|
|
4
5
|
type: 'token_ratio' | 'remaining_tokens' | 'messages_to_refine' | (string & {});
|
|
5
6
|
value: number;
|
|
@@ -76,6 +77,8 @@ export type SummarizationConfig = {
|
|
|
76
77
|
updatePrompt?: string;
|
|
77
78
|
trigger?: SummarizationTrigger;
|
|
78
79
|
maxSummaryTokens?: number;
|
|
80
|
+
/** maxContextTokens is an input ceiling by default; use window for a full model window. */
|
|
81
|
+
contextBudgetMode?: ContextBudgetMode;
|
|
79
82
|
/** Fraction of the token budget reserved as headroom (0–1). Defaults to 0.05. */
|
|
80
83
|
reserveRatio?: number;
|
|
81
84
|
/**
|
|
@@ -95,6 +98,8 @@ export interface SummarizeResult {
|
|
|
95
98
|
export interface SummarizationNodeInput {
|
|
96
99
|
remainingContextTokens: number;
|
|
97
100
|
agentId: string;
|
|
101
|
+
/** Pruned, masked provider history from the turn requesting compaction. */
|
|
102
|
+
windowMessages?: BaseMessage[];
|
|
98
103
|
/**
|
|
99
104
|
* Why the detour was requested.
|
|
100
105
|
*
|
|
@@ -105,8 +110,7 @@ export interface SummarizationNodeInput {
|
|
|
105
110
|
* variant performs no model call — the corrected budget alone is what the
|
|
106
111
|
* retry needs.
|
|
107
112
|
* - `manual`: the host asked for a summary outright (a summarize-only run).
|
|
108
|
-
*
|
|
109
|
-
* `retainRecent` explicitly, so the summary replaces the whole history.
|
|
113
|
+
* Uses the same bounded recent-tail policy as automatic compaction.
|
|
110
114
|
*/
|
|
111
115
|
reason?: 'trigger' | 'overflow' | 'manual';
|
|
112
116
|
/**
|
|
@@ -139,10 +143,18 @@ export interface SummarizeDeltaEvent {
|
|
|
139
143
|
summary: SummaryContentBlock;
|
|
140
144
|
};
|
|
141
145
|
}
|
|
146
|
+
export type SummarizationErrorCode = 'provider_overloaded' | 'rate_limited' | 'context_exceeded' | 'timeout' | 'unknown';
|
|
147
|
+
export interface SummarizationAttemptUsage {
|
|
148
|
+
provider: ProviderName;
|
|
149
|
+
model?: string;
|
|
150
|
+
usage: Partial<UsageMetadata>;
|
|
151
|
+
}
|
|
142
152
|
export interface SummarizeCompleteEvent {
|
|
143
153
|
id: string;
|
|
144
154
|
agentId: string;
|
|
145
155
|
summary?: SummaryContentBlock;
|
|
146
156
|
error?: string;
|
|
157
|
+
errorCode?: SummarizationErrorCode;
|
|
158
|
+
attemptUsage?: readonly SummarizationAttemptUsage[];
|
|
147
159
|
}
|
|
148
160
|
export {};
|
|
@@ -46,6 +46,8 @@ export interface ContextOverflowContext {
|
|
|
46
46
|
* Extracts a human-readable error message from an unknown error value.
|
|
47
47
|
*/
|
|
48
48
|
export declare function extractErrorMessage(error: unknown): string;
|
|
49
|
+
/** Recognizes cancellation names, codes, and messages in bounded error chains. */
|
|
50
|
+
export declare function isProviderCancellation(error: unknown): boolean;
|
|
49
51
|
/**
|
|
50
52
|
* Classifies a provider error as a recoverable context overflow, returning
|
|
51
53
|
* whatever the provider disclosed about the limit and the request size.
|