The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(analytics): correct memory engine import path
Steven Enamakelada909a66434
diff --git a/app/src/components/settings/panels/memoryEngineUtils.ts b/app/src/components/settings/panels/memoryEngineUtils.tsnew file mode 100644index 0000000000..0c3166180f--- /dev/null+++ b/app/src/components/settings/panels/memoryEngineUtils.ts@@ -0,0 +1,36 @@+import type { MemoryEngineDescriptor } from '../../../utils/tauriCommands/memoryEngine';++export type MemoryEngineErrorKind =+ | 'insufficient_credits'+ | 'session_expired'+ | 'backend_unavailable'+ | 'other';++/** Maps the core's prefixed error strings onto a friendly state. */+export function classifyMemoryEngineError(err: unknown): MemoryEngineErrorKind {+ const message = err instanceof Error ? err.message : String(err ?? '');+ if (message.includes('INSUFFICIENT_CREDITS:')) return 'insufficient_credits';+ if (message.includes('SESSION_EXPIRED:')) return 'session_expired';+ if (message.includes('BACKEND_UNAVAILABLE:')) return 'backend_unavailable';+ return 'other';+}++/** Capabilities the active engine offers that the target lacks. */+export function missingCapabilities(+ active: MemoryEngineDescriptor | undefined,+ target: MemoryEngineDescriptor | undefined+): string[] {+ if (!active || !target || active.id === target.id) return [];+ const have = new Set(target.capabilities);+ return active.capabilities.filter(cap => !have.has(cap));+}++/** `graph_export` -> `graph export`; capability ids are core-defined. */+export function humanizeCapability(cap: string): string {+ return cap.replace(/[_-]+/g, ' ');+}++/** Fallback label for an engine id the RPC did not describe. */+export function engineLabel(engines: MemoryEngineDescriptor[], id: string): string {+ return engines.find(e => e.id === id)?.label ?? id;+}diff --git a/app/src/services/analytics.ts b/app/src/services/analytics.tsindex 24794774b5..aa6e02f4dc 100644--- a/app/src/services/analytics.ts+++ b/app/src/services/analytics.ts@@ -104,6 +104,7 @@ const ALLOWED_EVENT_NAMES = ['automation_run_started','automation_run_resumed','automation_run_cancelled',+ 'memory_engine_switched','memory_repair_succeeded','memory_tree_retry_succeeded','skill_install',diff --git a/app/src/services/rpcMethods.ts b/app/src/services/rpcMethods.tsindex 90cab2dcbd..b3137d4e09 100644--- a/app/src/services/rpcMethods.ts+++ b/app/src/services/rpcMethods.ts@@ -34,6 +34,11 @@ export const CORE_RPC_METHODS = {configWorkspaceOnboardingFlagExists: 'openhuman.config_workspace_onboarding_flag_exists',configWorkspaceOnboardingFlagSet: 'openhuman.config_workspace_onboarding_flag_set',corePing: 'core.ping',+ memoryEngineGet: 'openhuman.memory_engine_get',+ memoryEngineMigrate: 'openhuman.memory_engine_migrate',+ memoryEngineMigrateStatus: 'openhuman.memory_engine_migrate_status',+ memoryEngineSet: 'openhuman.memory_engine_set',+ memoryEnginesList: 'openhuman.memory_engines_list',inferenceAgentChat: 'openhuman.inference_agent_chat',inferenceAgentChatSimple: 'openhuman.inference_agent_chat_simple',inferenceApplyPreset: 'openhuman.inference_apply_preset',diff --git a/app/src/utils/tauriCommands/index.ts b/app/src/utils/tauriCommands/index.tsindex 6c72819e6d..ae76f58e93 100644--- a/app/src/utils/tauriCommands/index.ts+++ b/app/src/utils/tauriCommands/index.ts@@ -7,6 +7,7 @@ export * from './window';export * from './core';export * from './memory';export * from './memoryTree';+export * from './memoryEngine';export * from './composio';export * from './conscious';export * from './localAi';diff --git a/app/src/utils/tauriCommands/memoryEngine.ts b/app/src/utils/tauriCommands/memoryEngine.tsnew file mode 100644index 0000000000..7924d6ac2f--- /dev/null+++ b/app/src/utils/tauriCommands/memoryEngine.ts@@ -0,0 +1,87 @@+/**+ * Typed wrappers for the memory-engine RPCs (`openhuman.memory_engine*`).+ *+ * The core owns engine selection, credentials and migration; these wrappers+ * only carry the wire shapes. Errors may be prefixed `INSUFFICIENT_CREDITS:`,+ * `SESSION_EXPIRED:` or `BACKEND_UNAVAILABLE:` — see `memoryEngineErrors`.+ */+import { callCoreRpc } from '../../services/coreRpcClient';+import { CORE_RPC_METHODS } from '../../services/rpcMethods';++export interface MemoryEngineDescriptor {+ id: string;+ label: string;+ description: string;+ needs_endpoint: boolean;+ needs_key: boolean;+ key_optional: boolean;+ /** e.g. `["cloud", "self_hosted"]`, or empty when the engine has one shape. */+ deployments: string[];+ default_endpoint: string | null;+ /** True when billed through OpenHuman credits and the signed-in session. */+ hosted: boolean;+ capabilities: string[];+}++export interface MemoryEnginesList {+ engines: MemoryEngineDescriptor[];+ active: string;+}++export interface MemoryEngineState {+ driver: string;+ endpoint: string | null;+ deployment: string | null;+ has_credential: boolean;+ class: string;+ fell_back_from: string | null;+ last_error: string | null;+}++export interface MemoryEngineTarget {+ driver: string;+ endpoint?: string;+ deployment?: string;+ api_key?: string;+}++export type MemoryEngineMigrateState = 'running' | 'done' | 'failed';++export interface MemoryEngineMigrateStatus {+ state: MemoryEngineMigrateState;+ copied: number;+ total: number | null;+ error: string | null;+}++export async function memoryEnginesList(): Promise<MemoryEnginesList> {+ return await callCoreRpc<MemoryEnginesList>({ method: CORE_RPC_METHODS.memoryEnginesList });+}++export async function memoryEngineGet(): Promise<MemoryEngineState> {+ return await callCoreRpc<MemoryEngineState>({ method: CORE_RPC_METHODS.memoryEngineGet });+}++export async function memoryEngineSet(target: MemoryEngineTarget): Promise<MemoryEngineState> {+ return await callCoreRpc<MemoryEngineState>({+ method: CORE_RPC_METHODS.memoryEngineSet,+ params: target,+ });+}++/** Copies every memory from the active engine into `to`, then switches to it. */+export async function memoryEngineMigrate(to: MemoryEngineTarget): Promise<{ job_id: string }> {+ return await callCoreRpc<{ job_id: string }>({+ method: CORE_RPC_METHODS.memoryEngineMigrate,+ params: { to },+ });+}++export async function memoryEngineMigrateStatus(+ jobId: string+): Promise<MemoryEngineMigrateStatus> {+ return await callCoreRpc<MemoryEngineMigrateStatus>({+ method: CORE_RPC_METHODS.memoryEngineMigrateStatus,+ params: { job_id: jobId },+ });+}