Skip to content

Fix nia add folder persistence and improve upload type errors#35

Draft
arlanrakh wants to merge 2 commits into
mainfrom
cursor-cloud/nia-add-source-handling-6d3b
Draft

Fix nia add folder persistence and improve upload type errors#35
arlanrakh wants to merge 2 commits into
mainfrom
cursor-cloud/nia-add-source-handling-6d3b

Conversation

@arlanrakh

@arlanrakh arlanrakh commented May 9, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Added a new root nia add <target> command that routes by target type:
    • existing folder path -> registers local source through the daemon (detected_type=folder)
    • existing file path -> uploads supported single-file source types
    • http(s) URL -> creates a documentation source
  • Added a new root nia status command to show configured local sources (same status view as local sources, with explicit No sources configured. when empty).
  • Improved add failure surfacing for local folder registration so daemon/API details are shown directly instead of generic not-found phrasing.
  • Improved unsupported upload handling for nia sources upload:
    • explicit errors for unsupported extensions
    • .md and .docx now return a clear message with supported types and a folder-based workaround
    • exported resolveUploadContentType() for reusable validation
  • Added regression tests for add-target detection and upload-type messaging (tests/commands/add.test.ts).
  • Follow-up fix: addressed CI Biome failures by organizing imports and applying formatter-compliant line wrapping in new files.

Why

User-reported behavior showed folder targets being detected but not persisted when using nia add, followed by nia status showing no configured sources. The new root add path now performs explicit folder registration via the local daemon and surfaces actionable backend error details.

Verification

  • Added unit tests for:
    • folder/file/url target detection
    • unsupported .md/.docx upload messaging includes supported types
    • supported upload extension mapping
  • Initial CI failure was lint-only (Biome import/format); fixed in follow-up commit d8e843a.
Open in Web Open in Cursor 

Summary by cubic

Adds root nia add and nia status commands. Fixes folder source persistence and clarifies upload errors with actionable guidance.

  • New Features

    • nia add <target> auto-detects target:
      • Folder -> registers local source via daemon
      • File -> uploads supported single-file types
      • http(s) URL -> creates a documentation source
    • nia status lists configured local sources (shows “No sources configured.” when empty)
    • Exported resolveUploadContentType() and centralized supported types: .pdf, .csv, .xlsx
  • Bug Fixes

    • Folder adds now persist via the local daemon; failures surface detailed backend errors
    • Clear upload errors for unsupported extensions; .md/.docx now suggest adding the parent folder and list supported types
    • Added tests for target detection and upload-type messaging
    • Biome import/order fix in add command

Written for commit d8e843a. Summary will update on new commits.

Co-authored-by: Arlan Rakhmetzhanov <arlanrakh@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented May 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 26d3b00f-0814-44cc-b8a0-392d2100ef8e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor-cloud/nia-add-source-handling-6d3b

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: Arlan Rakhmetzhanov <arlanrakh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants