mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-27 21:44:25 -07:00
Adds executeCommand endpoint with support for /extensions list (#11515)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { describe, it, expect, vi } from 'vitest';
|
||||
import { listExtensions } from './extensions.js';
|
||||
import type { Config } from '../config/config.js';
|
||||
|
||||
describe('listExtensions', () => {
|
||||
it('should call config.getExtensions and return the result', () => {
|
||||
const mockExtensions = [{ name: 'ext1' }, { name: 'ext2' }];
|
||||
const mockConfig = {
|
||||
getExtensions: vi.fn().mockReturnValue(mockExtensions),
|
||||
} as unknown as Config;
|
||||
|
||||
const result = listExtensions(mockConfig);
|
||||
|
||||
expect(mockConfig.getExtensions).toHaveBeenCalledTimes(1);
|
||||
expect(result).toEqual(mockExtensions);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type { Config } from '../config/config.js';
|
||||
|
||||
export function listExtensions(config: Config) {
|
||||
return config.getExtensions();
|
||||
}
|
||||
@@ -14,6 +14,9 @@ export * from './policy/policy-engine.js';
|
||||
export * from './confirmation-bus/types.js';
|
||||
export * from './confirmation-bus/message-bus.js';
|
||||
|
||||
// Export Commands logic
|
||||
export * from './commands/extensions.js';
|
||||
|
||||
// Export Core Logic
|
||||
export * from './core/client.js';
|
||||
export * from './core/contentGenerator.js';
|
||||
|
||||
Reference in New Issue
Block a user