5 Commits
Author SHA1 Message Date
zeekay dee0d76af8 fix: superuser token fallback in external-only auth mode + scrub PB references
- loadAuthToken now falls back to local validation for _superusers tokens
  when JWKS validation fails in external-only mode. Non-superuser local
  tokens are still rejected. Fixes seeding with IAM enabled.
- Scrub PocketBase references from docs, SDK, and UI config
2026-03-02 15:28:53 -07:00
zeekay 7da62dfb4f feat(sdk): publish @hanzo/base v0.2.0, swap UI dependency
- Add /compat export path re-exporting PocketBase client as drop-in
- Add pocketbase as dependency (compat layer)
- Add RealtimeService.unsubscribe() method
- Build: core, compat, react, crdt entry points
- UI: swap pocketbase → @hanzo/base/compat, builds clean
- Published to npm as @hanzo/[email protected]
2026-03-02 10:49:54 -07:00
zeekay 1d3fe4e9e7 feat: add zap plugin and update IAM integration 2026-03-02 10:09:58 -08:00
zeekay a4cb1bc7ea Fix bugs from CTO audit: presence race, IAM cache, KMS token caching, SDK fixes
- presence.go: Replace slice-index callback tracking with ID-based map
  to prevent stale index corruption on unsubscribe
- ws.go: Remove 7 unused WebSocket close code constants
- platform.go: Move config defaults before IAMClient creation, use
  cached p.iam.ValidateToken() instead of standalone function
- kms.go: Add KMS auth token caching with expiry-aware refresh
- collection.ts: Implement unsubscribe() (was silent no-op)
- index.ts: Remove duplicate ListResult type export
- use-query.ts: Fix missing deps bug by serializing full options as
  stable key via JSON.stringify, remove eslint-disable
2026-02-27 10:13:00 -08:00
zeekay 7f17d4b316 Add realtime DX platform: CRDT engine, WebSocket, SDKs, typegen, scheduler, multi-tenant
7-phase implementation of Convex-inspired realtime developer experience:

- crdt/: Go CRDT engine (GCounter, PNCounter, LWWRegister, ORSet, RGA text)
  with state-vector sync protocol and convergence-tested types (31 tests)
- apis/ws.go: Pure RFC 6455 WebSocket endpoint with JWT auth, CRDT sync,
  presence tracking, channel subscriptions
- apis/presence.go: Channel-based presence manager for collaborative awareness
- cmd/typegen/: CLI tool to generate TypeScript interfaces from Base schemas
  (4 tests, all 14 field types mapped)
- plugins/scheduler/: Scheduled functions with exactly-once semantics,
  retry with backoff, JSVM bindings (8 tests)
- plugins/platform/: Multi-tenant platform with IAM (hanzo.id) auth,
  KMS (kms.hanzo.ai) secrets, tenant isolation via collection prefixes,
  RBAC roles, API key management (7 tests)
- sdk/base-js/: @hanzoai/base TypeScript SDK with reactive queries,
  query deduplication, optimistic updates, state versioning, CRDT client
  (72 smoke tests passing)
- sdk/base-react/: @hanzoai/base-react React hooks (useQuery, useMutation,
  useAuth, useRealtime, useCRDT, usePresence) with useSyncExternalStore
2026-02-27 10:00:24 -08:00