+20
-2
@@ -62,6 +62,23 @@ test('ask extracts harness reply text instead of stringifying the object', async
|
||||
}
|
||||
});
|
||||
|
||||
test('harness bridge caps voice shell chaining', () => {
|
||||
const bridge = new HarnessBridge();
|
||||
assert.equal(bridge.options.origin, 'jarvis-qvac');
|
||||
assert.equal(bridge.options.voice, true);
|
||||
assert.equal(bridge.options.maxShellCalls, 1);
|
||||
assert.equal(bridge.options.maxTurns, 6);
|
||||
assert.deepEqual(bridge.options.builtinTools, [
|
||||
'read_file',
|
||||
'list_dir',
|
||||
'grep',
|
||||
'run_terminal_cmd',
|
||||
'web_fetch',
|
||||
'web_search',
|
||||
]);
|
||||
assert.equal(bridge.options.webFetch, true);
|
||||
});
|
||||
|
||||
test('harness bridge recovers streamed text when final envelope is empty after a tool call', async () => {
|
||||
const session = new (await import('node:events')).EventEmitter();
|
||||
session.prompt = async () => {
|
||||
@@ -92,13 +109,14 @@ test('ask with no spoken text after tools returns to listening without a Reply',
|
||||
}
|
||||
});
|
||||
|
||||
test('confirmPermission forwards Allow/Deny to the harness session', async () => {
|
||||
test('confirmPermission forwards Allow/Deny/Always to the harness session', async () => {
|
||||
const daemon = new JarvisDaemon();
|
||||
const calls = [];
|
||||
daemon.harness = { session: { permit(...args) { calls.push(args); } }, cancel() {}, close: async () => {} };
|
||||
try {
|
||||
daemon.confirmPermission('job-1', 'call-9', 'allow');
|
||||
assert.deepEqual(calls, [['job-1', 'call-9', 'allow']]);
|
||||
daemon.confirmPermission('job-1', 'call-9', 'always');
|
||||
assert.deepEqual(calls, [['job-1', 'call-9', 'allow'], ['job-1', 'call-9', 'always']]);
|
||||
} finally {
|
||||
await daemon.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user