Commit Graph

21 Commits

Author SHA1 Message Date
iven
ecd7f2e928 fix(desktop): console.log 清理 — 替换为结构化 logger
将 desktop/src 中 23 处 console.log 替换为 createLogger() 结构化日志:
- 生产构建自动静默 debug/info 级别
- 保留 console.error 用于关键错误可见性
- 新增 dompurify 依赖修复 XSS 防护引入缺失

涉及文件: App.tsx, offlineStore.ts, autonomy-manager.ts,
gateway-auth.ts, llm-service.ts, request-helper.ts,
security-index.ts, skill-discovery.ts, use-onboarding.ts 等 16 个文件
2026-03-30 16:22:16 +08:00
iven
13c0b18bbc feat: Batch 5-9 — GrowthIntegration桥接、验证补全、死代码清理、Pipeline模板、Speech/Twitter真实实现
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
Batch 5 (P0): GrowthIntegration 接入 Tauri
- Kernel 新增 set_viking()/set_extraction_driver() 桥接 SqliteStorage
- 中间件链共享存储,MemoryExtractor 接入 LLM 驱动

Batch 6 (P1): 输入验证 + Heartbeat
- Relay 验证补全(stream 兼容检查、API key 格式校验)
- UUID 类型校验、SessionId 错误返回
- Heartbeat 默认开启 + 首次聊天自动初始化

Batch 7 (P2): 死代码清理
- zclaw-channels 整体移除(317 行)
- multi-agent 特性门控、admin 方法标注

Batch 8 (P2): Pipeline 模板
- PipelineMetadata 新增 annotations 字段
- pipeline_templates 命令 + 2 个示例模板
- fallback driver base_url 修复(doubao/qwen/deepseek 端点)

Batch 9 (P1): SpeechHand/TwitterHand 真实实现
- SpeechHand: tts_method 字段 + Browser TTS 前端集成 (Web Speech API)
- TwitterHand: 12 个 action 全部替换为 Twitter API v2 真实 HTTP 调用
- chatStore/useAutomationEvents 双路径 TTS 触发
2026-03-30 09:24:50 +08:00
iven
30b2515f07 feat(audit): 审计修复第四轮 — 跨会话搜索、LLM压缩集成、Presentation渲染器
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
- S9: MessageSearch 新增 Session/Global 双模式,Global 调用 VikingStorage memory_search
- M4b: LLM 压缩器集成到 kernel AgentLoop,支持 use_llm 配置切换
- M4c: 压缩时自动提取记忆到 VikingStorage (runtime + tauri 双路径)
- H6: 新增 ChartRenderer(recharts)、Document/Slideshow 完整渲染
- 累计修复 23 项,整体完成度 ~72%,真实可用率 ~80%
2026-03-27 11:44:14 +08:00
iven
0d4fa96b82 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。包括:
- 配置文件中的项目名称
- 代码注释和文档引用
- 环境变量和路径
- 类型定义和接口名称
- 测试用例和模拟数据

同时优化部分代码结构,移除未使用的模块,并更新相关依赖项。
2026-03-27 07:36:03 +08:00
iven
978dc5cdd8 fix(安全): 修复HTML导出中的XSS漏洞并清理调试日志
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
refactor(日志): 替换console.log为tracing日志系统
style(代码): 移除未使用的代码和依赖项

feat(测试): 添加端到端测试文档和CI工作流
docs(变更日志): 更新CHANGELOG.md记录0.1.0版本变更

perf(构建): 更新依赖版本并优化CI流程
2026-03-26 19:49:03 +08:00
iven
85bf47bebb feat(dev-server): 添加开发模式 HTTP/WebSocket 服务器
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
功能:
- 创建 dev_server.rs 模块,提供 HTTP/WebSocket API
- 使用 feature flag \dev-server\ 控制编译
- 仅绑定 localhost:50051,安全限制 CORS
- 生产构建不包含此模块

使用方式:
- pnpm tauri:dev:web - 启动带开发服务器的 Tauri
- pnpm tauri:dev - 常规开发模式(无服务器)

安全:
- 仅 localhost 绑定
- CORS 限制为 Vite 开发端口
- 通过 feature flag 完全移除生产代码
2026-03-26 17:38:53 +08:00
iven
d0c6319fc1 feat: 添加ESLint和Prettier配置并优化代码结构
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
style: 格式化代码文件并修复样式问题

docs: 新增部署文档和系统要求文档

test: 更新测试截图和覆盖率报告

refactor: 重构SchedulerPanel加载状态逻辑

ci: 添加lint和format脚本到package.json

build: 更新依赖项并添加开发工具

chore: 添加验证报告和上线审查计划
2026-03-26 08:02:23 +08:00
iven
aa6a9cbd84 feat: 新增技能编排引擎和工作流构建器组件
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
refactor: 统一Hands系统常量到单个源文件
refactor: 更新Hands中文名称和描述

fix: 修复技能市场在连接状态变化时重新加载
fix: 修复身份变更提案的错误处理逻辑

docs: 更新多个功能文档的验证状态和实现位置
docs: 更新Hands系统文档

test: 添加测试文件验证工作区路径
2026-03-25 08:27:25 +08:00
iven
3ff08faa56 release(v0.2.0): streaming, MCP protocol, Browser Hand, security enhancements
## Major Features

### Streaming Response System
- Implement LlmDriver trait with `stream()` method returning async Stream
- Add SSE parsing for Anthropic and OpenAI API streaming
- Integrate Tauri event system for frontend streaming (`stream:chunk` events)
- Add StreamChunk types: Delta, ToolStart, ToolEnd, Complete, Error

### MCP Protocol Implementation
- Add MCP JSON-RPC 2.0 types (mcp_types.rs)
- Implement stdio-based MCP transport (mcp_transport.rs)
- Support tool discovery, execution, and resource operations

### Browser Hand Implementation
- Complete browser automation with Playwright-style actions
- Support Navigate, Click, Type, Scrape, Screenshot, Wait actions
- Add educational Hands: Whiteboard, Slideshow, Speech, Quiz

### Security Enhancements
- Implement command whitelist/blacklist for shell_exec tool
- Add SSRF protection with private IP blocking
- Create security.toml configuration file

## Test Improvements
- Fix test import paths (security-utils, setup)
- Fix vi.mock hoisting issues with vi.hoisted()
- Update test expectations for validateUrl and sanitizeFilename
- Add getUnsupportedLocalGatewayStatus mock

## Documentation Updates
- Update architecture documentation
- Improve configuration reference
- Add quick-start guide updates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 03:24:24 +08:00
iven
20eed290f8 feat(deps): add Valtio and XState for Phase 2
- Add valtio for Proxy-based state management
- Add xstate and @xstate/react for state machines
- Create domains directory structure (chat, hands, intelligence, skills)
- Create shared directory for common utilities

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 19:43:12 +08:00
iven
47a84f52a2 fix(test): add @vitest/coverage-v8 dependency for coverage reports
- Add @vitest/coverage-v8@2.1.8 matching vitest version
- Required for test:coverage script to work

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 17:00:09 +08:00
iven
2c80a2c3c2 test: add Vitest configuration and setup
- Add vitest.config.ts with jsdom environment and path aliases
- Add tests/setup.ts with mocks for Tauri API, crypto, and localStorage
- Add test:coverage script to package.json

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 16:55:44 +08:00
iven
9fc17e9d36 test(desktop): add Vitest and testing dependencies
Install testing framework dependencies for unit testing:
- vitest@2.1.8 - Test runner
- @testing-library/react@16.1.0 - React component testing
- @testing-library/jest-dom@6.6.3 - Jest DOM matchers
- jsdom@25.0.1 - DOM simulation environment

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 16:50:38 +08:00
iven
6f72442531 docs(guide): rewrite CLAUDE.md with ZCLAW-first perspective
Major changes:
- Shift from "OpenFang desktop client" to "independent AI Agent desktop app"
- Add decision principle: "Is this useful for ZCLAW? Does it affect ZCLAW?"
- Simplify project structure and tech stack sections
- Replace OpenClaw vs OpenFang comparison with unified backend approach
- Consolidate troubleshooting from scattered sections into organized FAQ
- Update Hands system documentation with 8 capabilities and status
- Stream
2026-03-20 19:30:09 +08:00
iven
d890fa1858 feat(scripts): add unified startup scripts for full stack development
Add comprehensive startup scripts for managing all ZCLAW services:

Windows (PowerShell):
- start.ps1 / start-all.ps1 - Unified service launcher
- Supports -NoBrowser, -NoGateway, -Dev, -Stop flags

Unix (Bash):
- start.sh - Cross-platform launcher for macOS/Linux

Makefile:
- make start / make start-unix
- make desktop / make desktop-build
- make setup / make test / make clean

pnpm commands:
- pnpm start - Start all services
- pnpm start:dev - Development mode with hot reload
- pnpm start:no-browser - Skip ChromeDriver
- pnpm start:no-gateway - Skip OpenFang gateway
- pnpm desktop - Start Tauri only
- pnpm chromedriver - Start ChromeDriver only

Services managed:
1. ChromeDriver (port 4444) - Browser automation
2. OpenFang Gateway (port 4200) - AI Agent runtime
3. Tauri Desktop - React + Rust frontend

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 09:23:44 +08:00
iven
f4efc823e2 refactor(types): comprehensive TypeScript type system improvements
Major type system refactoring and error fixes across the codebase:

**Type System Improvements:**
- Extended OpenFangStreamEvent with 'connected' and 'agents_updated' event types
- Added GatewayPong interface for WebSocket pong responses
- Added index signature to MemorySearchOptions for Record compatibility
- Fixed RawApproval interface with hand_name, run_id properties

**Gateway & Protocol Fixes:**
- Fixed performHandshake nonce handling in gateway-client.ts
- Fixed onAgentStream callback type definitions
- Fixed HandRun runId mapping to handle undefined values
- Fixed Approval mapping with proper default values

**Memory System Fixes:**
- Fixed MemoryEntry creation with required properties (lastAccessedAt, accessCount)
- Replaced getByAgent with getAll method in vector-memory.ts
- Fixed MemorySearchOptions type compatibility

**Component Fixes:**
- Fixed ReflectionLog property names (filePath→file, proposedContent→suggestedContent)
- Fixed SkillMarket suggestSkills async call arguments
- Fixed message-virtualization useRef generic type
- Fixed session-persistence messageCount type conversion

**Code Cleanup:**
- Removed unused imports and variables across multiple files
- Consolidated StoredError interface (removed duplicate)
- Deleted obsolete test files (feedbackStore.test.ts, memory-index.test.ts)

**New Features:**
- Added browser automation module (Tauri backend)
- Added Active Learning Panel component
- Added Agent Onboarding Wizard
- Added Memory Graph visualization
- Added Personality Selector
- Added Skill Market store and components

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 08:05:07 +08:00
iven
5bc4487146 chore: add react-window dependency for message virtualization
Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-15 20:36:09 +08:00
iven
e3d164e9d2 feat(ui): enhance UI with animations, dark mode support and and improved components
- Add framer-motion page transitions and AnimatePresence support
- Add dark mode support across all components
- Create reusable UI components (Button, Badge, Card, EmptyState, Input, Toast, Skeleton)
- Add CSS custom properties for consistent theming
- Add animation variants and utility functions
- Improve ChatArea, Sidebar, TriggersPanel with animations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 17:24:40 +08:00
iven
4eb164764a feat(openfang): add bundled OpenFang runtime support
- Add prepare-openfang-runtime.mjs script for cross-platform binary download
- Update lib.rs to support binary runtime (fallback to Node.js for legacy)
- Add openfang.cmd/sh launcher scripts
- Update runtime-manifest.json for binary-based runtime
- Add README documentation for bundled runtime architecture

OpenFang binary is downloaded during build, supporting:
- Windows x64/ARM64 (.zip)
- macOS Intel/Apple Silicon (.tar.gz)
- Linux x64/ARM64 (.tar.gz)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 18:03:43 +08:00
iven
ef849c62ab cc工作前备份 2026-03-12 00:23:42 +08:00
iven
045e9cef5b feat: initialize ZCLAW project with core systems and Tauri desktop
- Created backend core systems:
  - Remote Execution System (远程执行系统)
  - Task Orchestration Engine (任务编排引擎)
  - Persistent Memory System (持续记忆系统)
  - Proactive Service System (主动服务系统)

- Created Tauri desktop app:
  - Three-column layout based on AutoClaw design
  - React + TypeScript + Tailwind CSS
  - Zustand state management
  - Lucide React icons

- Components:
  - Sidebar (Agent list, IM channels, scheduled tasks)
  - ChatArea (Chat interface with message bubbles)
  - RightPanel (Task progress, statistics, next actions)

Next: Test Tauri dev server and integrate with OpenClaw backend
2026-03-11 22:06:07 +08:00