@noteplanco/noteplan-mcp 1.1.1
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 +257 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/noteplan/embeddings.d.ts +170 -0
- package/dist/noteplan/embeddings.d.ts.map +1 -0
- package/dist/noteplan/embeddings.js +684 -0
- package/dist/noteplan/embeddings.js.map +1 -0
- package/dist/noteplan/file-reader.d.ts +77 -0
- package/dist/noteplan/file-reader.d.ts.map +1 -0
- package/dist/noteplan/file-reader.js +488 -0
- package/dist/noteplan/file-reader.js.map +1 -0
- package/dist/noteplan/file-writer.d.ts +108 -0
- package/dist/noteplan/file-writer.d.ts.map +1 -0
- package/dist/noteplan/file-writer.js +621 -0
- package/dist/noteplan/file-writer.js.map +1 -0
- package/dist/noteplan/filter-store.d.ts +28 -0
- package/dist/noteplan/filter-store.d.ts.map +1 -0
- package/dist/noteplan/filter-store.js +180 -0
- package/dist/noteplan/filter-store.js.map +1 -0
- package/dist/noteplan/frontmatter-parser.d.ts +45 -0
- package/dist/noteplan/frontmatter-parser.d.ts.map +1 -0
- package/dist/noteplan/frontmatter-parser.js +259 -0
- package/dist/noteplan/frontmatter-parser.js.map +1 -0
- package/dist/noteplan/fuzzy-search.d.ts +7 -0
- package/dist/noteplan/fuzzy-search.d.ts.map +1 -0
- package/dist/noteplan/fuzzy-search.js +66 -0
- package/dist/noteplan/fuzzy-search.js.map +1 -0
- package/dist/noteplan/markdown-parser.d.ts +87 -0
- package/dist/noteplan/markdown-parser.d.ts.map +1 -0
- package/dist/noteplan/markdown-parser.js +519 -0
- package/dist/noteplan/markdown-parser.js.map +1 -0
- package/dist/noteplan/preferences.d.ts +44 -0
- package/dist/noteplan/preferences.d.ts.map +1 -0
- package/dist/noteplan/preferences.js +156 -0
- package/dist/noteplan/preferences.js.map +1 -0
- package/dist/noteplan/ripgrep-search.d.ts +29 -0
- package/dist/noteplan/ripgrep-search.d.ts.map +1 -0
- package/dist/noteplan/ripgrep-search.js +110 -0
- package/dist/noteplan/ripgrep-search.js.map +1 -0
- package/dist/noteplan/sqlite-reader.d.ts +77 -0
- package/dist/noteplan/sqlite-reader.d.ts.map +1 -0
- package/dist/noteplan/sqlite-reader.js +605 -0
- package/dist/noteplan/sqlite-reader.js.map +1 -0
- package/dist/noteplan/sqlite-writer.d.ts +63 -0
- package/dist/noteplan/sqlite-writer.d.ts.map +1 -0
- package/dist/noteplan/sqlite-writer.js +574 -0
- package/dist/noteplan/sqlite-writer.js.map +1 -0
- package/dist/noteplan/types.d.ts +97 -0
- package/dist/noteplan/types.d.ts.map +1 -0
- package/dist/noteplan/types.js +33 -0
- package/dist/noteplan/types.js.map +1 -0
- package/dist/noteplan/unified-store.d.ts +289 -0
- package/dist/noteplan/unified-store.d.ts.map +1 -0
- package/dist/noteplan/unified-store.js +1308 -0
- package/dist/noteplan/unified-store.js.map +1 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +2468 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/calendar.d.ts +311 -0
- package/dist/tools/calendar.d.ts.map +1 -0
- package/dist/tools/calendar.js +504 -0
- package/dist/tools/calendar.js.map +1 -0
- package/dist/tools/embeddings.d.ts +244 -0
- package/dist/tools/embeddings.d.ts.map +1 -0
- package/dist/tools/embeddings.js +226 -0
- package/dist/tools/embeddings.js.map +1 -0
- package/dist/tools/events.d.ts +176 -0
- package/dist/tools/events.d.ts.map +1 -0
- package/dist/tools/events.js +326 -0
- package/dist/tools/events.js.map +1 -0
- package/dist/tools/filters.d.ts +205 -0
- package/dist/tools/filters.d.ts.map +1 -0
- package/dist/tools/filters.js +347 -0
- package/dist/tools/filters.js.map +1 -0
- package/dist/tools/memory.d.ts +6 -0
- package/dist/tools/memory.d.ts.map +1 -0
- package/dist/tools/memory.js +161 -0
- package/dist/tools/memory.js.map +1 -0
- package/dist/tools/notes.d.ts +1221 -0
- package/dist/tools/notes.d.ts.map +1 -0
- package/dist/tools/notes.js +1868 -0
- package/dist/tools/notes.js.map +1 -0
- package/dist/tools/plugins.d.ts +140 -0
- package/dist/tools/plugins.d.ts.map +1 -0
- package/dist/tools/plugins.js +782 -0
- package/dist/tools/plugins.js.map +1 -0
- package/dist/tools/reminders.d.ts +207 -0
- package/dist/tools/reminders.d.ts.map +1 -0
- package/dist/tools/reminders.js +323 -0
- package/dist/tools/reminders.js.map +1 -0
- package/dist/tools/search.d.ts +58 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +373 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/spaces.d.ts +484 -0
- package/dist/tools/spaces.d.ts.map +1 -0
- package/dist/tools/spaces.js +870 -0
- package/dist/tools/spaces.js.map +1 -0
- package/dist/tools/tasks.d.ts +313 -0
- package/dist/tools/tasks.d.ts.map +1 -0
- package/dist/tools/tasks.js +690 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/tools/themes.d.ts +91 -0
- package/dist/tools/themes.d.ts.map +1 -0
- package/dist/tools/themes.js +294 -0
- package/dist/tools/themes.js.map +1 -0
- package/dist/tools/ui.d.ts +89 -0
- package/dist/tools/ui.d.ts.map +1 -0
- package/dist/tools/ui.js +137 -0
- package/dist/tools/ui.js.map +1 -0
- package/dist/utils/applescript.d.ts +5 -0
- package/dist/utils/applescript.d.ts.map +1 -0
- package/dist/utils/applescript.js +27 -0
- package/dist/utils/applescript.js.map +1 -0
- package/dist/utils/confirmation-tokens.d.ts +19 -0
- package/dist/utils/confirmation-tokens.d.ts.map +1 -0
- package/dist/utils/confirmation-tokens.js +58 -0
- package/dist/utils/confirmation-tokens.js.map +1 -0
- package/dist/utils/date-filters.d.ts +15 -0
- package/dist/utils/date-filters.d.ts.map +1 -0
- package/dist/utils/date-filters.js +129 -0
- package/dist/utils/date-filters.js.map +1 -0
- package/dist/utils/date-utils.d.ts +113 -0
- package/dist/utils/date-utils.d.ts.map +1 -0
- package/dist/utils/date-utils.js +341 -0
- package/dist/utils/date-utils.js.map +1 -0
- package/dist/utils/folder-matcher.d.ts +14 -0
- package/dist/utils/folder-matcher.d.ts.map +1 -0
- package/dist/utils/folder-matcher.js +191 -0
- package/dist/utils/folder-matcher.js.map +1 -0
- package/dist/utils/version.d.ts +10 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +88 -0
- package/dist/utils/version.js.map +1 -0
- package/docs/plugin-api/Calendar.md +448 -0
- package/docs/plugin-api/CalendarItem.md +198 -0
- package/docs/plugin-api/Clipboard.md +101 -0
- package/docs/plugin-api/CommandBar.md +251 -0
- package/docs/plugin-api/DataStore.md +700 -0
- package/docs/plugin-api/Editor.md +982 -0
- package/docs/plugin-api/HTMLView.md +337 -0
- package/docs/plugin-api/NoteObject.md +588 -0
- package/docs/plugin-api/NotePlan.md +398 -0
- package/docs/plugin-api/ParagraphObject.md +242 -0
- package/docs/plugin-api/RangeObject.md +56 -0
- package/docs/plugin-api/getting-started.md +545 -0
- package/docs/plugin-api/plugin-api-condensed.md +526 -0
- package/docs/plugin-api/plugin.json +26 -0
- package/docs/plugin-api/script.js +542 -0
- package/package.json +60 -0
- package/scripts/calendar-helper +0 -0
- package/scripts/reminders-helper +0 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task marker configuration from NotePlan preferences
|
|
3
|
+
*/
|
|
4
|
+
export interface TaskMarkerConfig {
|
|
5
|
+
isAsteriskTodo: boolean;
|
|
6
|
+
isDashTodo: boolean;
|
|
7
|
+
defaultTodoCharacter: '*' | '-';
|
|
8
|
+
useCheckbox: boolean;
|
|
9
|
+
taskPrefix: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Get task marker configuration from NotePlan preferences
|
|
13
|
+
*
|
|
14
|
+
* Logic from NotePlan's TextUtils.adjustTodoMarks():
|
|
15
|
+
* - Both asterisk AND dash enabled → No checkbox, just `* ` or `- ` based on default
|
|
16
|
+
* - Neither enabled → With checkbox `* [ ] ` or `- [ ] ` based on default
|
|
17
|
+
* - Only one enabled → That one is for tasks (without checkbox)
|
|
18
|
+
*/
|
|
19
|
+
export declare function getTaskMarkerConfig(): TaskMarkerConfig;
|
|
20
|
+
/**
|
|
21
|
+
* Get cached task marker configuration
|
|
22
|
+
*/
|
|
23
|
+
export declare function getTaskMarkerConfigCached(): TaskMarkerConfig;
|
|
24
|
+
/**
|
|
25
|
+
* Get the task prefix to use when creating new tasks
|
|
26
|
+
*/
|
|
27
|
+
export declare function getTaskPrefix(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Check if a character is configured as a task marker
|
|
30
|
+
*/
|
|
31
|
+
export declare function isTaskMarker(char: string): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Get the first day of week preference from NotePlan
|
|
34
|
+
* Returns 0-6 where 0 = Sunday, 1 = Monday, etc. (JavaScript convention)
|
|
35
|
+
*
|
|
36
|
+
* NotePlan stores this using NSCalendar convention: 1 = Sunday, 2 = Monday, ..., 7 = Saturday
|
|
37
|
+
* We convert to JavaScript's getDay() convention: 0 = Sunday, 1 = Monday, ..., 6 = Saturday
|
|
38
|
+
*/
|
|
39
|
+
export declare function getFirstDayOfWeek(): number;
|
|
40
|
+
/**
|
|
41
|
+
* Get cached first day of week
|
|
42
|
+
*/
|
|
43
|
+
export declare function getFirstDayOfWeekCached(): number;
|
|
44
|
+
//# sourceMappingURL=preferences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preferences.d.ts","sourceRoot":"","sources":["../../src/noteplan/preferences.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,oBAAoB,EAAE,GAAG,GAAG,GAAG,CAAC;IAChC,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAkCD;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,CAmCtD;AAOD;;GAEG;AACH,wBAAgB,yBAAyB,IAAI,gBAAgB,CAO5D;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAOlD;AAkBD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAQ1C;AAMD;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAOhD"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
// NotePlan preferences reader
|
|
2
|
+
// Reads user preferences from UserDefaults to match NotePlan's behavior
|
|
3
|
+
import { execFileSync } from 'child_process';
|
|
4
|
+
/**
|
|
5
|
+
* Read a boolean preference from NotePlan's UserDefaults
|
|
6
|
+
* Uses execFileSync (not execSync) to avoid shell injection
|
|
7
|
+
*/
|
|
8
|
+
function readBoolPref(key, defaultValue) {
|
|
9
|
+
try {
|
|
10
|
+
const result = execFileSync('defaults', ['read', 'co.noteplan.NotePlan3', key], {
|
|
11
|
+
encoding: 'utf-8',
|
|
12
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
13
|
+
}).trim();
|
|
14
|
+
return result === '1';
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return defaultValue;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Read a string preference from NotePlan's UserDefaults
|
|
22
|
+
* Uses execFileSync (not execSync) to avoid shell injection
|
|
23
|
+
*/
|
|
24
|
+
function readStringPref(key, defaultValue) {
|
|
25
|
+
try {
|
|
26
|
+
const result = execFileSync('defaults', ['read', 'co.noteplan.NotePlan3', key], {
|
|
27
|
+
encoding: 'utf-8',
|
|
28
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
29
|
+
}).trim();
|
|
30
|
+
return result || defaultValue;
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return defaultValue;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get task marker configuration from NotePlan preferences
|
|
38
|
+
*
|
|
39
|
+
* Logic from NotePlan's TextUtils.adjustTodoMarks():
|
|
40
|
+
* - Both asterisk AND dash enabled → No checkbox, just `* ` or `- ` based on default
|
|
41
|
+
* - Neither enabled → With checkbox `* [ ] ` or `- [ ] ` based on default
|
|
42
|
+
* - Only one enabled → That one is for tasks (without checkbox)
|
|
43
|
+
*/
|
|
44
|
+
export function getTaskMarkerConfig() {
|
|
45
|
+
const isAsteriskTodo = readBoolPref('isAsteriskTodo', true);
|
|
46
|
+
const isDashTodo = readBoolPref('isDashTodo', false);
|
|
47
|
+
const defaultChar = readStringPref('defaultTodoCharacter', '*');
|
|
48
|
+
// Determine if checkboxes should be used
|
|
49
|
+
// Checkboxes are used when NEITHER asterisk nor dash is enabled as a todo marker
|
|
50
|
+
const useCheckbox = !isAsteriskTodo && !isDashTodo;
|
|
51
|
+
// Determine which character to use
|
|
52
|
+
let taskChar;
|
|
53
|
+
if (isAsteriskTodo && isDashTodo) {
|
|
54
|
+
// Both enabled: use the default character
|
|
55
|
+
taskChar = defaultChar;
|
|
56
|
+
}
|
|
57
|
+
else if (isAsteriskTodo) {
|
|
58
|
+
// Only asterisk enabled
|
|
59
|
+
taskChar = '*';
|
|
60
|
+
}
|
|
61
|
+
else if (isDashTodo) {
|
|
62
|
+
// Only dash enabled
|
|
63
|
+
taskChar = '-';
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
// Neither enabled: use the default character (with checkbox)
|
|
67
|
+
taskChar = defaultChar;
|
|
68
|
+
}
|
|
69
|
+
// Build the task prefix
|
|
70
|
+
const taskPrefix = useCheckbox ? `${taskChar} [ ] ` : `${taskChar} `;
|
|
71
|
+
return {
|
|
72
|
+
isAsteriskTodo,
|
|
73
|
+
isDashTodo,
|
|
74
|
+
defaultTodoCharacter: defaultChar,
|
|
75
|
+
useCheckbox,
|
|
76
|
+
taskPrefix,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
// Cache the config to avoid repeated shell calls
|
|
80
|
+
let cachedConfig = null;
|
|
81
|
+
let cacheTime = 0;
|
|
82
|
+
const CACHE_TTL = 5000; // 5 seconds
|
|
83
|
+
/**
|
|
84
|
+
* Get cached task marker configuration
|
|
85
|
+
*/
|
|
86
|
+
export function getTaskMarkerConfigCached() {
|
|
87
|
+
const now = Date.now();
|
|
88
|
+
if (!cachedConfig || now - cacheTime > CACHE_TTL) {
|
|
89
|
+
cachedConfig = getTaskMarkerConfig();
|
|
90
|
+
cacheTime = now;
|
|
91
|
+
}
|
|
92
|
+
return cachedConfig;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Get the task prefix to use when creating new tasks
|
|
96
|
+
*/
|
|
97
|
+
export function getTaskPrefix() {
|
|
98
|
+
return getTaskMarkerConfigCached().taskPrefix;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Check if a character is configured as a task marker
|
|
102
|
+
*/
|
|
103
|
+
export function isTaskMarker(char) {
|
|
104
|
+
const config = getTaskMarkerConfigCached();
|
|
105
|
+
if (char === '*')
|
|
106
|
+
return config.isAsteriskTodo || (!config.isAsteriskTodo && !config.isDashTodo);
|
|
107
|
+
if (char === '-')
|
|
108
|
+
return config.isDashTodo || (!config.isAsteriskTodo && !config.isDashTodo);
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Read an integer preference from NotePlan's UserDefaults
|
|
113
|
+
*/
|
|
114
|
+
function readIntPref(key, defaultValue) {
|
|
115
|
+
try {
|
|
116
|
+
const result = execFileSync('defaults', ['read', 'co.noteplan.NotePlan3', key], {
|
|
117
|
+
encoding: 'utf-8',
|
|
118
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
119
|
+
}).trim();
|
|
120
|
+
const parsed = parseInt(result, 10);
|
|
121
|
+
return isNaN(parsed) ? defaultValue : parsed;
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
return defaultValue;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Get the first day of week preference from NotePlan
|
|
129
|
+
* Returns 0-6 where 0 = Sunday, 1 = Monday, etc. (JavaScript convention)
|
|
130
|
+
*
|
|
131
|
+
* NotePlan stores this using NSCalendar convention: 1 = Sunday, 2 = Monday, ..., 7 = Saturday
|
|
132
|
+
* We convert to JavaScript's getDay() convention: 0 = Sunday, 1 = Monday, ..., 6 = Saturday
|
|
133
|
+
*/
|
|
134
|
+
export function getFirstDayOfWeek() {
|
|
135
|
+
// NotePlan uses NSCalendar weekday: 1 = Sunday, 2 = Monday, ..., 7 = Saturday
|
|
136
|
+
// Default to 2 (Monday) if not set
|
|
137
|
+
const notePlanValue = readIntPref('firstDayOfWeek', 2);
|
|
138
|
+
// Convert to JavaScript convention: 0 = Sunday, 1 = Monday, ..., 6 = Saturday
|
|
139
|
+
// NSCalendar 1 → JS 0, NSCalendar 2 → JS 1, etc.
|
|
140
|
+
return (notePlanValue - 1) % 7;
|
|
141
|
+
}
|
|
142
|
+
// Cache for first day of week
|
|
143
|
+
let cachedFirstDayOfWeek = null;
|
|
144
|
+
let firstDayOfWeekCacheTime = 0;
|
|
145
|
+
/**
|
|
146
|
+
* Get cached first day of week
|
|
147
|
+
*/
|
|
148
|
+
export function getFirstDayOfWeekCached() {
|
|
149
|
+
const now = Date.now();
|
|
150
|
+
if (cachedFirstDayOfWeek === null || now - firstDayOfWeekCacheTime > CACHE_TTL) {
|
|
151
|
+
cachedFirstDayOfWeek = getFirstDayOfWeek();
|
|
152
|
+
firstDayOfWeekCacheTime = now;
|
|
153
|
+
}
|
|
154
|
+
return cachedFirstDayOfWeek;
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=preferences.js.map
|
|
@@ -0,0 +1 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G,CAAC,CAAC;AAEhC;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACrC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,IAAI,oBAAoB,KAAK,IAAI,IAAI,GAAG,GAAG,uBAAuB,GAAG,SAAS,EAAE,CAAC;QAC/E,oBAAoB,GAAG,iBAAiB,EAAE,CAAC;QAC3C,uBAAuB,GAAG,GAAG,CAAC;IAChC,CAAC;IACD,OAAO,oBAAoB,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface RipgrepMatch {
|
|
2
|
+
file: string;
|
|
3
|
+
line: number;
|
|
4
|
+
content: string;
|
|
5
|
+
matchStart: number;
|
|
6
|
+
matchEnd: number;
|
|
7
|
+
}
|
|
8
|
+
export interface RipgrepOptions {
|
|
9
|
+
caseSensitive?: boolean;
|
|
10
|
+
wordBoundary?: boolean;
|
|
11
|
+
contextLines?: number;
|
|
12
|
+
maxResults?: number;
|
|
13
|
+
paths?: string[];
|
|
14
|
+
}
|
|
15
|
+
export interface RipgrepSearchResponse {
|
|
16
|
+
matches: RipgrepMatch[];
|
|
17
|
+
partialResults: boolean;
|
|
18
|
+
warning?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Search files using ripgrep for fast regex-enabled search
|
|
22
|
+
* Uses spawn() with array arguments to avoid shell injection
|
|
23
|
+
*/
|
|
24
|
+
export declare function searchWithRipgrep(pattern: string, options?: RipgrepOptions): Promise<RipgrepSearchResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Check if ripgrep is available on the system
|
|
27
|
+
*/
|
|
28
|
+
export declare function isRipgrepAvailable(): Promise<boolean>;
|
|
29
|
+
//# sourceMappingURL=ripgrep-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ripgrep-search.d.ts","sourceRoot":"","sources":["../../src/noteplan/ripgrep-search.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,qBAAqB,CAAC,CAsEhC;AA+BD;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC,CAM3D"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// Ripgrep wrapper for fast local file search
|
|
2
|
+
import { spawn } from 'child_process';
|
|
3
|
+
import { getNotesPath, getCalendarPath } from './file-reader.js';
|
|
4
|
+
/**
|
|
5
|
+
* Search files using ripgrep for fast regex-enabled search
|
|
6
|
+
* Uses spawn() with array arguments to avoid shell injection
|
|
7
|
+
*/
|
|
8
|
+
export async function searchWithRipgrep(pattern, options = {}) {
|
|
9
|
+
const { caseSensitive = false, wordBoundary = false, contextLines = 0, maxResults = 100, paths = [getNotesPath(), getCalendarPath()], } = options;
|
|
10
|
+
// Build args array (safe - no shell interpretation)
|
|
11
|
+
const args = [
|
|
12
|
+
'--json', // JSON output for parsing
|
|
13
|
+
'--max-count',
|
|
14
|
+
String(maxResults),
|
|
15
|
+
'-g',
|
|
16
|
+
'*.md',
|
|
17
|
+
'-g',
|
|
18
|
+
'*.txt',
|
|
19
|
+
];
|
|
20
|
+
if (!caseSensitive)
|
|
21
|
+
args.push('-i');
|
|
22
|
+
if (wordBoundary)
|
|
23
|
+
args.push('-w');
|
|
24
|
+
if (contextLines > 0)
|
|
25
|
+
args.push('-C', String(contextLines));
|
|
26
|
+
// -- ensures pattern isn't treated as flag
|
|
27
|
+
args.push('--', pattern);
|
|
28
|
+
// Add paths (array elements are safe from injection)
|
|
29
|
+
args.push(...paths.filter((p) => p)); // Filter out empty paths
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
const rg = spawn('rg', args, {
|
|
32
|
+
stdio: ['ignore', 'pipe', 'pipe'], // No stdin, capture stdout/stderr
|
|
33
|
+
});
|
|
34
|
+
let stdout = '';
|
|
35
|
+
let stderr = '';
|
|
36
|
+
rg.stdout.on('data', (data) => {
|
|
37
|
+
stdout += data;
|
|
38
|
+
});
|
|
39
|
+
rg.stderr.on('data', (data) => {
|
|
40
|
+
stderr += data;
|
|
41
|
+
});
|
|
42
|
+
rg.on('close', (code) => {
|
|
43
|
+
// Exit codes: 0 = matches found, 1 = no matches, 2+ = error
|
|
44
|
+
if (code === 0 || code === 1) {
|
|
45
|
+
resolve({
|
|
46
|
+
matches: parseRipgrepJson(stdout),
|
|
47
|
+
partialResults: false,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
const interrupted = /interrupted system call/i.test(stderr);
|
|
52
|
+
const partialMatches = parseRipgrepJson(stdout);
|
|
53
|
+
if (interrupted && partialMatches.length > 0) {
|
|
54
|
+
resolve({
|
|
55
|
+
matches: partialMatches,
|
|
56
|
+
partialResults: true,
|
|
57
|
+
warning: 'ripgrep interrupted; returning partial local matches',
|
|
58
|
+
});
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
reject(new Error(`ripgrep error: ${stderr || `exit code ${code}`}`));
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
rg.on('error', (err) => {
|
|
65
|
+
// ripgrep not installed
|
|
66
|
+
reject(new Error(`Failed to spawn ripgrep: ${err.message}`));
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Parse ripgrep JSON output format
|
|
72
|
+
*/
|
|
73
|
+
function parseRipgrepJson(output) {
|
|
74
|
+
const matches = [];
|
|
75
|
+
if (!output.trim())
|
|
76
|
+
return matches;
|
|
77
|
+
// ripgrep --json outputs one JSON object per line
|
|
78
|
+
for (const line of output.split('\n')) {
|
|
79
|
+
if (!line.trim())
|
|
80
|
+
continue;
|
|
81
|
+
try {
|
|
82
|
+
const obj = JSON.parse(line);
|
|
83
|
+
if (obj.type === 'match') {
|
|
84
|
+
const data = obj.data;
|
|
85
|
+
matches.push({
|
|
86
|
+
file: data.path.text,
|
|
87
|
+
line: data.line_number,
|
|
88
|
+
content: data.lines.text.trimEnd(),
|
|
89
|
+
matchStart: data.submatches[0]?.start ?? 0,
|
|
90
|
+
matchEnd: data.submatches[0]?.end ?? 0,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
// Skip malformed lines
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return matches;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Check if ripgrep is available on the system
|
|
102
|
+
*/
|
|
103
|
+
export async function isRipgrepAvailable() {
|
|
104
|
+
return new Promise((resolve) => {
|
|
105
|
+
const rg = spawn('rg', ['--version'], { stdio: 'ignore' });
|
|
106
|
+
rg.on('close', (code) => resolve(code === 0));
|
|
107
|
+
rg.on('error', () => resolve(false));
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=ripgrep-search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ripgrep-search.js","sourceRoot":"","sources":["../../src/noteplan/ripgrep-search.ts"],"names":[],"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AC,WAAW,CAAC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC3D,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC;QAC9C,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import Database from 'better-sqlite3';
|
|
2
|
+
import { Note, Space, Folder } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Get or create the database connection
|
|
5
|
+
*/
|
|
6
|
+
export declare function getDatabase(): Database.Database | null;
|
|
7
|
+
/**
|
|
8
|
+
* Get resolved teamspace database path (if available)
|
|
9
|
+
*/
|
|
10
|
+
export declare function getDatabasePath(): string | null;
|
|
11
|
+
/**
|
|
12
|
+
* Close the database connection
|
|
13
|
+
*/
|
|
14
|
+
export declare function closeDatabase(): void;
|
|
15
|
+
/**
|
|
16
|
+
* List all spaces
|
|
17
|
+
*/
|
|
18
|
+
export declare function listSpaces(): Space[];
|
|
19
|
+
/**
|
|
20
|
+
* Count notes and subfolders under a space folder (recursive)
|
|
21
|
+
*/
|
|
22
|
+
export declare function countSpaceFolderContents(folderId: string): {
|
|
23
|
+
noteCount: number;
|
|
24
|
+
folderCount: number;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* List notes in a teamspace
|
|
28
|
+
*/
|
|
29
|
+
export declare function listSpaceNotes(spaceIdOrOptions?: string | {
|
|
30
|
+
spaceId?: string;
|
|
31
|
+
includeTrash?: boolean;
|
|
32
|
+
}): Note[];
|
|
33
|
+
/**
|
|
34
|
+
* Get a specific teamspace note by ID or filename
|
|
35
|
+
*/
|
|
36
|
+
export declare function getSpaceNote(identifier: string): Note | null;
|
|
37
|
+
/**
|
|
38
|
+
* Get a teamspace note by title
|
|
39
|
+
*/
|
|
40
|
+
export declare function getSpaceNoteByTitle(title: string, spaceId?: string, includeTrash?: boolean): Note | null;
|
|
41
|
+
/**
|
|
42
|
+
* Search teamspace notes using LIKE pattern (fallback)
|
|
43
|
+
*/
|
|
44
|
+
export declare function searchSpaceNotes(query: string, options?: {
|
|
45
|
+
spaceId?: string;
|
|
46
|
+
limit?: number;
|
|
47
|
+
includeTrash?: boolean;
|
|
48
|
+
}): Note[];
|
|
49
|
+
/**
|
|
50
|
+
* Search space notes using LIKE with OR pattern support
|
|
51
|
+
* This is the primary search method - we don't modify NotePlan's database
|
|
52
|
+
*/
|
|
53
|
+
export declare function searchSpaceNotesFTS(query: string, options?: {
|
|
54
|
+
spaceId?: string;
|
|
55
|
+
limit?: number;
|
|
56
|
+
includeTrash?: boolean;
|
|
57
|
+
}): Note[];
|
|
58
|
+
/**
|
|
59
|
+
* List folders in teamspace
|
|
60
|
+
*/
|
|
61
|
+
export declare function listSpaceFolders(spaceIdOrOptions?: string | {
|
|
62
|
+
spaceId?: string;
|
|
63
|
+
includeTrash?: boolean;
|
|
64
|
+
}): Folder[];
|
|
65
|
+
export declare function resolveSpaceFolder(spaceId: string, identifier: string, options?: {
|
|
66
|
+
includeTrash?: boolean;
|
|
67
|
+
}): Folder | null;
|
|
68
|
+
export declare function isSpaceNoteInTrash(identifier: string): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Extract all unique tags from teamspace notes
|
|
71
|
+
*/
|
|
72
|
+
export declare function extractSpaceTags(spaceId?: string): string[];
|
|
73
|
+
/**
|
|
74
|
+
* Get calendar note from teamspace by date
|
|
75
|
+
*/
|
|
76
|
+
export declare function getSpaceCalendarNote(dateStr: string, spaceId: string): Note | null;
|
|
77
|
+
//# sourceMappingURL=sqlite-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-reader.d.ts","sourceRoot":"","sources":["../../src/noteplan/sqlite-reader.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