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>
This commit is contained in:
iven
2026-03-17 08:05:07 +08:00
parent adfd7024df
commit f4efc823e2
80 changed files with 9496 additions and 1390 deletions

View File

@@ -12,6 +12,9 @@ mod viking_server;
mod memory;
mod llm;
// Browser automation module (Fantoccini-based Browser Hand)
mod browser;
use serde::Serialize;
use serde_json::{json, Value};
use std::fs;
@@ -991,8 +994,12 @@ fn gateway_doctor(app: AppHandle) -> Result<String, String> {
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
// Initialize browser state
let browser_state = browser::commands::BrowserState::new();
tauri::Builder::default()
.plugin(tauri_plugin_opener::init())
.manage(browser_state)
.invoke_handler(tauri::generate_handler![
// OpenFang commands (new naming)
openfang_status,
@@ -1035,7 +1042,31 @@ pub fn run() {
memory::extractor::extract_session_memories,
memory::context_builder::estimate_content_tokens,
// LLM commands (for extraction)
llm::llm_complete
llm::llm_complete,
// Browser automation commands (Fantoccini-based Browser Hand)
browser::commands::browser_create_session,
browser::commands::browser_close_session,
browser::commands::browser_list_sessions,
browser::commands::browser_get_session,
browser::commands::browser_navigate,
browser::commands::browser_back,
browser::commands::browser_forward,
browser::commands::browser_refresh,
browser::commands::browser_get_url,
browser::commands::browser_get_title,
browser::commands::browser_find_element,
browser::commands::browser_find_elements,
browser::commands::browser_click,
browser::commands::browser_type,
browser::commands::browser_get_text,
browser::commands::browser_get_attribute,
browser::commands::browser_wait_for_element,
browser::commands::browser_execute_script,
browser::commands::browser_screenshot,
browser::commands::browser_element_screenshot,
browser::commands::browser_get_source,
browser::commands::browser_scrape_page,
browser::commands::browser_fill_form
])
.run(tauri::generate_context!())
.expect("error while running tauri application");