How sidekik-live/sidekik-platform works
sidekik-platform is a shared TypeScript contract and runtime library for Sidekik services, not the services that perform capture, coaching, or tutoring. Its main workflow is that a service imports shared schemas and stream definitions to validate events, then uses the Redis Streams bus to publish or consume them; auth helpers and fail-closed PII redaction support integrations. The README also documents Supabase schema/seed data and fixture replay. Service behavior and several links to the database are not shown in the sampled source, so those relationships are omitted.
Main entry points: streams.ts Stream registry · api.ts HTTP and WS schemas · commands.ts Agent commands · bus.ts Redis Streams bus
Components 20
Shared contracts
- Event envelopes
src/contracts/envelope.ts - Session lifecycle
src/contracts/lifecycle.ts - Transcript events
src/contracts/transcript.ts - Screen events
src/contracts/screen.ts - Agent commands
src/contracts/commands.ts - Decision specs
src/contracts/decisions.ts - Work Maps
src/contracts/workmap.ts - HTTP and WS schemas
src/contracts/api.ts - Usage records
src/contracts/usage.ts
Runtime utilities
- Stream registry
src/streams.ts - Redis Streams bus
src/bus.ts - Auth helpers
src/auth.ts - PII redaction
src/presidio.ts
Platform data
- Supabase schema
supabase/migrations
Demo and replay
- Demo Work Map data
dev/seed/demo.ts - Seed SQL renderer
dev/seed/render.ts - Fixture replay
dev/replay.ts
Other components
- Sidekik services
- Presidio service
- Redis Streams
Connections 22
- Sidekik services → Event envelopes: import contracts
README.md - Sidekik services → Stream registry: import stream names
README.md - Sidekik services → Redis Streams bus: publish or consume
README.md - Redis Streams bus → Stream registry: validates stream payloads
src/bus.ts - Stream registry → Event envelopes: wraps payloads
src/streams.ts - Stream registry → Session lifecycle: maps event schema
src/streams.ts - Stream registry → Transcript events: maps event schema
src/streams.ts - Stream registry → Screen events: maps event schema
src/streams.ts - Stream registry → Agent commands: maps event schema
src/streams.ts - Stream registry → Work Maps: maps event schema
src/streams.ts - Stream registry → Usage records: maps event schema
src/streams.ts - HTTP and WS schemas → Decision specs: uses schemas
src/contracts/api.ts - HTTP and WS schemas → Session lifecycle: uses schemas
src/contracts/api.ts - HTTP and WS schemas → Screen events: uses schemas
src/contracts/api.ts - HTTP and WS schemas → Transcript events: uses schemas
src/contracts/api.ts - Agent commands → Session lifecycle: uses phase schema
src/contracts/commands.ts - Agent commands → Work Maps: uses mastery schema
src/contracts/commands.ts - PII redaction → Presidio service: analyzes and anonymizes
README.md - Fixture replay → Redis Streams bus: publishes events
dev/replay.ts - Fixture replay → Redis Streams: writes streams
dev/replay.ts - Seed SQL renderer → Demo Work Map data: renders demo data
dev/seed/render.ts - Seed SQL renderer → Supabase schema: generates seed SQL
README.md