Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ Both editions depend on these crates — the desktop app
and the server edition. A change here reaches both, so "it works for my
case" is not the bar.

What is *not* here: adopting AI clients, editing their MCP servers and
scanning their configuration. Those change files on the machine the
desktop app runs on, so they live in the desktop app (its `tw-adopt` and
`tw-scan` crates), and the only control-plane endpoint they use is
`POST /clients/{id}/key`, which issues a client its own gateway key.

## Commit messages

Conventional Commits (`fix(scope): subject`), in **English** — this is a
Expand Down Expand Up @@ -123,7 +129,8 @@ a `target/` directory that afternoon.
binary actually runs and reports the version on the tag, and attaches
it to a GitHub Release with a `sha256`.

The desktop app pins `tw-api` to the same tag and bundles the binary
The desktop app pins `tw-api` (and the few other crates it uses: `tw-types`,
`tw-yaml`, `tw-guard`, `tw-watch`) to the same tag and bundles the binary
from that release. Those two have to come from one commit: the binary
speaks a protocol, and the app compiles a mirror of it.

Expand Down
85 changes: 0 additions & 85 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ members = [
"crates/tw-yaml",
"crates/tw-store",
"crates/tw-pricing",
"crates/tw-adopt",
"crates/tw-scan",
"crates/tw-watch",
"crates/tw-engine",
"crates/tw-observe",
Expand Down Expand Up @@ -55,8 +53,6 @@ tw-control = { path = "crates/tw-control" }
tw-yaml = { path = "crates/tw-yaml" }
tw-store = { path = "crates/tw-store" }
tw-pricing = { path = "crates/tw-pricing" }
tw-adopt = { path = "crates/tw-adopt" }
tw-scan = { path = "crates/tw-scan" }
tw-watch = { path = "crates/tw-watch" }
tw-guard = { path = "crates/tw-guard" }
tw-breaker = { path = "crates/tw-breaker" }
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Point a client (Claude Code, Codex, and friends) at a local port, and:
```
tw-dialect · tw-guard · tw-breaker ← shared with the server edition
tw-types · tw-engine · tw-pricing · tw-yaml · tw-secret · tw-watch ← domain logic
tw-config · tw-store · tw-scan · tw-adopt · tw-observe ← assembly
tw-config · tw-store · tw-observe ← assembly
tw-gateway · tw-control · tw-link ← data plane / control plane
```

Expand All @@ -56,6 +56,11 @@ depend only on each other — a test enforces it, and CI builds the server
edition against every change to them. A component only one side uses lives
on that side, not here.

Adopting AI clients (pointing their configuration at the gateway), editing
their MCP servers and scanning their configuration live in the desktop app:
they change files on the machine the app runs on, which need not be the one
running core. Core only issues a client its own gateway key.

Everything below is the single-machine implementation (SQLite, unix socket)
and is deliberately **not** shared: single-machine SQLite and multi-tenant
Postgres are different enough that forcing one abstraction over both would
Expand Down
6 changes: 5 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ cargo run -p twcore -- serve # 起网关和控制面
```
tw-dialect · tw-guard · tw-breaker ← 与服务端版本共用
tw-types · tw-engine · tw-pricing · tw-yaml · tw-secret · tw-watch ← 领域逻辑
tw-config · tw-store · tw-scan · tw-adopt · tw-observe ← 装配
tw-config · tw-store · tw-observe ← 装配
tw-gateway · tw-control · tw-link ← 数据面 / 控制面
```

Expand All @@ -49,6 +49,10 @@ tw-gateway · tw-control · tw-link ← 数
CI 也会拿服务端版本对着每一次改动编译一遍。只有一方在用的东西住在那一方,
不放在这里。

接管 AI 客户端(把它们的配置指向网关)、改它们的 MCP 服务器、扫描它们的配置
都在桌面版里做:改的是桌面版所在那台机器上的文件,那台机器不一定跑着 core。
core 只负责给一个客户端发它自己的网关密钥。

下面三层是单机的实现(SQLite、unix socket),**有意不共用** —— 单机 SQLite
和多租户 Postgres 差得太远,强行统一只会造出一个两边都别扭的抽象。

Expand Down
2 changes: 0 additions & 2 deletions bin/twcore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ chrono = { workspace = true }
tw-secret = { workspace = true }
anyhow = { workspace = true }
clap = { workspace = true }
tw-adopt = { workspace = true }
tw-scan = { workspace = true }
tw-guard = { workspace = true }
serde_yaml_ng = { workspace = true }
tokio = { workspace = true }
Expand Down
Loading
Loading