diff --git a/.changeset/clean-poets-joke.md b/.changeset/clean-poets-joke.md new file mode 100644 index 00000000..2edc5231 --- /dev/null +++ b/.changeset/clean-poets-joke.md @@ -0,0 +1,10 @@ +--- +"@promptx/desktop": minor +--- +**AgentX 支持多配置管理** + +- 新增多 API 配置(Profile)功能:可保存多组 API Key / Base URL / 模型,随时一键切换激活 +- 设置页面 AgentX 配置区改为列表 + 弹窗形式,支持新增、编辑、删除 +- 旧版单配置自动迁移为名为 "Default" 的 Profile,无需手动重新配置 +- Windows 平台在设置页面新增 Git 安装提示,附官网下载链接 +- 移除内置 MinGit,改为要求用户自行安装 Git for Windows diff --git a/.changeset/quiet-regions-knock.md b/.changeset/quiet-regions-knock.md deleted file mode 100644 index 4fe1a15c..00000000 --- a/.changeset/quiet-regions-knock.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -"@promptx/cli": major -"@promptx/desktop": major -"@promptx/config": major -"@promptx/core": major -"@promptx/logger": major -"@promptx/mcp-office": major -"@promptx/mcp-server": major -"@promptx/resource": major ---- - -## v2.0.0 — AgentX UI + RoleX (V2) + Skills Management - -This major release introduces three new core pillars: the AgentX conversational UI, the V2 RoleX role system, and global Skills management — along with significant desktop improvements and infrastructure upgrades. - -### ✨ New Features - -#### AgentX UI (Conversational Interface) -- Add MCP Office server and local settings support -- Add file path support for attachments (send file path as text, display as file cards) -- Add i18n support for agentx-ui components -- Improve conversation list layout and assistant entry width -- Add WelcomePage with typewriter effect and preset questions -- Add MCP configuration and restart dialog - -#### RoleX — V2 Role System -- Add V2 (RoleX) feature toggle in system settings -- Add V1/V2 version toggle and standardize role naming convention -- Complete V1/V2 role detail panel with structure, edit, and description tabs -- Split V1 role structure into overview/structure tabs; support `roleResources=all` -- Add memory/cognition tab with editable engrams and network graph visualization -- Add `goToSendMessage` utility and improve role page UX -- Hide V1/V2 tabs in roles list when V2 is disabled -- Match roles list layout to tools page when V2 is disabled -- Add system role avatars with upload support and i18n keys - -#### Skills Management -- Add global skills management page in AgentX -- Sync enabled skills to `~/.claude/skills/` for Claude Code discovery -- Link workdir skills directly to userData skills directory -- Replace placeholder Skills card with SkillsConfig component in settings - -#### Desktop & Infrastructure -- Add remote web access feature with LAN-aware IP detection -- Add resource import/delete with V1/V2 support -- Add MCP configuration and restart dialog -- Add bundled git-bash binaries for Windows -- Add `--no-v2` CLI flag to `mcp-server` to disable RoleX features (V2 enabled by default) - -### 🐛 Bug Fixes - -- Fix `--no-v2` default value — V2 should be enabled by default -- Fix system role avatar path resolution -- Fix runtime `settingSources` to include `project` and `user` for skills support -- Fix `core`: sync seed roles on version change and identify as system-level -- Fix desktop: bundle mcp-office and fix runtime paths for production -- Fix agentx-ui layout: rolex growup and agentx-window sizing -- Fix i18n: update skills translations to match component usage - -### ♻️ Refactors - -- Extract `roles-window` and `tools-window` into dedicated sub-components -- Merge network/cues tabs; add i18n type labels and flex layout with hidden scrollbar -- Unify agentx-ui block widths and remove deprecated components -- Enhance tools page with edit info, plaza filter, and standardized metadata -- Add create tool button and switch to black/white color scheme -- Set AgentX as the default page; configure Electron mirror diff --git a/README.md b/README.md index bcdf33ad..ce296b53 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,8 @@ AI: Provides in-depth product strategy advice as a professional product manage | 🍎**macOS (Intel)** | [Download .dmg](https://promptx.deepractice.ai/download/latest/promptx-desktop-mac-x64.dmg) | | 🪟**Windows** | [Download .exe](https://promptx.deepractice.ai/download/latest/promptx-desktop-win32-x64-setup.exe) | +> **Windows users:** The AgentX feature requires [Git for Windows](https://git-scm.com/download/win) to be installed. Please install it before using AgentX. + [📦 View All Releases & Platforms](https://promptx.deepractice.ai/download/) (Linux, Portable versions, etc.) #### 🚀 Quick Start diff --git a/apps/desktop/electron-builder.yml b/apps/desktop/electron-builder.yml index eb0598fb..3a0b0468 100644 --- a/apps/desktop/electron-builder.yml +++ b/apps/desktop/electron-builder.yml @@ -51,11 +51,6 @@ win: icon: assets/icons/icon.png artifactName: promptx-desktop-${version}-win32-${arch}.${ext} requestedExecutionLevel: asInvoker - extraResources: - - from: "resources/win/git-bash" - to: "git-bash" - filter: - - "**/*" target: - nsis diff --git a/apps/desktop/resources/win/git-bash/bin/bash.exe b/apps/desktop/resources/win/git-bash/bin/bash.exe deleted file mode 100644 index 65d31bb2..00000000 Binary files a/apps/desktop/resources/win/git-bash/bin/bash.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/bin/sh.exe b/apps/desktop/resources/win/git-bash/bin/sh.exe deleted file mode 100644 index 67761e0e..00000000 Binary files a/apps/desktop/resources/win/git-bash/bin/sh.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/etc/DIR_COLORS b/apps/desktop/resources/win/git-bash/etc/DIR_COLORS deleted file mode 100644 index 8f795bc9..00000000 --- a/apps/desktop/resources/win/git-bash/etc/DIR_COLORS +++ /dev/null @@ -1,207 +0,0 @@ -# Configuration file for dircolors, a utility to help you set the -# LS_COLORS environment variable used by GNU ls with the --color option. - -# Copyright (C) 1996-2020 Free Software Foundation, Inc. -# Copying and distribution of this file, with or without modification, -# are permitted provided the copyright notice and this notice are preserved. - -# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the -# slackware version of dircolors) are recognized but ignored. - -# Below are TERM entries, which can be a glob patterns, to match -# against the TERM environment variable to determine if it is colorizable. -TERM Eterm -TERM ansi -TERM *color* -TERM con[0-9]*x[0-9]* -TERM cons25 -TERM console -TERM cygwin -TERM dtterm -TERM gnome -TERM hurd -TERM jfbterm -TERM konsole -TERM kterm -TERM linux -TERM linux-c -TERM mlterm -TERM putty -TERM rxvt* -TERM screen* -TERM st -TERM terminator -TERM tmux* -TERM vt100 -TERM xterm* - -# Below are the color init strings for the basic file types. -# One can use codes for 256 or more colors supported by modern terminals. -# The default color codes use the capabilities of an 8 color terminal -# with some additional attributes as per the following codes: -# Attribute codes: -# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed -# Text color codes: -# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white -# Background color codes: -# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white -#NORMAL 00 # no color code at all -#FILE 00 # regular file: use no color at all -RESET 0 # reset to "normal" color -DIR 01;34 # directory -LINK 01;36 # symbolic link. (If you set this to 'target' instead of a - # numerical value, the color is as for the file pointed to.) -MULTIHARDLINK 00 # regular file with more than one link -FIFO 40;33 # pipe -SOCK 01;35 # socket -DOOR 01;35 # door -BLK 40;33;01 # block device driver -CHR 40;33;01 # character device driver -ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file ... -MISSING 00 # ... and the files they point to -SETUID 37;41 # file that is setuid (u+s) -SETGID 30;43 # file that is setgid (g+s) -CAPABILITY 30;41 # file with capability -STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w) -OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky -STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable - -# This is for files with execute permission: -EXEC 01;32 - -# List any file extensions like '.gz' or '.tar' that you would like ls -# to colorize below. Put the extension, a space, and the color init string. -# (and any comments you want to add after a '#') - -# If you use DOS-style suffixes, you may want to uncomment the following: -#.cmd 01;32 # executables (bright green) -#.exe 01;32 -#.com 01;32 -#.btm 01;32 -#.bat 01;32 -# Or if you want to colorize scripts even if they do not have the -# executable bit actually set. -#.sh 01;32 -#.csh 01;32 - - # archives or compressed (bright red) -.tar 01;31 -.tgz 01;31 -.arc 01;31 -.arj 01;31 -.taz 01;31 -.lha 01;31 -.lz4 01;31 -.lzh 01;31 -.lzma 01;31 -.tlz 01;31 -.txz 01;31 -.tzo 01;31 -.t7z 01;31 -.zip 01;31 -.z 01;31 -.dz 01;31 -.gz 01;31 -.lrz 01;31 -.lz 01;31 -.lzo 01;31 -.xz 01;31 -.zst 01;31 -.tzst 01;31 -.bz2 01;31 -.bz 01;31 -.tbz 01;31 -.tbz2 01;31 -.tz 01;31 -.deb 01;31 -.rpm 01;31 -.jar 01;31 -.war 01;31 -.ear 01;31 -.sar 01;31 -.rar 01;31 -.alz 01;31 -.ace 01;31 -.zoo 01;31 -.cpio 01;31 -.7z 01;31 -.rz 01;31 -.cab 01;31 -.wim 01;31 -.swm 01;31 -.dwm 01;31 -.esd 01;31 - -# image formats -.jpg 01;35 -.jpeg 01;35 -.mjpg 01;35 -.mjpeg 01;35 -.gif 01;35 -.bmp 01;35 -.pbm 01;35 -.pgm 01;35 -.ppm 01;35 -.tga 01;35 -.xbm 01;35 -.xpm 01;35 -.tif 01;35 -.tiff 01;35 -.png 01;35 -.svg 01;35 -.svgz 01;35 -.mng 01;35 -.pcx 01;35 -.mov 01;35 -.mpg 01;35 -.mpeg 01;35 -.m2v 01;35 -.mkv 01;35 -.webm 01;35 -.webp 01;35 -.ogm 01;35 -.mp4 01;35 -.m4v 01;35 -.mp4v 01;35 -.vob 01;35 -.qt 01;35 -.nuv 01;35 -.wmv 01;35 -.asf 01;35 -.rm 01;35 -.rmvb 01;35 -.flc 01;35 -.avi 01;35 -.fli 01;35 -.flv 01;35 -.gl 01;35 -.dl 01;35 -.xcf 01;35 -.xwd 01;35 -.yuv 01;35 -.cgm 01;35 -.emf 01;35 - -# https://wiki.xiph.org/MIME_Types_and_File_Extensions -.ogv 01;35 -.ogx 01;35 - -# audio formats -.aac 00;36 -.au 00;36 -.flac 00;36 -.m4a 00;36 -.mid 00;36 -.midi 00;36 -.mka 00;36 -.mp3 00;36 -.mpc 00;36 -.ogg 00;36 -.ra 00;36 -.wav 00;36 - -# https://wiki.xiph.org/MIME_Types_and_File_Extensions -.oga 00;36 -.opus 00;36 -.spx 00;36 -.xspf 00;36 diff --git a/apps/desktop/resources/win/git-bash/etc/bash.bashrc b/apps/desktop/resources/win/git-bash/etc/bash.bashrc deleted file mode 100644 index 28f5ba41..00000000 --- a/apps/desktop/resources/win/git-bash/etc/bash.bashrc +++ /dev/null @@ -1,69 +0,0 @@ -# To the extent possible under law, the author(s) have dedicated all -# copyright and related and neighboring rights to this software to the -# public domain worldwide. This software is distributed without any warranty. -# You should have received a copy of the CC0 Public Domain Dedication along -# with this software. -# If not, see . - -# /etc/bash.bashrc: executed by bash(1) for interactive shells. - -# System-wide bashrc file - -# Check that we haven't already been sourced. -([[ -z ${CYG_SYS_BASHRC} ]] && CYG_SYS_BASHRC="1") || return - -# If not running interactively, don't do anything -[[ "$-" != *i* ]] && return - -# If started from sshd, make sure profile is sourced -if [[ -n "$SSH_CONNECTION" ]] && [[ "$PATH" != *:/usr/bin* ]]; then - source /etc/profile -fi - -# Warnings -unset _warning_found -for _warning_prefix in '' ${MINGW_PREFIX}; do - for _warning_file in ${_warning_prefix}/etc/profile.d/*.warning{.once,}; do - test -f "${_warning_file}" || continue - _warning="$(command sed 's/^/\t\t/' "${_warning_file}" 2>/dev/null)" - if test -n "${_warning}"; then - if test -z "${_warning_found}"; then - _warning_found='true' - echo - fi - if test -t 1 - then printf "\t\e[1;33mwarning:\e[0m\n${_warning}\n\n" - else printf "\twarning:\n${_warning}\n\n" - fi - fi - [[ "${_warning_file}" = *.once ]] && rm -f "${_warning_file}" - done -done -unset _warning_found -unset _warning_prefix -unset _warning_file -unset _warning - -# If MSYS2_PS1 is set, use that as default PS1; -# if a PS1 is already set and exported, use that; -# otherwise set a default prompt -# of user@host, MSYSTEM variable, and current_directory -[[ -n "${MSYS2_PS1}" ]] && export PS1="${MSYS2_PS1}" -# if we have the "High Mandatory Level" group, it means we're elevated -#if [[ -n "$(command -v getent)" ]] && id -G | grep -q "$(getent -w group 'S-1-16-12288' | cut -d: -f2)" -# then _ps1_symbol='\[\e[1m\]#\[\e[0m\]' -# else _ps1_symbol='\$' -#fi -case "$(declare -p PS1 2>/dev/null)" in -'declare -x '*) ;; # okay -*) - export PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[35m\]$MSYSTEM\[\e[0m\] \[\e[33m\]\w\[\e[0m\]\n'"${_ps1_symbol}"' ' - ;; -esac -unset _ps1_symbol - -# Uncomment to use the terminal colours set in DIR_COLORS -# eval "$(dircolors -b /etc/DIR_COLORS)" - -# Fixup git-bash in non login env -shopt -q login_shell || . /etc/profile.d/git-prompt.sh diff --git a/apps/desktop/resources/win/git-bash/etc/fstab b/apps/desktop/resources/win/git-bash/etc/fstab deleted file mode 100644 index 738f7420..00000000 --- a/apps/desktop/resources/win/git-bash/etc/fstab +++ /dev/null @@ -1,6 +0,0 @@ -# For a description of the file format, see the Users Guide -# https://cygwin.com/cygwin-ug-net/using.html#mount-table - -# DO NOT REMOVE NEXT LINE. It remove cygdrive prefix from path -none / cygdrive binary,posix=0,noacl,user 0 0 -none /tmp usertemp binary,posix=0,noacl 0 0 diff --git a/apps/desktop/resources/win/git-bash/etc/inputrc b/apps/desktop/resources/win/git-bash/etc/inputrc deleted file mode 100644 index 5c3bdb6e..00000000 --- a/apps/desktop/resources/win/git-bash/etc/inputrc +++ /dev/null @@ -1,82 +0,0 @@ -# none, visible or audible -set bell-style visible - -# Ask before displaying >40 items -# Since $WINDIR $PATH var can be in $PATH, this could list -# all window executables in C:\WINDOWS -set completion-query-items 40 - -# Ignore case for the command-line-completion functionality -# on: default on a Windows style console -# off: default on a *nix style console -set completion-ignore-case on - -# disable/enable 8bit input -set input-meta on -set output-meta on -set convert-meta off - -# visible-stats -# Append a mark according to the file type in a listing -set visible-stats off -set mark-directories on -set mark-symlinked-directories on - -# Beep first, show all only upon double-Tab -set show-all-if-ambiguous off - -# MSYSTEM is emacs based -$if mode=emacs - # Common to Console & RXVT - "\e[2;2~": paste-from-clipboard # Shift-Insert - "\e[5~": beginning-of-history # Page up - "\e[6~": end-of-history # Page down - - # Mintty - "\e[1;5D": "\eOD" # Ctrl-Left - "\e[1;5C": "\eOC" # Ctrl-Right - "\e[1;5A": "\eOA" # Ctrl-Up - "\e[1;5B": "\eOB" # Ctrl-Down - "\e[1;3D": "\e\e[D" # Alt-Left - "\e[1;3C": "\e\e[C" # Alt-Right - - "\e[Z": complete # Shift-Tab - - $if term=msys # RXVT - "\e[7~": beginning-of-line # Home Key - "\e[8~": end-of-line # End Key - "\e[11~": display-shell-version # F1 - "\e[15~": re-read-init-file # F5 - "\e[12~": "Function Key 2" - "\e[13~": "Function Key 3" - "\e[14~": "Function Key 4" - "\e[17~": "Function Key 6" - "\e[18~": "Function Key 7" - "\e[19~": "Function Key 8" - "\e[20~": "Function Key 9" - "\e[21~": "Function Key 10" - $else - # Eh, normal Console is not really cygwin anymore, is it? Using 'else' instead. -mstormo - # $if term=cygwin # Console - "\e[1~": beginning-of-line # Home Key - "\e[4~": end-of-line # End Key - "\e[3~": delete-char # Delete Key - "\e[1;5D": backward-word # Ctrl-Left - "\e[1;5C": forward-word # Ctrl-Right - "\e\e[C": forward-word # Alt-Right - "\e\e[D": backward-word # Alt-Left - "\e[17~": "Function Key 6" - "\e[18~": "Function Key 7" - "\e[19~": "Function Key 8" - "\e[20~": "Function Key 9" - "\e[21~": "Function Key 10" - "\e[23~": "Function Key 11" - $endif - - $if term=cygwin - "\e[A": previous-history # Cursor Up - "\e[B": next-history # Cursor Down - "\e[C": forward-char # Cursor Right - "\e[D": backward-char # Cursor Left - $endif -$endif diff --git a/apps/desktop/resources/win/git-bash/etc/mtab b/apps/desktop/resources/win/git-bash/etc/mtab deleted file mode 100644 index e69de29b..00000000 diff --git a/apps/desktop/resources/win/git-bash/etc/nsswitch.conf b/apps/desktop/resources/win/git-bash/etc/nsswitch.conf deleted file mode 100644 index fb960eb8..00000000 --- a/apps/desktop/resources/win/git-bash/etc/nsswitch.conf +++ /dev/null @@ -1,12 +0,0 @@ -# Begin /etc/nsswitch.conf - -passwd: files db -group: files # db - -db_enum: cache builtin - -db_home: env windows cygwin desc -db_shell: env windows # cygwin desc -db_gecos: env # cygwin desc - -# End /etc/nsswitch.conf diff --git a/apps/desktop/resources/win/git-bash/etc/profile b/apps/desktop/resources/win/git-bash/etc/profile deleted file mode 100644 index 2aa95e76..00000000 --- a/apps/desktop/resources/win/git-bash/etc/profile +++ /dev/null @@ -1,146 +0,0 @@ -# To the extent possible under law, the author(s) have dedicated all -# copyright and related and neighboring rights to this software to the -# public domain worldwide. This software is distributed without any warranty. -# You should have received a copy of the CC0 Public Domain Dedication along -# with this software. -# If not, see . - - -# System-wide profile file - -# Some resources... -# Customizing Your Shell: http://www.dsl.org/cookbook/cookbook_5.html#SEC69 -# Consistent BackSpace and Delete Configuration: -# http://www.ibb.net/~anne/keyboard.html -# The Linux Documentation Project: https://www.tldp.org/ -# The Linux Cookbook: https://www.tldp.org/LDP/linuxcookbook/html/ -# Greg's Wiki https://mywiki.wooledge.org/ - -# Setup some default paths. Note that this order will allow user installed -# software to override 'system' software. -# Modifying these default path settings can be done in different ways. -# To learn more about startup files, refer to your shell's man page. - -MSYS2_PATH="/usr/local/bin:/usr/bin:/bin" -MANPATH='/usr/local/man:/usr/share/man:/usr/man:/share/man' -INFOPATH='/usr/local/info:/usr/share/info:/usr/info:/share/info' - -case "${MSYS2_PATH_TYPE:-inherit}" in - strict) - # Do not inherit any path configuration, and allow for full customization - # of external path. This is supposed to be used in special cases such as - # debugging without need to change this file, but not daily usage. - unset ORIGINAL_PATH - ;; - inherit) - # Inherit previous path. Note that this will make all of the Windows path - # available in current shell, with possible interference in project builds. - ORIGINAL_PATH="${ORIGINAL_PATH:-${PATH}}" - ;; - *) - # Do not inherit any path configuration but configure a default Windows path - # suitable for normal usage with minimal external interference. - WIN_ROOT="$(PATH=${MSYS2_PATH} exec cygpath -Wu)" - ORIGINAL_PATH="${WIN_ROOT}/System32:${WIN_ROOT}:${WIN_ROOT}/System32/Wbem:${WIN_ROOT}/System32/WindowsPowerShell/v1.0/" -esac - -unset MINGW_MOUNT_POINT -. '/etc/msystem' -case "${MSYSTEM}" in -MINGW*|CLANG*|UCRT*) - MINGW_MOUNT_POINT="${MINGW_PREFIX}" - PATH="${MINGW_MOUNT_POINT}/bin:${MSYS2_PATH}${ORIGINAL_PATH:+:${ORIGINAL_PATH}}" - PKG_CONFIG_PATH="${MINGW_MOUNT_POINT}/lib/pkgconfig:${MINGW_MOUNT_POINT}/share/pkgconfig" - PKG_CONFIG_SYSTEM_INCLUDE_PATH="${MINGW_MOUNT_POINT}/include" - PKG_CONFIG_SYSTEM_LIBRARY_PATH="${MINGW_MOUNT_POINT}/lib" - ACLOCAL_PATH="${MINGW_MOUNT_POINT}/share/aclocal:/usr/share/aclocal" - MANPATH="${MINGW_MOUNT_POINT}/local/man:${MINGW_MOUNT_POINT}/share/man:${MANPATH}" - INFOPATH="${MINGW_MOUNT_POINT}/local/info:${MINGW_MOUNT_POINT}/share/info:${INFOPATH}" - ;; -*) - PATH="${MSYS2_PATH}:/opt/bin${ORIGINAL_PATH:+:${ORIGINAL_PATH}}" - PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig" -esac - -CONFIG_SITE="/etc/config.site" - -MAYBE_FIRST_START=false -if [ ! -d "${HOME}" ]; then - printf "\e[1;32mMSYS2 is starting for the first time. Executing the initial setup.\e[1;0m\n" 1>&2; - MAYBE_FIRST_START=true -fi - -SYSCONFDIR="${SYSCONFDIR:=/etc}" - -# TMP and TEMP as defined in the Windows environment must be kept -# for windows apps, even if started from msys2. However, leaving -# them set to the default Windows temporary directory or unset -# can have unexpected consequences for msys2 apps, so we define -# our own to match GNU/Linux behaviour. -ORIGINAL_TMP="${ORIGINAL_TMP:-${TMP}}" -ORIGINAL_TEMP="${ORIGINAL_TEMP:-${TEMP}}" -#TMP="/tmp" -#TEMP="/tmp" -case "$TMP" in *\\*) TMP="$(cygpath -m "$TMP")";; esac -case "$TEMP" in *\\*) TEMP="$(cygpath -m "$TEMP")";; esac -test -d "$TMPDIR" || test ! -d "$TMP" || { - TMPDIR="$TMP" - export TMPDIR -} - - -# Shell dependent settings -profile_d () -{ - local file= - for file in $(export LC_COLLATE=C; echo /etc/profile.d/*.$1); do - [ -e "${file}" ] && . "${file}" - done - - if [ -n "${MINGW_MOUNT_POINT}" ]; then - for file in $(export LC_COLLATE=C; echo ${MINGW_MOUNT_POINT}/etc/profile.d/*.$1); do - [ -e "${file}" ] && . "${file}" - done - fi -} - -for postinst in $(export LC_COLLATE=C; echo /etc/post-install/*.post); do - [ -e "${postinst}" ] && . "${postinst}" -done - -if [ ! "x${BASH_VERSION}" = "x" ]; then - HOSTNAME="$(exec /usr/bin/hostname)" - SHELL=`which bash` - profile_d sh - [ -f "/etc/bash.bashrc" ] && . "/etc/bash.bashrc" -elif [ ! "x${KSH_VERSION}" = "x" ]; then - typeset -l HOSTNAME="$(exec /usr/bin/hostname)" - profile_d sh - PS1=$(print '\033]0;${PWD}\n\033[32m${USER}@${HOSTNAME} \033[33m${PWD/${HOME}/~}\033[0m\n$ ') -elif [ ! "x${ZSH_VERSION}" = "x" ]; then - HOSTNAME="$(exec /usr/bin/hostname)" - profile_d sh - profile_d zsh - PS1='(%n@%m)[%h] %~ %% ' - SHELL=`which zsh` -elif [ ! "x${POSH_VERSION}" = "x" ]; then - HOSTNAME="$(exec /usr/bin/hostname)" - PS1="$ " -else - HOSTNAME="$(exec /usr/bin/hostname)" - profile_d sh - PS1="$ " -fi - -if [ -n "$ACLOCAL_PATH" ] -then - export ACLOCAL_PATH -fi - -export PATH MANPATH INFOPATH PKG_CONFIG_PATH PKG_CONFIG_SYSTEM_INCLUDE_PATH PKG_CONFIG_SYSTEM_LIBRARY_PATH USER TMP TEMP HOSTNAME PS1 SHELL ORIGINAL_TMP ORIGINAL_TEMP ORIGINAL_PATH CONFIG_SITE -unset PATH_SEPARATOR - -if [ "$MAYBE_FIRST_START" = "true" ]; then - printf "\e[1;32mInitial setup complete. MSYS2 is now ready to use.\e[1;0m\n" 1>&2; -fi -unset MAYBE_FIRST_START diff --git a/apps/desktop/resources/win/git-bash/usr/bin/awk.exe b/apps/desktop/resources/win/git-bash/usr/bin/awk.exe deleted file mode 100644 index 3a5e2001..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/awk.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/basename.exe b/apps/desktop/resources/win/git-bash/usr/bin/basename.exe deleted file mode 100644 index 1839a389..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/basename.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/bash.exe b/apps/desktop/resources/win/git-bash/usr/bin/bash.exe deleted file mode 100644 index 65d31bb2..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/bash.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/cat.exe b/apps/desktop/resources/win/git-bash/usr/bin/cat.exe deleted file mode 100644 index ce4da335..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/cat.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/chmod.exe b/apps/desktop/resources/win/git-bash/usr/bin/chmod.exe deleted file mode 100644 index d4b4d95b..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/chmod.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/cp.exe b/apps/desktop/resources/win/git-bash/usr/bin/cp.exe deleted file mode 100644 index 3658198b..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/cp.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/cut.exe b/apps/desktop/resources/win/git-bash/usr/bin/cut.exe deleted file mode 100644 index 8706f824..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/cut.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/cygpath.exe b/apps/desktop/resources/win/git-bash/usr/bin/cygpath.exe deleted file mode 100644 index 2d0f1591..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/cygpath.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/date.exe b/apps/desktop/resources/win/git-bash/usr/bin/date.exe deleted file mode 100644 index 098d7f11..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/date.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/dirname.exe b/apps/desktop/resources/win/git-bash/usr/bin/dirname.exe deleted file mode 100644 index 6ebcda3d..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/dirname.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/echo.exe b/apps/desktop/resources/win/git-bash/usr/bin/echo.exe deleted file mode 100644 index a7030516..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/echo.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/env.exe b/apps/desktop/resources/win/git-bash/usr/bin/env.exe deleted file mode 100644 index d3408cbf..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/env.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/expr.exe b/apps/desktop/resources/win/git-bash/usr/bin/expr.exe deleted file mode 100644 index 74ea339a..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/expr.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/false.exe b/apps/desktop/resources/win/git-bash/usr/bin/false.exe deleted file mode 100644 index 39b03b68..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/false.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/find.exe b/apps/desktop/resources/win/git-bash/usr/bin/find.exe deleted file mode 100644 index a12f7537..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/find.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/gawk.exe b/apps/desktop/resources/win/git-bash/usr/bin/gawk.exe deleted file mode 100644 index 3a5e2001..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/gawk.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/grep.exe b/apps/desktop/resources/win/git-bash/usr/bin/grep.exe deleted file mode 100644 index 18777448..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/grep.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/head.exe b/apps/desktop/resources/win/git-bash/usr/bin/head.exe deleted file mode 100644 index 3cd9f333..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/head.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/ls.exe b/apps/desktop/resources/win/git-bash/usr/bin/ls.exe deleted file mode 100644 index 86786085..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/ls.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/mkdir.exe b/apps/desktop/resources/win/git-bash/usr/bin/mkdir.exe deleted file mode 100644 index 50edba24..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/mkdir.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-2.0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-2.0.dll deleted file mode 100644 index 4ec83b65..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-2.0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-apr-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-apr-1-0.dll deleted file mode 100644 index 3b1d665f..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-apr-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-aprutil-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-aprutil-1-0.dll deleted file mode 100644 index fb59143e..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-aprutil-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-asn1-8.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-asn1-8.dll deleted file mode 100644 index 9e99834d..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-asn1-8.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-assuan-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-assuan-0.dll deleted file mode 100644 index f8418409..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-assuan-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-bz2-1.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-bz2-1.dll deleted file mode 100644 index ec39449a..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-bz2-1.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-cbor-0.11.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-cbor-0.11.dll deleted file mode 100644 index b917c77f..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-cbor-0.11.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-com_err-1.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-com_err-1.dll deleted file mode 100644 index 43b10181..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-com_err-1.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-crypt-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-crypt-0.dll deleted file mode 100644 index 6834c617..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-crypt-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-crypt-2.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-crypt-2.dll deleted file mode 100644 index a0cfbe8a..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-crypt-2.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-crypto-3.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-crypto-3.dll deleted file mode 100644 index 8e176a05..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-crypto-3.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-edit-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-edit-0.dll deleted file mode 100644 index ad2f949d..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-edit-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-expat-1.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-expat-1.dll deleted file mode 100644 index 2667176b..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-expat-1.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-ffi-8.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-ffi-8.dll deleted file mode 100644 index f3a7dad3..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-ffi-8.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-fido2-1.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-fido2-1.dll deleted file mode 100644 index 00752eeb..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-fido2-1.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-gcc_s-seh-1.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-gcc_s-seh-1.dll deleted file mode 100644 index f17b29c7..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-gcc_s-seh-1.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-gcrypt-20.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-gcrypt-20.dll deleted file mode 100644 index 1d1f1d4b..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-gcrypt-20.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-gmp-10.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-gmp-10.dll deleted file mode 100644 index c22ff0c8..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-gmp-10.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-gnutls-30.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-gnutls-30.dll deleted file mode 100644 index b47d71ab..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-gnutls-30.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-gpg-error-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-gpg-error-0.dll deleted file mode 100644 index b9eed6d3..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-gpg-error-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-gssapi-3.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-gssapi-3.dll deleted file mode 100644 index dd99a5ba..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-gssapi-3.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-hcrypto-4.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-hcrypto-4.dll deleted file mode 100644 index a6ec7686..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-hcrypto-4.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-heimbase-1.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-heimbase-1.dll deleted file mode 100644 index 0a2674e9..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-heimbase-1.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-heimntlm-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-heimntlm-0.dll deleted file mode 100644 index 0427b2b2..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-heimntlm-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-hogweed-6.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-hogweed-6.dll deleted file mode 100644 index 1b6161e9..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-hogweed-6.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-hx509-5.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-hx509-5.dll deleted file mode 100644 index 14606548..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-hx509-5.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-iconv-2.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-iconv-2.dll deleted file mode 100644 index 42f61060..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-iconv-2.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-idn2-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-idn2-0.dll deleted file mode 100644 index 7576c909..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-idn2-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-intl-8.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-intl-8.dll deleted file mode 100644 index 8cb09977..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-intl-8.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-krb5-26.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-krb5-26.dll deleted file mode 100644 index dc56a458..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-krb5-26.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-ksba-8.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-ksba-8.dll deleted file mode 100644 index 224b1dac..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-ksba-8.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-lz4-1.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-lz4-1.dll deleted file mode 100644 index 8107a579..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-lz4-1.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-lzma-5.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-lzma-5.dll deleted file mode 100644 index db7b9751..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-lzma-5.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-magic-1.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-magic-1.dll deleted file mode 100644 index 33fdf450..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-magic-1.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-mpfr-6.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-mpfr-6.dll deleted file mode 100644 index 35913a1f..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-mpfr-6.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-ncursesw6.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-ncursesw6.dll deleted file mode 100644 index c192f520..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-ncursesw6.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-nettle-8.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-nettle-8.dll deleted file mode 100644 index 2f633c76..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-nettle-8.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-npth-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-npth-0.dll deleted file mode 100644 index 1af6c4f5..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-npth-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-p11-kit-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-p11-kit-0.dll deleted file mode 100644 index 6d957dda..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-p11-kit-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-pcre-1.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-pcre-1.dll deleted file mode 100644 index b66fc415..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-pcre-1.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-pcre2-8-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-pcre2-8-0.dll deleted file mode 100644 index 3cf89e60..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-pcre2-8-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-pcre2-posix-3.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-pcre2-posix-3.dll deleted file mode 100644 index e02e6dc3..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-pcre2-posix-3.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-perl5_38.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-perl5_38.dll deleted file mode 100644 index e56e087f..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-perl5_38.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-psl-5.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-psl-5.dll deleted file mode 100644 index c361bd77..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-psl-5.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-readline8.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-readline8.dll deleted file mode 100644 index 1e35348a..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-readline8.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-roken-18.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-roken-18.dll deleted file mode 100644 index 78339d2d..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-roken-18.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-sasl2-3.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-sasl2-3.dll deleted file mode 100644 index 41659ef5..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-sasl2-3.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-serf-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-serf-1-0.dll deleted file mode 100644 index c1db9a12..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-serf-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-smartcols-1.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-smartcols-1.dll deleted file mode 100644 index 6c64bfd6..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-smartcols-1.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-sqlite3-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-sqlite3-0.dll deleted file mode 100644 index e0ef4c3b..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-sqlite3-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-ssl-3.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-ssl-3.dll deleted file mode 100644 index a79cd082..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-ssl-3.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_client-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_client-1-0.dll deleted file mode 100644 index 5fc7515d..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_client-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_delta-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_delta-1-0.dll deleted file mode 100644 index f35a723d..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_delta-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_diff-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_diff-1-0.dll deleted file mode 100644 index c9d6e1f6..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_diff-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_fs-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_fs-1-0.dll deleted file mode 100644 index 6f5ae7ff..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_fs-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_fs_fs-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_fs_fs-1-0.dll deleted file mode 100644 index 4b5300b9..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_fs_fs-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_fs_util-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_fs_util-1-0.dll deleted file mode 100644 index 3b7655e4..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_fs_util-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_fs_x-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_fs_x-1-0.dll deleted file mode 100644 index cb2a48c2..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_fs_x-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_ra-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_ra-1-0.dll deleted file mode 100644 index 8ba3347b..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_ra-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_ra_local-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_ra_local-1-0.dll deleted file mode 100644 index 2f9b9631..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_ra_local-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_ra_serf-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_ra_serf-1-0.dll deleted file mode 100644 index 33b01584..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_ra_serf-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_ra_svn-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_ra_svn-1-0.dll deleted file mode 100644 index a2c0f909..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_ra_svn-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_repos-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_repos-1-0.dll deleted file mode 100644 index d2bf5001..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_repos-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_subr-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_subr-1-0.dll deleted file mode 100644 index 1841a436..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_subr-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_swig_perl-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_swig_perl-1-0.dll deleted file mode 100644 index c75fa679..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_swig_perl-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_wc-1-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_wc-1-0.dll deleted file mode 100644 index 433a2b45..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-svn_wc-1-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-tasn1-6.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-tasn1-6.dll deleted file mode 100644 index 81add91a..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-tasn1-6.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-ticw6.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-ticw6.dll deleted file mode 100644 index e1b495b8..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-ticw6.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-unistring-5.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-unistring-5.dll deleted file mode 100644 index fa601802..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-unistring-5.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-uuid-1.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-uuid-1.dll deleted file mode 100644 index 93e70c0b..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-uuid-1.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-wind-0.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-wind-0.dll deleted file mode 100644 index 9d759463..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-wind-0.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-z.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-z.dll deleted file mode 100644 index 8b684d71..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-z.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/msys-zstd-1.dll b/apps/desktop/resources/win/git-bash/usr/bin/msys-zstd-1.dll deleted file mode 100644 index 1058b163..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/msys-zstd-1.dll and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/mv.exe b/apps/desktop/resources/win/git-bash/usr/bin/mv.exe deleted file mode 100644 index 2c125b8f..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/mv.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/printf.exe b/apps/desktop/resources/win/git-bash/usr/bin/printf.exe deleted file mode 100644 index 58b7efd3..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/printf.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/pwd.exe b/apps/desktop/resources/win/git-bash/usr/bin/pwd.exe deleted file mode 100644 index 1b6cfd6d..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/pwd.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/rm.exe b/apps/desktop/resources/win/git-bash/usr/bin/rm.exe deleted file mode 100644 index c5e95f72..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/rm.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/sed.exe b/apps/desktop/resources/win/git-bash/usr/bin/sed.exe deleted file mode 100644 index 0d1911ba..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/sed.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/sleep.exe b/apps/desktop/resources/win/git-bash/usr/bin/sleep.exe deleted file mode 100644 index ccd446bf..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/sleep.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/sort.exe b/apps/desktop/resources/win/git-bash/usr/bin/sort.exe deleted file mode 100644 index 67e1d2c3..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/sort.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/tail.exe b/apps/desktop/resources/win/git-bash/usr/bin/tail.exe deleted file mode 100644 index e89c17d8..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/tail.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/test.exe b/apps/desktop/resources/win/git-bash/usr/bin/test.exe deleted file mode 100644 index f51600e8..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/test.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/touch.exe b/apps/desktop/resources/win/git-bash/usr/bin/touch.exe deleted file mode 100644 index 50649bdc..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/touch.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/tr.exe b/apps/desktop/resources/win/git-bash/usr/bin/tr.exe deleted file mode 100644 index 4be9eb08..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/tr.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/true.exe b/apps/desktop/resources/win/git-bash/usr/bin/true.exe deleted file mode 100644 index 99602a24..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/true.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/uniq.exe b/apps/desktop/resources/win/git-bash/usr/bin/uniq.exe deleted file mode 100644 index bf5ea638..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/uniq.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/wc.exe b/apps/desktop/resources/win/git-bash/usr/bin/wc.exe deleted file mode 100644 index 6d0a618d..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/wc.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/which.exe b/apps/desktop/resources/win/git-bash/usr/bin/which.exe deleted file mode 100644 index 5413ac38..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/which.exe and /dev/null differ diff --git a/apps/desktop/resources/win/git-bash/usr/bin/xargs.exe b/apps/desktop/resources/win/git-bash/usr/bin/xargs.exe deleted file mode 100644 index ac0e88d3..00000000 Binary files a/apps/desktop/resources/win/git-bash/usr/bin/xargs.exe and /dev/null differ diff --git a/apps/desktop/src/i18n/locales/en.json b/apps/desktop/src/i18n/locales/en.json index 7f2afb18..2c4f3112 100644 --- a/apps/desktop/src/i18n/locales/en.json +++ b/apps/desktop/src/i18n/locales/en.json @@ -39,6 +39,22 @@ "saving": "Saving...", "saveSuccess": "AgentX configuration saved successfully", "saveFailed": "Failed to save AgentX configuration", + "windowsGitWarning": { + "text": "AgentX requires Git to be installed on Windows.", + "link": "Download Git for Windows" + }, + "profiles": { + "empty": "No configurations yet. Add one to get started.", + "add": "Add Configuration", + "addTitle": "Add Configuration", + "editTitle": "Edit Configuration", + "name": "Name", + "active": "Active", + "activate": "Set as active", + "activated": "Configuration activated", + "deleted": "Configuration deleted", + "saved": "Configuration saved" + }, "skills": { "title": "Skills Configuration", "description": "Manage enabled Skills that will be used for all AgentX conversations", @@ -653,7 +669,12 @@ "title": "No conversation selected", "description": "Select a conversation or start a new one" }, - "dropToSend": "Drop to send" + "dropToSend": "Drop to send", + "errors": { + "maxAttachments": "Maximum {{max}} attachments allowed", + "fileTooLarge": "{{name}} exceeds the {{max}} size limit", + "fileTypeNotAccepted": "{{name}} is not a supported file type" + } }, "conversations": { "title": "Conversations", diff --git a/apps/desktop/src/i18n/locales/zh-CN.json b/apps/desktop/src/i18n/locales/zh-CN.json index 9b17c162..37ebf86b 100644 --- a/apps/desktop/src/i18n/locales/zh-CN.json +++ b/apps/desktop/src/i18n/locales/zh-CN.json @@ -39,6 +39,22 @@ "saving": "保存中...", "saveSuccess": "AgentX 配置保存成功", "saveFailed": "保存 AgentX 配置失败", + "windowsGitWarning": { + "text": "AgentX 在 Windows 上需要安装 Git。", + "link": "下载 Git for Windows" + }, + "profiles": { + "empty": "暂无配置,点击下方按钮添加。", + "add": "添加配置", + "addTitle": "添加配置", + "editTitle": "编辑配置", + "name": "名称", + "active": "当前", + "activate": "设为当前", + "activated": "已切换配置", + "deleted": "配置已删除", + "saved": "配置已保存" + }, "skills": { "title": "Skills 配置", "description": "管理启用的 Skills,这些 Skills 将被用于所有 AgentX 对话", @@ -650,7 +666,12 @@ "title": "未选择对话", "description": "选择一个对话或开始新对话" }, - "dropToSend": "拖放以发送" + "dropToSend": "拖放以发送", + "errors": { + "maxAttachments": "最多只能添加 {{max}} 个附件", + "fileTooLarge": "{{name}} 超过了 {{max}} 的大小限制", + "fileTypeNotAccepted": "{{name}} 不是支持的文件类型" + } }, "conversations": { "title": "对话列表", diff --git a/apps/desktop/src/main/index.ts b/apps/desktop/src/main/index.ts index e339e87b..249f4f40 100644 --- a/apps/desktop/src/main/index.ts +++ b/apps/desktop/src/main/index.ts @@ -212,7 +212,7 @@ class PromptXDesktopApp { logger.debug(`Updated PATH with Electron directory: ${electronDir}`) } - // On Windows: ensure node and bash (git-bash) are in PATH for Claude Code subprocess + // On Windows: ensure node.exe is in PATH for Claude Code subprocess // In packaged Electron apps, system PATH may not include these if (process.platform === 'win32') { this.ensureWindowsToolsInPath() @@ -223,43 +223,6 @@ class PromptXDesktopApp { const { execSync } = require('child_process') const { app } = require('electron') - // --- Ensure bash.exe is in PATH (Claude Code CLI requires bash on Windows) --- - const hasBash = (process.env.PATH || '').split(path.delimiter).some(dir => { - try { return fs.existsSync(path.join(dir, 'bash.exe')) } catch { return false } - }) - - if (!hasBash) { - // 1. Prefer bundled git-bash (packaged app: resources/git-bash) - const bundledBashBin = path.join(process.resourcesPath || '', 'git-bash', 'bin') - const bundledBashUsrBin = path.join(process.resourcesPath || '', 'git-bash', 'usr', 'bin') - - if (fs.existsSync(path.join(bundledBashBin, 'bash.exe'))) { - // Add both bin and usr/bin so all git utilities are available - let newPath = bundledBashBin + path.delimiter + (process.env.PATH || '') - if (fs.existsSync(bundledBashUsrBin)) { - newPath = bundledBashUsrBin + path.delimiter + newPath - } - process.env.PATH = newPath - logger.info(`Using bundled git-bash: ${bundledBashBin}`) - } else { - // 2. Fall back to system git-bash - const bashCandidates = [ - 'C:\\Program Files\\Git\\bin', - 'C:\\Program Files\\Git\\usr\\bin', - 'C:\\Program Files (x86)\\Git\\bin', - 'C:\\Program Files (x86)\\Git\\usr\\bin', - ] - const bashDir = bashCandidates.find(p => { try { return fs.existsSync(path.join(p, 'bash.exe')) } catch { return false } }) ?? null - - if (bashDir) { - process.env.PATH = bashDir + path.delimiter + (process.env.PATH || '') - logger.info(`Added system git-bash to PATH: ${bashDir}`) - } else { - logger.warn('bash.exe not found — Claude Code subprocess may fail on Windows without git-bash') - } - } - } - // --- Ensure node.exe is in PATH --- const hasNode = (process.env.PATH || '').split(path.delimiter).some(dir => { try { return fs.existsSync(path.join(dir, 'node.exe')) } catch { return false } diff --git a/apps/desktop/src/main/services/AgentXService.ts b/apps/desktop/src/main/services/AgentXService.ts index ea76c681..c16ce0d9 100644 --- a/apps/desktop/src/main/services/AgentXService.ts +++ b/apps/desktop/src/main/services/AgentXService.ts @@ -20,12 +20,22 @@ export interface MCPServerConfig { [key: string]: unknown // 支持其他自定义字段 } +export interface AgentXProfile { + id: string + name: string + apiKey: string + baseUrl: string + model: string +} + export interface AgentXConfig { apiKey: string baseUrl: string model: string mcpServers?: MCPServerConfig[] enabledSkills?: string[] // 启用的 skills 列表 + profiles?: AgentXProfile[] + activeProfileId?: string } const DEFAULT_CONFIG: AgentXConfig = { @@ -57,6 +67,20 @@ export class AgentXService { const data = fs.readFileSync(this.configPath, 'utf-8') const saved = JSON.parse(data) this.config = { ...DEFAULT_CONFIG, ...saved } + + // Migrate: if no profiles but has apiKey, create a default profile + if (!this.config.profiles?.length && this.config.apiKey) { + const defaultProfile: AgentXProfile = { + id: crypto.randomUUID(), + name: 'Default', + apiKey: this.config.apiKey, + baseUrl: this.config.baseUrl, + model: this.config.model, + } + this.config.profiles = [defaultProfile] + this.config.activeProfileId = defaultProfile.id + this.saveConfig() + } } } catch (error) { logger.error('Failed to load AgentX config:', String(error)) @@ -77,6 +101,17 @@ export class AgentXService { async updateConfig(newConfig: Partial): Promise { this.config = { ...this.config, ...newConfig } + + // Sync active profile's fields to top-level apiKey/baseUrl/model + if (this.config.profiles?.length && this.config.activeProfileId) { + const active = this.config.profiles.find(p => p.id === this.config.activeProfileId) + if (active) { + this.config.apiKey = active.apiKey + this.config.baseUrl = active.baseUrl + this.config.model = active.model + } + } + this.saveConfig() // 如果服务正在运行,重启以应用新配置 diff --git a/apps/desktop/src/preload/index.ts b/apps/desktop/src/preload/index.ts index 87a0f233..c05a3a42 100644 --- a/apps/desktop/src/preload/index.ts +++ b/apps/desktop/src/preload/index.ts @@ -1,4 +1,4 @@ -import { contextBridge, ipcRenderer } from 'electron' +import { contextBridge, ipcRenderer, shell } from 'electron' /** * Preload Script - 安全的IPC通信桥接 @@ -22,11 +22,21 @@ interface MCPServerConfig { [key: string]: unknown } +interface AgentXProfile { + id: string + name: string + apiKey: string + baseUrl: string + model: string +} + interface AgentXConfig { apiKey: string baseUrl: string model: string mcpServers?: MCPServerConfig[] + profiles?: AgentXProfile[] + activeProfileId?: string } interface OpenDialogOptions { @@ -101,6 +111,12 @@ interface ElectronAPI { deleteEngram: (roleId: string, engramId: number) => Promise deleteCue: (roleId: string, cueWord: string) => Promise } + // Shell API + shell: { + openExternal: (url: string) => Promise + } + // System info + platform: string } contextBridge.exposeInMainWorld('electronAPI', { @@ -155,7 +171,13 @@ contextBridge.exposeInMainWorld('electronAPI', { ipcRenderer.invoke('cognition:updateEngram', roleId, engramId, updates), deleteEngram: (roleId: string, engramId: number) => ipcRenderer.invoke('cognition:deleteEngram', roleId, engramId), deleteCue: (roleId: string, cueWord: string) => ipcRenderer.invoke('cognition:deleteCue', roleId, cueWord), - } + }, + // Shell API + shell: { + openExternal: (url: string) => shell.openExternal(url), + }, + // System info + platform: process.platform, } as ElectronAPI) // 为window对象添加类型定义 diff --git a/apps/desktop/src/view/components/agentx-ui/components/pane/InputPane.tsx b/apps/desktop/src/view/components/agentx-ui/components/pane/InputPane.tsx index 01659272..42e24ba0 100644 --- a/apps/desktop/src/view/components/agentx-ui/components/pane/InputPane.tsx +++ b/apps/desktop/src/view/components/agentx-ui/components/pane/InputPane.tsx @@ -197,6 +197,14 @@ export const InputPane: React.ForwardRefExoticComponent< const [attachments, setAttachments] = React.useState([]); const [showEmojiPicker, setShowEmojiPicker] = React.useState(false); const [isDragging, setIsDragging] = React.useState(false); + const [fileError, setFileError] = React.useState(null); + const fileErrorTimerRef = React.useRef | null>(null); + + const showFileError = React.useCallback((msg: string) => { + setFileError(msg); + if (fileErrorTimerRef.current) clearTimeout(fileErrorTimerRef.current); + fileErrorTimerRef.current = setTimeout(() => setFileError(null), 3000); + }, []); const textareaRef = React.useRef(null); const emojiPickerRef = React.useRef(null); @@ -244,19 +252,19 @@ export const InputPane: React.ForwardRefExoticComponent< for (const file of fileArray) { // Check max attachments if (attachments.length >= maxAttachments) { - console.warn(`Maximum ${maxAttachments} attachments allowed`); + showFileError(t("agentxUI.chat.errors.maxAttachments", { max: maxAttachments })); break; } // Check file type (skip if acceptAllFileTypes is true) if (!acceptAllFileTypes && !allAcceptedTypes.includes(file.type)) { - console.warn(`File type ${file.type} not accepted`); + showFileError(t("agentxUI.chat.errors.fileTypeNotAccepted", { name: file.name })); continue; } // Check file size if (file.size > maxFileSize) { - console.warn(`File ${file.name} exceeds maximum size of ${maxFileSize} bytes`); + showFileError(t("agentxUI.chat.errors.fileTooLarge", { name: file.name, max: `${Math.round(maxFileSize / 1024 / 1024)}MB` })); continue; } @@ -295,6 +303,8 @@ export const InputPane: React.ForwardRefExoticComponent< allAcceptedTypes, acceptedImageTypes, acceptAllFileTypes, + showFileError, + t, ] ); @@ -313,7 +323,7 @@ export const InputPane: React.ForwardRefExoticComponent< for (const filePath of filePaths) { // Check max attachments if (attachments.length >= maxAttachments) { - console.warn(`Maximum ${maxAttachments} attachments allowed`); + showFileError(t("agentxUI.chat.errors.maxAttachments", { max: maxAttachments })); break; } @@ -339,7 +349,7 @@ export const InputPane: React.ForwardRefExoticComponent< // Check file size if (file.size > maxFileSize) { - console.warn(`File ${result.fileName} exceeds maximum size of ${maxFileSize} bytes`); + showFileError(t("agentxUI.chat.errors.fileTooLarge", { name: result.fileName, max: `${Math.round(maxFileSize / 1024 / 1024)}MB` })); continue; } @@ -370,7 +380,7 @@ export const InputPane: React.ForwardRefExoticComponent< } } }, - [attachments.length, maxAttachments, maxFileSize, acceptedImageTypes] + [attachments.length, maxAttachments, maxFileSize, acceptedImageTypes, showFileError, t] ); /** @@ -629,6 +639,13 @@ export const InputPane: React.ForwardRefExoticComponent< )} + {/* File error toast */} + {fileError && ( +
+ {fileError} +
+ )} + {/* Attachment preview area */} {attachments.length > 0 && (
diff --git a/apps/desktop/src/view/pages/settings-window/components/AgentXProfilesConfig.tsx b/apps/desktop/src/view/pages/settings-window/components/AgentXProfilesConfig.tsx new file mode 100644 index 00000000..d0a20b49 --- /dev/null +++ b/apps/desktop/src/view/pages/settings-window/components/AgentXProfilesConfig.tsx @@ -0,0 +1,226 @@ +import { useState, useEffect } from "react" +import { useTranslation } from "react-i18next" +import { Button } from "@/components/ui/button" +import { Input } from "@/components/ui/input" +import { Label } from "@/components/ui/label" +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, + DialogFooter, +} from "@/components/ui/dialog" +import { CheckCircle2, XCircle, Loader2, Plus, Pencil, Trash2, Check } from "lucide-react" +import { toast } from "sonner" + +interface AgentXProfile { + id: string + name: string + apiKey: string + baseUrl: string + model: string +} + +const EMPTY_FORM = { + name: "", + apiKey: "", + baseUrl: "https://api.anthropic.com", + model: "claude-sonnet-4-20250514", +} + +export function AgentXProfilesConfig() { + const { t } = useTranslation() + const [profiles, setProfiles] = useState([]) + const [activeProfileId, setActiveProfileId] = useState() + const [dialogOpen, setDialogOpen] = useState(false) + const [editingId, setEditingId] = useState(null) + const [form, setForm] = useState(EMPTY_FORM) + const [isTesting, setIsTesting] = useState(false) + const [isSaving, setIsSaving] = useState(false) + const [connectionStatus, setConnectionStatus] = useState<"idle" | "success" | "error">("idle") + + useEffect(() => { loadProfiles() }, []) + + const loadProfiles = async () => { + const config = await window.electronAPI?.agentx.getConfig() + if (config) { + setProfiles((config as any).profiles ?? []) + setActiveProfileId((config as any).activeProfileId) + } + } + + const openAdd = () => { + setEditingId(null) + setForm(EMPTY_FORM) + setConnectionStatus("idle") + setDialogOpen(true) + } + + const openEdit = (p: AgentXProfile) => { + setEditingId(p.id) + setForm({ name: p.name, apiKey: p.apiKey, baseUrl: p.baseUrl, model: p.model }) + setConnectionStatus("idle") + setDialogOpen(true) + } + + const handleActivate = async (id: string) => { + const config = await window.electronAPI?.agentx.getConfig() + await window.electronAPI?.agentx.updateConfig({ ...(config as any), activeProfileId: id }) + setActiveProfileId(id) + toast.success(t("settings.agentx.profiles.activated")) + } + + const handleDelete = async (id: string) => { + const config = await window.electronAPI?.agentx.getConfig() + const newProfiles = ((config as any).profiles ?? []).filter((p: AgentXProfile) => p.id !== id) + const newActiveId = (config as any).activeProfileId === id ? newProfiles[0]?.id : (config as any).activeProfileId + await window.electronAPI?.agentx.updateConfig({ ...(config as any), profiles: newProfiles, activeProfileId: newActiveId }) + setProfiles(newProfiles) + setActiveProfileId(newActiveId) + toast.success(t("settings.agentx.profiles.deleted")) + } + + const handleTest = async () => { + setIsTesting(true) + setConnectionStatus("idle") + try { + const result = await window.electronAPI?.agentx.testConnection({ + apiKey: form.apiKey, + baseUrl: form.baseUrl, + model: form.model, + }) + setConnectionStatus(result?.success ? "success" : "error") + if (!result?.success) toast.error(result?.error ?? t("settings.agentx.testFailed")) + } catch { + setConnectionStatus("error") + } finally { + setIsTesting(false) + } + } + + const handleSave = async () => { + if (!form.name || !form.apiKey) return + setIsSaving(true) + try { + const config = await window.electronAPI?.agentx.getConfig() + const existing: AgentXProfile[] = (config as any).profiles ?? [] + let newProfiles: AgentXProfile[] + let newActiveId = (config as any).activeProfileId as string | undefined + + if (editingId) { + newProfiles = existing.map(p => p.id === editingId ? { ...p, ...form } : p) + } else { + const newProfile: AgentXProfile = { id: crypto.randomUUID(), ...form } + newProfiles = [...existing, newProfile] + if (!newActiveId) newActiveId = newProfile.id + } + + await window.electronAPI?.agentx.updateConfig({ ...(config as any), profiles: newProfiles, activeProfileId: newActiveId }) + setProfiles(newProfiles) + setActiveProfileId(newActiveId) + setDialogOpen(false) + toast.success(t("settings.agentx.profiles.saved")) + } finally { + setIsSaving(false) + } + } + + return ( +
+ {profiles.length === 0 ? ( +

{t("settings.agentx.profiles.empty")}

+ ) : ( + profiles.map(profile => ( +
+
+
+ {profile.name} + {profile.id === activeProfileId && ( + + {t("settings.agentx.profiles.active")} + + )} +
+

{profile.baseUrl} · {profile.model}

+
+
+ {profile.id !== activeProfileId && ( + + )} + + +
+
+ )) + )} + + + + + + + + {editingId ? t("settings.agentx.profiles.editTitle") : t("settings.agentx.profiles.addTitle")} + + +
+
+ + setForm(f => ({ ...f, name: e.target.value }))} + /> +
+
+ + { setForm(f => ({ ...f, apiKey: e.target.value })); setConnectionStatus("idle") }} + /> +
+
+ + { setForm(f => ({ ...f, baseUrl: e.target.value })); setConnectionStatus("idle") }} + /> +
+
+ + { setForm(f => ({ ...f, model: e.target.value })); setConnectionStatus("idle") }} + /> +
+
+ + + {connectionStatus === "success" && } + {connectionStatus === "error" && } +
+ + + +
+
+ ) +} diff --git a/apps/desktop/src/view/pages/settings-window/index.tsx b/apps/desktop/src/view/pages/settings-window/index.tsx index 22fd0fac..6731ea38 100644 --- a/apps/desktop/src/view/pages/settings-window/index.tsx +++ b/apps/desktop/src/view/pages/settings-window/index.tsx @@ -21,7 +21,8 @@ import { LanguageSelector } from "./components/LanguageSelector" import { MCPConfig } from "./components/MCPConfig" import { SkillsConfig } from "./components/SkillsConfig" import { WebAccessConfig } from "./components/WebAccessConfig" -import { Loader2, CheckCircle2, XCircle, Settings, Bot, RefreshCw, Wifi } from "lucide-react" +import { AgentXProfilesConfig } from "./components/AgentXProfilesConfig" +import { Loader2, Settings, Bot, RefreshCw, Wifi, AlertTriangle } from "lucide-react" interface ServerConfig { host: string @@ -30,12 +31,6 @@ interface ServerConfig { enableV2: boolean } -interface AgentXConfig { - apiKey: string - baseUrl: string - model: string -} - interface StatusMessage { type: "success" | "error" | null message: string @@ -50,16 +45,8 @@ function SettingsWindow() { debug: false, enableV2: true }) - const [agentXConfig, setAgentXConfig] = useState({ - apiKey: "", - baseUrl: "https://api.anthropic.com", - model: "claude-sonnet-4-20250514" - }) const [statusMessage, setStatusMessage] = useState({ type: null, message: "" }) const [isLoading, setIsLoading] = useState(false) - const [isTestingConnection, setIsTestingConnection] = useState(false) - const [connectionStatus, setConnectionStatus] = useState<"idle" | "success" | "error">("idle") - const [isSavingAgentX, setIsSavingAgentX] = useState(false) const [isCheckingUpdate, setIsCheckingUpdate] = useState(false) const [showRestartDialog, setShowRestartDialog] = useState(false) @@ -88,11 +75,6 @@ function SettingsWindow() { if (config) { setServerConfig(config) } - - const agentxConfig = await window.electronAPI?.agentx.getConfig() - if (agentxConfig) { - setAgentXConfig(agentxConfig) - } } catch (error) { console.error("Failed to load settings:", error) showMessage("error", t("messages.loadError")) @@ -171,47 +153,6 @@ function SettingsWindow() { } } - const handleAgentXConfigChange = (field: keyof AgentXConfig, value: string) => { - setAgentXConfig(prev => ({ ...prev, [field]: value })) - setConnectionStatus("idle") - } - - const handleTestConnection = async () => { - setIsTestingConnection(true) - setConnectionStatus("idle") - try { - const result = await window.electronAPI?.agentx.testConnection(agentXConfig) - if (result?.success) { - setConnectionStatus("success") - showMessage("success", t("settings.agentx.testSuccess")) - } else { - setConnectionStatus("error") - showMessage("error", result?.error || t("settings.agentx.testFailed")) - } - } catch (error) { - setConnectionStatus("error") - showMessage("error", String(error)) - } finally { - setIsTestingConnection(false) - } - } - - const handleSaveAgentXConfig = async () => { - setIsSavingAgentX(true) - try { - const result = await window.electronAPI?.agentx.updateConfig(agentXConfig) - if (result?.success) { - showMessage("success", t("settings.agentx.saveSuccess")) - } else { - showMessage("error", result?.error || t("settings.agentx.saveFailed")) - } - } catch (error) { - showMessage("error", String(error)) - } finally { - setIsSavingAgentX(false) - } - } - const handleCheckUpdate = async () => { setIsCheckingUpdate(true) try { @@ -367,72 +308,28 @@ function SettingsWindow() { {t("settings.agentx.title")} {t("settings.agentx.description")} - -
- - handleAgentXConfigChange("apiKey", e.target.value)} - /> -

{t("settings.agentx.apiKey.description")}

-
- -
- - handleAgentXConfigChange("baseUrl", e.target.value)} - /> -

{t("settings.agentx.baseUrl.description")}

-
- -
- - handleAgentXConfigChange("model", e.target.value)} - /> -

{t("settings.agentx.model.description")}

-
+ + + -
- - - {connectionStatus === "success" && ( - - )} - {connectionStatus === "error" && ( - - )} + {/* Windows Git requirement warning */} + {window.electronAPI?.platform === "win32" && ( + - + )} {/* MCP 配置 */}