mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import { getCliVersion } from '../../utils/version.js';
|
|
import { CommandKind, SlashCommand } from './types.js';
|
|
import process from 'node:process';
|
|
import { MessageType, type HistoryItemAbout } from '../types.js';
|
|
|
|
export const aboutCommand: SlashCommand = {
|
|
name: 'about',
|
|
description: 'show version info',
|
|
kind: CommandKind.BUILT_IN,
|
|
action: async (context) => {
|
|
const osVersion = process.platform;
|
|
let sandboxEnv = 'no sandbox';
|
|
if (process.env.SANDBOX && process.env.SANDBOX !== 'sandbox-exec') {
|
|
sandboxEnv = process.env.SANDBOX;
|
|
} else if (process.env.SANDBOX === 'sandbox-exec') {
|
|
sandboxEnv = `sandbox-exec (${
|
|
process.env.SEATBELT_PROFILE || 'unknown'
|
|
})`;
|
|
}
|
|
const modelVersion = context.services.config?.getModel() || 'Unknown';
|
|
const cliVersion = await getCliVersion();
|
|
const selectedAuthType =
|
|
context.services.settings.merged.selectedAuthType || '';
|
|
const gcpProject = process.env.GOOGLE_CLOUD_PROJECT || '';
|
|
|
|
const aboutItem: Omit<HistoryItemAbout, 'id'> = {
|
|
type: MessageType.ABOUT,
|
|
cliVersion,
|
|
osVersion,
|
|
sandboxEnv,
|
|
modelVersion,
|
|
selectedAuthType,
|
|
gcpProject,
|
|
};
|
|
|
|
context.ui.addItem(aboutItem, Date.now());
|
|
},
|
|
};
|