@troykelly/openclaw-projects 0.0.16 → 0.0.20
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/dist/api-client.d.ts +1 -1
- package/dist/api-client.d.ts.map +1 -1
- package/dist/api-client.js +3 -3
- package/dist/api-client.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +10 -10
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +82 -7
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +56 -5
- package/dist/config.js.map +1 -1
- package/dist/context.d.ts +3 -3
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +3 -3
- package/dist/context.js.map +1 -1
- package/dist/gateway/oauth-rpc-methods.d.ts +44 -44
- package/dist/gateway/oauth-rpc-methods.d.ts.map +1 -1
- package/dist/gateway/oauth-rpc-methods.js +106 -106
- package/dist/gateway/oauth-rpc-methods.js.map +1 -1
- package/dist/gateway/rpc-methods.d.ts +3 -3
- package/dist/gateway/rpc-methods.d.ts.map +1 -1
- package/dist/gateway/rpc-methods.js +11 -11
- package/dist/gateway/rpc-methods.js.map +1 -1
- package/dist/hooks.d.ts +3 -3
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +42 -42
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -19
- package/dist/index.js.map +1 -1
- package/dist/register-openclaw.d.ts.map +1 -1
- package/dist/register-openclaw.js +741 -262
- package/dist/register-openclaw.js.map +1 -1
- package/dist/services/notification-service.d.ts +1 -1
- package/dist/services/notification-service.d.ts.map +1 -1
- package/dist/services/notification-service.js +11 -11
- package/dist/services/notification-service.js.map +1 -1
- package/dist/tools/contacts.d.ts +7 -7
- package/dist/tools/contacts.d.ts.map +1 -1
- package/dist/tools/contacts.js +30 -30
- package/dist/tools/contacts.js.map +1 -1
- package/dist/tools/context-search.d.ts +2 -2
- package/dist/tools/context-search.d.ts.map +1 -1
- package/dist/tools/context-search.js +14 -14
- package/dist/tools/context-search.js.map +1 -1
- package/dist/tools/email-send.d.ts +13 -13
- package/dist/tools/email-send.d.ts.map +1 -1
- package/dist/tools/email-send.js +22 -22
- package/dist/tools/email-send.js.map +1 -1
- package/dist/tools/entity-links.d.ts +1 -1
- package/dist/tools/entity-links.d.ts.map +1 -1
- package/dist/tools/entity-links.js +33 -33
- package/dist/tools/entity-links.js.map +1 -1
- package/dist/tools/file-share.d.ts +15 -15
- package/dist/tools/file-share.d.ts.map +1 -1
- package/dist/tools/file-share.js +30 -30
- package/dist/tools/file-share.js.map +1 -1
- package/dist/tools/memory-forget.d.ts +7 -7
- package/dist/tools/memory-forget.d.ts.map +1 -1
- package/dist/tools/memory-forget.js +34 -34
- package/dist/tools/memory-forget.js.map +1 -1
- package/dist/tools/memory-recall.d.ts +4 -4
- package/dist/tools/memory-recall.d.ts.map +1 -1
- package/dist/tools/memory-recall.js +9 -9
- package/dist/tools/memory-recall.js.map +1 -1
- package/dist/tools/memory-store.d.ts +3 -3
- package/dist/tools/memory-store.d.ts.map +1 -1
- package/dist/tools/memory-store.js +13 -13
- package/dist/tools/memory-store.js.map +1 -1
- package/dist/tools/message-search.d.ts +8 -8
- package/dist/tools/message-search.d.ts.map +1 -1
- package/dist/tools/message-search.js +19 -19
- package/dist/tools/message-search.js.map +1 -1
- package/dist/tools/notebooks.d.ts +20 -20
- package/dist/tools/notebooks.d.ts.map +1 -1
- package/dist/tools/notebooks.js +40 -40
- package/dist/tools/notebooks.js.map +1 -1
- package/dist/tools/notes.d.ts +35 -35
- package/dist/tools/notes.d.ts.map +1 -1
- package/dist/tools/notes.js +67 -67
- package/dist/tools/notes.js.map +1 -1
- package/dist/tools/project-search.d.ts +3 -3
- package/dist/tools/project-search.d.ts.map +1 -1
- package/dist/tools/project-search.js +15 -15
- package/dist/tools/project-search.js.map +1 -1
- package/dist/tools/projects.d.ts +6 -6
- package/dist/tools/projects.d.ts.map +1 -1
- package/dist/tools/projects.js +25 -25
- package/dist/tools/projects.js.map +1 -1
- package/dist/tools/relationships.d.ts +19 -19
- package/dist/tools/relationships.d.ts.map +1 -1
- package/dist/tools/relationships.js +38 -38
- package/dist/tools/relationships.js.map +1 -1
- package/dist/tools/skill-store.d.ts +11 -11
- package/dist/tools/skill-store.d.ts.map +1 -1
- package/dist/tools/skill-store.js +51 -51
- package/dist/tools/skill-store.js.map +1 -1
- package/dist/tools/sms-send.d.ts +7 -7
- package/dist/tools/sms-send.d.ts.map +1 -1
- package/dist/tools/sms-send.js +16 -16
- package/dist/tools/sms-send.js.map +1 -1
- package/dist/tools/threads.d.ts +18 -18
- package/dist/tools/threads.d.ts.map +1 -1
- package/dist/tools/threads.js +33 -33
- package/dist/tools/threads.js.map +1 -1
- package/dist/tools/todo-search.d.ts +3 -3
- package/dist/tools/todo-search.d.ts.map +1 -1
- package/dist/tools/todo-search.js +15 -15
- package/dist/tools/todo-search.js.map +1 -1
- package/dist/tools/todos.d.ts +13 -13
- package/dist/tools/todos.d.ts.map +1 -1
- package/dist/tools/todos.js +37 -37
- package/dist/tools/todos.js.map +1 -1
- package/dist/types/openclaw-api.d.ts +2 -2
- package/dist/types/openclaw-api.d.ts.map +1 -1
- package/dist/utils/auto-linker.d.ts +2 -2
- package/dist/utils/auto-linker.d.ts.map +1 -1
- package/dist/utils/auto-linker.js +40 -40
- package/dist/utils/auto-linker.js.map +1 -1
- package/dist/utils/injection-log-rate-limiter.d.ts +1 -1
- package/dist/utils/injection-log-rate-limiter.js +1 -1
- package/dist/utils/nominatim.d.ts +1 -1
- package/dist/utils/nominatim.d.ts.map +1 -1
- package/dist/utils/nominatim.js +1 -1
- package/dist/utils/nominatim.js.map +1 -1
- package/openclaw.plugin.json +40 -4
- package/package.json +2 -2
package/dist/tools/notes.d.ts
CHANGED
|
@@ -21,27 +21,27 @@ export interface Note {
|
|
|
21
21
|
id: string;
|
|
22
22
|
title: string;
|
|
23
23
|
content: string;
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
notebook_id: string | null;
|
|
25
|
+
user_email: string;
|
|
26
26
|
tags: string[];
|
|
27
27
|
visibility: NoteVisibility;
|
|
28
|
-
|
|
28
|
+
hide_from_agents: boolean;
|
|
29
29
|
summary: string | null;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
is_pinned: boolean;
|
|
31
|
+
created_at: string;
|
|
32
|
+
updated_at: string;
|
|
33
33
|
}
|
|
34
34
|
/** Tool options shared by all note tools */
|
|
35
35
|
export interface NoteToolOptions {
|
|
36
36
|
client: ApiClient;
|
|
37
37
|
logger: Logger;
|
|
38
38
|
config: PluginConfig;
|
|
39
|
-
|
|
39
|
+
user_id: string;
|
|
40
40
|
}
|
|
41
41
|
export declare const NoteCreateParamsSchema: z.ZodObject<{
|
|
42
42
|
title: z.ZodString;
|
|
43
43
|
content: z.ZodString;
|
|
44
|
-
|
|
44
|
+
notebook_id: z.ZodOptional<z.ZodString>;
|
|
45
45
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
46
46
|
visibility: z.ZodDefault<z.ZodOptional<z.ZodEnum<["private", "shared", "public"]>>>;
|
|
47
47
|
summary: z.ZodOptional<z.ZodString>;
|
|
@@ -50,13 +50,13 @@ export declare const NoteCreateParamsSchema: z.ZodObject<{
|
|
|
50
50
|
title: string;
|
|
51
51
|
visibility: "private" | "shared" | "public";
|
|
52
52
|
tags?: string[] | undefined;
|
|
53
|
-
|
|
53
|
+
notebook_id?: string | undefined;
|
|
54
54
|
summary?: string | undefined;
|
|
55
55
|
}, {
|
|
56
56
|
content: string;
|
|
57
57
|
title: string;
|
|
58
58
|
tags?: string[] | undefined;
|
|
59
|
-
|
|
59
|
+
notebook_id?: string | undefined;
|
|
60
60
|
visibility?: "private" | "shared" | "public" | undefined;
|
|
61
61
|
summary?: string | undefined;
|
|
62
62
|
}>;
|
|
@@ -66,9 +66,9 @@ export interface NoteCreateSuccess {
|
|
|
66
66
|
data: {
|
|
67
67
|
id: string;
|
|
68
68
|
title: string;
|
|
69
|
-
|
|
69
|
+
notebook_id: string | null;
|
|
70
70
|
visibility: string;
|
|
71
|
-
|
|
71
|
+
created_at: string;
|
|
72
72
|
url?: string;
|
|
73
73
|
};
|
|
74
74
|
}
|
|
@@ -86,13 +86,13 @@ export interface NoteCreateTool {
|
|
|
86
86
|
export declare function createNoteCreateTool(options: NoteToolOptions): NoteCreateTool;
|
|
87
87
|
export declare const NoteGetParamsSchema: z.ZodObject<{
|
|
88
88
|
noteId: z.ZodString;
|
|
89
|
-
|
|
89
|
+
include_versions: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
90
90
|
}, "strip", z.ZodTypeAny, {
|
|
91
91
|
noteId: string;
|
|
92
|
-
|
|
92
|
+
include_versions: boolean;
|
|
93
93
|
}, {
|
|
94
94
|
noteId: string;
|
|
95
|
-
|
|
95
|
+
include_versions?: boolean | undefined;
|
|
96
96
|
}>;
|
|
97
97
|
export type NoteGetParams = z.infer<typeof NoteGetParamsSchema>;
|
|
98
98
|
export interface NoteGetSuccess {
|
|
@@ -101,15 +101,15 @@ export interface NoteGetSuccess {
|
|
|
101
101
|
id: string;
|
|
102
102
|
title: string;
|
|
103
103
|
content: string;
|
|
104
|
-
|
|
104
|
+
notebook_id: string | null;
|
|
105
105
|
tags: string[];
|
|
106
106
|
visibility: string;
|
|
107
107
|
summary: string | null;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
is_pinned: boolean;
|
|
109
|
+
created_at: string;
|
|
110
|
+
updated_at: string;
|
|
111
111
|
url?: string;
|
|
112
|
-
|
|
112
|
+
version_count?: number;
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
export interface NoteGetFailure {
|
|
@@ -128,29 +128,29 @@ export declare const NoteUpdateParamsSchema: z.ZodObject<{
|
|
|
128
128
|
noteId: z.ZodString;
|
|
129
129
|
title: z.ZodOptional<z.ZodString>;
|
|
130
130
|
content: z.ZodOptional<z.ZodString>;
|
|
131
|
-
|
|
131
|
+
notebook_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
132
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
133
133
|
visibility: z.ZodOptional<z.ZodEnum<["private", "shared", "public"]>>;
|
|
134
134
|
summary: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
135
|
-
|
|
135
|
+
is_pinned: z.ZodOptional<z.ZodBoolean>;
|
|
136
136
|
}, "strip", z.ZodTypeAny, {
|
|
137
137
|
noteId: string;
|
|
138
138
|
tags?: string[] | undefined;
|
|
139
139
|
content?: string | undefined;
|
|
140
140
|
title?: string | undefined;
|
|
141
|
-
|
|
141
|
+
notebook_id?: string | null | undefined;
|
|
142
142
|
visibility?: "private" | "shared" | "public" | undefined;
|
|
143
143
|
summary?: string | null | undefined;
|
|
144
|
-
|
|
144
|
+
is_pinned?: boolean | undefined;
|
|
145
145
|
}, {
|
|
146
146
|
noteId: string;
|
|
147
147
|
tags?: string[] | undefined;
|
|
148
148
|
content?: string | undefined;
|
|
149
149
|
title?: string | undefined;
|
|
150
|
-
|
|
150
|
+
notebook_id?: string | null | undefined;
|
|
151
151
|
visibility?: "private" | "shared" | "public" | undefined;
|
|
152
152
|
summary?: string | null | undefined;
|
|
153
|
-
|
|
153
|
+
is_pinned?: boolean | undefined;
|
|
154
154
|
}>;
|
|
155
155
|
export type NoteUpdateParams = z.infer<typeof NoteUpdateParamsSchema>;
|
|
156
156
|
export interface NoteUpdateSuccess {
|
|
@@ -159,7 +159,7 @@ export interface NoteUpdateSuccess {
|
|
|
159
159
|
id: string;
|
|
160
160
|
title: string;
|
|
161
161
|
visibility: string;
|
|
162
|
-
|
|
162
|
+
updated_at: string;
|
|
163
163
|
url?: string;
|
|
164
164
|
changes: string[];
|
|
165
165
|
};
|
|
@@ -205,8 +205,8 @@ export interface NoteDeleteTool {
|
|
|
205
205
|
export declare function createNoteDeleteTool(options: NoteToolOptions): NoteDeleteTool;
|
|
206
206
|
export declare const NoteSearchParamsSchema: z.ZodObject<{
|
|
207
207
|
query: z.ZodString;
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
search_type: z.ZodDefault<z.ZodOptional<z.ZodEnum<["hybrid", "text", "semantic"]>>>;
|
|
209
|
+
notebook_id: z.ZodOptional<z.ZodString>;
|
|
210
210
|
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
211
211
|
visibility: z.ZodOptional<z.ZodEnum<["private", "shared", "public"]>>;
|
|
212
212
|
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
@@ -214,18 +214,18 @@ export declare const NoteSearchParamsSchema: z.ZodObject<{
|
|
|
214
214
|
}, "strip", z.ZodTypeAny, {
|
|
215
215
|
query: string;
|
|
216
216
|
limit: number;
|
|
217
|
-
|
|
217
|
+
search_type: "text" | "semantic" | "hybrid";
|
|
218
218
|
offset: number;
|
|
219
219
|
tags?: string[] | undefined;
|
|
220
|
-
|
|
220
|
+
notebook_id?: string | undefined;
|
|
221
221
|
visibility?: "private" | "shared" | "public" | undefined;
|
|
222
222
|
}, {
|
|
223
223
|
query: string;
|
|
224
224
|
limit?: number | undefined;
|
|
225
|
-
|
|
225
|
+
search_type?: "text" | "semantic" | "hybrid" | undefined;
|
|
226
226
|
tags?: string[] | undefined;
|
|
227
227
|
offset?: number | undefined;
|
|
228
|
-
|
|
228
|
+
notebook_id?: string | undefined;
|
|
229
229
|
visibility?: "private" | "shared" | "public" | undefined;
|
|
230
230
|
}>;
|
|
231
231
|
export type NoteSearchParams = z.infer<typeof NoteSearchParamsSchema>;
|
|
@@ -236,13 +236,13 @@ export interface NoteSearchResult {
|
|
|
236
236
|
score: number;
|
|
237
237
|
tags: string[];
|
|
238
238
|
visibility: string;
|
|
239
|
-
|
|
239
|
+
updated_at: string;
|
|
240
240
|
}
|
|
241
241
|
export interface NoteSearchSuccess {
|
|
242
242
|
success: true;
|
|
243
243
|
data: {
|
|
244
244
|
query: string;
|
|
245
|
-
|
|
245
|
+
search_type: string;
|
|
246
246
|
results: Array<{
|
|
247
247
|
id: string;
|
|
248
248
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notes.d.ts","sourceRoot":"","sources":["../../src/tools/notes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAOjD,6BAA6B;AAC7B,eAAO,MAAM,cAAc,4CAA0C,CAAC;AACtE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,oBAAoB;AACpB,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,
|
|
1
|
+
{"version":3,"file":"notes.d.ts","sourceRoot":"","sources":["../../src/tools/notes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAOjD,6BAA6B;AAC7B,eAAO,MAAM,cAAc,4CAA0C,CAAC;AACtE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D,oBAAoB;AACpB,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM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,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAEzE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,sBAAsB,CAAC;IAC1C,OAAO,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACtE;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,cAAc,CAmG7E"}
|
package/dist/tools/notes.js
CHANGED
|
@@ -22,13 +22,13 @@ export const NoteVisibility = z.enum(['private', 'shared', 'public']);
|
|
|
22
22
|
export const NoteCreateParamsSchema = z.object({
|
|
23
23
|
title: z.string().min(1, 'Title cannot be empty').max(500, 'Title must be 500 characters or less'),
|
|
24
24
|
content: z.string().min(1, 'Content cannot be empty').max(100000, 'Content must be 100,000 characters or less'),
|
|
25
|
-
|
|
25
|
+
notebook_id: z.string().uuid().optional(),
|
|
26
26
|
tags: z.array(z.string()).max(20).optional(),
|
|
27
27
|
visibility: NoteVisibility.optional().default('private'),
|
|
28
28
|
summary: z.string().max(1000).optional(),
|
|
29
29
|
});
|
|
30
30
|
export function createNoteCreateTool(options) {
|
|
31
|
-
const { client, logger, config,
|
|
31
|
+
const { client, logger, config, user_id } = options;
|
|
32
32
|
return {
|
|
33
33
|
name: 'note_create',
|
|
34
34
|
description: 'Create a new note with markdown content. Use for meeting notes, documentation, ' + 'research, or any information worth preserving as a document.',
|
|
@@ -39,7 +39,7 @@ export function createNoteCreateTool(options) {
|
|
|
39
39
|
const errorMessage = parseResult.error.errors.map((e) => `${e.path.join('.')}: ${e.message}`).join(', ');
|
|
40
40
|
return { success: false, error: errorMessage };
|
|
41
41
|
}
|
|
42
|
-
const { title, content,
|
|
42
|
+
const { title, content, notebook_id, tags, visibility, summary } = parseResult.data;
|
|
43
43
|
const sanitizedTitle = sanitizeText(title);
|
|
44
44
|
const sanitizedContent = sanitizeText(content);
|
|
45
45
|
if (sanitizedTitle.length === 0) {
|
|
@@ -49,24 +49,24 @@ export function createNoteCreateTool(options) {
|
|
|
49
49
|
return { success: false, error: 'Content cannot be empty after sanitization' };
|
|
50
50
|
}
|
|
51
51
|
logger.info('note_create invoked', {
|
|
52
|
-
|
|
52
|
+
user_id,
|
|
53
53
|
titleLength: sanitizedTitle.length,
|
|
54
54
|
contentLength: sanitizedContent.length,
|
|
55
|
-
|
|
55
|
+
notebook_id,
|
|
56
56
|
visibility,
|
|
57
57
|
});
|
|
58
58
|
try {
|
|
59
59
|
const response = await client.post('/api/notes', {
|
|
60
60
|
title: sanitizedTitle,
|
|
61
61
|
content: sanitizedContent,
|
|
62
|
-
notebook_id:
|
|
62
|
+
notebook_id: notebook_id,
|
|
63
63
|
tags,
|
|
64
64
|
visibility,
|
|
65
65
|
summary,
|
|
66
|
-
}, {
|
|
66
|
+
}, { user_id });
|
|
67
67
|
if (!response.success) {
|
|
68
68
|
logger.error('note_create API error', {
|
|
69
|
-
|
|
69
|
+
user_id,
|
|
70
70
|
status: response.error.status,
|
|
71
71
|
code: response.error.code,
|
|
72
72
|
});
|
|
@@ -77,7 +77,7 @@ export function createNoteCreateTool(options) {
|
|
|
77
77
|
}
|
|
78
78
|
const note = response.data;
|
|
79
79
|
logger.debug('note_create completed', {
|
|
80
|
-
|
|
80
|
+
user_id,
|
|
81
81
|
noteId: note.id,
|
|
82
82
|
});
|
|
83
83
|
return {
|
|
@@ -85,16 +85,16 @@ export function createNoteCreateTool(options) {
|
|
|
85
85
|
data: {
|
|
86
86
|
id: note.id,
|
|
87
87
|
title: note.title,
|
|
88
|
-
|
|
88
|
+
notebook_id: note.notebook_id,
|
|
89
89
|
visibility: note.visibility,
|
|
90
|
-
|
|
90
|
+
created_at: note.created_at,
|
|
91
91
|
...(config.baseUrl ? { url: `${config.baseUrl}/notes/${note.id}` } : {}),
|
|
92
92
|
},
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
catch (error) {
|
|
96
96
|
logger.error('note_create failed', {
|
|
97
|
-
|
|
97
|
+
user_id,
|
|
98
98
|
error: error instanceof Error ? error.message : String(error),
|
|
99
99
|
});
|
|
100
100
|
return {
|
|
@@ -110,10 +110,10 @@ export function createNoteCreateTool(options) {
|
|
|
110
110
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
111
111
|
export const NoteGetParamsSchema = z.object({
|
|
112
112
|
noteId: z.string().uuid('Note ID must be a valid UUID'),
|
|
113
|
-
|
|
113
|
+
include_versions: z.boolean().optional().default(false),
|
|
114
114
|
});
|
|
115
115
|
export function createNoteGetTool(options) {
|
|
116
|
-
const { client, logger, config,
|
|
116
|
+
const { client, logger, config, user_id } = options;
|
|
117
117
|
return {
|
|
118
118
|
name: 'note_get',
|
|
119
119
|
description: 'Get a note by its ID. Returns the full content and metadata of the note. ' + 'Only accessible if you have permission to view the note.',
|
|
@@ -124,24 +124,24 @@ export function createNoteGetTool(options) {
|
|
|
124
124
|
const errorMessage = parseResult.error.errors.map((e) => `${e.path.join('.')}: ${e.message}`).join(', ');
|
|
125
125
|
return { success: false, error: errorMessage };
|
|
126
126
|
}
|
|
127
|
-
const { noteId,
|
|
127
|
+
const { noteId, include_versions } = parseResult.data;
|
|
128
128
|
logger.info('note_get invoked', {
|
|
129
|
-
|
|
129
|
+
user_id,
|
|
130
130
|
noteId,
|
|
131
|
-
|
|
131
|
+
include_versions,
|
|
132
132
|
});
|
|
133
133
|
try {
|
|
134
|
-
const queryParams = new URLSearchParams({ user_email:
|
|
135
|
-
if (
|
|
136
|
-
queryParams.set('
|
|
134
|
+
const queryParams = new URLSearchParams({ user_email: user_id });
|
|
135
|
+
if (include_versions) {
|
|
136
|
+
queryParams.set('include_versions', 'true');
|
|
137
137
|
}
|
|
138
|
-
const response = await client.get(`/api/notes/${noteId}?${queryParams}`, {
|
|
138
|
+
const response = await client.get(`/api/notes/${noteId}?${queryParams}`, { user_id });
|
|
139
139
|
if (!response.success) {
|
|
140
140
|
if (response.error.status === 404) {
|
|
141
141
|
return { success: false, error: 'Note not found or access denied' };
|
|
142
142
|
}
|
|
143
143
|
logger.error('note_get API error', {
|
|
144
|
-
|
|
144
|
+
user_id,
|
|
145
145
|
noteId,
|
|
146
146
|
status: response.error.status,
|
|
147
147
|
});
|
|
@@ -152,7 +152,7 @@ export function createNoteGetTool(options) {
|
|
|
152
152
|
}
|
|
153
153
|
const note = response.data;
|
|
154
154
|
logger.debug('note_get completed', {
|
|
155
|
-
|
|
155
|
+
user_id,
|
|
156
156
|
noteId,
|
|
157
157
|
});
|
|
158
158
|
return {
|
|
@@ -161,21 +161,21 @@ export function createNoteGetTool(options) {
|
|
|
161
161
|
id: note.id,
|
|
162
162
|
title: note.title,
|
|
163
163
|
content: note.content,
|
|
164
|
-
|
|
164
|
+
notebook_id: note.notebook_id,
|
|
165
165
|
tags: note.tags,
|
|
166
166
|
visibility: note.visibility,
|
|
167
167
|
summary: note.summary,
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
is_pinned: note.is_pinned,
|
|
169
|
+
created_at: note.created_at,
|
|
170
|
+
updated_at: note.updated_at,
|
|
171
171
|
...(config.baseUrl ? { url: `${config.baseUrl}/notes/${note.id}` } : {}),
|
|
172
|
-
|
|
172
|
+
version_count: note.version_count,
|
|
173
173
|
},
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
176
|
catch (error) {
|
|
177
177
|
logger.error('note_get failed', {
|
|
178
|
-
|
|
178
|
+
user_id,
|
|
179
179
|
noteId,
|
|
180
180
|
error: error instanceof Error ? error.message : String(error),
|
|
181
181
|
});
|
|
@@ -194,14 +194,14 @@ export const NoteUpdateParamsSchema = z.object({
|
|
|
194
194
|
noteId: z.string().uuid('Note ID must be a valid UUID'),
|
|
195
195
|
title: z.string().min(1).max(500).optional(),
|
|
196
196
|
content: z.string().min(1).max(100000).optional(),
|
|
197
|
-
|
|
197
|
+
notebook_id: z.string().uuid().nullable().optional(),
|
|
198
198
|
tags: z.array(z.string()).max(20).optional(),
|
|
199
199
|
visibility: NoteVisibility.optional(),
|
|
200
200
|
summary: z.string().max(1000).nullable().optional(),
|
|
201
|
-
|
|
201
|
+
is_pinned: z.boolean().optional(),
|
|
202
202
|
});
|
|
203
203
|
export function createNoteUpdateTool(options) {
|
|
204
|
-
const { client, logger, config,
|
|
204
|
+
const { client, logger, config, user_id } = options;
|
|
205
205
|
return {
|
|
206
206
|
name: 'note_update',
|
|
207
207
|
description: 'Update an existing note. Can update title, content, tags, visibility, or move to a different notebook. ' +
|
|
@@ -213,10 +213,10 @@ export function createNoteUpdateTool(options) {
|
|
|
213
213
|
const errorMessage = parseResult.error.errors.map((e) => `${e.path.join('.')}: ${e.message}`).join(', ');
|
|
214
214
|
return { success: false, error: errorMessage };
|
|
215
215
|
}
|
|
216
|
-
const { noteId, title, content,
|
|
216
|
+
const { noteId, title, content, notebook_id, tags, visibility, summary, is_pinned } = parseResult.data;
|
|
217
217
|
// Track what's being changed
|
|
218
218
|
const changes = [];
|
|
219
|
-
const updateData = { user_email:
|
|
219
|
+
const updateData = { user_email: user_id };
|
|
220
220
|
if (title !== undefined) {
|
|
221
221
|
const sanitizedTitle = sanitizeText(title);
|
|
222
222
|
if (sanitizedTitle.length === 0) {
|
|
@@ -233,8 +233,8 @@ export function createNoteUpdateTool(options) {
|
|
|
233
233
|
updateData.content = sanitizedContent;
|
|
234
234
|
changes.push('content');
|
|
235
235
|
}
|
|
236
|
-
if (
|
|
237
|
-
updateData.notebook_id =
|
|
236
|
+
if (notebook_id !== undefined) {
|
|
237
|
+
updateData.notebook_id = notebook_id;
|
|
238
238
|
changes.push('notebook');
|
|
239
239
|
}
|
|
240
240
|
if (tags !== undefined) {
|
|
@@ -249,20 +249,20 @@ export function createNoteUpdateTool(options) {
|
|
|
249
249
|
updateData.summary = summary;
|
|
250
250
|
changes.push('summary');
|
|
251
251
|
}
|
|
252
|
-
if (
|
|
253
|
-
updateData.is_pinned =
|
|
254
|
-
changes.push('
|
|
252
|
+
if (is_pinned !== undefined) {
|
|
253
|
+
updateData.is_pinned = is_pinned;
|
|
254
|
+
changes.push('is_pinned');
|
|
255
255
|
}
|
|
256
256
|
if (changes.length === 0) {
|
|
257
257
|
return { success: false, error: 'No changes specified' };
|
|
258
258
|
}
|
|
259
259
|
logger.info('note_update invoked', {
|
|
260
|
-
|
|
260
|
+
user_id,
|
|
261
261
|
noteId,
|
|
262
262
|
changes,
|
|
263
263
|
});
|
|
264
264
|
try {
|
|
265
|
-
const response = await client.put(`/api/notes/${noteId}`, updateData, {
|
|
265
|
+
const response = await client.put(`/api/notes/${noteId}`, updateData, { user_id });
|
|
266
266
|
if (!response.success) {
|
|
267
267
|
if (response.error.status === 404) {
|
|
268
268
|
return { success: false, error: 'Note not found or access denied' };
|
|
@@ -271,7 +271,7 @@ export function createNoteUpdateTool(options) {
|
|
|
271
271
|
return { success: false, error: 'You do not have permission to update this note' };
|
|
272
272
|
}
|
|
273
273
|
logger.error('note_update API error', {
|
|
274
|
-
|
|
274
|
+
user_id,
|
|
275
275
|
noteId,
|
|
276
276
|
status: response.error.status,
|
|
277
277
|
});
|
|
@@ -282,7 +282,7 @@ export function createNoteUpdateTool(options) {
|
|
|
282
282
|
}
|
|
283
283
|
const note = response.data;
|
|
284
284
|
logger.debug('note_update completed', {
|
|
285
|
-
|
|
285
|
+
user_id,
|
|
286
286
|
noteId,
|
|
287
287
|
changes,
|
|
288
288
|
});
|
|
@@ -292,7 +292,7 @@ export function createNoteUpdateTool(options) {
|
|
|
292
292
|
id: note.id,
|
|
293
293
|
title: note.title,
|
|
294
294
|
visibility: note.visibility,
|
|
295
|
-
|
|
295
|
+
updated_at: note.updated_at,
|
|
296
296
|
...(config.baseUrl ? { url: `${config.baseUrl}/notes/${note.id}` } : {}),
|
|
297
297
|
changes,
|
|
298
298
|
},
|
|
@@ -300,7 +300,7 @@ export function createNoteUpdateTool(options) {
|
|
|
300
300
|
}
|
|
301
301
|
catch (error) {
|
|
302
302
|
logger.error('note_update failed', {
|
|
303
|
-
|
|
303
|
+
user_id,
|
|
304
304
|
noteId,
|
|
305
305
|
error: error instanceof Error ? error.message : String(error),
|
|
306
306
|
});
|
|
@@ -319,7 +319,7 @@ export const NoteDeleteParamsSchema = z.object({
|
|
|
319
319
|
noteId: z.string().uuid('Note ID must be a valid UUID'),
|
|
320
320
|
});
|
|
321
321
|
export function createNoteDeleteTool(options) {
|
|
322
|
-
const { client, logger,
|
|
322
|
+
const { client, logger, user_id } = options;
|
|
323
323
|
return {
|
|
324
324
|
name: 'note_delete',
|
|
325
325
|
description: 'Delete a note. This soft-deletes the note, which can be restored later. ' + 'Only the note owner can delete a note.',
|
|
@@ -332,11 +332,11 @@ export function createNoteDeleteTool(options) {
|
|
|
332
332
|
}
|
|
333
333
|
const { noteId } = parseResult.data;
|
|
334
334
|
logger.info('note_delete invoked', {
|
|
335
|
-
|
|
335
|
+
user_id,
|
|
336
336
|
noteId,
|
|
337
337
|
});
|
|
338
338
|
try {
|
|
339
|
-
const response = await client.delete(`/api/notes/${noteId}?user_email=${encodeURIComponent(
|
|
339
|
+
const response = await client.delete(`/api/notes/${noteId}?user_email=${encodeURIComponent(user_id)}`, { user_id });
|
|
340
340
|
if (!response.success) {
|
|
341
341
|
if (response.error.status === 404) {
|
|
342
342
|
return { success: false, error: 'Note not found' };
|
|
@@ -345,7 +345,7 @@ export function createNoteDeleteTool(options) {
|
|
|
345
345
|
return { success: false, error: 'Only the note owner can delete this note' };
|
|
346
346
|
}
|
|
347
347
|
logger.error('note_delete API error', {
|
|
348
|
-
|
|
348
|
+
user_id,
|
|
349
349
|
noteId,
|
|
350
350
|
status: response.error.status,
|
|
351
351
|
});
|
|
@@ -355,7 +355,7 @@ export function createNoteDeleteTool(options) {
|
|
|
355
355
|
};
|
|
356
356
|
}
|
|
357
357
|
logger.debug('note_delete completed', {
|
|
358
|
-
|
|
358
|
+
user_id,
|
|
359
359
|
noteId,
|
|
360
360
|
});
|
|
361
361
|
return {
|
|
@@ -368,7 +368,7 @@ export function createNoteDeleteTool(options) {
|
|
|
368
368
|
}
|
|
369
369
|
catch (error) {
|
|
370
370
|
logger.error('note_delete failed', {
|
|
371
|
-
|
|
371
|
+
user_id,
|
|
372
372
|
noteId,
|
|
373
373
|
error: error instanceof Error ? error.message : String(error),
|
|
374
374
|
});
|
|
@@ -385,15 +385,15 @@ export function createNoteDeleteTool(options) {
|
|
|
385
385
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
386
386
|
export const NoteSearchParamsSchema = z.object({
|
|
387
387
|
query: z.string().min(1, 'Search query cannot be empty').max(500),
|
|
388
|
-
|
|
389
|
-
|
|
388
|
+
search_type: z.enum(['hybrid', 'text', 'semantic']).optional().default('hybrid'),
|
|
389
|
+
notebook_id: z.string().uuid().optional(),
|
|
390
390
|
tags: z.array(z.string()).optional(),
|
|
391
391
|
visibility: NoteVisibility.optional(),
|
|
392
392
|
limit: z.number().min(1).max(50).optional().default(20),
|
|
393
393
|
offset: z.number().min(0).optional().default(0),
|
|
394
394
|
});
|
|
395
395
|
export function createNoteSearchTool(options) {
|
|
396
|
-
const { client, logger, config,
|
|
396
|
+
const { client, logger, config, user_id } = options;
|
|
397
397
|
return {
|
|
398
398
|
name: 'note_search',
|
|
399
399
|
description: 'Search notes using text search, semantic search, or hybrid (combines both). ' +
|
|
@@ -405,32 +405,32 @@ export function createNoteSearchTool(options) {
|
|
|
405
405
|
const errorMessage = parseResult.error.errors.map((e) => `${e.path.join('.')}: ${e.message}`).join(', ');
|
|
406
406
|
return { success: false, error: errorMessage };
|
|
407
407
|
}
|
|
408
|
-
const { query,
|
|
408
|
+
const { query, search_type, notebook_id, tags, visibility, limit, offset } = parseResult.data;
|
|
409
409
|
logger.info('note_search invoked', {
|
|
410
|
-
|
|
410
|
+
user_id,
|
|
411
411
|
queryLength: query.length,
|
|
412
|
-
|
|
413
|
-
|
|
412
|
+
search_type,
|
|
413
|
+
notebook_id,
|
|
414
414
|
limit,
|
|
415
415
|
});
|
|
416
416
|
try {
|
|
417
417
|
const queryParams = new URLSearchParams({
|
|
418
|
-
user_email:
|
|
418
|
+
user_email: user_id,
|
|
419
419
|
q: query,
|
|
420
|
-
|
|
420
|
+
search_type,
|
|
421
421
|
limit: String(limit),
|
|
422
422
|
offset: String(offset),
|
|
423
423
|
});
|
|
424
|
-
if (
|
|
425
|
-
queryParams.set('
|
|
424
|
+
if (notebook_id)
|
|
425
|
+
queryParams.set('notebook_id', notebook_id);
|
|
426
426
|
if (tags && tags.length > 0)
|
|
427
427
|
queryParams.set('tags', tags.join(','));
|
|
428
428
|
if (visibility)
|
|
429
429
|
queryParams.set('visibility', visibility);
|
|
430
|
-
const response = await client.get(`/api/notes/search?${queryParams}`, {
|
|
430
|
+
const response = await client.get(`/api/notes/search?${queryParams}`, { user_id, isAgent: true });
|
|
431
431
|
if (!response.success) {
|
|
432
432
|
logger.error('note_search API error', {
|
|
433
|
-
|
|
433
|
+
user_id,
|
|
434
434
|
status: response.error.status,
|
|
435
435
|
});
|
|
436
436
|
return {
|
|
@@ -440,7 +440,7 @@ export function createNoteSearchTool(options) {
|
|
|
440
440
|
}
|
|
441
441
|
const searchResult = response.data;
|
|
442
442
|
logger.debug('note_search completed', {
|
|
443
|
-
|
|
443
|
+
user_id,
|
|
444
444
|
resultsCount: searchResult.results.length,
|
|
445
445
|
total: searchResult.total,
|
|
446
446
|
});
|
|
@@ -448,7 +448,7 @@ export function createNoteSearchTool(options) {
|
|
|
448
448
|
success: true,
|
|
449
449
|
data: {
|
|
450
450
|
query: searchResult.query,
|
|
451
|
-
|
|
451
|
+
search_type: searchResult.search_type,
|
|
452
452
|
results: searchResult.results.map((r) => ({
|
|
453
453
|
id: r.id,
|
|
454
454
|
title: r.title,
|
|
@@ -466,7 +466,7 @@ export function createNoteSearchTool(options) {
|
|
|
466
466
|
}
|
|
467
467
|
catch (error) {
|
|
468
468
|
logger.error('note_search failed', {
|
|
469
|
-
|
|
469
|
+
user_id,
|
|
470
470
|
error: error instanceof Error ? error.message : String(error),
|
|
471
471
|
});
|
|
472
472
|
return {
|