Files
terminalX/README.md
kid d4ab55db48 docs: 刷新交接文档至 M4 完成态(供无上下文新会话续接)
- HANDOFF: 修正 git 说明(6 commits/artifacts 有意提交)、重排 §7 下一步(真机化为首要缺口)、
  更新单测计数(50)、补 M4/tmux resize 代码地图
- CLAUDE.md: 单测计数 50、git 状态
- README: 全面重写——M0~M4 进展、实际包结构(TXCore/TXTransport/app,澄清计划包未成形)、
  artifacts 有意提交、指向 HANDOFF/CLAUDE

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-07-24 18:22:56 +08:00

54 lines
2.8 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.

# terminalX
原生苹果生态终端运维 / vibe coding 工具。平台优先级:**iPadOS > iOS > macOS(Apple Silicon)**。
核心选型:**libghostty**(终端引擎) · **mosh** · **Tailscale (tsnet 用户态)** · **tmux control mode hook**
> **接手/继续开发先读 [`docs/HANDOFF.md`](docs/HANDOFF.md)**(项目全貌 + 里程碑 + 代码地图 + 下一步)与 [`CLAUDE.md`](CLAUDE.md)(构建/验证命令 + 环境约束 + 坑)。
## 当前进展2026-07-24均 iOS 模拟器验证,未上真机/未签名)
- **M0** SSH 直连终端libghostty 渲染/键盘/CJK、会话状态机+自动重连)✅
- **M1** tsnet 用户态 + SSH-over-tsnetfd 桥)✅
- **M1.5 / tmux** control-mode 原生 tab + **多 pane 分屏 + iPadOS 动态 resize**
- **M2** mosh over tsnet自编 `MoshCore.xcframework` + UDP relay✅ 端到端验证
- **M3** mosh 挂起→恢复 <3s唤醒脉冲 + 会话状态机三相)✅
- **M4** 安全host key TOFU pinMITM 防护+ publickey 认证SE 优先/软件回退)✅
- **M5** 合规提审 暂缓
四大核心需求libghostty / tailscale / tmux / mosh均已端到端验证
## 仓库结构(实际)
```
packages/
TXCore 零依赖纯逻辑tmux 解析器/layout、SessionMachine(状态机+重连+mosh三相)、
MoshConnect(解析)、SSH(线格式/ECDSA/host key)。50 单测。
TXTransport SSHSession(libssh2)、MoshSession(mosh_main 桥)、Transport 协议;
C shim: CSSH+CSSHCore(libssh2)、CMosh+MoshCore(mosh)。
apps/TerminalX iOS appXcodeGen 生成SSHTerminalModel(编排)/ContentView/
TmuxController(pane-per-surface 网关)/SigningKeyProvider/KeychainKnownHostsStore。
vendor/ 非 Swift 依赖本地化(认证代理不支持 SwiftPM全 vendor
libghostty-spm、libssh2、mbedtls、tsnet-bridge(Go)、mosh、protobuf。
artifacts/ 预编译 xcframeworkCSSHCore/TsnetBridge/MoshCore**有意提交**,克隆即可构建)。
```
> 计划中的 `TXTailnet/TXSecurity/TXPTY/TXUI` 未单独成包——tsnet 逻辑在 app 的 `TsnetManager`、
> 安全在 app 的 `SigningKeyProvider`/`KeychainKnownHostsStore`、UI 直接在 app。macOS 本地 PTY 未建。
## 快速开始
```sh
# 纯逻辑单测(无需 Xcode/模拟器)
swift test --package-path packages/TXCore # 50 tests
# 构建 app模拟器——详见 CLAUDE.md
cd apps/TerminalX && xcodegen generate --spec project.yml
xcodebuild -project TerminalX.xcodeproj -scheme TerminalX \
-destination 'platform=iOS Simulator,id=<UDID>' -clonedSourcePackagesDirPath /tmp/tx-spm build
```
## 工具链
Xcode 26 / Swift 6.3 · Go 1.26(`~/.local/go`)+gomobile · CMake+Ninja+zigvendor 构建)。构建命令与环境约束见 `CLAUDE.md`