Commit Graph

272 Commits

Author SHA1 Message Date
saravanakumardb1
b424b490be fix(web): close tone dropdown on outside click
Add useRef + useEffect mousedown listener to dismiss the Change Tone
dropdown when clicking outside. Prevents stale dropdown from lingering.
2026-04-06 10:46:03 -07:00
saravanakumardb1
f2c3258b53 fix(backend): review fixes — persist requiresApproval, shutdown hook, productId check, GET by ID
- repository.ts: persist requiresApproval field in createPromptTemplate (was silently dropped)
- server.ts: register onClose hook to call stopSchedulerLoop() on graceful shutdown
- scheduler.ts: add productId check in webhook trigger note lookup
- scheduler.ts: add GET /prompt-schedules/:id and GET /prompt-webhooks/:id endpoints
2026-04-06 10:45:03 -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
511c36d87e feat(mcp): add Smart Action MCP tools — suggest_tags, check_duplicates, suggest_links
Phase 5 of Smart Actions Roadmap — Agent & workflow intelligence:

- Add 3 new MCP tool contracts to note-tool-contracts.ts:
  - notes.intelligence.suggest_tags: LLM-powered tag suggestion
  - notes.intelligence.check_duplicates: embedding-based duplicate detection
  - notes.intelligence.suggest_links: embedding-based related note suggestions
- Add Zod schemas and SmartActionMcpToolDefinitions export
- Implement executeSuggestTags, executeCheckDuplicates, executeSuggestLinks
- Wire all 3 into NotesExecutableMcpTools array (now 11 tools total)
- Update note-tools.test.ts to expect 11 tool names
- All 131 tests pass, typecheck clean
2026-04-06 08:45:38 -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
saravanakumardb1
564e8f72dc feat(web): add Smart Actions UI — prompt client, SmartActionsPanel, prompts page
Phase 3 of Smart Actions Roadmap:

- Create web/src/lib/prompt-client.ts: typed API client for all prompt endpoints
  - listPromptTemplates, getPromptTemplate, createPromptTemplate, deletePromptTemplate
  - runPrompt, suggestTags, checkDuplicates, suggestLinks, getReadingTime
  - compareNotes, mergeNotes, getKnowledgeGaps
- Add Smart Actions types to web/src/lib/types.ts:
  - PromptTemplate, RunPromptInput, RunPromptOutput, SimilarNote, KnowledgeGap
- Create SmartActionsPanel component:
  - Reading time display, tag suggestion with accept/dismiss
  - Category filter tabs, 2-column template grid
  - One-click prompt execution with loading state
  - Inline result display with copy/dismiss
- Create /prompts template library page:
  - Browse built-in + custom templates with category filter
  - Grid layout with input/output type badges
  - Delete custom templates
- Wire SmartActionsPanel into note detail sidebar (above MetadataPanel)
- Add 'Prompts' nav item to Sidebar (Sparkles icon)
- Web typecheck passes, all 131 backend tests pass
2026-04-06 08:19:35 -07:00
saravanakumardb1
fe3b0f9b3e feat(backend): add note intelligence — embeddings, auto-summarize, duplicates, suggest-links, knowledge gaps
Phase 2 of Smart Actions Roadmap:

- Create lib/embeddings.ts: embedText(), cosineSimilarity(), stripHtmlForEmbedding()
- Add embedding + summaryArtifactId fields to NoteDoc
- Create lib/note-hooks.ts: runPostSaveHooks() for background AI enrichment
  - backgroundEmbed: compute and store note embedding vectors
  - backgroundAutoSummarize: generate summary artifact for notes > 300 words
  - Both gated behind feature flags (notelett_auto_embed_enabled, notelett_auto_summarize_enabled)
- Add intelligence endpoints to note-prompts routes:
  - POST /api/notes/:id/suggest-tags (F5) — LLM-generated tag suggestions
  - POST /api/notes/:id/check-duplicates (F8) — cosine similarity duplicate detection
  - POST /api/notes/:id/suggest-links (F9) — related note suggestions
  - POST /api/workspaces/:wsId/knowledge-gaps (F12) — workspace gap analysis
  - POST /api/notes/compare (F14) — multi-note comparison
  - POST /api/notes/merge (F13) — multi-note merge
- Add 4 feature flags for intelligence features
- 9 new tests in embeddings.test.ts (cosine similarity, HTML stripping, embedText)
2026-04-06 08:10:26 -07:00
saravanakumardb1
f015ae6f20 chore: resolve pnpm-lock.yaml conflict after rebase 2026-04-06 08:03:46 -07:00
saravanakumardb1
9e3a7206b9 feat(backend): add note-prompts module with Smart Actions LLM integration
- Add @bytelyst/llm dependency (file: ref) + llm.ts singleton wrapper
- Add LLM env vars to config (LLM_PROVIDER, LLM_DEFAULT_MODEL, LLM_VISION_MODEL, LLM_EMBEDDING_MODEL)
- Create note-prompts module: types, repository, runner, routes, seed (20 built-in templates)
- Built-in templates: 8 transform, 3 extract, 3 generate, 2 analyze, 2 vision, 2 export
- Prompt runner supports text, image, and text+image inputs via @bytelyst/llm vision
- Upgrade copilot-transform.ts to use @bytelyst/llm directly (with local heuristic fallback)
- Add reading-time endpoint (GET /api/notes/:id/reading-time)
- Extend agent-action types with smart_action and auto_enrich
- Add note_prompts Cosmos container to cosmos-init
- Register notePromptRoutes in server.ts
- 15 new tests (CRUD, run, slug resolution, seed validation, reading-time)
2026-04-06 08:01:42 -07:00
7ee2151f17 feat(phase3): wire notelett trail import route 2026-04-04 00:33:38 -07:00
4af86b43f7 feat(phase3): add notelett trail report import 2026-04-03 19:49:46 -07:00
saravanakumardb1
623d02c32f test(notes): verify phase1 transcript→note import against @bytelyst/events schemas
- Add @bytelyst/events dependency for contract validation
- Expand ecosystem-phase1 tests from 1 to 13 focused tests:
  - transcript artifact import from disk
  - transcript capture event load + missing file graceful
  - note creation with productId, sourceType, links, tags
  - note artifact doc for internal persistence
  - artifact.created event with upstream causation propagation
  - artifact.linked event chained from artifact.created
  - provenance lineage preservation (lysnrai→notelett)
  - NoteArtifactEnvelopeSchema conformance (no contract drift)
  - ArtifactCreatedEventSchema conformance
  - ArtifactLinkedEventSchema conformance
  - disk persistence + index file verification
  - graceful degradation without capture event
- Fix server.test.ts route count (7→8) for ecosystem-phase1 route
2026-04-03 19:13:55 -07:00
9ecc7c6bf5 fix(notes): preserve phase1 transcript event lineage 2026-04-03 17:40:59 -07:00
6ffc2f8755 feat(notes): import phase1 transcript artifacts 2026-04-03 16:36:54 -07:00
59d13e423e fix(api): set JSON Content-Type on onboarding-seed
POST /workspaces/onboarding-seed now sends application/json so servers that require it parse the body correctly.

Made-with: Cursor
2026-03-31 13:06:00 -07:00
f8a50cdd95 feat(ui): add Workspace chat to command palette
Static action opens /chat for quick navigation from the palette.

Made-with: Cursor
2026-03-31 13:06:00 -07:00
32b5e1cd6c fix(chat): empty workspace state and disabled Ask
Show guidance when the user has no workspaces and prevent submitting without a selected workspace.

Made-with: Cursor
2026-03-31 13:05:34 -07:00
821d9aee35 fix(share): sanitize public HTML and harden token handling
Add a conservative sanitizer for shared note bodies before dangerouslySetInnerHTML.

Normalize dynamic route params, reject blank tokens, and require noteId in the JSON payload so empty titles still render.

Made-with: Cursor
2026-03-31 13:05:32 -07:00
8d8540e320 fix(note-shares): treat expired shares as not found
findShareByToken now returns null when expiresAt is in the past, aligning the public share API with stored metadata.

Add unit tests for expiry, future expiry, missing expiry, and no match.

Made-with: Cursor
2026-03-31 13:05:30 -07:00
5e3e374d3a fix(notes): export route order and lexical snippet ellipsis
Register GET /notes/export before GET /notes/:id so the path is not captured as an id.

Compute search snippets from stripped plain text so the trailing ellipsis matches visible length, not raw HTML length.

Made-with: Cursor
2026-03-31 13:05:29 -07:00
a697752d15 feat: implement WEB_AI_FAST_ROADMAP (web + backend + docs)
Phase 1: Command palette (⌘K), editor autosave with quiet auto-saves, dashboard
saved views from API + quick links + onboarding seed CTA, explicit task scan panel.

Phase 2: Context pack formatter with YAML frontmatter, copy on note + workspace .md export.

Phase 3: ADR for hybrid search without embeddings; POST /notes/search (lexical +
ranked hybrid); search UI mode toggle.

Phase 4: POST copilot + suggest-title; in-editor copilot actions; /chat retrieval
answers with citations (backend chat.rag_enabled).

Phase 5: Settings MCP snippet, offline queue note, API token deferral; DEEP_LINKS.md.

Phase 6: Note shares + public GET; share page; POST onboarding-seed.

Phase 7: note_versions on PATCH; version panel; create-note templates; PWA manifest.

Flags: search.hybrid_enabled, copilot.enabled, chat.rag_enabled, onboarding.seed_enabled.
Made-with: Cursor
2026-03-31 13:00:36 -07:00
1fa7e29691 docs: link PRD from WEB_AI_FAST_ROADMAP companion list
Made-with: Cursor
2026-03-31 12:50:26 -07:00
6dc5464dd5 docs: add WEB_AI_FAST_ROADMAP and index cross-links
- New phased plan for web (command palette, autosave, saved views, task scan,
  context packs, semantic search, copilot, MCP onboarding, sharing, polish)
- Link from AGENT_TASK_ROADMAP; index entry in ROADMAP.md
- Fix task-summary table total row; rename meta sections to avoid clash with Phase N

Made-with: Cursor
2026-03-31 12:50:21 -07:00
85292b61dc docs(mobile): checkboxes for auth-gated hydrates, telemetry flush, tests
- AGENT_TASK_ROADMAP: Current State + remaining gaps
- MOBILE_DELEGATION: Remaining/deferred table, Block A/G/H, audit follow-up

Made-with: Cursor
2026-03-31 01:51:11 -07:00
370e96fa45 test(mobile): settings smoke test; docs: capture points to blob-upload
- settings.test.tsx mirrors auth/home import smoke pattern
- Capture screen comment: future uploads via api/blob-upload

Made-with: Cursor
2026-03-31 01:51:07 -07:00
6620e5dabb fix(mobile): auth-gated hydrates and telemetry flush on background
- Run notes/workspace/inbox hydrate, broadcast/survey polling, and offline
  queue flush timers only when hasBootstrapped && isAuthenticated
- Split effects: kill switch, bootstrap, initPlatform, global AppState flush
- Avoid pre-auth 401s from parallel API hydrates

Made-with: Cursor
2026-03-31 01:51:05 -07:00
e920d724e4 fix(mobile): export flushTelemetry for background buffer flush
Expose telemetryClient.flush() from platform.ts for AppState wiring.

Made-with: Cursor
2026-03-31 01:51:03 -07:00
4ee604be76 docs(mobile): post-review gaps in AGENT + MOBILE_DELEGATION roadmaps
- AGENT_TASK_ROADMAP: mobile summary row, dated bump, ordered gap list → blocks
- MOBILE_DELEGATION_ROADMAP: post-review checklist table + NomGap SDK note

Made-with: Cursor
2026-03-31 01:36:57 -07:00
saravanakumardb1
db2874174b feat(mobile): blob upload abstraction via shared blobClient (Block F)
- Create mobile/src/api/blob-upload.ts with uploadNoteAttachment() and uploadNoteImage()
- All mobile uploads route through shared blobClient from lib/platform.ts
- No duplicate SAS logic or raw fetch paths
- Update MOBILE_DELEGATION_ROADMAP to mark Block F complete
2026-03-31 01:32:30 -07:00
saravanakumardb1
cfcb25e379 docs(mobile): add post-completion audit summary to MOBILE_DELEGATION_ROADMAP
- Document 7 bugs/gaps found and fixed during systematic review of blocks A–H
- Note remaining blocks F and I as deferred/optional
2026-03-31 01:19:41 -07:00
saravanakumardb1
6acd1a70d4 fix(backend): fix trackEvent call signature and route registration tests
- auth.ts: type requireWriter param as { headers: { authorization?: string } } instead of unknown
- notes/routes.ts: fix 3 trackEvent calls from object form to positional args (event, userId, properties)
- workspaces/routes.ts: fix 1 trackEvent call from object form to positional args
- 5 route registration tests: add missing delete mock to app object for Phase 2 DELETE endpoints
2026-03-31 01:00:32 -07:00
saravanakumardb1
83f4953870 fix(mobile): add missing accessibilityLabels across all screens
- settings.tsx: labels on sign-out, feedback type chips, submit button
- capture.tsx: labels on workspace selection chips
- index.tsx: labels on workspace filter chips, note card pressables
- search.tsx: labels on search input, result row pressables
- note/[id].tsx: labels on edit, save, cancel buttons
2026-03-31 00:55:05 -07:00
saravanakumardb1
a4124949d1 fix(mobile): auto-dismiss queue status banner when queue is empty
- Skip flush call and clear lastFlushed when getNoteQueueSize() is 0
- Prevents stale 'Flushed on last attempt: N' persisting after queue drains
2026-03-31 00:52:24 -07:00
saravanakumardb1
c96c7855c6 fix(mobile): add error handling to store hydrate methods
- notes-store: wrap hydrate() and openNote() in try/catch to prevent isLoading stuck true
- inbox-store: wrap hydrate() in try/catch to prevent isLoading stuck true on API failure
- openNote falls back to cached list note when detail fetch fails
2026-03-31 00:51:16 -07:00
saravanakumardb1
9d3ac06234 fix(mobile): use dynamic platform in feedback, add null coercion, add Content-Type on flush
- settings.tsx: replace hardcoded platform: 'ios' with APP_PLATFORM from app-metadata
- feedback-client.ts: add ?? '' null coercion on getAuthToken (matches broadcast/survey pattern)
- offline-queue.ts: add Content-Type: application/json header on flush requests
2026-03-31 00:49:40 -07:00
saravanakumardb1
a761ec9ee0 docs(mobile): update roadmap with Block H completion and commit links 2026-03-31 00:44:03 -07:00
saravanakumardb1
5a0175fa66 feat(mobile): add Block H — Vitest RN mock aliases + component smoke tests
- Create __mocks__/ with react-native, expo-router, expo-constants, expo-status-bar, react-native-mmkv, @testing-library/react-native
- Update vitest.config.ts with resolve aliases for all native modules
- Add AuthScreen smoke test (3 tests)
- Add HomeScreen smoke test (2 tests)
- Add @types/react-test-renderer dev dependency
- Total: 32 passing tests (27 store + 5 component)
2026-03-31 00:42:49 -07:00
saravanakumardb1
5f231816bd docs(mobile): mark block G done with commit link 2026-03-31 00:24:48 -07:00
saravanakumardb1
e4683ad695 fix(mobile): complete block G metadata and accessibility 2026-03-31 00:23:57 -07:00
saravanakumardb1
a9172e4230 docs(mobile): mark block E done with commit link 2026-03-31 00:18:58 -07:00
saravanakumardb1
5d8216066a feat(mobile): wire offline queue enqueue and flush 2026-03-31 00:17:41 -07:00
saravanakumardb1
c37d6443f4 docs(mobile): mark block D done with commit link 2026-03-31 00:11:38 -07:00
saravanakumardb1
746cba74ff feat(mobile): add settings tab with feedback client 2026-03-31 00:10:50 -07:00
saravanakumardb1
d26d9946b3 docs(mobile): mark block C done with commit link 2026-03-31 00:04:03 -07:00
saravanakumardb1
48896ab879 feat(mobile): integrate broadcast and survey clients 2026-03-31 00:03:20 -07:00
saravanakumardb1
97c9eaed24 docs(mobile): mark block B done with commit link 2026-03-30 23:58:37 -07:00
saravanakumardb1
acdedbcb9a feat(mobile): add kill switch gate in root layout 2026-03-30 23:58:03 -07:00
saravanakumardb1
8162a086d1 docs(mobile): mark block A done with commit link 2026-03-30 23:56:56 -07:00
saravanakumardb1
ae0a481504 feat(mobile): complete block A auth session flow 2026-03-30 23:56:18 -07:00
8aff92d6b2 docs(mobile): add MOBILE_DELEGATION_ROADMAP for NoteLett
- Sequential blocks A–I (auth, kill switch, broadcast/survey, feedback,
  offline queue, blob, health, RNTL, optional sync) with file paths under mobile/
- Cross-link from AGENT_TASK_ROADMAP Current State section

Made-with: Cursor
2026-03-30 23:48:38 -07:00