refactor: 统一项目名称从OpenFang到ZCLAW
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
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
重构所有代码和文档中的项目名称,将OpenFang统一更新为ZCLAW。包括: - 配置文件中的项目名称 - 代码注释和文档引用 - 环境变量和路径 - 类型定义和接口名称 - 测试用例和模拟数据 同时优化部分代码结构,移除未使用的模块,并更新相关依赖项。
This commit is contained in:
@@ -57,12 +57,12 @@ desktop/
|
||||
|
||||
Run (Windows):
|
||||
```bash
|
||||
cd g:\ZClaw_openfang\desktop && pnpm add -D vitest@2.1.8 @testing-library/react@16.1.0 @testing-library/jest-dom@6.6.3 jsdom@25.0.1
|
||||
cd g:\ZClaw_zclaw\desktop && pnpm add -D vitest@2.1.8 @testing-library/react@16.1.0 @testing-library/jest-dom@6.6.3 jsdom@25.0.1
|
||||
```
|
||||
|
||||
Run (Unix):
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm add -D vitest@2.1.8 @testing-library/react@16.1.0 @testing-library/jest-dom@6.6.3 jsdom@25.0.1
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm add -D vitest@2.1.8 @testing-library/react@16.1.0 @testing-library/jest-dom@6.6.3 jsdom@25.0.1
|
||||
```
|
||||
|
||||
Expected: 依赖安装成功
|
||||
@@ -71,7 +71,7 @@ Expected: 依赖安装成功
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:\ZClaw_openfang\desktop && pnpm exec vitest --version
|
||||
cd g:\ZClaw_zclaw\desktop && pnpm exec vitest --version
|
||||
```
|
||||
|
||||
Expected: 输出 `vitest/2.1.8`
|
||||
@@ -214,7 +214,7 @@ Verify `desktop/package.json` scripts section includes:
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm test
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm test
|
||||
```
|
||||
|
||||
Expected: 测试运行成功 (可能显示 0 tests,这是正常的)
|
||||
@@ -222,7 +222,7 @@ Expected: 测试运行成功 (可能显示 0 tests,这是正常的)
|
||||
- [ ] **Step 5: 提交测试框架配置**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git add desktop/vitest.config.ts desktop/tests/setup.ts desktop/package.json
|
||||
cd g:/ZClaw_zclaw && git add desktop/vitest.config.ts desktop/tests/setup.ts desktop/package.json
|
||||
git commit -m "test: add Vitest configuration and setup
|
||||
|
||||
- Add vitest.config.ts with coverage thresholds
|
||||
@@ -284,7 +284,7 @@ describe('crypto-utils', () => {
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm test tests/lib/crypto-utils.test.ts
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm test tests/lib/crypto-utils.test.ts
|
||||
```
|
||||
|
||||
Expected: FAIL - "Cannot find module '../../src/lib/crypto-utils'"
|
||||
@@ -411,7 +411,7 @@ export function generateMasterKey(): string {
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm test tests/lib/crypto-utils.test.ts
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm test tests/lib/crypto-utils.test.ts
|
||||
```
|
||||
|
||||
Expected: PASS - 2 tests
|
||||
@@ -450,7 +450,7 @@ describe('encrypt and decrypt', () => {
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm test tests/lib/crypto-utils.test.ts
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm test tests/lib/crypto-utils.test.ts
|
||||
```
|
||||
|
||||
Expected: PASS - 3 tests
|
||||
@@ -458,7 +458,7 @@ Expected: PASS - 3 tests
|
||||
- [ ] **Step 7: 提交加密工具模块**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git add desktop/src/lib/crypto-utils.ts desktop/tests/lib/crypto-utils.test.ts
|
||||
cd g:/ZClaw_zclaw && git add desktop/src/lib/crypto-utils.ts desktop/tests/lib/crypto-utils.test.ts
|
||||
git commit -m "feat(crypto): add AES-GCM encryption utilities
|
||||
|
||||
- Add arrayToBase64/base64ToArray conversion functions
|
||||
@@ -556,7 +556,7 @@ describe('secureStorage', () => {
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm test tests/lib/secure-storage.test.ts
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm test tests/lib/secure-storage.test.ts
|
||||
```
|
||||
|
||||
Expected: FAIL - localStorage 存储明文
|
||||
@@ -697,7 +697,7 @@ export const secureStorage = {
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm test tests/lib/secure-storage.test.ts
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm test tests/lib/secure-storage.test.ts
|
||||
```
|
||||
|
||||
Expected: PASS - 4 tests
|
||||
@@ -705,7 +705,7 @@ Expected: PASS - 4 tests
|
||||
- [ ] **Step 7: 提交凭据加密增强**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git add desktop/src/lib/secure-storage.ts desktop/tests/lib/secure-storage.test.ts
|
||||
cd g:/ZClaw_zclaw && git add desktop/src/lib/secure-storage.ts desktop/tests/lib/secure-storage.test.ts
|
||||
git commit -m "feat(security): add AES-GCM encryption for localStorage fallback
|
||||
|
||||
- Encrypt credentials before storing in localStorage
|
||||
@@ -836,7 +836,7 @@ describe('WebSocket Security', () => {
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm test tests/lib/gateway-security.test.ts
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm test tests/lib/gateway-security.test.ts
|
||||
```
|
||||
|
||||
Expected: PASS - 6 tests (这些是纯逻辑测试)
|
||||
@@ -904,7 +904,7 @@ async connect(): Promise<void> {
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm test
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm test
|
||||
```
|
||||
|
||||
Expected: All tests pass
|
||||
@@ -912,7 +912,7 @@ Expected: All tests pass
|
||||
- [ ] **Step 7: 提交 WSS 强制策略**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git add desktop/src/lib/gateway-client.ts desktop/tests/lib/gateway-security.test.ts
|
||||
cd g:/ZClaw_zclaw && git add desktop/src/lib/gateway-client.ts desktop/tests/lib/gateway-security.test.ts
|
||||
git commit -m "feat(security): enforce WSS for non-localhost connections
|
||||
|
||||
- Add validateWebSocketSecurity function
|
||||
@@ -939,7 +939,7 @@ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"
|
||||
|
||||
Run:
|
||||
```bash
|
||||
head -n 100 g:/ZClaw_openfang/desktop/src/store/chatStore.ts
|
||||
head -n 100 g:/ZClaw_zclaw/desktop/src/store/chatStore.ts
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 写失败的测试 - 基础功能**
|
||||
@@ -1098,7 +1098,7 @@ describe('chatStore', () => {
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm test tests/store/chatStore.test.ts
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm test tests/store/chatStore.test.ts
|
||||
```
|
||||
|
||||
Expected: PASS - 8+ tests
|
||||
@@ -1147,7 +1147,7 @@ describe('updateMessage', () => {
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm test tests/store/chatStore.test.ts
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm test tests/store/chatStore.test.ts
|
||||
```
|
||||
|
||||
Expected: PASS - 10+ tests
|
||||
@@ -1156,7 +1156,7 @@ Expected: PASS - 10+ tests
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm test:coverage tests/store/chatStore.test.ts
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm test:coverage tests/store/chatStore.test.ts
|
||||
```
|
||||
|
||||
Expected: Coverage > 80% for chatStore
|
||||
@@ -1164,7 +1164,7 @@ Expected: Coverage > 80% for chatStore
|
||||
- [ ] **Step 7: 提交 ChatStore 测试**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git add desktop/tests/store/chatStore.test.ts
|
||||
cd g:/ZClaw_zclaw && git add desktop/tests/store/chatStore.test.ts
|
||||
git commit -m "test(chat): add comprehensive unit tests for chatStore
|
||||
|
||||
- Test initial state
|
||||
@@ -1189,7 +1189,7 @@ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm test
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm test
|
||||
```
|
||||
|
||||
Expected: All tests pass
|
||||
@@ -1198,7 +1198,7 @@ Expected: All tests pass
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm test:coverage
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm test:coverage
|
||||
```
|
||||
|
||||
Expected: Overall coverage >= 60%
|
||||
@@ -1254,7 +1254,7 @@ Create `docs/changelogs/2026-03-21-phase1-security.md`:
|
||||
- [ ] **Step 2: 提交文档更新**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git add docs/changelogs/2026-03-21-phase1-security.md
|
||||
cd g:/ZClaw_zclaw && git add docs/changelogs/2026-03-21-phase1-security.md
|
||||
git commit -m "docs: add Phase 1 changelog
|
||||
|
||||
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"
|
||||
@@ -1265,13 +1265,13 @@ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"
|
||||
- [ ] **Step 1: 创建 Phase 1 完成标签**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git tag -a v0.3.0-phase1 -m "Phase 1: Security + Testing Complete"
|
||||
cd g:/ZClaw_zclaw && git tag -a v0.3.0-phase1 -m "Phase 1: Security + Testing Complete"
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 推送所有提交**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git push origin main --tags
|
||||
cd g:/ZClaw_zclaw && git push origin main --tags
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -70,7 +70,7 @@ desktop/
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm add valtio
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm add valtio
|
||||
```
|
||||
|
||||
Expected: valtio 安装成功
|
||||
@@ -79,7 +79,7 @@ Expected: valtio 安装成功
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm add xstate @xstate/react
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm add xstate @xstate/react
|
||||
```
|
||||
|
||||
Expected: xstate 和 @xstate/react 安装成功
|
||||
@@ -88,7 +88,7 @@ Expected: xstate 和 @xstate/react 安装成功
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm list valtio xstate @xstate/react
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm list valtio xstate @xstate/react
|
||||
```
|
||||
|
||||
Expected: 显示已安装版本
|
||||
@@ -96,7 +96,7 @@ Expected: 显示已安装版本
|
||||
- [ ] **Step 4: 提交依赖更新**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git add desktop/package.json desktop/pnpm-lock.yaml
|
||||
cd g:/ZClaw_zclaw && git add desktop/package.json desktop/pnpm-lock.yaml
|
||||
git commit -m "$(cat <<'EOF'
|
||||
feat(deps): add Valtio and XState for Phase 2
|
||||
|
||||
@@ -123,13 +123,13 @@ EOF
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop/src && mkdir -p domains/chat domains/hands domains/intelligence domains/skills shared
|
||||
cd g:/ZClaw_zclaw/desktop/src && mkdir -p domains/chat domains/hands domains/intelligence domains/skills shared
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 提交目录结构**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git add desktop/src/domains desktop/src/shared
|
||||
cd g:/ZClaw_zclaw && git add desktop/src/domains desktop/src/shared
|
||||
git commit -m "$(cat <<'EOF'
|
||||
refactor: create domains directory structure
|
||||
|
||||
@@ -240,7 +240,7 @@ export interface ChatState {
|
||||
- [ ] **Step 2: 提交类型定义**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git add desktop/src/domains/chat/types.ts
|
||||
cd g:/ZClaw_zclaw && git add desktop/src/domains/chat/types.ts
|
||||
git commit -m "$(cat <<'EOF'
|
||||
refactor(chat): extract chat domain types
|
||||
|
||||
@@ -442,7 +442,7 @@ if (import.meta.env.DEV) {
|
||||
- [ ] **Step 2: 提交 Valtio Store**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git add desktop/src/domains/chat/store.ts
|
||||
cd g:/ZClaw_zclaw && git add desktop/src/domains/chat/store.ts
|
||||
git commit -m "$(cat <<'EOF'
|
||||
refactor(chat): create Valtio-based chat store
|
||||
|
||||
@@ -566,7 +566,7 @@ export {
|
||||
- [ ] **Step 3: 提交 Hooks 和 Index**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git add desktop/src/domains/chat/hooks.ts desktop/src/domains/chat/index.ts
|
||||
cd g:/ZClaw_zclaw && git add desktop/src/domains/chat/hooks.ts desktop/src/domains/chat/index.ts
|
||||
git commit -m "$(cat <<'EOF'
|
||||
refactor(chat): add chat domain hooks and public API
|
||||
|
||||
@@ -675,7 +675,7 @@ export type HandsEvent =
|
||||
- [ ] **Step 2: 提交类型定义**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git add desktop/src/domains/hands/types.ts
|
||||
cd g:/ZClaw_zclaw && git add desktop/src/domains/hands/types.ts
|
||||
git commit -m "$(cat <<'EOF'
|
||||
refactor(hands): extract hands domain types
|
||||
|
||||
@@ -809,7 +809,7 @@ export const handMachine = setup({
|
||||
- [ ] **Step 2: 提交状态机**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git add desktop/src/domains/hands/machine.ts
|
||||
cd g:/ZClaw_zclaw && git add desktop/src/domains/hands/machine.ts
|
||||
git commit -m "$(cat <<'EOF'
|
||||
refactor(hands): create XState machine for hand execution
|
||||
|
||||
@@ -960,7 +960,7 @@ export { useHandsState, useHands, useApprovalQueue, useHandsActions } from './ho
|
||||
- [ ] **Step 4: 提交 Hands Domain**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git add desktop/src/domains/hands/
|
||||
cd g:/ZClaw_zclaw && git add desktop/src/domains/hands/
|
||||
git commit -m "$(cat <<'EOF'
|
||||
refactor(hands): complete hands domain migration
|
||||
|
||||
@@ -1063,7 +1063,7 @@ export * from './types';
|
||||
- [ ] **Step 4: 提交共享模块**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git add desktop/src/shared/
|
||||
cd g:/ZClaw_zclaw && git add desktop/src/shared/
|
||||
git commit -m "$(cat <<'EOF'
|
||||
refactor(shared): create shared module
|
||||
|
||||
@@ -1102,7 +1102,7 @@ export * from '../domains/chat';
|
||||
- [ ] **Step 2: 提交兼容层**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang && git add desktop/src/store/chatStore.ts
|
||||
cd g:/ZClaw_zclaw && git add desktop/src/store/chatStore.ts
|
||||
git commit -m "$(cat <<'EOF'
|
||||
refactor(chat): add backward compatibility layer
|
||||
|
||||
@@ -1122,7 +1122,7 @@ EOF
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm test tests/store/chatStore.test.ts
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm test tests/store/chatStore.test.ts
|
||||
```
|
||||
|
||||
Expected: Tests pass with new Valtio store
|
||||
@@ -1131,7 +1131,7 @@ Expected: Tests pass with new Valtio store
|
||||
|
||||
Run:
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm test
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm test
|
||||
```
|
||||
|
||||
Expected: No new test failures
|
||||
|
||||
@@ -64,7 +64,7 @@ desktop/src/
|
||||
- [ ] **Step 1: 安装依赖**
|
||||
|
||||
```bash
|
||||
cd g:/ZClaw_openfang/desktop && pnpm add react-window @types/react-window
|
||||
cd g:/ZClaw_zclaw/desktop && pnpm add react-window @types/react-window
|
||||
```
|
||||
|
||||
- [ ] **Step 2: 验证安装**
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
### 2.2 数据流
|
||||
|
||||
```
|
||||
用户操作 → AutomationPanel → automationStore → gateway-client → OpenFang API
|
||||
用户操作 → AutomationPanel → automationStore → gateway-client → ZCLAW API
|
||||
│
|
||||
├── 更新 UI 状态
|
||||
├── WebSocket 事件 → 更新执行状态
|
||||
|
||||
@@ -78,7 +78,7 @@ ZCLAW 是面向中文用户的 AI Agent 桌面客户端,经过分析发现以
|
||||
┌─────────────────────────────────────────────────────────────────┐
|
||||
│ Backend Layer │
|
||||
│ ┌──────────────────┐ ┌──────────────────────────────────────┐│
|
||||
│ │ OpenFang Kernel │ │ Tauri Rust Backend ││
|
||||
│ │ ZCLAW Kernel │ │ Tauri Rust Backend ││
|
||||
│ │ (Port 50051) │ │ - Intelligence (心跳/压缩/反思) ││
|
||||
│ │ │ │ - Memory (SQLite 持久化) ││
|
||||
│ │ │ │ - Browser (WebDriver) ││
|
||||
|
||||
Reference in New Issue
Block a user