Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions apps/storage/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# dependencies (bun install)
node_modules

# output
out
dist
*.tgz

# code coverage
coverage
*.lcov

# logs
logs
*.log
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# caches
.eslintcache
.cache
*.tsbuildinfo

# IntelliJ based IDEs
.idea

# Finder (MacOS) folder config
.DS_Store

# Test vaults created by demo.ts / test runs
test-vault/
demo-vault/
45 changes: 45 additions & 0 deletions apps/storage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Smart Notes Storage

What it does — in plain terms
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix markdownlint violations (MD041, MD047).

Add a top-level H1 at Line 1 and ensure the file ends with a single trailing newline.

📝 Proposed fix
-What it does — in plain terms
+# Smart Notes Storage Layer
+
+What it does — in plain terms

(Also ensure one final newline at EOF.)

Also applies to: 43-43

🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 1-1: First line in a file should be a top-level heading

(MD041, first-line-heading, first-line-h1)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/storage/README.md` at line 1, Add a top-level H1 by prefixing the first
line with "# " so the first line becomes "# What it does — in plain terms" and
remove any extra blank lines at the end so the file ends with exactly one
trailing newline (ensure only a single final newline character at EOF).

Vault (the notes folder)
Open any folder as a vault
Re-opening the same folder is safe — nothing breaks or duplicates
Works even if you already have existing .md files in the folder
Notes
Create a note — writes a .md file, saves metadata to DB
Read a note — gives you the content + title + tags
Update a note — saves new content, keeps frontmatter intact
Rename a note — renames the file, updates the title inside the file
Move a note to a different folder
Delete a note — moves to trash by default, or permanent delete
Trash
Deleted notes go to a .trash folder, not permanently gone
List everything in the trash
Restore a trashed note back to its original location
Folders
Create a folder (with optional icon and pin-to-top)
Rename a folder — all notes inside automatically get their paths updated
Delete a folder — safely trashes all notes inside first
Tags
Attach tags to a note when creating or updating
Tags stored in both the DB and the .md file frontmatter
Filter notes by tag
List all tags in the vault with usage counts
Search
Search notes by title
Sorting & Pagination
List notes sorted by last updated, created date, or name
Limit results per page (useful for sidebars with many notes)
Conflict Detection
If a note was edited by another app (e.g. VS Code) while you had it open, it won't silently overwrite — saves a conflict copy and alerts you
File Watcher
Detects when any .md file is added, changed, or deleted outside your app
DB automatically stays in sync even if the user edits notes in another editor
Events
Every action fires an event (noteCreated, noteUpdated, noteDeleted, noteRenamed, noteMoved, folderCreated, folderRenamed, folderDeleted, conflictDetected)
Your UI just listens and reacts — no polling needed
RAG / AI pipeline bridge
Tells the RAG pipeline which notes need to be embedded (new, changed, or previously failed)
Tells the RAG pipeline which notes changed since a specific time (for incremental updates)
Lets the RAG pipeline report back when it finishes indexing a note
Bulk-read all notes with content in one call for initial indexing
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add trailing newline at end of file.

The file should end with a single newline character per Markdown conventions (MD047).

🧰 Tools
🪛 markdownlint-cli2 (0.21.0)

[warning] 45-45: Files should end with a single newline character

(MD047, single-trailing-newline)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/storage/README.md` at line 45, The README.md file is missing a trailing
newline; update apps/storage/README.md to ensure the file ends with a single
newline character (add one blank line terminator at EOF) so it conforms to
Markdown convention (MD047).

1 change: 1 addition & 0 deletions apps/storage/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./src/index"
31 changes: 31 additions & 0 deletions apps/storage/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "storage",
"module": "index.ts",
"type": "module",
"private": true,
"scripts": {
"test": "vitest run",
"test:watch": "vitest",
"demo": "bun run demo.ts",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"better-sqlite3": "^12.6.2",
"chokidar": "^5.0.0",
"eventemitter3": "^5.0.4",
"gray-matter": "^4.0.3",
"js-yaml": "^4.1.0",
"uuid": "^13.0.0"
},
"devDependencies": {
"@types/better-sqlite3": "^7.6.13",
"@types/bun": "latest",
"@types/js-yaml": "^4.0.9",
"@types/node": "^25.3.3",
"@types/uuid": "^11.0.0",
"vitest": "^4.0.18"
},
"peerDependencies": {
"typescript": "^5"
}
}
Loading