feat(ai-core): provider-agnostic AI architecture with streaming#156
Conversation
## Summary Release 0.9.0 — a major milestone with AI features, sync stability, and a complete website redesign. - **Website redesign** with shadcn/ui + Magic UI - **Auth UX rethink** — Enable Sync flow + middleware fix (500 → 401) - **Sync stability** — error propagation, exponential backoff, abort on logout, typed token refresh - **Sync onboarding** — prompt after 5 notes + offline queue visibility - **AI Commands (Cmd+K v1)** — command panel, settings, keybindings - **AI Knowledge (Cmd+K v2)** — RAG, ask notes, related context - **AI Extensibility** — plugin API, presets import/export - **API documentation** ## Version bumps | File | From | To | |------|------|----| | `package.json` | 0.2.0 | 0.9.0 | | `apps/desktop/package.json` | 0.8.0 | 0.9.0 | ## Checklist - [x] Version bumped in root `package.json` - [x] Version bumped in `apps/desktop/package.json` - [x] CHANGELOG.md updated - [x] Tests pass - [ ] QA smoke test on macOS - [ ] QA smoke test on Windows - [ ] Tag `v0.9.0` after merge ## Post-merge After merging to `main`: 1. Tag `v0.9.0` on main 2. Merge `main` back into `develop` 3. Delete `release/0.9.0` branch 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * AI Assistant panel with modeful interface (chat/ask-notes modes), configurable via settings * AI command presets support (export/import functionality) * Sync status monitoring with error tracking and pending change count * Enable Sync onboarding flow for new users * Redesigned website with modernized design system * Settings panel for AI configuration (API key, model selection, context limits) * **Bug Fixes** * Improved token handling for deep-link authentication * Better sync error classification and exponential backoff * Enhanced device limit error handling <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
## Summary - Adds `auto-tag.yml` workflow that was created during v0.9.0 development but missed the squash merge to main - Without this workflow, release PRs don't trigger automatic tag creation, breaking the release pipeline ## Context The release pipeline chain is: `release/* PR merge → auto-tag creates vX.Y.Z → release.yml builds + publishes` This workflow was in `release/0.9.0` but the squash merge of PR #149 didn't include it, so v0.9.0 never got tagged or released. ## After merge Once this is on main, I'll manually create the `v0.9.0` tag to trigger the release build. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
## Release v0.9.0 ### Highlights - **Auth → Payment → Sync flow**: License-gated sync with smart step routing in EnableSyncModal - **Stripe checkout**: Monthly (€2/mo) and annual (€20/year) plan selection - **Sidebar drag-and-drop**: Grip handle, circular reference prevention, child depth propagation - **CI/CD**: Auto-deploy API — develop → staging, main → production - **Design tokens**: SyncStatusIndicator uses CSS variables instead of hardcoded colors - **AI features**: Command execution, plugin bridge, knowledge system (Phase 4-5) - **UI cleanup**: Tailwind v4 canonical classes, removed dead design-system package ### Changes since v0.8.0 - feat(sync): connect auth → payment → sync flow with license gating (#154) - chore: Tailwind v4 canonical classes + tsconfig cleanup (#151) - feat(ai): complete Phase 4-5 — AI command execution + plugin bridge (#150) - feat(ai,plugins): complete Phase 4-5 — AI knowledge & extensibility - feat(desktop,api): complete Phase 1-3 roadmap implementation ### Checklist - [x] `pnpm typecheck` passes - [x] `pnpm test` passes - [x] `package.json` version is `0.9.0` - [x] All features merged to develop first - [x] API production secrets configured (Stripe, Resend) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit # Release Notes * **New Features** * Added AI-powered text commands (summarize, rewrite, tweet) with plugin integration. * Introduced drag-and-drop notebook reordering with automatic circular reference protection. * Enhanced sync onboarding with license-based feature gating. * Improved magic link authentication with automatic verification. * **Bug Fixes** * Fixed token refresh infinite loop handling. * Added URL encoding for verification links. * Improved cleanup for animated UI components. * **Improvements** * Enhanced error handling for authentication and sync failures. * Added accessibility attributes (ARIA labels, semantic HTML). * Updated visual styling with new token-driven design system. * **Refactor** * Migrated from design-system package to plugin-api package. * Consolidated design tokens and theme system. * **Chores** * Updated GitHub Actions release automation. * Refreshed project documentation and contribution guidelines. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…used imports Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements context assembly for LLM calls with token-aware budget management: drops oldest history messages and truncates/excludes notes that exceed limits. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements parseSSEStream as an async generator that handles chunked Uint8Array streams, double-newline event boundaries, event/data field parsing, comment skipping, and malformed JSON resilience. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements AnthropicProvider with full SSE streaming support, HTTP error classification, usage token tracking, static model list, and config validation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…etry Implements AIServiceImpl that wires together ProviderRegistry, buildContext, and withRetry into a single chat() entry point returning an abortable AsyncIterable<LLMEvent> handle with start/done envelope events. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace legacy ai:query handler with ai-core-based streaming IPC: - Add @readied/ai-core dependency, remove @readied/ai-assistant - Create apps/desktop/src/main/ai/setup.ts: singleton AIService factory using ProviderRegistry + AnthropicProvider with net.fetch - Create apps/desktop/src/main/ai/ipc-ai.ts: registerAIHandlers with ai:chat (streaming), ai:cancel, ai:validate, ai:exportPreset, ai:importPreset; 50ms text batching + per-window handle tracking - Remove old registerAiHandlers() inline function from index.ts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace ai.query() with ai.chat(), ai.onEvent(), ai.cancel(), ai.validate(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace synchronous ai.query() calls with event-driven ai.chat() streaming. Add provider field to settings schema (v3 migration), copy aiCommandTypes to ai-core, and update all renderer imports from @readied/ai-assistant to @readied/ai-core. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All functionality has been migrated to @readied/ai-core. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Merge duplicate AI panel systems (plugin + App.tsx) into single panel instance managed by App.tsx - Plugin's Sparkles button now dispatches CustomEvent instead of managing its own panel, eliminating the duplicate panel that appeared inside the editor zone - Fix AI panel CSS from fixed height (350px) to 100% to fill the side panel container properly - Default to 'ask-notes' mode (RAG) when opening panel via ⌘K - Make React DevTools a dynamic import so it stays out of production bundle Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
lucide-react@0.562 ships types against @types/react@19.x, but the desktop app uses React 18. pnpm hoisted the 19.x types from apps/web, causing a type identity mismatch (bigint not in React 18 ReactNode). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe pull request refactors the AI subsystem from a monolithic Changes
Sequence Diagram(s)sequenceDiagram
participant Renderer as Renderer<br/>(AiPanel)
participant IPC as Electron IPC
participant Service as AIService
participant Provider as AnthropicProvider
participant Network as Anthropic API
Renderer->>IPC: ai:chat { query, history,<br/>mode, provider }
activate IPC
IPC->>Service: chat(request)
activate Service
Service->>Service: buildContext(sources,<br/>budget)
Service->>Provider: chat(options,<br/>config)
activate Provider
Provider->>Network: POST /v1/messages<br/>(stream SSE)
activate Network
Network-->>Provider: SSE stream<br/>(text_delta, etc)
deactivate Network
loop Streaming Events
Provider->>Provider: parseSSEStream()
Provider->>Service: yield LLMEvent<br/>(text, usage)
Service->>Service: track tokens,<br/>accumulate
Service->>IPC: emit text event<br/>(batched, 50ms)
IPC->>Renderer: ai:event<br/>(text delta)
Renderer->>Renderer: accumulate text,<br/>update UI
end
Provider-->>Service: yield done event
deactivate Provider
Service->>Service: cleanup handle,<br/>emit duration
Service-->>IPC: done(duration,<br/>cancelled)
deactivate Service
IPC->>Renderer: ai:event (done)
deactivate IPC
Renderer->>Renderer: finalize stream,<br/>apply output target
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Accept all apps/web changes from develop - Move aiCommandTypes from ai-assistant into ai-core - Fix test imports for renamed ai-command-types module - Regenerate pnpm-lock.yaml Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
## Summary - Merges all develop changes into main for release preparation - Includes: AI core provider abstraction (#156), automated release pipeline (#157), and all other develop work - All conflicts resolved (develop is source of truth) ## What happens after merge 1. Go to **Actions → Release → Run workflow** (branch: main) 2. semantic-release calculates version, creates tag + draft release 3. Build workflow triggers automatically for mac/win/linux 4. Release is published when all builds succeed ## Test plan - [x] All tests pass (`pnpm test` — 16/16) - [x] No conflict markers remaining - [ ] CI checks pass on this PR 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Summary
@readied/ai-corepackage — provider-agnostic AI architecture with LLMProvider interface, ProviderRegistry, streaming SSE parser, retry logic with exponential backoff, context builder with token budgeting, and AIService orchestrator@types/reactto 18.x via pnpm overrides to resolve lucide-react type mismatchArchitecture
What's included
packages/ai-core (new)
LLMProviderinterface +ProviderRegistryfor pluggable providersAnthropicProviderwith native SSE streaming (no SDK dependency)ContextBuilderwith token budgeting and automatic content trimmingAIServiceorchestrator with retry, cancellation, and context buildingLLMEventprotocol:text,error,done,tool_call,tool_resultapps/desktop
window.readied.ai.chat(),.onEvent(),.cancel()Monorepo
@readied/ai-assistantpackagepnpm.overridesto pin@types/react@18.3.27across workspaceTest plan
pnpm testpnpm typecheckpasses (17/17 tasks)pnpm buildsucceeds🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Refactor