Timeline
A directional axis. Each point holds a frame. The pointer moves; history retains.
ChronoAI is an open-source AI engine core. Put conversation state on a timeline, let the DAG propagate, let commands schedule themselves.
Declare timelines, write frames, let reaction frames recompute, let commands carry side effects. Reads like a paper. Writes like normal TypeScript.
A directional axis. Each point holds a frame. The pointer moves; history retains.
Three kinds: key (manual), auto (reaction — re-runs on trigger), tween (lazy on read).
Write triggers a topological cascade: settle state, plan commands, execute, propagate again.
Side effects carried explicitly. Plan decides what to call, execute streams writes back.
import { defineFeature, useTimeline, useCommand, reactionFrame } from 'chronoai';export const AssistantFeature = defineFeature('assistant', () => {// 1. 声明用户输入:手写关键帧const userInput = useTimeline<string>({ name: 'user-input' });// 2. 衍生时间轴:反应帧 — 触发器变化时自动重算const messages = useTimeline<ChatMessage[]>({name: 'messages-ready',fill: reactionFrame({triggers: { userInput },compute({ userInput }) {return [{ role: 'user', content: userInput.value }];},}),});// 3. 命令:DAG 收敛后调用 LLMuseCommand('call-llm', {runAt: 'after-commit',plan({ read }) {return ModelCall.plan({ messages: read(messages).value });},});});
4 features composed: system prompt → message builder → LLM call → response. Full multi-turn streaming.
View example →Minimal runnable examples: read, write, advance, rewind, seek, collect, reactionFrame.
View example →Showcases the command system: define kind, plan, execute.
View example →Live render pipeline: chained reactionFrame derivations + observeTimeline + renderToHtml.
View example →