Compare commits
1 Commits
c7d7951273
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 7200252d2e |
37
package.json
37
package.json
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "silky-assistant",
|
"name": "aura-keep",
|
||||||
"version": "0.0.3",
|
"version": "0.0.3",
|
||||||
"description": "Silky Assistant",
|
"description": "Aura Keep Desktop Application",
|
||||||
"main": "app-dist/main.js",
|
"main": "app-dist/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --config vite.config.ts",
|
"dev": "vite --config vite.config.ts",
|
||||||
@@ -10,36 +10,37 @@
|
|||||||
"build:mac": "electron-builder --mac --universal",
|
"build:mac": "electron-builder --mac --universal",
|
||||||
"build:win": "electron-builder --win",
|
"build:win": "electron-builder --win",
|
||||||
"build:linux": "electron-builder --linux",
|
"build:linux": "electron-builder --linux",
|
||||||
"watch:electron": "electron app-dist/main.js --watch",
|
"watch": "electron app-dist/main.js --watch",
|
||||||
"start": "electron .",
|
"start": "electron .",
|
||||||
"html": "tsx scripts/clear-directory.ts",
|
"html": "tsx scripts/clear-directory.ts",
|
||||||
"prepub": "pnpm html",
|
"prepub": "pnpm html",
|
||||||
"pub": "ev deploy ./build -k silky-assistant -v 0.0.3 -u -o root"
|
"pub": "ev deploy ./build -k aura-keep -v 0.0.3 -u -o root"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "abearxiong <xiongxiao@xiongxiao.me>",
|
"author": "abearxiong <xiongxiao@xiongxiao.me>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rollup/plugin-commonjs": "^28.0.3",
|
"@kevisual/cli": "^0.0.59",
|
||||||
"@rollup/plugin-node-resolve": "^16.0.1",
|
"@rollup/plugin-commonjs": "^28.0.6",
|
||||||
"@types/node": "^22.15.21",
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
||||||
"cross-env": "^7.0.3",
|
"@types/node": "^24.7.2",
|
||||||
"electron": "^36.3.1",
|
"cross-env": "^10.1.0",
|
||||||
|
"electron": "^38.2.2",
|
||||||
"electron-builder": "^26.0.12",
|
"electron-builder": "^26.0.12",
|
||||||
"electron-log": "^5.4.0",
|
"electron-log": "^5.4.3",
|
||||||
"typescript": "^5.8.3",
|
"typescript": "^5.9.3",
|
||||||
"vite": "^6.3.5",
|
"vite": "^7.1.9",
|
||||||
"vite-plugin-electron": "^0.29.0",
|
"vite-plugin-electron": "^0.29.0",
|
||||||
"vite-plugin-static-copy": "^3.0.0"
|
"vite-plugin-static-copy": "^3.1.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@kevisual/use-config": "^1.0.17",
|
"@kevisual/use-config": "^1.0.19",
|
||||||
"electron-updater": "^6.6.2"
|
"electron-updater": "^6.6.2"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"appId": "cn.silkeyai.assistant",
|
"appId": "cn.kevisual.aura-keep",
|
||||||
"productName": "Silky Assistant",
|
"productName": "Aura Keep",
|
||||||
"copyright": "Copyright © 2025 ${author}",
|
"copyright": "Copyright © 2025 ${author}",
|
||||||
"icon": "icons/app-512x512.png",
|
"icon": "icons/app-512x512.png",
|
||||||
"directories": {
|
"directories": {
|
||||||
@@ -76,9 +77,9 @@
|
|||||||
"publish": [
|
"publish": [
|
||||||
{
|
{
|
||||||
"provider": "generic",
|
"provider": "generic",
|
||||||
"url": "https://kevisual.silkyai.cn/root/silky-assistant/"
|
"url": "https://kevisual.cn/root/aura-keep/"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@10.11.0"
|
"packageManager": "pnpm@10.18.2"
|
||||||
}
|
}
|
||||||
1248
pnpm-lock.yaml
generated
1248
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -3,14 +3,15 @@ import path from 'node:path';
|
|||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
const __dirname = path.dirname(__filename);
|
const __dirname = path.dirname(__filename);
|
||||||
|
// 创建透明窗口
|
||||||
export const createTransWindow = () => {
|
export const createTransWindow = () => {
|
||||||
const window = new BrowserWindow({
|
const window = new BrowserWindow({
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 600,
|
height: 1000,
|
||||||
transparent: true,
|
transparent: true,
|
||||||
frame: false,
|
frame: false,
|
||||||
});
|
});
|
||||||
window.loadURL(process?.env?.ASSISTANT_HOME ?? 'https://kevisual.silkyai.cn/root/talkshow-admin/');
|
window.loadURL(process?.env?.ASSISTANT_HOME ?? 'https://kevisual.cn/root/center/');
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.setPosition(0, 0, true);
|
window.setPosition(0, 0, true);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
@@ -29,6 +30,6 @@ export const createDemoWinodw = (window?: BrowserWindow, opts?: any) => {
|
|||||||
...opts?.webPreferences,
|
...opts?.webPreferences,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
window.loadURL(process?.env?.ASSISTANT_HOME ?? 'https://kevisual.silkyai.cn/root/talkshow-admin/');
|
window.loadURL(process?.env?.ASSISTANT_HOME ?? 'https://kevisual.cn/root/center/');
|
||||||
return window;
|
return window;
|
||||||
};
|
};
|
||||||
|
|||||||
25
src/main/hot-keys/index.ts
Normal file
25
src/main/hot-keys/index.ts
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
// 注册快捷键 ctrl+q
|
||||||
|
import { globalShortcut } from 'electron';
|
||||||
|
|
||||||
|
export const registerHotKeys = (app: Electron.App) => {
|
||||||
|
const ret = globalShortcut.register('CommandOrControl+Q', () => {
|
||||||
|
console.log('CommandOrControl+Q is pressed');
|
||||||
|
app.quit();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!ret) {
|
||||||
|
console.log('registration failed');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check whether a shortcut is registered.
|
||||||
|
console.log(globalShortcut.isRegistered('CommandOrControl+Q'));
|
||||||
|
};
|
||||||
|
|
||||||
|
export const unregisterHotKeys = () => {
|
||||||
|
globalShortcut.unregisterAll();
|
||||||
|
};
|
||||||
|
|
||||||
|
// Unregister a shortcut.
|
||||||
|
export const unregisterHotKey = (key: string) => {
|
||||||
|
globalShortcut.unregister(key);
|
||||||
|
};
|
||||||
@@ -1,19 +1,11 @@
|
|||||||
import { app, BrowserWindow } from 'electron';
|
import { app, BrowserWindow } from 'electron';
|
||||||
import * as path from 'path';
|
|
||||||
import { fileURLToPath } from 'url';
|
|
||||||
import { createSession } from './session/index.ts';
|
|
||||||
import { handle } from './handle/index.ts';
|
import { handle } from './handle/index.ts';
|
||||||
import { loadMenu } from './menu/index.ts';
|
import { loadMenu } from './menu/index.ts';
|
||||||
import { getLogPath, log } from './app.ts';
|
import { getLogPath, log } from './app.ts';
|
||||||
import { checkShowPage } from './window/page/index.ts';
|
|
||||||
import { closeProcess, createProcess } from './process/index.ts';
|
import { closeProcess, createProcess } from './process/index.ts';
|
||||||
import { getElectronResourcePath, isMac } from './system/env.ts';
|
import { getElectronResourcePath } from './system/env.ts';
|
||||||
// import { checkForUpdates } from './updater/index.ts';
|
import { createDemoWinodw } from './browsers/trans.ts';
|
||||||
import { createTransWindow, createDemoWinodw } from './browsers/trans.ts';
|
import { registerHotKeys } from "./hot-keys/index.ts";
|
||||||
|
|
||||||
// @ts-ignore
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
|
||||||
const __dirname = path.dirname(__filename);
|
|
||||||
|
|
||||||
let mainWindow: BrowserWindow | null;
|
let mainWindow: BrowserWindow | null;
|
||||||
|
|
||||||
@@ -23,22 +15,16 @@ async function createWindow() {
|
|||||||
log.info('createWindow');
|
log.info('createWindow');
|
||||||
log.info('path', getLogPath());
|
log.info('path', getLogPath());
|
||||||
loadMenu();
|
loadMenu();
|
||||||
// await checkShowPage(mainWindow);
|
|
||||||
let transWindow = createDemoWinodw();
|
let transWindow = createDemoWinodw();
|
||||||
transWindow.on('closed', () => {
|
transWindow.on('closed', () => {
|
||||||
transWindow = null;
|
transWindow = null;
|
||||||
});
|
});
|
||||||
// mainWindow.on('closed', () => {
|
|
||||||
// mainWindow = null;
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
app.on('ready', async () => {
|
app.on('ready', async () => {
|
||||||
// await createProcess();
|
// await createProcess();
|
||||||
createWindow();
|
createWindow();
|
||||||
// if (!isMac()) {
|
registerHotKeys(app);
|
||||||
// checkForUpdates();
|
|
||||||
// }
|
|
||||||
});
|
});
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export const createProcess = async () => {
|
|||||||
env: {
|
env: {
|
||||||
...process.env,
|
...process.env,
|
||||||
// KEVISUAL_URL: 'https://kevisual.xiongxiao.me',
|
// KEVISUAL_URL: 'https://kevisual.xiongxiao.me',
|
||||||
KEVISUAL_URL: 'https://kevisual.silkyai.cn',
|
KEVISUAL_URL: 'https://kevisual.cn',
|
||||||
NODE_ENV_PARENT: 'fork',
|
NODE_ENV_PARENT: 'fork',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
6
src/main/utils/current-path.ts
Normal file
6
src/main/utils/current-path.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
import path from 'node:path';
|
||||||
|
import { fileURLToPath } from 'node:url';
|
||||||
|
// @ts-ignore
|
||||||
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
|
const __dirname = path.dirname(__filename);
|
||||||
13
src/main/utils/run-cli.ts
Normal file
13
src/main/utils/run-cli.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import {spawn} from 'child_process';
|
||||||
|
|
||||||
|
export const runCli =async () =>{
|
||||||
|
|
||||||
|
const cli = 'ev -h';
|
||||||
|
const cmd = spawn(cli, { shell: true, stdio: 'inherit', cwd: process.cwd() });
|
||||||
|
cmd.on('close', (code) => {
|
||||||
|
console.log(`child process exited with code ${code}`);
|
||||||
|
});
|
||||||
|
cmd.on('error', (err) => {
|
||||||
|
console.error('Failed to start subprocess.', err);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"module": "CommonJS",
|
"module": "nodenext",
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
"outDir": "app-dist",
|
"outDir": "app-dist",
|
||||||
|
|||||||
Reference in New Issue
Block a user