小墨 d520df29d4 feat(cli): add deploy command + CF 1042 retry (#218)
- deploy: one-click OGraph deployment to Cloudflare (D1 + Worker)
- cloudflare.ts: CF REST API client (verify, accounts, D1, Worker upload)
- client.ts: auto-retry on CF 1042 edge propagation delay
- readiness check: require 3 consecutive health OKs before declaring ready
- 49 CLI tests passing (18 new deploy tests)
2026-04-13 00:00:13 +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%