Add extensions logging (#11261)

This commit is contained in:
christine betts
2025-10-21 16:55:16 -04:00
committed by GitHub
parent e9e80b054d
commit c6a59896f3
16 changed files with 230 additions and 65 deletions

View File

@@ -223,6 +223,7 @@ describe('extensionsCommand', () => {
const extensionOne: GeminiCLIExtension = {
name: 'ext-one',
id: 'ext-one-id',
version: '1.0.0',
isActive: true,
path: '/test/dir/ext-one',
@@ -235,6 +236,7 @@ describe('extensionsCommand', () => {
};
const extensionTwo: GeminiCLIExtension = {
name: 'another-ext',
id: 'another-ext-id',
version: '1.0.0',
isActive: true,
path: '/test/dir/another-ext',
@@ -247,6 +249,7 @@ describe('extensionsCommand', () => {
};
const allExt: GeminiCLIExtension = {
name: 'all-ext',
id: 'all-ext-id',
version: '1.0.0',
isActive: true,
path: '/test/dir/all-ext',

View File

@@ -196,6 +196,7 @@ export interface SlashCommand {
// Optional metadata for extension commands
extensionName?: string;
extensionId?: string;
// The action to run. Optional for parent commands that only group sub-commands.
action?: (

View File

@@ -518,6 +518,7 @@ export const useSlashCommandProcessor = (
command: resolvedCommandPath[0],
subcommand,
status: SlashCommandStatus.ERROR,
extension_id: commandToExecute?.extensionId,
});
logSlashCommand(config, event);
}
@@ -535,6 +536,7 @@ export const useSlashCommandProcessor = (
command: resolvedCommandPath[0],
subcommand,
status: SlashCommandStatus.SUCCESS,
extension_id: commandToExecute?.extensionId,
});
logSlashCommand(config, event);
}

View File

@@ -57,6 +57,7 @@ describe('useExtensionUpdates', () => {
const extensions = [
{
name: 'test-extension',
id: 'test-extension-id',
type: 'git',
version: '1.0.0',
path: '/some/path',
@@ -269,6 +270,7 @@ describe('useExtensionUpdates', () => {
const extensions = [
{
name: 'test-extension-1',
id: 'test-extension-1-id',
type: 'git',
version: '1.0.0',
path: '/some/path1',
@@ -282,6 +284,8 @@ describe('useExtensionUpdates', () => {
},
{
name: 'test-extension-2',
id: 'test-extension-2-id',
type: 'git',
version: '2.0.0',
path: '/some/path2',