Files
openhuman/src/App.tsx
T
6e4eeecc0c Fetch constitution from public GitHub repo and enhance AI system (#8)
* Add AI intelligence system with memory, sessions, skills and constitution

Implements a client-side AI system inspired by OpenClaw's architecture:

Rust backend (src-tauri/src/ai/):
- SQLite memory database with FTS5 full-text search (memory_db.rs)
- AES-256-GCM encryption with Argon2id key derivation (encryption.rs)
- Session JSONL file I/O and memory file management (sessions.rs)
- 30 new Tauri commands for memory, encryption, and session operations

TypeScript AI modules (src/lib/ai/):
- Constitution framework: safety rules, memory principles, action validation
- Memory system: markdown chunking, hybrid FTS5+vector search, encryption
- Prompt system: modular builder with 7 sections (constitution, identity,
  crypto-intelligence, memory-recall, skills, tools, context)
- Session system: JSONL transcripts, context compaction, memory flush
- Skills framework: SKILL.md loader, registry, GitHub installer
- LLM providers: pluggable interface with custom and OpenAI implementations
- AI tools: memory_search, memory_read, memory_write, web_search

Integration:
- Redux aiSlice with persisted config
- AIProvider in the app provider chain
- All data encrypted at rest, zero-knowledge architecture

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Apply cargo fmt formatting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Add unit tests for AI intelligence system

Cover constitution (loader, validator), memory (chunker), prompts
(system-prompt, sections), providers (embeddings), sessions (types),
skills (frontmatter, registry), tools (registry), and Redux aiSlice.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Enhance AI system with entity management and constitution updates

- Introduced EntityManager and EntityQuery classes for managing entity relationships and queries within the AI platform.
- Updated constitution loader to fetch the constitution from a public GitHub repository, with fallback to a bundled default.
- Enhanced constitution parsing to support new formats and improved error handling.
- Updated memory schema to reflect changes in storage management.
- Added support for loading skill definitions from TypeScript files, improving skill lifecycle management.

This update strengthens the AI system's capabilities in entity management and constitution handling, ensuring better compliance and functionality.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 20:25:12 +05:30

43 lines
1.6 KiB
TypeScript

import { HashRouter as Router } from "react-router-dom";
import { Provider } from "react-redux";
import { PersistGate } from "redux-persist/integration/react";
import * as Sentry from "@sentry/react";
import { store, persistor } from "./store";
import UserProvider from "./providers/UserProvider";
import SocketProvider from "./providers/SocketProvider";
import TelegramProvider from "./providers/TelegramProvider";
import AIProvider from "./providers/AIProvider";
import AppRoutes from "./AppRoutes";
function App() {
return (
<Sentry.ErrorBoundary fallback={<div>Something went wrong.</div>}>
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<UserProvider>
<SocketProvider>
<TelegramProvider>
<AIProvider>
<Router>
<div className="relative min-h-screen">
<div className="pointer-events-none fixed inset-x-0 bottom-3 flex justify-center z-50">
<div className="bg-black/30 px-3 py-1 text-[11px] uppercase tracking-[0.18em] text-white/40">
AlphaHuman is in alpha &mdash; share feedback by messaging
the Telegram bot.
</div>
</div>
<AppRoutes />
</div>
</Router>
</AIProvider>
</TelegramProvider>
</SocketProvider>
</UserProvider>
</PersistGate>
</Provider>
</Sentry.ErrorBoundary>
);
}
export default App;