@noesis-brain/mcp-server 2.0.0 → 2.1.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.
- package/README.md +93 -5
- package/dist/agent/runner.d.ts +25 -0
- package/dist/agent/runner.d.ts.map +1 -0
- package/dist/agent/runner.js +218 -0
- package/dist/agent/runner.js.map +1 -0
- package/dist/api/NoesisClient.d.ts +119 -0
- package/dist/api/NoesisClient.d.ts.map +1 -1
- package/dist/api/NoesisClient.js +130 -6
- package/dist/api/NoesisClient.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +409 -35
- package/dist/cli/setup.js.map +1 -1
- package/dist/database/PostgresAdapter.js +216 -216
- package/dist/index.js +31 -1
- package/dist/index.js.map +1 -1
- package/dist/resolve/noteRef.d.ts +101 -0
- package/dist/resolve/noteRef.d.ts.map +1 -0
- package/dist/resolve/noteRef.js +186 -0
- package/dist/resolve/noteRef.js.map +1 -0
- package/dist/resolve/rootsFormat.d.ts +12 -0
- package/dist/resolve/rootsFormat.d.ts.map +1 -0
- package/dist/resolve/rootsFormat.js +63 -0
- package/dist/resolve/rootsFormat.js.map +1 -0
- package/dist/services/embedding.js +19 -19
- package/dist/tools/backlog.d.ts +4 -0
- package/dist/tools/backlog.d.ts.map +1 -0
- package/dist/tools/backlog.js +157 -0
- package/dist/tools/backlog.js.map +1 -0
- package/dist/tools/index.d.ts +52 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +438 -142
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/navis.d.ts.map +1 -1
- package/dist/tools/navis.js +4 -0
- package/dist/tools/navis.js.map +1 -1
- package/package.json +9 -4
- package/scripts/agent-e2e.mjs +69 -0
- package/scripts/noesis-capture-session-end.mjs +94 -0
- package/scripts/noesis-capture-watcher.mjs +907 -0
- package/scripts/noesis-sync.mjs +469 -469
- package/skill-templates/noesis-capture.md +166 -0
- package/skill-templates/noesis-create-study-note.md +149 -0
- package/skill-templates/noesis-find-related.md +89 -0
- package/skill-templates/noesis-investigate.md +90 -0
- package/skill-templates/noesis-manage-news.md +80 -0
- package/skill-templates/noesis-refine-note.md +92 -92
- package/skill-templates/noesis-skim-read.md +72 -0
- package/skill-templates/noesis-sync.md +110 -110
- package/templates/claude-md-block.md +26 -22
- package/templates/claude-md-restructure-on-sync.md +10 -0
package/dist/tools/index.d.ts
CHANGED
|
@@ -2,7 +2,27 @@
|
|
|
2
2
|
* Tool registry for md-manager MCP server
|
|
3
3
|
*/
|
|
4
4
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
5
|
-
import { NoesisClient } from '../api/NoesisClient.js';
|
|
5
|
+
import { NoesisClient, type Note } from '../api/NoesisClient.js';
|
|
6
|
+
/**
|
|
7
|
+
* Resolve a user-supplied file path to a registered root + relative path,
|
|
8
|
+
* mirroring the sync resolver (see sync_notes): expand `~` / `%USERPROFILE%`
|
|
9
|
+
* against this machine's home, resolve to absolute, then prefix-match the input
|
|
10
|
+
* against each root's active path, preferring the longest (most specific) match.
|
|
11
|
+
* Returns null if the path isn't inside any known root.
|
|
12
|
+
*
|
|
13
|
+
* This is what lets get_note resolve an absolute clipboard path
|
|
14
|
+
* (e.g. C:\Users\me\Noesis\foo.md) against a tilde-stored cloud root (~/Noesis):
|
|
15
|
+
* the backend /notes/by-path route does a literal prefix compare and never
|
|
16
|
+
* expands `~`, so absolute paths can't match cloud roots there — resolving
|
|
17
|
+
* client-side and calling /notes/by-relative instead sidesteps that.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolvePathToRoot(filePath: string, roots: Array<{
|
|
20
|
+
id: number;
|
|
21
|
+
path?: string;
|
|
22
|
+
}>): {
|
|
23
|
+
rootId: number;
|
|
24
|
+
relativePath: string;
|
|
25
|
+
} | null;
|
|
6
26
|
export interface ToolServices {
|
|
7
27
|
client: NoesisClient;
|
|
8
28
|
geminiApiKey?: string;
|
|
@@ -11,4 +31,35 @@ export interface ToolServices {
|
|
|
11
31
|
* Register all MCP tools with the server
|
|
12
32
|
*/
|
|
13
33
|
export declare function registerTools(server: McpServer, services: ToolServices): void;
|
|
34
|
+
/**
|
|
35
|
+
* A cloud note in the exact shape the sync branches consume (matching the old
|
|
36
|
+
* getNotesForSync element). Built by adaptCloudNote from a single-note fetch
|
|
37
|
+
* (content + metadata) plus the authoritative hash from the root hash map.
|
|
38
|
+
*/
|
|
39
|
+
type CloudNoteRow = {
|
|
40
|
+
id: number;
|
|
41
|
+
relative_path: string;
|
|
42
|
+
hash: string;
|
|
43
|
+
modified_at: string;
|
|
44
|
+
content: string;
|
|
45
|
+
title: string | null;
|
|
46
|
+
description: string | null;
|
|
47
|
+
keywords: string | string[] | null;
|
|
48
|
+
edited_online_at: string | null;
|
|
49
|
+
};
|
|
50
|
+
/** Adapt a by-relative Note (+ its hash from the root hash map) into CloudNoteRow. */
|
|
51
|
+
export declare function adaptCloudNote(n: Note, relativePath: string, hash: string): CloudNoteRow;
|
|
52
|
+
/**
|
|
53
|
+
* Sync specific files by path (single-file or multi-file sync mode)
|
|
54
|
+
* @param force - If true, bypass hash check and always re-sync (useful for metadata regeneration)
|
|
55
|
+
* @param regenerateMetadata - If true, backend AI regenerates all metadata fields, overwriting existing values
|
|
56
|
+
*/
|
|
57
|
+
export declare function syncSpecificFiles(filePaths: string[], dryRun: boolean, client: NoesisClient, force?: boolean, regenerateMetadata?: boolean): Promise<{
|
|
58
|
+
content: Array<{
|
|
59
|
+
type: 'text';
|
|
60
|
+
text: string;
|
|
61
|
+
}>;
|
|
62
|
+
isError?: boolean;
|
|
63
|
+
}>;
|
|
64
|
+
export {};
|
|
14
65
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,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