codebuff 1.0.148 → 1.0.150

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.
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tool_handlers_1 = require("../tool-handlers");
4
- const terminal_1 = require("../utils/terminal");
5
- // Set up test directory
6
- beforeAll(() => {
7
- (0, terminal_1.resetPtyShell)(process.cwd());
8
- });
9
- describe('handleRunTerminalCommand', () => {
10
- afterEach(() => {
11
- // Clean up after each test
12
- (0, terminal_1.resetPtyShell)(process.cwd());
13
- });
14
- it('should preserve shell state between commands', async () => {
15
- // First command: Create a test variable
16
- const result1 = await (0, tool_handlers_1.handleRunTerminalCommand)({ command: 'TEST_VAR=hello' }, 'test-id', 'user');
17
- // Second command: Echo the test variable
18
- const result2 = await (0, tool_handlers_1.handleRunTerminalCommand)({ command: 'echo $TEST_VAR' }, 'test-id', 'user');
19
- expect(result2.stdout.trim()).toBe('hello');
20
- });
21
- it('should handle command timeout by restarting shell', async () => {
22
- // Start a command that will definitely timeout
23
- const longRunningCommand = (0, tool_handlers_1.handleRunTerminalCommand)({ command: 'sleep 15' }, // Longer than MAX_EXECUTION_TIME
24
- 'test-id', 'assistant');
25
- const result = await longRunningCommand;
26
- // Verify the shell was restarted
27
- expect(result.result).toContain('Shell has been restarted');
28
- // Verify we can still run commands after restart
29
- const subsequentCommand = await (0, tool_handlers_1.handleRunTerminalCommand)({ command: 'echo "test"' }, 'test-id', 'assistant');
30
- expect(subsequentCommand.stdout).toContain('test');
31
- });
32
- });
33
- //# sourceMappingURL=tool-handlers.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tool-handlers.test.js","sourceRoot":"","sources":["../../src/__tests__/tool-handlers.test.ts"],"names":[],"mappings":";;AAAA,oDAA2D;AAC3D,gDAAiD;AAEjD,wBAAwB;AACxB,SAAS,CAAC,GAAG,EAAE;IACb,IAAA,wBAAa,EAAC,O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