支持无GUI的Server运行模式

This commit is contained in:
xintaofei
2026-03-29 18:36:30 +08:00
parent 7b73d7e1c2
commit 080a16f26c
49 changed files with 2169 additions and 1047 deletions

View File

@@ -4,6 +4,7 @@ version = "0.4.7"
description = "Agent Code Generation App"
authors = ["feitao"]
edition = "2021"
default-run = "codeg"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -14,13 +15,36 @@ edition = "2021"
name = "codeg_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[features]
default = ["tauri-runtime"]
tauri-runtime = [
"dep:tauri",
"dep:tauri-plugin-opener",
"dep:tauri-plugin-dialog",
"dep:fix-path-env",
"dep:tauri-build",
"dep:tauri-plugin-window-state",
"dep:tauri-plugin-updater",
"dep:tauri-plugin-process",
"dep:tauri-plugin-notification",
]
[[bin]]
name = "codeg"
path = "src/main.rs"
[[bin]]
name = "codeg-server"
path = "src/bin/codeg_server.rs"
required-features = []
[build-dependencies]
tauri-build = { version = "2", features = [] }
tauri-build = { version = "2", features = [], optional = true }
[dependencies]
tauri = { version = "2", features = [] }
tauri-plugin-opener = "2"
tauri-plugin-dialog = "2"
tauri = { version = "2", features = [], optional = true }
tauri-plugin-opener = { version = "2", optional = true }
tauri-plugin-dialog = { version = "2", optional = true }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
chrono = { version = "0.4", features = ["serde"] }
@@ -29,7 +53,7 @@ dirs = "6"
walkdir = "2"
sacp = "11.0.0-alpha.1"
sacp-tokio = "11.0.0-alpha.1"
tokio = { version = "1", features = ["process", "io-util", "sync", "macros", "rt", "net"] }
tokio = { version = "1", features = ["process", "io-util", "sync", "macros", "rt", "net", "rt-multi-thread"] }
uuid = { version = "1", features = ["v4"] }
futures = "0.3"
reqwest = { version = "0.12", features = ["stream", "json"] }
@@ -40,7 +64,7 @@ zip = "2"
regex = "1"
portable-pty = "0.8"
urlencoding = "2"
fix-path-env = { git = "https://github.com/tauri-apps/fix-path-env-rs", version = "0.0.0" }
fix-path-env = { git = "https://github.com/tauri-apps/fix-path-env-rs", version = "0.0.0", optional = true }
sea-orm = { version = "1.1", features = ["sqlx-sqlite", "runtime-tokio-rustls", "macros"] }
sea-orm-migration = { version = "1.1", features = ["sqlx-sqlite", "runtime-tokio-rustls"] }
toml = "0.8"
@@ -54,11 +78,10 @@ axum = { version = "0.8", features = ["ws"] }
tower-http = { version = "0.6", features = ["fs", "cors"] }
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
tauri-plugin-window-state = "2"
tauri-plugin-updater = "2"
tauri-plugin-process = "2"
tauri-plugin-notification = "2"
tauri-plugin-window-state = { version = "2", optional = true }
tauri-plugin-updater = { version = "2", optional = true }
tauri-plugin-process = { version = "2", optional = true }
tauri-plugin-notification = { version = "2", optional = true }
[target.'cfg(target_os = "macos")'.dependencies]
mac-notification-sys = "0.6"