mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-11-15 18:59:33 +01:00
feat(agent): add bounded inspection and guarded submission
This commit is contained in:
1 parent
3e06f3c141
commit
a24b0ec7bb
30 files changed
+2462
-36
No files matched your search
@@ -229,6 +229,21 @@ describe('sendInput line breaks', () => {
|
||||
return argvOf(setBufferCmd.replace(/^.*? set-buffer /, `${FAKE_TMUX} set-buffer `)).at(-1) as string;
|
||||
}
|
||||
|
||||
it('checks a conditional Enter before the actual inputRunner command', async () => {
|
||||
const manager = managerWithSession();
|
||||
try {
|
||||
expect(await manager.sendInput('s1', '\r', { beforeDispatch: () => false })).toBe(false);
|
||||
expect(manager.ran).toEqual([]);
|
||||
expect(await manager.sendInput('s1', '\r', { beforeDispatch: () => true })).toBe(true);
|
||||
expect(manager.ran).toEqual([expect.stringMatching(/ Enter$/)]);
|
||||
manager.ran = [];
|
||||
expect(await manager.sendInput('s1', 'draft\r', { beforeDispatch: () => true })).toBe(false);
|
||||
expect(manager.ran).toEqual([]);
|
||||
} finally {
|
||||
manager.destroy();
|
||||
}
|
||||
});
|
||||
|
||||
it('submits a multi-line prompt as one paste with its line breaks, then Enter', async () => {
|
||||
const manager = managerWithSession();
|
||||
expect(await manager.sendInput('s1', 'line one\nline two\n\nparagraph three\r')).toBe(true);
|
||||
|
||||
Reference in new issue
Block a user