小橘 d84a860d15 feat: initial ograph repo — engine (85 tests) + cli (31 tests)
Extracted from uncaged monorepo (oc-xiaoju/uncaged).
Resolves oc-xiaoju/uncaged#224.

- @uncaged/ograph: CF Worker engine (events, projections, reactions)
- @uncaged/ograph-cli: CLI for managing OGraph instances
- Removed @uncaged/oid dependency (unused)
- 116 tests, all passing
- CI: GitHub Actions

小橘 🍊(NEKO Team)
2026-04-12 23:43:56 +00:00

OGraph

Event Sourcing + Projection + Reaction engine on Cloudflare Workers.

Part of the Uncaged ecosystem.

Packages

Package Description npm
@uncaged/ograph CF Worker engine — events, projections, reactions npm
@uncaged/ograph-cli CLI for managing OGraph instances npm

Core Concepts

  • Event — Immutable facts with typed properties and object references
  • Projection — Derived state computed incrementally from events via reducers
  • Reaction — Side effects triggered by projection state changes (webhooks, event emission, handlers)

Quick Start

npm install -g @uncaged/ograph-cli
ograph deploy          # Deploy to Cloudflare Workers
ograph event-def add   # Define event types
ograph event add       # Emit events
ograph projection list # Query projections

Development

npm install
npm test              # Run all tests
cd packages/engine && npm run dev  # Local dev server

Architecture

  • D1 for storage (events, projections, reactions)
  • Hono for API routing
  • Incremental reduce — projections track last_event_id for O(delta) updates
  • Dynamic handlersnew Function() sandboxed execution with emit/log/kv API injection

License

MIT


Built by 小橘 🍊 & 小墨 🖊️ — NEKO + KUMA Teams

Description
No description provided
Readme 532 KiB
Languages
TypeScript 57.4%
HTML 42%
JavaScript 0.3%
CSS 0.3%