mirror of
https://github.com/davidkaya/aryx.git
synced 2026-07-28 23:48:39 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa355197cb | ||
|
|
5f263002f0 | ||
|
|
1376de4148 | ||
|
|
5ce6bb4b0a | ||
|
|
47d3fb0a29 | ||
|
|
4da31cbdd6 | ||
|
|
f15323e37e | ||
|
|
f8fe9d866e |
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "aryx",
|
"name": "aryx",
|
||||||
"version": "0.0.27",
|
"version": "0.0.29",
|
||||||
"description": "Orchestrator for Copilot-powered agent workflows across multiple projects.",
|
"description": "Orchestrator for Copilot-powered agent workflows across multiple projects.",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "dist-electron/main/index.js",
|
"main": "dist-electron/main/index.js",
|
||||||
|
|||||||
+16
-4
@@ -16,6 +16,12 @@ import { createDefaultQuickPromptSettings } from '@shared/domain/tooling';
|
|||||||
|
|
||||||
const { app, BrowserWindow } = electron;
|
const { app, BrowserWindow } = electron;
|
||||||
|
|
||||||
|
// Enforce single instance — quit immediately if another instance already holds the lock.
|
||||||
|
const gotTheLock = app.requestSingleInstanceLock();
|
||||||
|
if (!gotTheLock) {
|
||||||
|
app.quit();
|
||||||
|
}
|
||||||
|
|
||||||
let mainWindow: BrowserWindowType | undefined;
|
let mainWindow: BrowserWindowType | undefined;
|
||||||
let quickPromptWindow: BrowserWindowType | undefined;
|
let quickPromptWindow: BrowserWindowType | undefined;
|
||||||
let appService: AryxAppService | undefined;
|
let appService: AryxAppService | undefined;
|
||||||
@@ -63,9 +69,9 @@ async function bootstrap(): Promise<void> {
|
|||||||
applyTitleBarTheme(mainWindow, workspace.settings.theme);
|
applyTitleBarTheme(mainWindow, workspace.settings.theme);
|
||||||
|
|
||||||
systemTray = new SystemTray({
|
systemTray = new SystemTray({
|
||||||
onShowWindow: showAndFocusWindow,
|
onShowWindow: () => showAndFocusWindow(mainWindow!),
|
||||||
onCreateScratchpad: () => {
|
onCreateScratchpad: () => {
|
||||||
showAndFocusWindow();
|
showAndFocusWindow(mainWindow!);
|
||||||
mainWindow?.webContents.send('tray:create-scratchpad');
|
mainWindow?.webContents.send('tray:create-scratchpad');
|
||||||
},
|
},
|
||||||
onQuit: () => app.quit(),
|
onQuit: () => app.quit(),
|
||||||
@@ -109,6 +115,12 @@ async function bootstrap(): Promise<void> {
|
|||||||
autoUpdateService.start();
|
autoUpdateService.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
app.on('second-instance', () => {
|
||||||
|
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||||
|
showAndFocusWindow(mainWindow);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
app.whenReady().then(bootstrap);
|
app.whenReady().then(bootstrap);
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
@@ -127,8 +139,8 @@ app.on('window-all-closed', () => {
|
|||||||
app.on('activate', async () => {
|
app.on('activate', async () => {
|
||||||
if (BrowserWindow.getAllWindows().length === 0) {
|
if (BrowserWindow.getAllWindows().length === 0) {
|
||||||
await bootstrap();
|
await bootstrap();
|
||||||
} else {
|
} else if (mainWindow && !mainWindow.isDestroyed()) {
|
||||||
showAndFocusWindow();
|
showAndFocusWindow(mainWindow);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { join } from 'node:path';
|
|||||||
|
|
||||||
import type { WorkspaceState } from '@shared/domain/workspace';
|
import type { WorkspaceState } from '@shared/domain/workspace';
|
||||||
|
|
||||||
const { app, Menu, Tray, nativeImage, BrowserWindow } = electron;
|
const { app, Menu, Tray, nativeImage } = electron;
|
||||||
type TrayType = InstanceType<typeof Tray>;
|
type TrayType = InstanceType<typeof Tray>;
|
||||||
type NativeImageType = ReturnType<typeof nativeImage.createFromPath>;
|
type NativeImageType = ReturnType<typeof nativeImage.createFromPath>;
|
||||||
|
|
||||||
@@ -123,10 +123,8 @@ export function setupCloseToTray(
|
|||||||
/**
|
/**
|
||||||
* Show and focus the main window, restoring from tray if hidden.
|
* Show and focus the main window, restoring from tray if hidden.
|
||||||
*/
|
*/
|
||||||
export function showAndFocusWindow(): void {
|
export function showAndFocusWindow(mainWindow: Electron.BrowserWindow): void {
|
||||||
const windows = BrowserWindow.getAllWindows();
|
if (mainWindow.isDestroyed()) return;
|
||||||
const mainWindow = windows[0];
|
|
||||||
if (!mainWindow) return;
|
|
||||||
|
|
||||||
// On macOS, show the dock icon again
|
// On macOS, show the dock icon again
|
||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin') {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { join, resolve } from 'node:path';
|
||||||
import { describe, expect, test } from 'bun:test';
|
import { describe, expect, test } from 'bun:test';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -8,6 +9,9 @@ import {
|
|||||||
type ReleaseDependencies,
|
type ReleaseDependencies,
|
||||||
} from '../../scripts/release';
|
} from '../../scripts/release';
|
||||||
|
|
||||||
|
const testRepositoryRoot = resolve('/test-workspace/aryx');
|
||||||
|
const testPackageJsonPath = join(testRepositoryRoot, 'package.json');
|
||||||
|
|
||||||
function gitSuccess(stdout = '', stderr = ''): GitCommandResult {
|
function gitSuccess(stdout = '', stderr = ''): GitCommandResult {
|
||||||
return {
|
return {
|
||||||
exitCode: 0,
|
exitCode: 0,
|
||||||
@@ -109,8 +113,8 @@ describe('release workflow', () => {
|
|||||||
|
|
||||||
const result = await runReleaseWorkflow(
|
const result = await runReleaseWorkflow(
|
||||||
{
|
{
|
||||||
repositoryRoot: 'C:\\workspace\\personal\\projects\\aryx',
|
repositoryRoot: testRepositoryRoot,
|
||||||
packageJsonPath: 'C:\\workspace\\personal\\projects\\aryx\\package.json',
|
packageJsonPath: testPackageJsonPath,
|
||||||
},
|
},
|
||||||
dependencies,
|
dependencies,
|
||||||
);
|
);
|
||||||
@@ -148,8 +152,8 @@ describe('release workflow', () => {
|
|||||||
await expect(
|
await expect(
|
||||||
runReleaseWorkflow(
|
runReleaseWorkflow(
|
||||||
{
|
{
|
||||||
repositoryRoot: 'C:\\workspace\\personal\\projects\\aryx',
|
repositoryRoot: testRepositoryRoot,
|
||||||
packageJsonPath: 'C:\\workspace\\personal\\projects\\aryx\\package.json',
|
packageJsonPath: testPackageJsonPath,
|
||||||
},
|
},
|
||||||
dependencies,
|
dependencies,
|
||||||
),
|
),
|
||||||
@@ -173,8 +177,8 @@ describe('release workflow', () => {
|
|||||||
await expect(
|
await expect(
|
||||||
runReleaseWorkflow(
|
runReleaseWorkflow(
|
||||||
{
|
{
|
||||||
repositoryRoot: 'C:\\workspace\\personal\\projects\\aryx',
|
repositoryRoot: testRepositoryRoot,
|
||||||
packageJsonPath: 'C:\\workspace\\personal\\projects\\aryx\\package.json',
|
packageJsonPath: testPackageJsonPath,
|
||||||
bumpArg: 'minor',
|
bumpArg: 'minor',
|
||||||
},
|
},
|
||||||
dependencies,
|
dependencies,
|
||||||
@@ -204,8 +208,8 @@ describe('release workflow', () => {
|
|||||||
await expect(
|
await expect(
|
||||||
runReleaseWorkflow(
|
runReleaseWorkflow(
|
||||||
{
|
{
|
||||||
repositoryRoot: 'C:\\workspace\\personal\\projects\\aryx',
|
repositoryRoot: testRepositoryRoot,
|
||||||
packageJsonPath: 'C:\\workspace\\personal\\projects\\aryx\\package.json',
|
packageJsonPath: testPackageJsonPath,
|
||||||
},
|
},
|
||||||
dependencies,
|
dependencies,
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user