@noesis-brain/mcp-server 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +218 -0
  3. package/dist/api/NoesisClient.d.ts +501 -0
  4. package/dist/api/NoesisClient.d.ts.map +1 -0
  5. package/dist/api/NoesisClient.js +654 -0
  6. package/dist/api/NoesisClient.js.map +1 -0
  7. package/dist/cli/setup.d.ts +8 -0
  8. package/dist/cli/setup.d.ts.map +1 -0
  9. package/dist/cli/setup.js +148 -0
  10. package/dist/cli/setup.js.map +1 -0
  11. package/dist/database/PostgresAdapter.d.ts +385 -0
  12. package/dist/database/PostgresAdapter.d.ts.map +1 -0
  13. package/dist/database/PostgresAdapter.js +1043 -0
  14. package/dist/database/PostgresAdapter.js.map +1 -0
  15. package/dist/index.d.ts +31 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +126 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/services/embedding.d.ts +38 -0
  20. package/dist/services/embedding.d.ts.map +1 -0
  21. package/dist/services/embedding.js +126 -0
  22. package/dist/services/embedding.js.map +1 -0
  23. package/dist/tools/SyncStateManager.d.ts +65 -0
  24. package/dist/tools/SyncStateManager.d.ts.map +1 -0
  25. package/dist/tools/SyncStateManager.js +217 -0
  26. package/dist/tools/SyncStateManager.js.map +1 -0
  27. package/dist/tools/index.d.ts +14 -0
  28. package/dist/tools/index.d.ts.map +1 -0
  29. package/dist/tools/index.js +3345 -0
  30. package/dist/tools/index.js.map +1 -0
  31. package/dist/tools/navis.d.ts +11 -0
  32. package/dist/tools/navis.d.ts.map +1 -0
  33. package/dist/tools/navis.js +231 -0
  34. package/dist/tools/navis.js.map +1 -0
  35. package/dist/types/index.d.ts +104 -0
  36. package/dist/types/index.d.ts.map +1 -0
  37. package/dist/types/index.js +5 -0
  38. package/dist/types/index.js.map +1 -0
  39. package/dist/utils/suggestPath.d.ts +15 -0
  40. package/dist/utils/suggestPath.d.ts.map +1 -0
  41. package/dist/utils/suggestPath.js +52 -0
  42. package/dist/utils/suggestPath.js.map +1 -0
  43. package/package.json +71 -0
  44. package/scripts/noesis-sync.mjs +469 -0
  45. package/skill-templates/noesis-refine-note.md +92 -0
  46. package/skill-templates/noesis-sync.md +110 -0
  47. package/templates/claude-md-block.md +22 -0
@@ -0,0 +1,22 @@
1
+ ## Noesis MCP — conventions
2
+
3
+ ### Writing notes
4
+ - Use plain `##` headings for primary sections — Noesis builds its sidebar outline from them. Reserve collapsible `<details>` blocks for appendix-style noise (logs, references, changelogs).
5
+
6
+ ### Pushing notes to the cloud
7
+ - "Sync to Noesis" means push to the Noesis cloud database, not `cp` to a folder.
8
+ - Use `mcp__noesis__sync_notes` with `files: [<absolute paths>]`.
9
+ - Files must be within a registered root — check via `mcp__noesis__list_roots`.
10
+
11
+ ### Reading and discovering notes
12
+ - Note relations and codebase links live in the Noesis **database**, not in `.md` frontmatter — don't grep `.md` files for them.
13
+ - Use `mcp__noesis__get_note` (read by ID or path), `mcp__noesis__find_similar_notes` (semantic similarity), `mcp__noesis__search_semantic` / `mcp__noesis__search_notes` (meaning / keyword search), `mcp__noesis__update_relations` (read-only when called without the `relations` param).
14
+
15
+ ### Path-as-identifier (cross-machine)
16
+ For any path inside a Noesis-watched root (paths containing `/.noesis/`, or any path under a directory listed by `mcp__noesis__list_roots`), the path is a Noesis identifier — the cloud copy is always authoritative, and the local copy on this machine may be **missing** (other machine) or **stale** (the user edited the note via the Noesis web UI's Quick Fix; the web UI surfaces that state with the badge 「在线编辑 · 等待本地同步」). Either way, the local copy is not a trustworthy source of truth — reading it directly silently feeds outdated content into the rest of the turn.
17
+
18
+ Trigger: when the user references such a path and you are about to read, edit, or otherwise consume it, sync first — once per path per turn, before the first tool call that touches it. Not before subsequent re-reads of the same path in the same turn.
19
+
20
+ - **NORMAL mode (writes allowed):** call `mcp__noesis__sync_notes(files: [<that path>])`. The three-way merge handles every case: in-sync → cheap no-op (`'skip'`); cloud-newer → auto-pulls to local disk; local-newer → pushes to cloud; both diverged → conflict cascade (3-way merge); missing locally → auto-creates from cloud. In all five cases the next `Read`/`Edit`/`Write` sees the right bytes.
21
+ - **PLAN mode (writes forbidden):** call `mcp__noesis__get_note(path=<that path>)` for a read-only cloud lookup. Compare its `content_hash` / `updated_at` against the local file's hash / mtime; if drift exists, surface it in the plan and propose `sync_notes` as Step 1 of the implementation.
22
+ - In either mode, do NOT fall back to Glob/Grep to hunt for similar filenames; do NOT ask the user to disambiguate the path. The cloud is authoritative for Noesis-watched paths.