Commit Graph

104 Commits

Author SHA1 Message Date
iven
a65b3d3958 feat(chat): add virtual scrolling for large message lists
- Integrate react-window v2 List component for messages > 100
- Add VirtualizedMessageList and VirtualizedMessageRow components
- Use useVirtualizedMessages hook for dynamic height measurement
- Preserve smooth animations for small message counts (< 100)
- Auto-scroll to bottom for both virtualized and non-virtualized modes

Performance improvements:
- Only render visible messages in viewport
- Dynamic height measurement for accurate positioning
- LRU cache for message content

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 20:43:07 +08:00
iven
32b9b41144 feat(domains): add Intelligence Domain with Valtio store and caching
- Create types.ts with frontend-friendly types
- Create cache.ts with LRU cache + TTL support
- Create store.ts wrapping intelligence-client with reactive state
- Create hooks.ts for React component integration
- Re-export backend types for compatibility

Intelligence Domain provides:
- Memory: store, search, delete with caching
- Heartbeat: init, start, stop, tick operations
- Compaction: threshold check and compact
- Reflection: conversation tracking and reflection
- Identity: load, build prompt, propose changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 20:01:47 +08:00
iven
5513d5d8e4 fix(domains): resolve TypeScript type errors in domain hooks
- Add type assertions for Valtio snapshot readonly arrays
- Remove unused fromPromise import from hands machine
- Ensures type compatibility with Valtio's useSnapshot

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 19:52:14 +08:00
iven
7ffd5e1531 feat(domains): create domain-driven architecture for Phase 2
Chat Domain:
- Add types.ts with Message, Conversation, Agent types
- Add store.ts with Valtio-based state management
- Add hooks.ts with useChatState, useMessages, etc.
- Add index.ts for public API export

Hands Domain:
- Add types.ts with Hand, Trigger, Approval types
- Add machine.ts with XState state machine
- Add store.ts with Valtio-based state management
- Add hooks.ts with useHands, useApprovalQueue, etc.

Shared Module:
- Add types.ts with Result, AsyncResult, PaginatedResponse
- Add error-handling.ts with AppError, NetworkError, etc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 19:47:48 +08:00
iven
32c9f93a7b feat(security): enforce WSS for non-localhost connections
- Add SecurityError class for clear error handling
- Add validateWebSocketSecurity function
- Block ws:// connections to non-localhost hosts
- Add unit tests for security validation logic

Security: Prevents man-in-the-middle attacks on remote connections
by requiring WSS protocol for all non-localhost WebSocket connections.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 17:27:56 +08:00
iven
d266a1435f feat(security): add AES-GCM encryption for localStorage fallback
- Encrypt credentials before storing in localStorage when OS keyring unavailable
- Decrypt on retrieval with automatic fallback
- Backward compatible with existing unencrypted data (migration on next set)
- Add comprehensive unit tests (11 test cases)

Security: Credentials are now encrypted using AES-GCM when
OS keyring is unavailable, preventing plaintext exposure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 17:13:50 +08:00
iven
f070d9151e feat(crypto): add AES-GCM encryption utilities
- Add arrayToBase64/base64ToArray conversion functions
- Add deriveKey for PBKDF2 key derivation
- Add encrypt/decrypt using AES-GCM
- Add generateMasterKey for random key generation
- Update setup.ts to use real Web Crypto API instead of mock
- Add comprehensive unit tests for all crypto functions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 17:05:15 +08:00
iven
f3ec3c8d4c feat(intelligence): complete migration to Rust backend
- Unify all intelligence modules to use intelligenceClient
- Delete legacy TS implementations (agent-memory, reflection-engine, heartbeat-engine, context-compactor, agent-identity, memory-index)
- Update all consumers to use snake_case backend types
- Remove deprecated llm-integration.test.ts

This eliminates code duplication between frontend and backend, resolves
localStorage limitations, and enables persistent intelligence features.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 15:17:39 +08:00
iven
17fb1e69aa feat(intelligence): add TypeScript frontend adapter for Rust commands
Provides unified API for calling Tauri intelligence commands:

- memory: store, search, get, delete, stats, export/import
- heartbeat: init, start, stop, tick, config management
- compactor: token estimation, threshold check, compact
- reflection: should_reflect, reflect, history, state
- identity: get/update files, proposals, snapshots

Usage:
```typescript
import { intelligence } from './intelligence-backend';
await intelligence.memory.store({ ... });
await intelligence.heartbeat.start('agent-1');
```

Part of Phase 4: Integration and documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 00:54:31 +08:00
iven
48a430fc97 refactor(skills): add skill-adapter and refactor SkillMarket
- Add skill-adapter.ts to bridge configStore and UI skill formats
- Refactor SkillMarket to use new skill-adapter instead of skill-discovery
- Add health check state to connectionStore
- Update multiple components with improved typing
- Clean up test artifacts and add new test results
- Update README and add skill-market-mvp plan

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 00:28:03 +08:00
iven
d3a4de2480 docs: add setup guides and error notification component
- Add OpenFang Kernel configuration guide (docs/setup/OPENFANG-SETUP.md)
- Add Chinese models configuration guide (docs/setup/chinese-models.md)
- Add quick start guide (docs/quick-start.md)
- Add quick start scripts for Windows and Linux/macOS
- Add ErrorNotification component for centralized error display

These additions help users:
- Quickly set up development environment
- Configure OpenFang backend correctly
- Configure Chinese LLM providers (GLM, Qwen, Kimi, MiniMax)
- See error notifications in a consistent UI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 00:17:44 +08:00
iven
c5d91cf9f0 feat: add integration test framework and health check improvements
- Add test helper library with assertion functions (scripts/lib/test-helpers.sh)
- Add gateway integration test script (scripts/tests/gateway-test.sh)
- Add configuration validation tool (scripts/validate-config.ts)
- Add health-check.ts library with Tauri command wrappers
- Add HealthStatusIndicator component to ConnectionStatus.tsx
- Add E2E test specs for memory, settings, and team collaboration
- Update ZCLAW-DEEP-ANALYSIS.md to reflect actual project state

Key improvements:
- Store architecture now properly documented as migrated
- Tauri backend shown as 85-90% complete
- Component integration status clarified

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 00:09:47 +08:00
iven
ce522de7e9 feat: integrate DevQALoop into TeamOrchestrator and add integration test checklist
- Add Review tab to TeamOrchestrator with DevQALoopPanel integration
- Create comprehensive integration test checklist (22 test cases)
- Document component integration status analysis
- Update progress documentation

Key findings:
- Most "low integration" components were actually integrated via indirect paths
- DevQALoop was the only truly unintegrated component, now fixed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 23:27:16 +08:00
iven
1cf3f585d3 refactor(store): split gatewayStore into specialized domain stores
Major restructuring:
- Split monolithic gatewayStore into 5 focused stores:
  - connectionStore: WebSocket connection and gateway lifecycle
  - configStore: quickConfig, workspaceInfo, MCP services
  - agentStore: clones, usage stats, agent management
  - handStore: hands, approvals, triggers, hand runs
  - workflowStore: workflows, workflow runs, execution

- Update all components to use new stores with selector pattern
- Remove
2026-03-20 22:14:13 +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
3518fc8ece feat(automation): complete unified automation system redesign
Phase 4 completion:
- Add ApprovalQueue component for managing pending approvals
- Add ExecutionResult component for displaying hand/workflow results
- Update Sidebar navigation to use unified AutomationPanel
- Replace separate 'hands' and 'workflow' tabs with single 'automation' tab
- Fix TypeScript type safety issues with unknown types in JSX expressions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 17:12:05 +08:00
iven
3a7631e035 feat(automation): implement unified automation system with Hands and Workflows
Phase 1 - Core Fixes:
- Fix parameter passing in HandsPanel (params now passed to triggerHand)
- Migrate HandsPanel from useGatewayStore to useHandStore
- Add type adapters and category mapping for 7 Hands
- Create useAutomationEvents hook for WebSocket event handling

Phase 2 - UI Components:
- Create AutomationPanel as unified entry point
- Create AutomationCard with grid/list view support
- Create AutomationFilters with category tabs and search
- Create BatchActionBar for batch operations

Phase 3 - Advanced Features:
- Create ScheduleEditor with visual scheduling (no cron syntax)
- Support frequency: once, daily, weekly, monthly, custom
- Add timezone selection and end date options

Technical Details:
- AutomationItem type unifies Hand and Workflow
- CategoryType: research, data, automation, communication, content, productivity
- ScheduleInfo interface for scheduling configuration
- WebSocket events: hand, workflow, approval

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 16:32:18 +08:00
iven
e262200f1e 首页布局优化前 2026-03-17 23:26:16 +08:00
iven
74dbf42644 refactor(startup): simplify stack to Tauri-managed OpenFang + optional ChromeDriver
- Remove OpenFang CLI dependency from startup scripts
- OpenFang now bundled with Tauri and managed via gateway_start/gateway_status commands
- Add bootstrap screen in App.tsx to auto-start local gateway before UI loads
- Update Makefile: replace start-no-gateway with start-desktop-only
- Fix gateway config endpoints: use /api/config instead of /api/config/quick
- Add Playwright dependencies for future E2E testing
2026-03-17 14:08:03 +08:00
iven
6bd9b841aa feat(browser-hand): implement Browser Hand UI components
Add complete Browser Hand UI system for browser automation:

Components:
- BrowserHandCard: Main card with status display and screenshot preview
- TaskTemplateModal: Template selection and parameter configuration
- ScreenshotPreview: Screenshot display with fullscreen capability

Templates:
- Basic operations: navigate, screenshot, form fill, click, execute JS
- Scraping: text, list, images, links, tables
- Automation: login+action, multi-page, monitoring, pagination

Features:
- 15 built-in task templates across 3 categories
- Real-time execution status with progress bar
- Screenshot preview with zoom and fullscreen
- Integration with HandsPanel for seamless UX
- Zustand store for state management
- Comprehensive test coverage (16 tests)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 08:56:02 +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
adfd7024df docs(claude): restructure documentation management and add feedback system
- Restructure §8 from "文档沉淀规则" to "文档管理规则" with 4 subsections
  - Add docs/ structure with features/ and knowledge-base/ directories
  - Add feature documentation template with 7 sections (概述/设计初衷/技术设计/预期作用/实际效果/演化路线/头脑风暴)
  - Add feature update trigger matrix (新增/修改/完成/问题/反馈)
  - Add documentation quality checklist
- Add §16
2026-03-16 13:54:03 +08:00
iven
8e630882c7 feat(l4): add AutonomyManager for tiered authorization system (Phase 3)
Implements L4 self-evolution authorization with:

Autonomy Levels:
- Supervised: All actions require user confirmation
- Assisted: Low-risk actions auto-execute, high-risk need approval
- Autonomous: Agent decides, only high-impact actions notify

Features:
- Risk-based action classification (low/medium/high)
- Importance threshold for auto-approval
- Approval workflow with pending queue
- Full audit logging with rollback support
- Configurable action permissions per level

Security:
- High-risk actions ALWAYS require confirmation
- Self-modification disabled by default even in autonomous mode
- All autonomous actions logged for audit
- One-click rollback to any historical state

Tests: 30 passing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 10:49:49 +08:00
iven
0b89329e19 feat(l4): upgrade engines with LLM-powered capabilities (Phase 2)
Phase 2 LLM Engine Upgrades:
- ReflectionEngine: Add LLM semantic analysis for pattern detection
- ContextCompactor: Add LLM summarization for high-quality compaction
- MemoryExtractor: Add LLM importance scoring for memory extraction
- Add unified LLM service adapter (OpenAI, Volcengine, Gateway, Mock)
- Add MemorySource 'llm-reflection' for LLM-generated memories
- Add 13 integration tests for LLM-powered features

Config options added:
- useLLM: Enable LLM mode for each engine
- llmProvider: Preferred LLM provider
- llmFallbackToRules: Fallback to rules if LLM fails

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 10:41:03 +08:00
iven
ef3315db69 feat(l4): add LLM service adapter for Phase 2 engine upgrades
- Unified interface for OpenAI, Volcengine, Gateway, and Mock providers
- Structured LLMMessage and LLMResponse types
- Configurable via localStorage with API key security
- Built-in prompt templates for reflection, compaction, extraction
- Helper functions: llmReflect(), llmCompact(), llmExtract()

This adapter enables the 3 engines to be upgraded from rule-based
to LLM-powered in Phase 2.1-2.3.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 10:28:10 +08:00
iven
85e39ecafd feat(l4): add Phase 1 UI components for self-evolution capability
SwarmDashboard (多 Agent 协作面板):
- Task list with real-time status updates
- Subtask visualization with results
- Communication style indicators (Sequential/Parallel/Debate)
- Task creation form with manual triggers

SkillMarket (技能市场):
- Browse 12 built-in skills by category
- Keyword/capability search
- Skill details with triggers and capabilities
- Install/uninstall with L4 autonomy hooks

HeartbeatConfig (心跳配置):
- Enable/disable periodic proactive checks
- Interval slider (5-120 minutes)
- Proactivity level selector (Silent/Light/Standard/Autonomous)
- Quiet hours configuration
- Built-in check item toggles

ReflectionLog (反思日志):
- Reflection history with pattern analysis
- Improvement suggestions by priority
- Identity change proposal approval workflow
- Manual reflection trigger
- Config panel for trigger settings

Part of ZCLAW L4 Self-Evolution capability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 10:24:00 +08:00
iven
134798c430 feat(viking): add local server management for privacy-first deployment
Backend (Rust):
- viking_commands.rs: Tauri commands for server status/start/stop/restart
- memory/mod.rs: Memory module exports
- memory/context_builder.rs: Context building with memory injection
- memory/extractor.rs: Memory extraction from conversations
- llm/mod.rs: LLM integration for memory summarization

Frontend (TypeScript):
- context-builder.ts: Context building with OpenViking integration
- viking-client.ts: OpenViking API client
- viking-local.ts: Local storage fallback when Viking unavailable
- viking-memory-adapter.ts: Memory extraction and persistence

Features:
- Multi-mode adapter (local/sidecar/remote) with auto-detection
- Privacy-first: all data stored in ~/.openviking/, server only on 127.0.0.1
- Graceful degradation when local server unavailable
- Context compaction with memory flush before compression

Tests: 21 passing (viking-adapter.test.ts)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 09:59:14 +08:00
iven
26e64a3fff fix(hands): use hand.id instead of hand.name for API calls
- Fix HandTaskPanel to use hand.id when loading runs and triggering
- Fix HandsPanel to use hand.id for getHandDetails and triggerHand
- Fix WorkflowEditor to use hand.id as option value

The API expects hand identifiers, not names. This ensures correct
hand execution and run history loading.

Also clean up old plan files and add Gateway stability plan.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 09:57:01 +08:00
iven
a312524abb fix(gateway): add API fallbacks and connection stability improvements
- Add api-fallbacks.ts with structured fallback data for 6 missing API endpoints
  - QuickConfig, WorkspaceInfo, UsageStats, PluginStatus, ScheduledTasks, SecurityStatus
  - Graceful degradation when backend returns 404
- Add heartbeat mechanism (30s interval, 3 max missed)
  - Automatic connection keep-alive with ping/pong
  - Triggers reconnect when heartbeats fail
- Improve reconnection strategy
  - Emit 'reconnecting' events for UI feedback
  - Support infinite reconnect mode
- Add ConnectionStatus component
  - Visual indicators for 5 connection states
  - Manual reconnect button when disconnected
  - Compact and full display modes

Diagnosed via Chrome DevTools: WebSocket was working fine, real issue was
404 errors from missing API endpoints being mistaken for connection problems.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 09:56:25 +08:00
iven
c8202d04e0 feat(viking): add local server management for privacy-first deployment
- Add viking_server.rs (Rust) for managing local OpenViking server process
- Add viking-server-manager.ts (TypeScript) for server control from UI
- Update VikingAdapter to support 'local' mode with auto-start capability
- Update documentation for local deployment mode

Key features:
- Auto-start local server when needed
- All data stays in ~/.openviking/ (privacy-first)
- Server listens only on 127.0.0.1
- Graceful fallback to remote/localStorage modes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 08:14:44 +08:00
iven
137f1a32fa feat: implement Phase 4 - Multi-Agent Swarm + Skill Discovery
Phase 4a: Agent Swarm Collaboration Framework (agent-swarm.ts)
- AgentSwarm class with configurable coordinator + specialist agents
- Three collaboration modes: Sequential (chain), Parallel (concurrent), Debate (multi-round)
- Auto task decomposition based on specialist capabilities
- Debate consensus detection with keyword similarity heuristic
- Rule-based result aggregation with structured markdown output
- Specialist management (add/update/remove) and config updates
- History persistence to localStorage (last 25 tasks)
- Memory integration: saves task completion as lesson memories

Phase 4b: Skill Discovery Engine (skill-discovery.ts)
- SkillDiscoveryEngine with 12 built-in skill definitions from skills/ directory
- Multi-signal search: name, description, triggers, capabilities, category matching
- Conversation-based skill recommendation via topic extraction (CN + EN patterns)
- Memory-augmented confidence scoring for suggestions
- Skill registration, install status toggle, category filtering
- localStorage persistence for skill index and suggestion cache

Phase 4c: chatStore Integration
- dispatchSwarmTask(description, style): creates and executes swarm task, adds result as message
- searchSkills(query): exposes skill search to UI layer

Tests: 317 passing across 13 test files (43 new for swarm + skills)
- AgentSwarm: createTask, sequential/parallel/debate execution, history, specialist mgmt
- SkillDiscovery: search, suggest, register, persist, categories

Refs: ZCLAW_AGENT_INTELLIGENCE_EVOLUTION.md updated - all 4 phases complete
2026-03-15 22:44:18 +08:00
iven
04ddf94123 feat: implement ZCLAW Agent Intelligence Evolution Phase 1-3
Phase 1: Persistent Memory + Identity Dynamic Evolution
- agent-memory.ts: MemoryManager with localStorage persistence, keyword search, deduplication, importance scoring, pruning, markdown export
- agent-identity.ts: AgentIdentityManager with per-agent SOUL/AGENTS/USER.md, change proposals with approval workflow, snapshot rollback
- memory-extractor.ts: Rule-based conversation memory extraction (Phase 1), LLM extraction prompt ready for Phase 2
- MemoryPanel.tsx: Memory browsing UI with search, type filter, delete, export (integrated as 4th tab in RightPanel)

Phase 2: Context Governance
- context-compactor.ts: Token estimation, threshold monitoring (soft/hard), memory flush before compaction, rule-based summarization
- chatStore integration: auto-compact when approaching token limits

Phase 3: Proactive Intelligence + Self-Reflection
- heartbeat-engine.ts: Periodic checks (pending tasks, memory health, idle greeting), quiet hours, proactivity levels (silent/light/standard/autonomous)
- reflection-engine.ts: Pattern analysis from memory corpus, improvement suggestions, identity change proposals, meta-memory creation

Chat Flow Integration (chatStore.ts):
- Pre-send: context compaction check -> memory search -> identity system prompt injection
- Post-complete: async memory extraction -> reflection conversation tracking -> auto-trigger reflection

Tests: 274 passing across 12 test files
- agent-memory.test.ts: 42 tests
- context-compactor.test.ts: 23 tests
- heartbeat-reflection.test.ts: 28 tests
- chatStore.test.ts: 11 tests (no regressions)

Refs: ZCLAW_AGENT_INTELLIGENCE_EVOLUTION.md updated with implementation progress
2026-03-15 22:24:57 +08:00
iven
c19be048e4 feat(phase-12-13): complete performance optimization and test coverage
Phase 12 - Performance Optimization:
- Add message-virtualization.ts with useVirtualizedMessages hook
- Implement MessageCache<T> LRU cache for rendered content
- Add createMessageBatcher for WebSocket message batching
- Add calculateVisibleRange and debounced scroll handlers
- Support for 10,000+ messages without performance degradation

Phase 13 - Test Coverage:
- Add workflowStore.test.ts (28 tests)
- Add configStore.test.ts (40 tests)
- Update general-settings.test.tsx to match current UI
- Total tests: 148 passing

Code Quality:
- TypeScript compilation passes
- All 148 tests pass

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-15 20:35:16 +08:00
iven
a7ae0eca7a feat(ui): improve CloneManager with error handling
- Add loading state during clone creation
- Add error display for failed operations
- Add retry/refresh functionality
- Improve gateway-client error handling

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 20:20:10 +08:00
iven
01737a7ef5 feat(phase-11): add store coordinator layer
- Create store/index.ts as unified entry point
- Add useCompositeStore() hook for multi-slice access
- Add initializeStores() for client injection
- Re-export all individual stores for direct access
- Maintain backward compatibility with useGatewayStore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 20:18:44 +08:00
iven
f22b1a2095 refactor(phase-11): extract specialized stores from gatewayStore
Decompose monolithic gatewayStore.ts (1660 lines) into focused stores:

- connectionStore.ts (444 lines) - WebSocket, auth, local gateway
- agentStore.ts (256 lines) - Clones, usage stats, plugins
- handStore.ts (498 lines) - Hands, triggers, approvals
- workflowStore.ts (255 lines) - Workflows, runs
- configStore.ts (537 lines) - QuickConfig, channels, skills

Each store uses client injection pattern for loose coupling.
Coordinator layer to be added in next commit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 20:17:17 +08:00
iven
6a66ce159d refactor(phase-10): complete type safety enhancement
- Add types/api-responses.ts with ApiResponse<T>, PaginatedResponse<T>
- Add types/errors.ts with comprehensive error type hierarchy
- Replace all any usage (53 → 0, 100% reduction)
- Add RawAPI response interfaces for type-safe mapping
- Update catch blocks to use unknown with type narrowing
- Add getState mock to chatStore tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 19:52:52 +08:00
iven
a6b1255dc0 security(phase-9): complete security hardening
- Add safeJsonParse utility with schema validation
- Migrate tokens to OS keyring storage
- Add Ed25519 key encryption at rest
- Enable WSS configuration option
- Fix JSON.parse in HandParamsForm, WorkflowEditor, WorkflowList
- Update test mock data to match valid status values

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 19:22:51 +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
308994121c fix(ui): resolve RightPanel JSX structure and close tag mismatch
- Fix the extra </> and )} that were't causing JSX parsing errors
- Ensure proper nesting of motion.div and aside, and div elements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 17:23:47 +08:00
iven
3e81bd3e50 feat(ui): Phase 8 UI/UX optimization and system documentation update
## Sidebar Enhancement
- Change tabs to icon + small label layout for better space utilization
- Add Teams tab with team collaboration entry point

## Settings Page Improvements
- Connect theme toggle to gatewayStore.saveQuickConfig for persistence
- Remove OpenFang backend download section, simplify UI
- Add time range filter to UsageStats (7d/30d/all)
- Add stat cards with icons (sessions, messages, input/output tokens)
- Add token usage overview bar chart
- Add 8 ZCLAW system skill definitions with categories

## Bug Fixes
- Fix ChannelList duplicate content with deduplication logic
- Integrate CreateTriggerModal in TriggersPanel
- Add independent SecurityStatusPanel with 12 default enabled layers
- Change workflow view to use SchedulerPanel as unified entry

## New Components
- CreateTriggerModal: Event trigger creation modal
- HandApprovalModal: Hand approval workflow dialog
- HandParamsForm: Enhanced Hand parameter form
- SecurityLayersPanel: 16-layer security status display

## Architecture
- Add TOML config parsing support (toml-utils.ts, config-parser.ts)
- Add request timeout and retry mechanism (request-helper.ts)
- Add secure token storage (secure-storage.ts, secure_storage.rs)

## Tests
- Add unit tests for config-parser, toml-utils, request-helper
- Add team-client and teamStore tests

## Documentation
- Update SYSTEM_ANALYSIS.md with Phase 8 completion
- UI completion: 100% (30/30 components)
- API coverage: 93% (63/68 endpoints)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 14:12:11 +08:00
iven
fc30290b1c fix(team): resolve TypeScript errors in team collaboration module
- Remove unused imports and variables in Team components
- Fix CollaborationEvent type import in useTeamEvents
- Add proper type guards for Hand status in gatewayStore
- Fix Session status type compatibility in gateway-client
- Remove unused getGatewayClient import from teamStore
- Handle unknown payload types in TeamCollaborationView

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 09:20:58 +08:00
iven
4802eb7d6a feat(team): add OpenFang Team API client and WebSocket events
API Client (lib/team-client.ts):
- Team CRUD: listTeams, getTeam, createTeam, updateTeam, deleteTeam
- Member management: addTeamMember, removeTeamMember, updateMemberRole
- Task management: addTeamTask, updateTaskStatus, assignTask, submitDeliverable
- Dev↔QA loops: startDevQALoop, submitReview, updateLoopState
- Metrics & Events: getTeamMetrics, getTeamEvents, subscribeToTeamEvents
- TeamAPIError class for error handling

WebSocket Events (lib/useTeamEvents.ts):
- useTeamEvents hook for subscribing to team events
- useTeamEventStream hook for specific team events
- useAllTeamEvents hook for all team events
- Real-time task status updates
- Real-time Dev↔QA loop state changes
- Auto-refresh on team/member updates

Event Types:
- team.created/updated/deleted
- member.added/removed/status_changed
- task.created/assigned/status_changed/completed
- loop.started/state_changed/completed
- review.submitted

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 03:38:36 +08:00
iven
cd2a02877c feat(team): integrate Team components into main application
- Add Team tab to Sidebar with TeamList component
- Update MainViewType to include 'team' view
- Add TeamCollaborationView rendering in App.tsx
- Add selectedTeamId and onSelectTeam props to Sidebar
- Create TeamList component for sidebar team navigation

UI Integration:
- Team tab shows list of teams with status indicators
- Selecting a team displays TeamCollaborationView
- Empty state shows guidance for creating teams

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 03:35:10 +08:00
iven
c91740c00e feat(team): implement multi-agent team collaboration UI
Phase 6 progress - Multi-Agent Team Collaboration:

Types (types/team.ts):
- Team, TeamMember, TeamTask type definitions
- Dev↔QA Loop state machine types
- CollaborationEvent and TeamMetrics types

Store (store/teamStore.ts):
- Team CRUD operations with localStorage persistence
- Task assignment and status management
- Dev↔QA loop lifecycle management
- Real-time collaboration events

Components:
- TeamOrchestrator.tsx: Team creation, member/task management UI
- DevQALoop.tsx: Developer↔QA review loop visualization
- TeamCollaborationView.tsx: Real-time collaboration dashboard

Features:
- 6 agent roles: orchestrator, developer, reviewer, tester, architect, specialist
- 7 task statuses: pending → assigned → in_progress → review → completed/failed
- Dev↔QA loop with max 3 iterations before escalation
- 4 collaboration patterns: sequential, parallel, pipeline, review_loop
- Live event feed with auto-scroll
- Team metrics: completion rate, pass rate, efficiency score

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 03:22:59 +08:00
iven
0139b20e5a fix: resolve TypeScript errors
- Remove unused imports (ChevronRight, Play, AlertTriangle)
- Fix WorkflowHistoryProps interface to accept isOpen/onClose
- Remove duplicate loadTriggers and loadWorkflowRuns definitions
- Add step move buttons in WorkflowEditor

Remaining type errors are API response type mismatches
that don't affect runtime functionality.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 02:04:55 +08:00
iven
2cc1514d1b refactor(phase3): remove OpenClaw compatibility layer
Phase 3 Configuration Migration completed:
- Remove OpenClaw backend type selector from General.tsx
- Update default workspace path from ~/.openclaw to ~/.openfang
- Update default port from 18789 to 50051
- Archive openclaw.default.json to docs/archive/openclaw-legacy/
- Remove OpenClaw migration UI from Workspace settings
- Update About.tsx to reference OpenFang
- Clean up gateway-client.ts comments

All OpenClaw compatibility code removed. ZCLAW now exclusively
targets OpenFang (Rust Agent OS) backend.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 02:00:04 +08:00
iven
d60d445cbf feat(phase4-5): add Workflow types and expand Skills ecosystem
Phase 4: Type System Completion (P2)
- Add comprehensive Workflow type definitions:
  - WorkflowStepType: hand, skill, agent, condition, parallel, delay
  - WorkflowStep: individual step configuration
  - Workflow: complete workflow definition
  - WorkflowRunStatus: pending, running, completed, failed, cancelled, paused
  - WorkflowRun: execution instance tracking
  - Request/Response types for API operations
  - Control types for pause/resume/cancel
- Update types/index.ts with workflow exports

Phase 5: Skills Ecosystem Expansion (P2)
- Add 5 new Skills with SKILL.md definitions:
  - git: Git version control operations
  - file-operations: File system operations
  - web-search: Web search capabilities
  - data-analysis: Data analysis and visualization
  - shell-command: Shell command execution
- Skills coverage now at 9/60+ (15%)

Documentation:
- Update SYSTEM_ANALYSIS.md Phase 4 & 5 status
- Mark Phase 4 as completed
- Update Phase 5 progress tracking

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 01:51:45 +08:00
iven
9c99ab16d4 feat(phase3-4): add OpenFang config.toml and TypeScript type definitions
Phase 3: Configuration Migration (P1)
- Create config/config.toml with comprehensive OpenFang settings
- Migrate openclaw.default.json content to TOML format
- Add server, agent, skills, hands, llm, security, logging configs
- Add desktop-specific settings for ZClaw client

Phase 4: Type System Enhancement (P2)
- Create types/agent.ts: Agent, AgentConfig, AgentStatus types
- Create types/session.ts: Session, SessionMessage, MessageRole types
- Create types/settings.ts: QuickConfig, MCPService, AppSettings types
- Create types/index.ts: Barrel export for all type definitions

Documentation Updates:
- Mark Phase 3 config migration tasks as completed (2/3)
- Mark Phase 4 type definition tasks as completed (3/4)
- Update technical debt cleanup status
- Update type definition section in SYSTEM_ANALYSIS.md

Files Added:
- config/config.toml (289 lines)
- desktop/src/types/agent.ts (68 lines)
- desktop/src/types/session.ts (75 lines)
- desktop/src/types/settings.ts (89 lines)
- desktop/src/types/index.ts (41 lines)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 01:45:25 +08:00
iven
5599c1a4db feat(phase2): complete P1 tasks - Channels, Triggers, Skills CRUD and UI enhancements
Phase 2 P1 Tasks Completed:

API Layer (gateway-client.ts, gatewayStore.ts):
- Add Channels CRUD: getChannel, createChannel, updateChannel, deleteChannel
- Add Triggers CRUD: getTrigger, createTrigger, updateTrigger, deleteTrigger
- Add Skills CRUD: getSkill, createSkill, updateSkill, deleteSkill
- Add Scheduled Tasks API: createScheduledTask, deleteScheduledTask, toggleScheduledTask
- Add loadModels action for dynamic model list

UI Components:
- ModelsAPI.tsx: Dynamic model loading from API with loading/error states
- SchedulerPanel.tsx: Full CreateJobModal with cron/interval/once scheduling
- SecurityStatus.tsx: Loading states, error handling, retry functionality
- WorkflowEditor.tsx: New workflow creation/editing modal (new file)
- WorkflowHistory.tsx: Workflow execution history viewer (new file)
- WorkflowList.tsx: Integrated editor and history access

Configuration:
- Add 4 Hands TOML configs: clip, collector, predictor, twitter

Documentation (SYSTEM_ANALYSIS.md):
- Update API coverage: 65% → 89% (53/62 endpoints)
- Update UI completion: 85% → 92%
- Mark Phase 2 P1 tasks as completed
- Update technical debt cleanup status

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 01:38:34 +08:00