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

重构所有代码和文档中的项目名称,将OpenFang统一更新为ZCLAW。包括:
- 配置文件中的项目名称
- 代码注释和文档引用
- 环境变量和路径
- 类型定义和接口名称
- 测试用例和模拟数据

同时优化部分代码结构,移除未使用的模块,并更新相关依赖项。
This commit is contained in:
iven
2026-03-27 07:36:03 +08:00
parent 4b08804aa9
commit 0d4fa96b82
226 changed files with 7288 additions and 5788 deletions

View File

@@ -1,11 +1,11 @@
/**
* OpenFang Mock Server for Testing
* ZCLAW Mock Server for Testing
*
* Simulates OpenFang Kernel API endpoints and WebSocket events.
* Simulates ZCLAW Kernel API endpoints and WebSocket events.
* Provides a complete test double for the ZCLAW desktop client.
*
* Usage:
* const server = createOpenFangMockServer({ port: 4200 });
* const server = createZclawMockServer({ port: 4200 });
* await server.start();
* // ... run tests ...
* await server.stop();
@@ -127,8 +127,8 @@ const DEFAULT_AGENTS: MockAgent[] = [
nickname: 'ZCLAW',
scenarios: ['general', 'coding'],
model: 'gpt-4',
workspaceDir: '~/.openfang/workspaces/default',
workspaceResolvedPath: '/home/user/.openfang/workspaces/default',
workspaceDir: '~/.zclaw/workspaces/default',
workspaceResolvedPath: '/home/user/.zclaw/workspaces/default',
restrictFiles: false,
privacyOptIn: false,
userName: 'User',
@@ -159,7 +159,7 @@ const DEFAULT_SECURITY_LAYERS: MockSecurityLayer[] = [
// === Server Implementation ===
export function createOpenFangMockServer(config: MockServerConfig = {}): MockServerInstance {
export function createZclawMockServer(config: MockServerConfig = {}): MockServerInstance {
const {
port = 4200,
host = '127.0.0.1',
@@ -563,8 +563,8 @@ export function createOpenFangMockServer(config: MockServerConfig = {}): MockSer
function handleGetWorkspace(_req: IncomingMessage, res: ServerResponse): void {
sendJson(res, {
path: '~/.openfang/workspaces/default',
resolvedPath: '/home/user/.openfang/workspaces/default',
path: '~/.zclaw/workspaces/default',
resolvedPath: '/home/user/.zclaw/workspaces/default',
exists: true,
fileCount: 42,
totalSize: 1024 * 1024 * 5, // 5MB
@@ -938,4 +938,4 @@ export function createOpenFangMockServer(config: MockServerConfig = {}): MockSer
// === Export for CommonJS compatibility ===
export default createOpenFangMockServer;
export default createZclawMockServer;