mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-30 06:32:24 +00:00
feat: integrate TinyHumans memory client for skill data synchronization
- Added `syncMemoryClientToken` utility to synchronize JWT token with the TinyHumans memory client after user login and Redux rehydration. - Updated `PersistGate` in `App.tsx` to call `syncMemoryClientToken` on lift. - Modified `SkillManagementPanel` to use `triggerSync` for skill management instead of stopping and starting skills. - Implemented memory commands in Tauri for initializing and querying the TinyHumans memory client. - Enhanced skill instance handling to persist sync data and clear memory on OAuth revocation. - Introduced a new memory module to manage skill data synchronization effectively.
This commit is contained in:
@@ -161,6 +161,28 @@ export async function setWindowTitle(title: string): Promise<void> {
|
||||
await invoke('set_window_title', { title });
|
||||
}
|
||||
|
||||
// --- Memory Commands ---
|
||||
|
||||
/**
|
||||
* Initialise the TinyHumans memory client in Rust with the user's JWT token
|
||||
* (sourced from `authSlice.token` in Redux). Call this after login and after
|
||||
* Redux Persist rehydration.
|
||||
*/
|
||||
export async function syncMemoryClientToken(token: string): Promise<void> {
|
||||
console.debug('[memory] syncMemoryClientToken: entry (token_present=%s, is_tauri=%s)', !!token, isTauri());
|
||||
if (!isTauri() || !token) {
|
||||
console.debug('[memory] syncMemoryClientToken: exit — skipped (not Tauri or empty token)');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
console.debug('[memory] syncMemoryClientToken: payload → init_memory_client { jwtToken: <redacted, len=%d> }', token.length);
|
||||
await invoke('init_memory_client', { jwtToken: token });
|
||||
console.info('[memory] syncMemoryClientToken: exit — ok');
|
||||
} catch (err) {
|
||||
console.warn('[memory] syncMemoryClientToken: exit — error:', err);
|
||||
}
|
||||
}
|
||||
|
||||
// --- Alphahuman Commands ---
|
||||
|
||||
export type DoctorSeverity = 'Ok' | 'Warn' | 'Error';
|
||||
|
||||
Reference in New Issue
Block a user