Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
受 Karpathy LLM Wiki 启发,将分散在 docs/ + memory/ + CLAUDE.md 的项目知识 编译为 8 个结构化 wiki 页面,解决新会话冷启动时上下文浪费问题。 - wiki/index.md: 主索引入口 (~200行),CLAUDE.md @import 自动加载 - wiki/architecture.md: 系统架构编译 (crate依赖/客户端路由/聊天流/LLM驱动) - wiki/module-status.md: 9个子系统状态 + Hands详情 + 测试覆盖 - wiki/data-flows.md: 6条核心数据流 (聊天/路由/记忆/认证/管家/Pipeline) - wiki/development.md: 开发规范 (闭环工作法/验证命令/提交规范) - wiki/known-issues.md: 缺陷状态 (P0/P1已修复,P2待处理) - wiki/file-map.md: 代码库文件地图 (crates/desktop/admin-v2/docs) - wiki/log.md: Append-only 变更日志 - CLAUDE.md: 添加 @wiki/index.md + §8.3 收尾流程增加 wiki 维护步骤
150 lines
5.3 KiB
Markdown
150 lines
5.3 KiB
Markdown
---
|
||
title: 文件地图
|
||
updated: 2026-04-11
|
||
status: active
|
||
tags: [files, reference]
|
||
---
|
||
|
||
# 文件地图
|
||
|
||
> 从 [[index]] 导航到此处。找什么去哪里。
|
||
|
||
## 项目顶层
|
||
|
||
```
|
||
ZCLAW/
|
||
├── CLAUDE.md → AI 协作规范(唯一入口)
|
||
├── wiki/ → 编译后知识库(新会话入口)
|
||
├── docs/ → 原始文档(raw 层)
|
||
├── skills/ → 75 个 SKILL.md
|
||
├── hands/ → HAND.toml 配置
|
||
├── config/ → TOML 配置模板
|
||
├── pipelines/ → 17 个 YAML Pipeline 模板
|
||
├── saas-config.toml → SaaS 后端配置
|
||
├── docker-compose.yml → PostgreSQL 容器
|
||
```
|
||
|
||
## Rust Crates
|
||
|
||
```
|
||
crates/
|
||
├── zclaw-types/ → L1 基础类型 (AgentId, Message, Error)
|
||
│ └── src/types.rs
|
||
│
|
||
├── zclaw-memory/ → L2 存储层
|
||
│ └── src/sqlite.rs, session_manager.rs
|
||
│
|
||
├── zclaw-runtime/ → L3 运行时
|
||
│ ├── src/driver/ → 4 LLM Driver (anthropic/openai/gemini/local.rs)
|
||
│ ├── src/middleware/ → 14 层中间件
|
||
│ │ ├── butler_router.rs → 管家路由
|
||
│ │ ├── data_masking.rs → 数据脱敏
|
||
│ │ └── trajectory_recorder.rs → 轨迹记录
|
||
│ ├── src/loop_runner.rs → 主聊天循环
|
||
│ └── src/tools/ → 7 个工具
|
||
│
|
||
├── zclaw-kernel/ → L4 核心协调
|
||
│ ├── src/kernel/mod.rs → Kernel 启动序列
|
||
│ ├── src/config.rs → LLM 配置 + Driver 工厂
|
||
│ └── src/intelligence/ → 管家/痛点/方案/人格
|
||
│ ├── pain_storage.rs
|
||
│ ├── solution_generator.rs
|
||
│ └── personality_detector.rs
|
||
│
|
||
├── zclaw-skills/ → 技能系统
|
||
│ └── src/semantic_router.rs → TF-IDF 语义路由
|
||
│
|
||
├── zclaw-hands/ → 自主能力
|
||
│ └── src/ (Browser/Collector/Researcher/...)
|
||
│
|
||
├── zclaw-protocols/ → 协议 (MCP + A2A feature-gated)
|
||
│
|
||
├── zclaw-pipeline/ → Pipeline DSL
|
||
│ └── src/executor.rs → DAG 执行器
|
||
│
|
||
├── zclaw-growth/ → 记忆增长
|
||
│ ├── src/extractor.rs → LLM 记忆提取
|
||
│ ├── src/retriever.rs → 语义检索
|
||
│ ├── src/injector.rs → Prompt 注入
|
||
│ ├── src/experience_store.rs → 经验 CRUD
|
||
│ └── src/storage/sqlite.rs → FTS5 + TF-IDF
|
||
│ └── src/retrieval/semantic.rs → EmbeddingClient trait
|
||
│
|
||
└── zclaw-saas/ → SaaS 后端 (Axum + PostgreSQL)
|
||
├── src/auth/ → 认证 (JWT + Cookie + TOTP)
|
||
├── src/knowledge/ → 知识库 (23 API + pgvector)
|
||
├── src/billing/ → 计费 (Alipay/WeChat)
|
||
├── src/workers/ → 7 后台 Worker
|
||
└── migrations/ → SQL 迁移 (34 表)
|
||
```
|
||
|
||
## 前端 (desktop/src/)
|
||
|
||
```
|
||
desktop/src/
|
||
├── store/ → 18 Zustand Store
|
||
│ ├── connectionStore.ts → 客户端路由 (844行, 核心中枢)
|
||
│ ├── saasStore.ts → SaaS 认证
|
||
│ ├── uiModeStore.ts → 简洁/专业模式
|
||
│ └── chat/ → 4 Store (stream/conversation/message/chat)
|
||
│ ├── streamStore.ts
|
||
│ └── conversationStore.ts
|
||
│
|
||
├── components/ → ~135 React 组件
|
||
│ ├── ChatArea.tsx → 聊天区域
|
||
│ ├── SimpleSidebar.tsx → 简洁模式侧边栏
|
||
│ └── ButlerPanel.tsx → 管家面板
|
||
│
|
||
├── hooks/ → React Hooks
|
||
│ └── use-cold-start.ts → 管家冷启动
|
||
│
|
||
├── lib/ → 通信和工具
|
||
│ ├── gateway-client.ts → WebSocket 客户端
|
||
│ ├── kernel-chat.ts → Tauri 内核聊天
|
||
│ ├── saas-relay-client.ts → SaaS SSE 中继
|
||
│ ├── tauri-gateway.ts → Tauri 原生命令
|
||
│ ├── pipeline-client.ts → Pipeline 客户端
|
||
│ ├── secure-storage.ts → OS keyring 存储
|
||
│ └── webmcp-tools.ts → WebMCP 调试工具
|
||
│
|
||
└── store/index.ts → Store 协调器 + client 注入
|
||
```
|
||
|
||
## Admin V2 (admin-v2/)
|
||
|
||
```
|
||
admin-v2/src/
|
||
├── pages/ → 15 页面 (Dashboard/Agents/Knowledge/Billing/...)
|
||
├── services/ → SaaS API 调用封装
|
||
└── tests/ → 17 测试文件 (61 tests)
|
||
```
|
||
|
||
## 文档 (docs/)
|
||
|
||
```
|
||
docs/
|
||
├── TRUTH.md → 数字的唯一真相源
|
||
├── ARCHITECTURE_BRIEF.md → 架构参考
|
||
├── features/ → 功能文档
|
||
│ ├── README.md → 功能索引
|
||
│ ├── AUDIT_TRACKER.md → 审计进度
|
||
│ └── audit-v12/ → V12 模块化审计报告
|
||
├── knowledge-base/ → 技术知识库
|
||
├── superpowers/
|
||
│ ├── specs/ → 设计规格文档
|
||
│ ├── plans/ → 实施计划
|
||
│ └── reports/ → 测试报告
|
||
└── archive/ → 归档文档 (~70+ 文件)
|
||
```
|
||
|
||
## Memory (.claude/projects/)
|
||
|
||
```
|
||
.claude/projects/g--ZClaw-openfang/memory/
|
||
├── MEMORY.md → memory 索引
|
||
└── 47 个 .md 文件 → 会话间工作记录
|
||
```
|
||
|
||
→ 架构见 [[architecture]]
|
||
→ 开发规范见 [[development]]
|