@librechat/agents 3.1.70 → 3.1.71-dev.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/graphs/Graph.cjs +45 -0
- package/dist/cjs/graphs/Graph.cjs.map +1 -1
- package/dist/cjs/main.cjs +4 -0
- package/dist/cjs/main.cjs.map +1 -1
- package/dist/cjs/messages/prune.cjs +9 -2
- package/dist/cjs/messages/prune.cjs.map +1 -1
- package/dist/cjs/run.cjs +4 -0
- package/dist/cjs/run.cjs.map +1 -1
- package/dist/cjs/tools/BashExecutor.cjs +43 -0
- package/dist/cjs/tools/BashExecutor.cjs.map +1 -1
- package/dist/cjs/tools/ToolNode.cjs +453 -45
- package/dist/cjs/tools/ToolNode.cjs.map +1 -1
- package/dist/cjs/tools/toolOutputReferences.cjs +475 -0
- package/dist/cjs/tools/toolOutputReferences.cjs.map +1 -0
- package/dist/cjs/utils/truncation.cjs +28 -0
- package/dist/cjs/utils/truncation.cjs.map +1 -1
- package/dist/esm/graphs/Graph.mjs +45 -0
- package/dist/esm/graphs/Graph.mjs.map +1 -1
- package/dist/esm/main.mjs +2 -2
- package/dist/esm/messages/prune.mjs +9 -2
- package/dist/esm/messages/prune.mjs.map +1 -1
- package/dist/esm/run.mjs +4 -0
- package/dist/esm/run.mjs.map +1 -1
- package/dist/esm/tools/BashExecutor.mjs +42 -1
- package/dist/esm/tools/BashExecutor.mjs.map +1 -1
- package/dist/esm/tools/ToolNode.mjs +453 -45
- package/dist/esm/tools/ToolNode.mjs.map +1 -1
- package/dist/esm/tools/toolOutputReferences.mjs +468 -0
- package/dist/esm/tools/toolOutputReferences.mjs.map +1 -0
- package/dist/esm/utils/truncation.mjs +27 -1
- package/dist/esm/utils/truncation.mjs.map +1 -1
- package/dist/types/graphs/Graph.d.ts +21 -0
- package/dist/types/run.d.ts +1 -0
- package/dist/types/tools/BashExecutor.d.ts +31 -0
- package/dist/types/tools/ToolNode.d.ts +86 -3
- package/dist/types/tools/toolOutputReferences.d.ts +205 -0
- package/dist/types/types/run.d.ts +9 -1
- package/dist/types/types/tools.d.ts +70 -0
- package/dist/types/utils/truncation.d.ts +21 -0
- package/package.json +1 -1
- package/src/graphs/Graph.ts +48 -0
- package/src/messages/prune.ts +9 -2
- package/src/run.ts +4 -0
- package/src/specs/prune.test.ts +413 -0
- package/src/tools/BashExecutor.ts +45 -0
- package/src/tools/ToolNode.ts +618 -55
- package/src/tools/__tests__/BashExecutor.test.ts +36 -0
- package/src/tools/__tests__/ToolNode.outputReferences.test.ts +1395 -0
- package/src/tools/__tests__/toolOutputReferences.test.ts +415 -0
- package/src/tools/toolOutputReferences.ts +590 -0
- package/src/types/run.ts +9 -1
- package/src/types/tools.ts +71 -0
- package/src/utils/__tests__/truncation.test.ts +66 -0
- package/src/utils/truncation.ts +30 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { describe, it, expect } from '@jest/globals';
|
|
2
|
+
import {
|
|
3
|
+
BashExecutionToolDescription,
|
|
4
|
+
BashToolOutputReferencesGuide,
|
|
5
|
+
buildBashExecutionToolDescription,
|
|
6
|
+
} from '../BashExecutor';
|
|
7
|
+
|
|
8
|
+
describe('buildBashExecutionToolDescription', () => {
|
|
9
|
+
it('returns the base description by default', () => {
|
|
10
|
+
expect(buildBashExecutionToolDescription()).toBe(
|
|
11
|
+
BashExecutionToolDescription
|
|
12
|
+
);
|
|
13
|
+
expect(buildBashExecutionToolDescription({})).toBe(
|
|
14
|
+
BashExecutionToolDescription
|
|
15
|
+
);
|
|
16
|
+
expect(
|
|
17
|
+
buildBashExecutionToolDescription({ enableToolOutputReferences: false })
|
|
18
|
+
).toBe(BashExecutionToolDescription);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('appends the tool-output references guide when enabled', () => {
|
|
22
|
+
const composed = buildBashExecutionToolDescription({
|
|
23
|
+
enableToolOutputReferences: true,
|
|
24
|
+
});
|
|
25
|
+
expect(composed.startsWith(BashExecutionToolDescription)).toBe(true);
|
|
26
|
+
expect(composed).toContain(BashToolOutputReferencesGuide);
|
|
27
|
+
expect(composed).toContain('{{tool<idx>turn<turn>}}');
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('separates base and guide with a blank line', () => {
|
|
31
|
+
const composed = buildBashExecutionToolDescription({
|
|
32
|
+
enableToolOutputReferences: true,
|
|
33
|
+
});
|
|
34
|
+
expect(composed.includes(`${BashExecutionToolDescription}\n\n`)).toBe(true);
|
|
35
|
+
});
|
|
36
|
+
});
|