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.
- package/dist/cli.d.ts +27 -10
- package/dist/cli.js +315 -284
- package/dist/cli.js.map +1 -1
- package/dist/common/browser-actions.d.ts +4409 -0
- package/dist/common/browser-actions.js +338 -0
- package/dist/common/browser-actions.js.map +1 -0
- package/dist/common/constants.d.ts +2 -2
- package/dist/common/constants.js +2 -2
- package/dist/common/constants.js.map +1 -1
- package/dist/common/util/file.js +5 -3
- package/dist/common/util/file.js.map +1 -1
- package/dist/common/util/min-heap.d.ts +15 -0
- package/dist/common/util/min-heap.js +73 -0
- package/dist/common/util/min-heap.js.map +1 -0
- package/dist/common/util/token-counter.d.ts +3 -0
- package/dist/common/util/token-counter.js +27 -0
- package/dist/common/util/token-counter.js.map +1 -0
- package/dist/create-template-project.d.ts +1 -1
- package/dist/create-template-project.js +20 -12
- package/dist/create-template-project.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/terminal.d.ts +3 -1
- package/dist/utils/terminal.js +180 -135
- package/dist/utils/terminal.js.map +1 -1
- package/dist/web-scraper.d.ts +1 -1
- package/dist/web-scraper.js +9 -7
- package/dist/web-scraper.js.map +1 -1
- package/package.json +1 -2
- package/dist/__tests__/tool-handlers.test.d.ts +0 -1
- package/dist/__tests__/tool-handlers.test.js +0 -33
- package/dist/__tests__/tool-handlers.test.js.map +0 -1
|
@@ -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,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;AAC9B,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,SA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