wootype 0.2.1

Blazing-fast Go type system service —— Vibe Coding toolchain
Documentation
# Phase 2: Servicefication - 服务化

## 概述

Phase 2 将 wootype 从单一的命令行工具升级为完整的**类型系统即服务(Type System as a Service, TaaS)**,提供独立的守护进程和多协议 API 支持。

## 架构

```
┌─────────────────────────────────────────────────────────────────┐
│                        Type Daemon                               │
├─────────────────────────────────────────────────────────────────┤
│   ┌───────────────┐    ┌───────────────┐    ┌───────────────┐   │
│   │  gRPC Server  │    │  WebSocket    │    │  HTTP REST    │   │
│   │  Port 50051   │    │  Port 8080    │    │  Port 8080    │   │
│   └───────┬───────┘    └───────┬───────┘    └───────┬───────┘   │
│           │                    │                    │            │
│           └────────────────────┴────────────────────┘            │
│                              │                                   │
│         ┌────────────────────┴────────────────────┐              │
│         │           Request Router                │              │
│         └────────────────────┬────────────────────┘              │
│                              │                                   │
│   ┌──────────────────────────┼──────────────────────────────┐   │
│   │                          ▼                               │   │
│   │  ┌──────────────┐ ┌──────────────┐ ┌──────────────┐    │   │
│   │  │    Type      │ │    Query     │ │   Validate   │    │   │
│   │  │   Service    │ │    Engine    │ │    Engine    │    │   │
│   │  └──────────────┘ └──────────────┘ └──────────────┘    │   │
│   │                                                          │   │
│   │  ┌──────────────┐ ┌──────────────┐ ┌──────────────┐    │   │
│   │  │ TypeUniverse │ │    Agent     │ │     IPC      │    │   │
│   │  │   (ECS)      │ │  Coordinator │ │    Bridge    │    │   │
│   │  └──────────────┘ └──────────────┘ └──────────────┘    │   │
│   │                                                          │   │
│   └──────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────┘
```

## 新组件

### 1. Protocol Buffers 定义

定义了完整的服务接口,包括:
- Agent 连接管理
- 类型查询(by ID, by name, by pattern)
- 流式验证
- 包导入
- 语义搜索

### 2. gRPC 服务

完整的 gRPC 服务实现,使用 tonic 框架。

### 3. WebSocket 服务

基于 axum 的 WebSocket 服务,支持实时流式验证。

### 4. Type Daemon

独立的守护进程,统一管理服务生命周期。

## 使用方法

### 启动守护进程

```bash
wootype-daemon --grpc-addr 127.0.0.1:50051 --ws-addr 127.0.0.1:8080
```

### gRPC 客户端示例

```bash
cargo run --example grpc_client
```

### WebSocket 客户端示例

```bash
cargo run --example websocket_client
```

## 集成场景

- Cursor / VS Code
- Claude Code
- GitHub Copilot
- 其他 AI 编码助手