Files
zn-ai/runtime-shared/lib/constants.ts
duanshuwen 301f7d33ed feat: implement launch at startup functionality in zn-ai
- Added a new setting for "launch at startup" in the GeneralSettingsPanel.
- Integrated the setting with the existing settings store and IPC mechanisms.
- Implemented platform-specific logic for enabling/disabling startup behavior in the main process.
- Created a new service for managing launch at startup settings, including Linux desktop entry creation.
- Added unit tests for the new functionality and ensured existing tests are updated accordingly.
- Updated i18n messages for the new setting in English, Chinese, and Japanese.
2026-04-20 23:29:10 +08:00

124 lines
3.4 KiB
TypeScript

export enum IPC_EVENTS {
EXTERNAL_OPEN = 'external-open',
APP_SET_FRAMELESS = 'app:set-frameless',
APP_LOAD_PAGE = 'app:load-page',
TAB_CREATE = 'tab:create',
TAB_LIST = 'tab:list',
TAB_NAVIGATE = 'tab:navigate',
TAB_RELOAD = 'tab:reload',
TAB_BACK = 'tab:back',
TAB_FORWARD = 'tab:forward',
TAB_SWITCH = 'tab:switch',
TAB_CLOSE = 'tab:close',
LOG_TO_MAIN = 'log-to-main',
READ_FILE = 'read-file',
INVOKE = 'ipc:invoke',
INVOKE_ASYNC = 'ipc:invokeAsync',
APP_MINIMIZE = 'app:minimize',
APP_MAXIMIZE = 'app:maximize',
APP_QUIT = 'app:quit',
FILE_READ = 'file:read',
FILE_WRITE = 'file:write',
GET_WINDOW_ID = 'get-window-id',
CUSTOM_EVENT = 'custom:event',
TIME_UPDATE = 'time:update',
RENDERER_IS_READY = 'renderer-ready',
SHOW_CONTEXT_MENU = 'show-context-menu',
START_A_DIALOGUE = 'start-a-dialogue',
OPEN_WINDOW = 'open-window',
LOG_DEBUG = 'log-debug',
LOG_INFO = 'log-info',
LOG_WARN = 'log-warn',
LOG_ERROR = 'log-error',
CONFIG_UPDATED = 'config-updated',
SET_CONFIG = 'set-config',
GET_CONFIG = 'get-config',
UPDATE_CONFIG = 'update-config',
SET_THEME_MODE = 'set-theme-mode',
GET_THEME_MODE = 'get-theme-mode',
IS_DARK_THEME = 'is-dark-theme',
THEME_MODE_UPDATED = 'theme-mode-updated',
EXECUTE_SCRIPT = 'execute-script',
TASK_PROGRESS = 'task:progress',
TASK_STARTED = 'task:started',
TASK_COMPLETED = 'task:completed',
OPEN_CHANNEL = 'open-channel',
SCRIPT_LIST = 'script:list',
SCRIPT_GET = 'script:get',
SCRIPT_SAVE = 'script:save',
SCRIPT_DELETE = 'script:delete',
SCRIPT_TOGGLE = 'script:toggle',
SCRIPT_RUN = 'script:run',
SCRIPT_RECORD_START = 'script:record-start',
SCRIPT_RECORD_STOP = 'script:record-stop',
SCRIPT_CODEGEN = 'script:codegen',
GATEWAY_RPC = 'gateway:rpc',
GATEWAY_EVENT = 'gateway:event',
UPDATE_CHECK = 'update:check',
UPDATE_DOWNLOAD = 'update:download',
UPDATE_INSTALL = 'update:install',
UPDATE_VERSION = 'update:version',
UPDATE_STATUS_CHANGED = 'update:status-changed',
}
export const MAIN_WIN_SIZE = {
width: 1440,
height: 900,
minWidth: 1440,
minHeight: 900,
} as const;
export enum WINDOW_NAMES {
MAIN = 'main',
SETTING = 'setting',
DIALOG = 'dialog',
LOADING = 'loading',
}
export enum CONFIG_KEYS {
THEME_MODE = 'themeMode',
PRIMARY_COLOR = 'primaryColor',
LANGUAGE = 'language',
FONT_SIZE = 'fontSize',
MINIMIZE_TO_TRAY = 'minimizeToTray',
LAUNCH_AT_STARTUP = 'launchAtStartup',
PROVIDER = 'provider',
DEFAULT_MODEL = 'defaultModel',
AUTO_CHECK_UPDATE = 'autoCheckUpdate',
AUTO_DOWNLOAD_UPDATE = 'autoDownloadUpdate',
GATEWAY_AUTO_START = 'gatewayAutoStart',
SELECTED_CHANNELS = 'selectedChannels',
IMAGE_CACHE = 'imageCache',
TASK_LIST = 'taskList',
}
export enum MENU_IDS {
CONVERSATION_ITEM = 'conversation-item',
CONVERSATION_LIST = 'conversation-list',
MESSAGE_ITEM = 'message-item',
}
export enum CONVERSATION_ITEM_MENU_IDS {
PIN = 'pin',
RENAME = 'rename',
DEL = 'del',
}
export enum CONVERSATION_LIST_MENU_IDS {
NEW_CONVERSATION = 'newConversation',
SORT_BY = 'sortBy',
SORT_BY_CREATE_TIME = 'sortByCreateTime',
SORT_BY_UPDATE_TIME = 'sortByUpdateTime',
SORT_BY_NAME = 'sortByName',
SORT_BY_MODEL = 'sortByModel',
SORT_ASCENDING = 'sortAscending',
SORT_DESCENDING = 'sortDescending',
BATCH_OPERATIONS = 'batchOperations',
}
export enum MESSAGE_ITEM_MENU_IDS {
COPY = 'copy',
DELETE = 'delete',
SELECT = 'select',
}