@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.
Files changed (111) hide show
  1. package/dist/cjs/agents/AgentContext.cjs +1 -1
  2. package/dist/cjs/common/constants.cjs +2 -0
  3. package/dist/cjs/common/constants.cjs.map +1 -1
  4. package/dist/cjs/graphs/Graph.cjs +18 -9
  5. package/dist/cjs/graphs/Graph.cjs.map +1 -1
  6. package/dist/cjs/hitl/approvalReview.cjs +1 -1
  7. package/dist/cjs/hooks/types.cjs.map +1 -1
  8. package/dist/cjs/main.cjs +8 -6
  9. package/dist/cjs/messages/index.cjs +1 -1
  10. package/dist/cjs/messages/prune.cjs +1 -1
  11. package/dist/cjs/run.cjs +7 -3
  12. package/dist/cjs/run.cjs.map +1 -1
  13. package/dist/cjs/stream.cjs +13 -3
  14. package/dist/cjs/stream.cjs.map +1 -1
  15. package/dist/cjs/summarization/node.cjs +3 -1
  16. package/dist/cjs/summarization/node.cjs.map +1 -1
  17. package/dist/cjs/tools/BashExecutor.cjs +79 -27
  18. package/dist/cjs/tools/BashExecutor.cjs.map +1 -1
  19. package/dist/cjs/tools/BashProgrammaticToolCalling.cjs +47 -7
  20. package/dist/cjs/tools/BashProgrammaticToolCalling.cjs.map +1 -1
  21. package/dist/cjs/tools/CodeExecutor.cjs +5 -2
  22. package/dist/cjs/tools/CodeExecutor.cjs.map +1 -1
  23. package/dist/cjs/tools/CodeSessionFileSummary.cjs +11 -1
  24. package/dist/cjs/tools/CodeSessionFileSummary.cjs.map +1 -1
  25. package/dist/cjs/tools/ProgrammaticToolCalling.cjs +54 -8
  26. package/dist/cjs/tools/ProgrammaticToolCalling.cjs.map +1 -1
  27. package/dist/cjs/tools/ToolNode.cjs +176 -43
  28. package/dist/cjs/tools/ToolNode.cjs.map +1 -1
  29. package/dist/cjs/tools/local/LocalProgrammaticToolCalling.cjs +1 -0
  30. package/dist/cjs/tools/local/LocalProgrammaticToolCalling.cjs.map +1 -1
  31. package/dist/cjs/tools/subagent/SubagentExecutionRegistry.cjs +0 -1
  32. package/dist/cjs/tools/subagent/SubagentExecutionRegistry.cjs.map +1 -1
  33. package/dist/cjs/tools/subagent/SubagentExecutor.cjs +120 -26
  34. package/dist/cjs/tools/subagent/SubagentExecutor.cjs.map +1 -1
  35. package/dist/cjs/tools/toolBatchReplay.cjs +4 -2
  36. package/dist/cjs/tools/toolBatchReplay.cjs.map +1 -1
  37. package/dist/cjs/utils/index.cjs +1 -1
  38. package/dist/esm/agents/AgentContext.mjs +1 -1
  39. package/dist/esm/common/constants.mjs +2 -1
  40. package/dist/esm/common/constants.mjs.map +1 -1
  41. package/dist/esm/graphs/Graph.mjs +17 -8
  42. package/dist/esm/graphs/Graph.mjs.map +1 -1
  43. package/dist/esm/hitl/approvalReview.mjs +1 -1
  44. package/dist/esm/hooks/types.mjs.map +1 -1
  45. package/dist/esm/main.mjs +7 -7
  46. package/dist/esm/messages/index.mjs +1 -1
  47. package/dist/esm/messages/prune.mjs +1 -1
  48. package/dist/esm/run.mjs +7 -3
  49. package/dist/esm/run.mjs.map +1 -1
  50. package/dist/esm/stream.mjs +13 -3
  51. package/dist/esm/stream.mjs.map +1 -1
  52. package/dist/esm/summarization/node.mjs +3 -1
  53. package/dist/esm/summarization/node.mjs.map +1 -1
  54. package/dist/esm/tools/BashExecutor.mjs +81 -29
  55. package/dist/esm/tools/BashExecutor.mjs.map +1 -1
  56. package/dist/esm/tools/BashProgrammaticToolCalling.mjs +48 -9
  57. package/dist/esm/tools/BashProgrammaticToolCalling.mjs.map +1 -1
  58. package/dist/esm/tools/CodeExecutor.mjs +5 -2
  59. package/dist/esm/tools/CodeExecutor.mjs.map +1 -1
  60. package/dist/esm/tools/CodeSessionFileSummary.mjs +11 -2
  61. package/dist/esm/tools/CodeSessionFileSummary.mjs.map +1 -1
  62. package/dist/esm/tools/ProgrammaticToolCalling.mjs +55 -9
  63. package/dist/esm/tools/ProgrammaticToolCalling.mjs.map +1 -1
  64. package/dist/esm/tools/ToolNode.mjs +176 -43
  65. package/dist/esm/tools/ToolNode.mjs.map +1 -1
  66. package/dist/esm/tools/local/LocalProgrammaticToolCalling.mjs +1 -0
  67. package/dist/esm/tools/local/LocalProgrammaticToolCalling.mjs.map +1 -1
  68. package/dist/esm/tools/subagent/SubagentExecutionRegistry.mjs +0 -1
  69. package/dist/esm/tools/subagent/SubagentExecutionRegistry.mjs.map +1 -1
  70. package/dist/esm/tools/subagent/SubagentExecutor.mjs +120 -26
  71. package/dist/esm/tools/subagent/SubagentExecutor.mjs.map +1 -1
  72. package/dist/esm/tools/toolBatchReplay.mjs +4 -2
  73. package/dist/esm/tools/toolBatchReplay.mjs.map +1 -1
  74. package/dist/esm/utils/index.mjs +1 -1
  75. package/dist/types/common/constants.d.ts +2 -0
  76. package/dist/types/graphs/Graph.d.ts +3 -2
  77. package/dist/types/hooks/types.d.ts +3 -0
  78. package/dist/types/run.d.ts +1 -0
  79. package/dist/types/summarization/node.d.ts +1 -0
  80. package/dist/types/tools/BashExecutor.d.ts +2 -0
  81. package/dist/types/tools/BashProgrammaticToolCalling.d.ts +1 -0
  82. package/dist/types/tools/CodeExecutor.d.ts +1 -1
  83. package/dist/types/tools/CodeSessionFileSummary.d.ts +3 -0
  84. package/dist/types/tools/ProgrammaticToolCalling.d.ts +2 -2
  85. package/dist/types/tools/ToolNode.d.ts +6 -2
  86. package/dist/types/tools/subagent/SubagentExecutor.d.ts +7 -4
  87. package/dist/types/tools/toolBatchReplay.d.ts +2 -0
  88. package/dist/types/types/graph.d.ts +28 -0
  89. package/dist/types/types/run.d.ts +2 -0
  90. package/dist/types/types/tools.d.ts +27 -3
  91. package/package.json +2 -2
  92. package/src/common/constants.ts +3 -0
  93. package/src/graphs/Graph.ts +32 -18
  94. package/src/hooks/types.ts +3 -0
  95. package/src/run.ts +30 -15
  96. package/src/stream.ts +27 -5
  97. package/src/summarization/node.ts +3 -0
  98. package/src/tools/BashExecutor.ts +143 -40
  99. package/src/tools/BashProgrammaticToolCalling.ts +82 -10
  100. package/src/tools/CodeExecutor.ts +12 -2
  101. package/src/tools/CodeSessionFileSummary.ts +25 -1
  102. package/src/tools/ProgrammaticToolCalling.ts +77 -6
  103. package/src/tools/ToolNode.ts +665 -170
  104. package/src/tools/local/LocalProgrammaticToolCalling.ts +1 -0
  105. package/src/tools/subagent/SubagentExecutionRegistry.ts +0 -1
  106. package/src/tools/subagent/SubagentExecutor.ts +214 -55
  107. package/src/tools/toolBatchReplay.ts +23 -1
  108. package/src/types/graph.ts +37 -0
  109. package/src/types/run.ts +2 -0
  110. package/src/types/tools.ts +30 -3
  111. package/src/utils/llmConfig.ts +0 -1
@@ -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 = CodeExecutionToolParams;
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 = ProgrammaticToolCallingParams;
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;
@@ -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,