feat: intent-based cache API (createCache.io, .minimal, .production, .secure)#42
Conversation
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds an intent-based API for Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
….secure) Add intent factory functions that pre-configure the full cache stack (backend, reliability, encryption) from a single declarative call: - createCache.minimal() — speed-first, no circuit breaker/retry - createCache.production() — reliability-first with CB + retry + degradation - createCache.secure() — production + AES-256-GCM zero-knowledge encryption - createCache.io() — SaaS backend via cachekit.io with full reliability Each factory builds CacheOptions and delegates to createCache() — thin wrappers, no new abstraction layer. Master key and API key resolve from options or environment variables (CACHEKIT_MASTER_KEY, CACHEKIT_API_KEY). Closes #1
Update Quick Start to lead with createCache.production() and add intent API section with comparison table covering all 4 intents.
73c020b to
118b642
Compare
🤖 I have created a release *beep* *boop* --- <details><summary>cachekit: 0.1.1</summary> ## [0.1.1](cachekit-v0.1.0...cachekit-v0.1.1) (2026-04-26) ### Features * CachekitIO backend full parity — session, metrics, SSRF, errors, locking, TTL ([985cf09](985cf09)) * CachekitIO backend full parity (session, metrics, SSRF, locking, TTL) ([d408364](d408364)) * initial commit ([048585c](048585c)) * intent-based cache API (createCache.io, .minimal, .production, .secure) ([#42](#42)) ([c551bfb](c551bfb)) * wire ByteStorage into cache pipeline for protocol-compliant wire format ([#27](#27)) ([d246294](d246294)) </details> <details><summary>cachekit-core-ts: 0.1.1</summary> ## [0.1.1](cachekit-core-ts-v0.1.0...cachekit-core-ts-v0.1.1) (2026-04-26) ### Features * CachekitIO backend full parity (session, metrics, SSRF, locking, TTL) ([d408364](d408364)) * initial commit ([048585c](048585c)) * wire ByteStorage into cache pipeline for protocol-compliant wire format ([#27](#27)) ([d246294](d246294)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: cachekit-release-bot[bot] <247960786+cachekit-release-bot[bot]@users.noreply.github.com>
Summary
createCachefor declarative cache configurationcreateCache.minimal()— speed-first, no circuit breaker or retrycreateCache.production()— reliability-first with circuit breaker (threshold: 5), retry, degradationcreateCache.secure()— production + AES-256-GCM encryption (masterKey from options orCACHEKIT_MASTER_KEY)createCache.io()— SaaS backend via cachekit.io (apiKey from options orCACHEKIT_API_KEY)Each factory builds
CacheOptionsand delegates tocreateCache()— thin wrappers, no new abstraction.Closes #1
Files Changed
packages/cachekit/src/intents.tsCreateCacheFninterfacepackages/cachekit/src/intents.test.tspackages/cachekit/src/index.tscreateCachefrom intents moduleTest plan
tsc --noEmit)Summary by CodeRabbit
New Features
Tests
Documentation