@librechat/agents 3.8.5 → 3.8.7
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 +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 +18 -9
- package/dist/cjs/graphs/Graph.cjs.map +1 -1
- package/dist/cjs/hitl/approvalReview.cjs +1 -1
- package/dist/cjs/hooks/types.cjs.map +1 -1
- package/dist/cjs/main.cjs +8 -6
- package/dist/cjs/messages/index.cjs +1 -1
- package/dist/cjs/messages/prune.cjs +1 -1
- package/dist/cjs/run.cjs +7 -3
- package/dist/cjs/run.cjs.map +1 -1
- package/dist/cjs/stream.cjs +13 -3
- package/dist/cjs/stream.cjs.map +1 -1
- package/dist/cjs/summarization/node.cjs +3 -1
- package/dist/cjs/summarization/node.cjs.map +1 -1
- package/dist/cjs/tools/BashExecutor.cjs +79 -27
- package/dist/cjs/tools/BashExecutor.cjs.map +1 -1
- package/dist/cjs/tools/BashProgrammaticToolCalling.cjs +47 -7
- package/dist/cjs/tools/BashProgrammaticToolCalling.cjs.map +1 -1
- package/dist/cjs/tools/CodeExecutor.cjs +5 -2
- package/dist/cjs/tools/CodeExecutor.cjs.map +1 -1
- package/dist/cjs/tools/CodeSessionFileSummary.cjs +11 -1
- package/dist/cjs/tools/CodeSessionFileSummary.cjs.map +1 -1
- package/dist/cjs/tools/ProgrammaticToolCalling.cjs +54 -8
- package/dist/cjs/tools/ProgrammaticToolCalling.cjs.map +1 -1
- package/dist/cjs/tools/ToolNode.cjs +176 -43
- package/dist/cjs/tools/ToolNode.cjs.map +1 -1
- package/dist/cjs/tools/local/LocalProgrammaticToolCalling.cjs +1 -0
- package/dist/cjs/tools/local/LocalProgrammaticToolCalling.cjs.map +1 -1
- package/dist/cjs/tools/subagent/SubagentExecutionRegistry.cjs +0 -1
- package/dist/cjs/tools/subagent/SubagentExecutionRegistry.cjs.map +1 -1
- package/dist/cjs/tools/subagent/SubagentExecutor.cjs +120 -26
- package/dist/cjs/tools/subagent/SubagentExecutor.cjs.map +1 -1
- package/dist/cjs/tools/toolBatchReplay.cjs +4 -2
- package/dist/cjs/tools/toolBatchReplay.cjs.map +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/esm/agents/AgentContext.mjs +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 +17 -8
- package/dist/esm/graphs/Graph.mjs.map +1 -1
- package/dist/esm/hitl/approvalReview.mjs +1 -1
- package/dist/esm/hooks/types.mjs.map +1 -1
- package/dist/esm/main.mjs +7 -7
- package/dist/esm/messages/index.mjs +1 -1
- package/dist/esm/messages/prune.mjs +1 -1
- package/dist/esm/run.mjs +7 -3
- package/dist/esm/run.mjs.map +1 -1
- package/dist/esm/stream.mjs +13 -3
- package/dist/esm/stream.mjs.map +1 -1
- package/dist/esm/summarization/node.mjs +3 -1
- package/dist/esm/summarization/node.mjs.map +1 -1
- package/dist/esm/tools/BashExecutor.mjs +81 -29
- package/dist/esm/tools/BashExecutor.mjs.map +1 -1
- package/dist/esm/tools/BashProgrammaticToolCalling.mjs +48 -9
- package/dist/esm/tools/BashProgrammaticToolCalling.mjs.map +1 -1
- package/dist/esm/tools/CodeExecutor.mjs +5 -2
- package/dist/esm/tools/CodeExecutor.mjs.map +1 -1
- package/dist/esm/tools/CodeSessionFileSummary.mjs +11 -2
- package/dist/esm/tools/CodeSessionFileSummary.mjs.map +1 -1
- package/dist/esm/tools/ProgrammaticToolCalling.mjs +55 -9
- package/dist/esm/tools/ProgrammaticToolCalling.mjs.map +1 -1
- package/dist/esm/tools/ToolNode.mjs +176 -43
- package/dist/esm/tools/ToolNode.mjs.map +1 -1
- package/dist/esm/tools/local/LocalProgrammaticToolCalling.mjs +1 -0
- package/dist/esm/tools/local/LocalProgrammaticToolCalling.mjs.map +1 -1
- package/dist/esm/tools/subagent/SubagentExecutionRegistry.mjs +0 -1
- package/dist/esm/tools/subagent/SubagentExecutionRegistry.mjs.map +1 -1
- package/dist/esm/tools/subagent/SubagentExecutor.mjs +120 -26
- package/dist/esm/tools/subagent/SubagentExecutor.mjs.map +1 -1
- package/dist/esm/tools/toolBatchReplay.mjs +4 -2
- package/dist/esm/tools/toolBatchReplay.mjs.map +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/types/common/constants.d.ts +2 -0
- package/dist/types/graphs/Graph.d.ts +3 -2
- package/dist/types/hooks/types.d.ts +3 -0
- package/dist/types/run.d.ts +1 -0
- package/dist/types/summarization/node.d.ts +1 -0
- package/dist/types/tools/BashExecutor.d.ts +2 -0
- package/dist/types/tools/BashProgrammaticToolCalling.d.ts +1 -0
- package/dist/types/tools/CodeExecutor.d.ts +1 -1
- package/dist/types/tools/CodeSessionFileSummary.d.ts +3 -0
- package/dist/types/tools/ProgrammaticToolCalling.d.ts +2 -2
- package/dist/types/tools/ToolNode.d.ts +6 -2
- package/dist/types/tools/subagent/SubagentExecutor.d.ts +7 -4
- package/dist/types/tools/toolBatchReplay.d.ts +2 -0
- package/dist/types/types/graph.d.ts +28 -0
- package/dist/types/types/run.d.ts +2 -0
- package/dist/types/types/tools.d.ts +27 -3
- package/package.json +2 -2
- package/src/common/constants.ts +3 -0
- package/src/graphs/Graph.ts +32 -18
- package/src/hooks/types.ts +3 -0
- package/src/run.ts +30 -15
- package/src/stream.ts +27 -5
- package/src/summarization/node.ts +3 -0
- package/src/tools/BashExecutor.ts +143 -40
- package/src/tools/BashProgrammaticToolCalling.ts +82 -10
- package/src/tools/CodeExecutor.ts +12 -2
- package/src/tools/CodeSessionFileSummary.ts +25 -1
- package/src/tools/ProgrammaticToolCalling.ts +77 -6
- package/src/tools/ToolNode.ts +665 -170
- package/src/tools/local/LocalProgrammaticToolCalling.ts +1 -0
- package/src/tools/subagent/SubagentExecutionRegistry.ts +0 -1
- package/src/tools/subagent/SubagentExecutor.ts +214 -55
- package/src/tools/toolBatchReplay.ts +23 -1
- package/src/types/graph.ts +37 -0
- package/src/types/run.ts +2 -0
- package/src/types/tools.ts +30 -3
- package/src/utils/llmConfig.ts +0 -1
package/src/types/tools.ts
CHANGED
|
@@ -11,10 +11,10 @@ import type {
|
|
|
11
11
|
ToolErrorData,
|
|
12
12
|
} from './stream';
|
|
13
13
|
import type { ToolOutputReferenceRegistry } from '@/tools/toolOutputReferences';
|
|
14
|
+
import type { LangfuseConfig, SubagentExecutionContext } from './graph';
|
|
14
15
|
import type { PreparedSubagents } from '@/tools/preparedSubagents';
|
|
15
16
|
import type { RunBreakerScope } from '@/llm/streamLimits';
|
|
16
17
|
import type { HumanInTheLoopConfig } from './hitl';
|
|
17
|
-
import type { LangfuseConfig } from './graph';
|
|
18
18
|
import type { HookRegistry } from '@/hooks';
|
|
19
19
|
|
|
20
20
|
/** Replacement type for `import type { ToolCall } from '@langchain/core/messages/tool'` in order to have stringified args typed */
|
|
@@ -75,6 +75,7 @@ export type EagerEventToolExecution = {
|
|
|
75
75
|
toolName: string;
|
|
76
76
|
args: Record<string, unknown>;
|
|
77
77
|
request: ToolCallRequest;
|
|
78
|
+
codeSessionBaselineByName?: ReadonlyMap<string, string>;
|
|
78
79
|
promise: Promise<EagerEventToolExecutionOutcome>;
|
|
79
80
|
/**
|
|
80
81
|
* True when the streaming eager path already emitted the user-visible
|
|
@@ -156,6 +157,8 @@ export type ToolNodeOptions = {
|
|
|
156
157
|
/** ID of the agent that owns this tool node, surfaced to hooks as `executingAgentId`
|
|
157
158
|
* so a batch can be attributed to a specific agent even where `agentId` is undefined. */
|
|
158
159
|
executingAgentId?: string;
|
|
160
|
+
/** SDK-owned identity of the child execution, independent of reusable agent IDs. */
|
|
161
|
+
executionContext?: SubagentExecutionContext;
|
|
159
162
|
/** Name of the agent that owns this tool node, used for active Langfuse attribution. */
|
|
160
163
|
executingAgentName?: string;
|
|
161
164
|
/** Root graph-agent identity retained alongside the currently executing tool owner. */
|
|
@@ -499,6 +502,8 @@ export type ExecuteResult = {
|
|
|
499
502
|
stdout: string;
|
|
500
503
|
stderr: string;
|
|
501
504
|
files?: FileRefs;
|
|
505
|
+
/** Persisted input paths explicitly removed during this execution. */
|
|
506
|
+
deleted_files?: string[];
|
|
502
507
|
artifact_delivery?: ArtifactDeliveryFailure;
|
|
503
508
|
/**
|
|
504
509
|
* Durable runtime session id echoed by a stateful Code API backend
|
|
@@ -573,6 +578,10 @@ export type ToolCallRequest = {
|
|
|
573
578
|
session_id: string;
|
|
574
579
|
files?: CodeEnvFile[];
|
|
575
580
|
};
|
|
581
|
+
/** Request-time execution session used to detect host session refreshes. */
|
|
582
|
+
codeSessionBaselineId?: string;
|
|
583
|
+
/** Preserve request-provisioned code inputs after an eager identity mismatch. */
|
|
584
|
+
retainCodeSessionInputs?: true;
|
|
576
585
|
/**
|
|
577
586
|
* Stable runtime session hint for stateful sandbox sessions. Orthogonal to
|
|
578
587
|
* `codeSessionContext` (which threads the transient exec-session for file
|
|
@@ -596,6 +605,8 @@ export type CallerCapabilityProjectionSnapshot = {
|
|
|
596
605
|
|
|
597
606
|
/** Batch request containing ALL tool calls for a graph step */
|
|
598
607
|
export type ToolExecuteBatchRequest = {
|
|
608
|
+
/** SDK-owned child lineage. Unset for tools in the root graph. */
|
|
609
|
+
executionContext?: SubagentExecutionContext;
|
|
599
610
|
/** All tool calls from the AIMessage */
|
|
600
611
|
toolCalls: ToolCallRequest[];
|
|
601
612
|
/** User ID for context */
|
|
@@ -1227,6 +1238,7 @@ export type ProgrammaticHookContext = {
|
|
|
1227
1238
|
runId: string;
|
|
1228
1239
|
threadId?: string;
|
|
1229
1240
|
agentId?: string;
|
|
1241
|
+
executionContext?: SubagentExecutionContext;
|
|
1230
1242
|
executingAgentId?: string;
|
|
1231
1243
|
};
|
|
1232
1244
|
|
|
@@ -1336,6 +1348,8 @@ export type ProgrammaticExecutionResponse = {
|
|
|
1336
1348
|
stdout?: string;
|
|
1337
1349
|
stderr?: string;
|
|
1338
1350
|
files?: FileRefs;
|
|
1351
|
+
/** Persisted input paths explicitly removed during this execution. */
|
|
1352
|
+
deleted_files?: string[];
|
|
1339
1353
|
artifact_delivery?: ArtifactDeliveryFailure;
|
|
1340
1354
|
|
|
1341
1355
|
/** Durable runtime session echo from a stateful backend (additive). */
|
|
@@ -1353,6 +1367,8 @@ export type ProgrammaticExecutionArtifact = {
|
|
|
1353
1367
|
/** Execution session — see `CodeSessionContext.session_id`. */
|
|
1354
1368
|
session_id?: string;
|
|
1355
1369
|
files?: FileRefs;
|
|
1370
|
+
/** Persisted input paths explicitly removed during this execution. */
|
|
1371
|
+
deleted_files?: string[];
|
|
1356
1372
|
artifact_delivery?: ArtifactDeliveryFailure;
|
|
1357
1373
|
/** Durable runtime session echo from a stateful backend (additive). */
|
|
1358
1374
|
runtime_session_id?: string;
|
|
@@ -1360,10 +1376,19 @@ export type ProgrammaticExecutionArtifact = {
|
|
|
1360
1376
|
};
|
|
1361
1377
|
|
|
1362
1378
|
/** Parameters for creating a bash execution tool (same API as CodeExecutor, bash-only) */
|
|
1363
|
-
export type BashExecutionToolParams =
|
|
1379
|
+
export type BashExecutionToolParams =
|
|
1380
|
+
| undefined
|
|
1381
|
+
| (Exclude<CodeExecutionToolParams, undefined> & {
|
|
1382
|
+
/** Trusted attached-workspace identifier selected by the host. */
|
|
1383
|
+
workspaceId?: string;
|
|
1384
|
+
});
|
|
1364
1385
|
|
|
1365
1386
|
/** Parameters for creating a bash programmatic tool calling tool (same API as PTC, bash-only) */
|
|
1366
|
-
export type BashProgrammaticToolCallingParams =
|
|
1387
|
+
export type BashProgrammaticToolCallingParams =
|
|
1388
|
+
ProgrammaticToolCallingParams & {
|
|
1389
|
+
/** Trusted attached-workspace identifier selected by the host. */
|
|
1390
|
+
workspaceId?: string;
|
|
1391
|
+
};
|
|
1367
1392
|
|
|
1368
1393
|
/**
|
|
1369
1394
|
* Initialization parameters for the PTC tool
|
|
@@ -1420,6 +1445,8 @@ export type CodeExecutionArtifact = {
|
|
|
1420
1445
|
/** Execution session — see `CodeSessionContext.session_id`. */
|
|
1421
1446
|
session_id?: string;
|
|
1422
1447
|
files?: FileRefs;
|
|
1448
|
+
/** Persisted input paths explicitly removed during this execution. */
|
|
1449
|
+
deleted_files?: string[];
|
|
1423
1450
|
artifact_delivery?: ArtifactDeliveryFailure;
|
|
1424
1451
|
/** Durable runtime session echo from a stateful backend (additive). */
|
|
1425
1452
|
runtime_session_id?: string;
|
package/src/utils/llmConfig.ts
CHANGED
|
@@ -71,7 +71,6 @@ export const llmConfigs: Record<string, t.BuiltInLLMConfig | undefined> = {
|
|
|
71
71
|
} as or.ChatOpenRouterCallOptions & t.BuiltInLLMConfig,
|
|
72
72
|
[Providers.AZURE]: {
|
|
73
73
|
provider: Providers.AZURE,
|
|
74
|
-
temperature: 0.7,
|
|
75
74
|
streaming: true,
|
|
76
75
|
streamUsage: true,
|
|
77
76
|
azureOpenAIApiKey: process.env.AZURE_OPENAI_API_KEY,
|