chishiki-core
v0.8.0
Published
Chishiki platform-agnostic core - LRS, scheduler, content management, activities
Readme
@chishiki/core
Platform-agnostic core for Chishiki learning platform.
Overview
@chishiki/core provides the core functionality of Chishiki in a platform-agnostic way. It includes:
- Storage Adapter Interface: Abstract storage layer for different backends (OPFS, SQLite, IndexedDB)
- Content Manager: Import and manage learning content
- Activity Manager: Create and run learning activities
- Scheduler: Spaced repetition scheduling (SM-2 algorithm)
- LRS: xAPI-compliant Learning Record Store
- Sync Manager: Synchronize data across devices/services
- Plugin Manager: Extend functionality with plugins
Architecture
The core is designed to be platform-agnostic. Platform-specific implementations (Chrome extension, PWA, Tauri) are provided as "shells" that use the core.
┌─────────────────────────────────────────────────────────────┐
│ @chishiki/core │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Storage │ │ Scheduler │ │ xAPI │ │
│ │ Adapter │ │ (SM-2+) │ │ Engine │ │
│ │ Interface │ │ │ │ │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Activity │ │ Content │ │ Sync │ │
│ │ Runner │ │ Manager │ │ Protocol │ │
│ │ │ │ │ │ │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘Usage
import { createChishiki } from '@chishiki/core';
import { OPFSAdapter } from '@chishiki/adapter-opfs';
// Create storage adapter
const storage = new OPFSAdapter('chishiki.db');
// Create Chishiki instance
const chishiki = createChishiki({ storage });
// Initialize
await chishiki.initialize();
// Use core features
const content = await chishiki.content.import({
type: 'text',
text: 'Hello, world!',
format: 'plain'
});
const activities = await chishiki.activities.listByContent(content.id);
const dueItems = await chishiki.scheduler.getDue();Status
Phase 1.1: ✅ Core interfaces defined
Phase 1.2: 🔄 Implementation in progress
Related Packages
@chishiki/adapter-opfs: OPFS storage adapter for Chrome/PWA@chishiki/adapter-tauri-sqlite: Native SQLite adapter for Tauri@chishiki/shell-chrome-extension: Chrome extension shell@chishiki/shell-pwa: PWA shell@chishiki/shell-tauri: Tauri desktop shell
