Commit Graph

4 Commits

Author SHA1 Message Date
saravanakumardb1
192c7baf2f fix: align web+mobile types with backend (categories, output types, field names, durationMs telemetry) 2026-04-06 16:24:31 -07:00
saravanakumardb1
0aad04f91a fix(mobile): align PromptCategory with backend, add tone param, remove dead import
- note-prompts.ts: fix PromptCategory ('analysis' → 'analyze', remove nonexistent 'vision'/'custom')
- note-prompts.ts: add CopilotTone type and optional tone param to copilotTransform
- capture.tsx: remove unused copilotTransform import (copilot requires real noteId)
2026-04-06 10:47:38 -07:00
saravanakumardb1
3260b7ea0a feat(smart-actions): F1-F4 inline editor AI, F15-F19 mobile capture modes, F25-F27 scheduler/webhooks/approval
F1-F4: Inline editor AI
- Backend: expand CopilotAction with fix-rewrite, change-tone, continue, explain
- Backend: add tone parameter to copilot route for change-tone action
- Web: copilot-client adds CopilotTone type and tone parameter
- Web: NoteEditor toolbar gains AI row with Fix & Rewrite, Change Tone dropdown,
  Continue Writing (appends at cursor), Explain (inline popover)

F15-F19: Mobile capture enhancements
- Backend: POST /note-prompts/url-extract endpoint (fetch, strip HTML, LLM summarize)
- Mobile API: extractFromUrl() and copilotTransform() client functions
- Mobile: capture tab rewritten with 6 capture modes grid (text, photo, voice,
  URL, scan, paste) — URL extract + clipboard paste fully wired, camera/voice/scan
  surface native permission prompts (require expo-av/expo-image-picker)
- expo-clipboard added as dependency

F25-F27: Scheduled actions, webhook triggers, approval-gated actions
- New scheduler.ts module with PromptScheduleDoc + PromptWebhookDoc types
- Schedule CRUD: GET/POST/PATCH/DELETE /prompt-schedules
- Webhook CRUD: GET/POST/PATCH/DELETE /prompt-webhooks
- POST /prompt-webhooks/:id/trigger — execute template against note
- Scheduler loop (60s tick) with cron next-run calculation
- Diagnostics endpoint: GET /prompt-schedules/diagnostics
- Cosmos containers: note_prompt_schedules, note_prompt_webhooks
- PromptTemplateDoc gains requiresApproval field (F27)
- Runner produces approvalState: proposed|applied based on template flag
- Create/Update schemas accept requiresApproval boolean
2026-04-06 10:25:34 -07:00
saravanakumardb1
37d7284730 feat(mobile): add Smart Actions — API client, prompt store, note detail integration
Phase 4 of Smart Actions Roadmap:

- Create mobile/src/api/note-prompts.ts: typed API client
  - listPromptTemplates, runPrompt, suggestTags, getReadingTime
- Create mobile/src/store/prompt-store.ts: Zustand store
  - fetchTemplates, runPrompt, clearResult, clearError
- Enhance note detail screen (mobile/src/app/note/[id].tsx):
  - Collapsible Smart Actions section with toggle
  - Reading time display on expand
  - Suggest tags button with inline tag display
  - Prompt template list (top 6) with one-tap execution
  - ActivityIndicator during prompt execution
  - Inline result card with model/token info and dismiss
- Mobile typecheck passes
2026-04-06 08:23:55 -07:00