feat(shell): enable interactive commands with virtual terminal (#6694)

This commit is contained in:
Gal Zahavi
2025-09-11 13:27:27 -07:00
committed by GitHub
parent 8969a232ec
commit 181898cb5d
43 changed files with 2345 additions and 324 deletions

View File

@@ -133,6 +133,37 @@ describe('SettingsUtils', () => {
},
},
},
tools: {
type: 'object',
label: 'Tools',
category: 'Tools',
requiresRestart: false,
default: {},
description: 'Tool settings.',
showInDialog: false,
properties: {
shell: {
type: 'object',
label: 'Shell',
category: 'Tools',
requiresRestart: false,
default: {},
description: 'Shell tool settings.',
showInDialog: false,
properties: {
pager: {
type: 'string',
label: 'Pager',
category: 'Tools',
requiresRestart: false,
default: 'less',
description: 'The pager to use for long output.',
showInDialog: true,
},
},
},
},
},
} as const satisfies SettingsSchema;
vi.mocked(getSettingsSchema).mockReturnValue(
@@ -405,8 +436,13 @@ describe('SettingsUtils', () => {
expect(keys).not.toContain('general.preferredEditor'); // Now marked false
expect(keys).not.toContain('security.auth.selectedType'); // Advanced setting
// Most string settings are now hidden, so let's just check they exclude advanced ones
expect(keys.every((key) => !key.startsWith('tool'))).toBe(true); // No tool-related settings
// Check that user-facing tool settings are included
expect(keys).toContain('tools.shell.pager');
// Check that advanced/hidden tool settings are excluded
expect(keys).not.toContain('tools.discoveryCommand');
expect(keys).not.toContain('tools.callCommand');
expect(keys.every((key) => !key.startsWith('advanced.'))).toBe(true);
});
});