Files
ssw-platform/Cargo.toml
T
admin 217dadf008 feat(mcp): 落地 MCP 工具层 —— 4 元工具 + 分层加载 + 进程内适配器
- 新增 crates/sspf-mcp:registry / jsonrpc / server / 4 个元工具(context·discover·describe·call)
- 内核新增 mcp_adapter.rs(NativeAdapter,直接调 AppState)与 `--mcp` 子命令
- 工具定义自带五段自提示(含 pitfalls/examples),示例必须能被测试跑通
- 新增 scripts/mcp-smoke.sh(13 条)与 docs/mcp.md(接入说明)
- 影响:协议层只暴露 4 个工具(常驻约 1.8K token);业务失败返回结构化 error 而非协议错
- 踩坑记录:内嵌 PG 会抢 fd 0/1,必须在开库前 detach 标准流;tokio 的 stdin 在管道上 ENXIO
2026-10-31 10:29:14 +08:00

63 lines
2.5 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ssw-platform —— cargo workspace 根
#
# 🔴 **本文件是脚手架的一部分,复制到项目根时必须一起带上**
#
# 为什么必须有它:`src/backend/Cargo.toml` 里的
# `version.workspace = true` / `edition.workspace = true` / `xxx = { workspace = true }`
# 都要求**上层有一个 workspace 根**。缺了它,cargo 直接报
# `error: could not find Cargo.toml in ... or any parent directory`,
# 脚手架**根本编译不起来**。
#
# 这里只放「跨成员共享」的配置:成员列表、依赖版本、release profile。
# 成员 crate(src/backend)不得再写 [profile.*],否则 cargo 直接报错。
[workspace]
# src/backend = 内核;crates/* = 平台侧 crate;packs/* = 业务包(只依赖 sspf-sdk)
members = ["src/backend", "crates/*", "packs/*"]
resolver = "2"
[workspace.package]
version = "0.1.0"
edition = "2021"
# 🔴 全仓工具链锁定在 rust-toolchain.toml 的 1.99.1。
# 这里的 MSRV 是「语法最低要求」,比锁定版本宽松;两者不要混。
# L3 动态库(cdylib)强依赖锁定版本:插件与内核必须同一 rustc,
# 否则 Rust 无稳定 ABI 的问题会以段错误的形式在运行期爆出来。
rust-version = "1.85"
# 依赖版本集中在此,成员 crate 一律用 `xxx = { workspace = true }` 继承。
#
# ⚠️ 版本锁死说明(不要随意升级):
# - aes 0.8 + ecb 0.1 属于 cipher **0.4** 家族;aes 0.9 / ecb 0.2 是 cipher 0.5,
# 泛型不通用,混用编译不过。
# - md-5 0.10 的 crate 名是 `md5`(`use md5::{Digest, Md5};`)。
# - pglite-rs 0.2 的 **lib 名是 `pglite`**(`use pglite::PGlite;`),
# 且 0.2.7 没有 `memory://` 模式,`PGlite::open()` 只接受路径。
[workspace.dependencies]
axum = "0.8"
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_urlencoded = "0.7"
aes = "0.8"
ecb = "0.1"
md-5 = "0.10"
rand = "0.8"
uuid = { version = "1", features = ["v4"] }
hex = "0.4"
pglite-rs = "0.2"
chrono = "0.4"
http = "1"
async-trait = "0.1"
# 只用于「MCP 模式下把 fd 1 让给 stderr」这一个系统调用(见 main.rs 的注释)。
libc = "0.2"
[profile.release]
opt-level = 2
lto = "thin"
strip = "symbols"
# 🔴 不要设 `panic = "abort"`:契约 §6.5 要求 panic ⇒ HTTP 200 + code=400,
# 而 abort 下 `catch_unwind` 抓不到 panic(进程直接死 ⇒ 客户端连接重置)。
# catch-all 中间件依赖默认的 `panic = "unwind"`(Ruling P19)。
codegen-units = 16