@librechat/agents 4.2.2 → 4.2.3
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/stream.cjs +1 -0
- package/dist/cjs/stream.cjs.map +1 -1
- package/dist/cjs/summarization/node.cjs +72 -47
- package/dist/cjs/summarization/node.cjs.map +1 -1
- package/dist/esm/stream.mjs +1 -0
- package/dist/esm/stream.mjs.map +1 -1
- package/dist/esm/summarization/node.mjs +73 -49
- package/dist/esm/summarization/node.mjs.map +1 -1
- package/dist/types/summarization/node.d.ts +21 -3
- package/dist/types/types/stream.d.ts +2 -0
- package/dist/types/types/summarize.d.ts +8 -0
- package/package.json +6 -5
- package/src/stream.ts +22 -8
- package/src/summarization/node.ts +508 -238
- package/src/types/stream.ts +2 -0
- package/src/types/summarize.ts +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@librechat/agents",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.3",
|
|
4
4
|
"reova": {
|
|
5
5
|
"enabled": true,
|
|
6
6
|
"endpoint": "https://telemetry.reo.dev/data"
|
|
@@ -316,11 +316,12 @@
|
|
|
316
316
|
"ajv": "6.14.0",
|
|
317
317
|
"@opentelemetry/core": "^2.9.0",
|
|
318
318
|
"js-yaml": "^4.3.1",
|
|
319
|
-
"
|
|
319
|
+
"glob": "^14.0.6",
|
|
320
|
+
"minimatch": "^11.0.8",
|
|
320
321
|
"test-exclude": "^8.0.0",
|
|
321
322
|
"follow-redirects": "^1.16.2",
|
|
322
323
|
"ip-address": "^10.7.5",
|
|
323
|
-
"node-forge": "^1.4.
|
|
324
|
+
"node-forge": "^1.4.3",
|
|
324
325
|
"undici": "^7.30.1"
|
|
325
326
|
},
|
|
326
327
|
"dependencies": {
|
|
@@ -382,9 +383,9 @@
|
|
|
382
383
|
"@types/yargs-parser": "^21.0.3",
|
|
383
384
|
"@typescript-eslint/eslint-plugin": "^8.65.0",
|
|
384
385
|
"@typescript-eslint/parser": "^8.65.0",
|
|
385
|
-
"eslint": "^10.
|
|
386
|
+
"eslint": "^10.15.0",
|
|
386
387
|
"eslint-import-resolver-typescript": "^4.4.5",
|
|
387
|
-
"eslint-plugin-import-x": "^4.
|
|
388
|
+
"eslint-plugin-import-x": "^4.18.1",
|
|
388
389
|
"globals": "^17.8.0",
|
|
389
390
|
"husky": "^9.1.7",
|
|
390
391
|
"jest": "^30.2.0",
|
package/src/stream.ts
CHANGED
|
@@ -55,7 +55,10 @@ import {
|
|
|
55
55
|
calculateMaxToolResultChars,
|
|
56
56
|
truncateToolResultContent,
|
|
57
57
|
} from '@/utils/truncation';
|
|
58
|
-
import {
|
|
58
|
+
import {
|
|
59
|
+
createToolCallsDispatchedEvent,
|
|
60
|
+
safeDispatchCustomEvent,
|
|
61
|
+
} from '@/utils/events';
|
|
59
62
|
import { resolveToolOutcome, outcomeFieldsFromResult } from '@/tools/intentArg';
|
|
60
63
|
import { snapshotValidatedModelChunk } from '@/graphs/acceptedModelResponse';
|
|
61
64
|
import { ProviderTextProtectionError } from '@/protection/providerText';
|
|
@@ -1366,7 +1369,8 @@ function startPreparedSubagents(
|
|
|
1366
1369
|
if ((graph.clientDelegatedToolNames?.size ?? 0) > 0) return;
|
|
1367
1370
|
// A parsed string call is not executable even if the same event carries
|
|
1368
1371
|
// sealed raw fragments. Wait for a separately validated complete call.
|
|
1369
|
-
if (chunk.tool_calls?.some((call) => typeof call.args === 'string') === true)
|
|
1372
|
+
if (chunk.tool_calls?.some((call) => typeof call.args === 'string') === true)
|
|
1373
|
+
return;
|
|
1370
1374
|
if (
|
|
1371
1375
|
(graph as Partial<StandardGraph>).canPrestartSubagents?.(agentContext) !==
|
|
1372
1376
|
true ||
|
|
@@ -1688,7 +1692,11 @@ export class ChatModelStreamHandler implements t.EventHandler {
|
|
|
1688
1692
|
graph.breakerAbort instanceof AbortController
|
|
1689
1693
|
? graph.breakerAbort
|
|
1690
1694
|
: undefined;
|
|
1691
|
-
const entrySignals = [
|
|
1695
|
+
const entrySignals = [
|
|
1696
|
+
eventBreaker?.signal,
|
|
1697
|
+
graph.signal,
|
|
1698
|
+
graph.config.signal,
|
|
1699
|
+
];
|
|
1692
1700
|
/** Immutable scope captured at handler entry. A reset while this
|
|
1693
1701
|
* handler is suspended in an await replaces the object, so ONE
|
|
1694
1702
|
* reference comparison proves the event still belongs to the live run
|
|
@@ -1698,10 +1706,12 @@ export class ChatModelStreamHandler implements t.EventHandler {
|
|
|
1698
1706
|
entryRunScope != null && graph.runScope !== entryRunScope;
|
|
1699
1707
|
const throwIfRunBreakerTripped = (): void => {
|
|
1700
1708
|
for (const signal of entrySignals) {
|
|
1701
|
-
if (
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1709
|
+
if (
|
|
1710
|
+
signal?.aborted === true &&
|
|
1711
|
+
(signal.reason instanceof StreamLimitExceededError ||
|
|
1712
|
+
signal.reason instanceof PreparedSubagentError ||
|
|
1713
|
+
signal.reason instanceof ProviderTextProtectionError)
|
|
1714
|
+
) {
|
|
1705
1715
|
throw signal.reason;
|
|
1706
1716
|
}
|
|
1707
1717
|
if (signal?.aborted === true && graph.providerTextProtection != null) {
|
|
@@ -1924,7 +1934,8 @@ export class ChatModelStreamHandler implements t.EventHandler {
|
|
|
1924
1934
|
chunk.response_metadata as Record<string, unknown> | undefined
|
|
1925
1935
|
);
|
|
1926
1936
|
const canStreamEager =
|
|
1927
|
-
chunk.tool_calls?.some((call) => typeof call.args === 'string') !==
|
|
1937
|
+
chunk.tool_calls?.some((call) => typeof call.args === 'string') !==
|
|
1938
|
+
true &&
|
|
1928
1939
|
(allowSequentialSeal || hasExplicitStreamedToolCallSeals(chunk)) &&
|
|
1929
1940
|
!hasPotentialDirectToolInStreamContext({ graph, agentContext }) &&
|
|
1930
1941
|
isEagerToolExecutionEnabledForBatch({ graph, metadata, agentContext });
|
|
@@ -2671,6 +2682,9 @@ export function createContentAggregator(): t.ContentAggregatorResult {
|
|
|
2671
2682
|
console.warn('No run step found for summarize delta event');
|
|
2672
2683
|
return;
|
|
2673
2684
|
}
|
|
2685
|
+
if (deltaData.reset === true) {
|
|
2686
|
+
contentParts[runStep.index] = { type: ContentTypes.SUMMARY };
|
|
2687
|
+
}
|
|
2674
2688
|
updateContent(runStep.index, deltaData.delta.summary);
|
|
2675
2689
|
return;
|
|
2676
2690
|
}
|