more fixes and improvements before final release

This commit is contained in:
Egor 2025-09-04 00:05:33 -07:00
parent 8c7edeae1a
commit 2b912cb22e
4 changed files with 25 additions and 72 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "gerbil", "name": "gerbil",
"productName": "Gerbil", "productName": "Gerbil",
"version": "1.0.0", "version": "0.9.10",
"description": "Run Large Language Models locally", "description": "Run Large Language Models locally",
"main": "out/main/index.js", "main": "out/main/index.js",
"homepage": "./", "homepage": "./",

View file

@ -41,7 +41,7 @@ export const AboutTab = () => {
} }
const versionItems = [ const versionItems = [
{ label: 'App Version', value: versionInfo.appVersion }, { label: PRODUCT_NAME, value: versionInfo.appVersion },
{ label: 'Electron', value: versionInfo.electronVersion }, { label: 'Electron', value: versionInfo.electronVersion },
{ label: 'Node.js', value: versionInfo.nodeVersion }, { label: 'Node.js', value: versionInfo.nodeVersion },
{ label: 'Chromium', value: versionInfo.chromeVersion }, { label: 'Chromium', value: versionInfo.chromeVersion },
@ -54,7 +54,7 @@ export const AboutTab = () => {
const copyVersionInfo = async () => { const copyVersionInfo = async () => {
const info = [ const info = [
`${PRODUCT_NAME} v${versionInfo.appVersion}`, `${PRODUCT_NAME}: v${versionInfo.appVersion}`,
`Electron: ${versionInfo.electronVersion}`, `Electron: ${versionInfo.electronVersion}`,
`Node.js: ${versionInfo.nodeVersion}`, `Node.js: ${versionInfo.nodeVersion}`,
`Chromium: ${versionInfo.chromeVersion}`, `Chromium: ${versionInfo.chromeVersion}`,
@ -137,12 +137,12 @@ export const AboutTab = () => {
</Card> </Card>
<Card withBorder radius="md" p="xs" style={{ position: 'relative' }}> <Card withBorder radius="md" p="xs" style={{ position: 'relative' }}>
<Tooltip label="Copy info"> <Tooltip label="Copy Version Info">
<ActionIcon <ActionIcon
variant="subtle" variant="subtle"
size="sm" size="sm"
onClick={copyVersionInfo} onClick={copyVersionInfo}
aria-label="Copy Info" aria-label="Copy Version Info"
style={{ style={{
position: 'absolute', position: 'absolute',
top: 8, top: 8,

View file

@ -133,6 +133,10 @@ export class SillyTavernManager {
> { > {
const env = { ...process.env }; const env = { ...process.env };
if (process.platform === 'win32') {
return env;
}
const versionManagerPaths = [ const versionManagerPaths = [
join(homedir(), '.local', 'share', 'fnm', 'node-versions'), join(homedir(), '.local', 'share', 'fnm', 'node-versions'),
join(homedir(), '.nvm', 'versions', 'node'), join(homedir(), '.nvm', 'versions', 'node'),
@ -144,19 +148,12 @@ export class SillyTavernManager {
if (process.platform === 'darwin') { if (process.platform === 'darwin') {
systemPaths.push('/opt/homebrew/bin', '/usr/local/bin'); systemPaths.push('/opt/homebrew/bin', '/usr/local/bin');
} }
if (process.platform === 'win32') {
versionManagerPaths.push(
join(homedir(), 'AppData', 'Local', 'fnm', 'node-versions'),
join(homedir(), 'AppData', 'Roaming', 'nvm')
);
}
for (const systemPath of systemPaths) { for (const systemPath of systemPaths) {
try { try {
await access(systemPath); await access(systemPath);
if (await this.tryAddPathToEnv(env, systemPath)) { await this.tryAddPathToEnv(env, systemPath);
return env; return env;
}
} catch { } catch {
continue; continue;
} }
@ -174,7 +171,11 @@ export class SillyTavernManager {
async isNpxAvailable(): Promise<boolean> { async isNpxAvailable(): Promise<boolean> {
try { try {
const env = await this.getNodeEnvironment(); const env = await this.getNodeEnvironment();
const testProcess = spawn('npx', ['--version'], { stdio: 'pipe', env }); const testProcess = spawn('npx', ['--version'], {
stdio: 'pipe',
env,
shell: process.platform === 'win32',
});
return new Promise<boolean>((resolve) => { return new Promise<boolean>((resolve) => {
const timeout = setTimeout(() => { const timeout = setTimeout(() => {
@ -203,6 +204,7 @@ export class SillyTavernManager {
stdio: ['pipe', 'pipe', 'pipe'], stdio: ['pipe', 'pipe', 'pipe'],
detached: false, detached: false,
env, env,
shell: process.platform === 'win32',
}); });
} }

View file

@ -55,68 +55,19 @@ export const sortDownloadsByType = <T extends { name: string }>(
}); });
export const pretifyBinName = (binName: string): string => { export const pretifyBinName = (binName: string): string => {
const cleanName = stripAssetExtensions(binName); const cleanName = stripAssetExtensions(binName).toLowerCase();
let name = cleanName.replace(/^koboldcpp[-_]?/, ''); if (cleanName.includes(ASSET_SUFFIXES.ROCM)) {
return 'ROCm';
if (!name) {
return 'Windows (x64)';
} }
const platforms = { if (cleanName.endsWith(ASSET_SUFFIXES.OLDPC)) {
linux: 'Linux', return 'Old PC';
mac: 'macOS', }
};
if (cleanName.endsWith(ASSET_SUFFIXES.NOCUDA)) {
const architectures = { return 'No CUDA';
x64: 'x64', }
arm64: 'ARM64',
}; return 'Standard';
const variants = {
rocm: 'ROCm',
nocuda: 'NoCUDA',
oldpc: 'OldPC',
};
const parts: string[] = [];
let workingName = name.toLowerCase();
let platform = '';
for (const [key, value] of Object.entries(platforms)) {
if (workingName.includes(key)) {
platform = value;
workingName = workingName.replace(key, '').replace(/^-+|-+$/g, '');
break;
}
}
let arch = '';
for (const [key, value] of Object.entries(architectures)) {
if (workingName.includes(key)) {
arch = value;
workingName = workingName.replace(key, '').replace(/^-+|-+$/g, '');
break;
}
}
const foundVariants: string[] = [];
for (const [key, value] of Object.entries(variants)) {
if (workingName.includes(key)) {
foundVariants.push(value);
workingName = workingName.replace(key, '').replace(/^-+|-+$/g, '');
}
}
if (platform) parts.push(platform);
if (arch) parts.push(`(${arch})`);
if (foundVariants.length > 0) {
parts.push(`- ${foundVariants.join(', ')}`);
}
if (parts.length === 0) {
return cleanName.replace('koboldcpp-', '').replace(/^-+/, '') || 'Standard';
}
return parts.join(' ');
}; };