Provider Blueprint (How to Add a New Provider)¶
Blueprint goal
A provider is valid only when it respects the shared contract and integrates with registry, cache, and docs/test policies. This page is the canonical add-provider checklist.
Step 1: Define provider config and UI¶
- Add typed config schema/type for the provider.
- Implement a configuration component for settings modal flow.
- Keep source-specific validation inside the provider domain.
Step 2: Implement provider contract¶
Implement the CalendarProvider interface with clear source capability boundaries:
getEventsis mandatory.createEvent/updateEvent/deleteEventshould throw explicit read-only errors if unsupported.getEventHandlemust return stable persistent identity.- Optional hooks (
initialize,toggleComplete,canBeScheduledAt) are allowed only when needed.
Step 3: Register and instantiate via registry¶
- Register dynamic loader in
registerBuiltInProviders. - Ensure source
typemaps to the exported class statictype. - Verify initialization path in
initializeInstancesand runtime source updates.
Step 4: Choose load priority intentionally¶
Load priority controls staged loading behavior:
- Lower values load earlier and improve perceived first render.
- Higher values can defer expensive or non-critical providers.
- Priorities should reflect startup UX and source latency profile.
Step 5: Validate identifier and sync behavior¶
- Ensure
getEventHandleproduces durable IDs across reads. - Confirm mapping
calendarId::persistentIdremains stable. - Verify update ingestion paths do not duplicate or orphan events.
Step 6: Ship with docs and tests¶
Minimum expectation before merge:
- Unit tests for parser/serializer or source edge cases.
- Integration tests for cache-provider mutation path.
- Architecture docs update in Provider Architecture section.
- User docs update if the provider is user-configurable.
Contributor contract
Append or modify only relevant documentation sections. Do not rewrite unrelated architecture pages when adding a provider.
Integration anchors¶
src/providers/Provider.tssrc/providers/ProviderRegistry.tssrc/ui/settings/SettingsTab.tsx