feat: implement menu service for context menu management

feat: add provider API service for managing provider accounts and keys
feat: create provider runtime sync service for agent runtime management
feat: introduce script execution service for running automation scripts
feat: develop script store service for managing script metadata and storage
feat: implement theme service for managing application theme settings
feat: add updater service for handling application updates
feat: create window service for managing application windows and their states
This commit is contained in:
DEV_DSW
2026-04-22 09:26:39 +08:00
parent 9b8214cdd4
commit 416399e7a8
19 changed files with 33 additions and 33 deletions

View File

@@ -0,0 +1,37 @@
import { executeScriptService } from '@electron/service/execute-script-service';
import {
getScriptPathById,
updateLastRun,
} from '@electron/service/script-store-service';
import type { ScriptExecutionResult } from '../../types/script-types';
const executor = new executeScriptService();
export async function runScriptById(
id: string,
channel?: string,
): Promise<ScriptExecutionResult> {
const scriptPath = getScriptPathById(id);
if (!scriptPath) {
return {
success: false,
exitCode: null,
stdoutTail: '',
stderrTail: '',
error: 'Script not found',
};
}
const result = await executor.executeScript(scriptPath, {
SCRIPT_ID: id,
CHANNEL: channel || '',
});
updateLastRun(id, {
time: new Date().toISOString(),
success: result.success,
error: result.error,
});
return result;
}