@naumu/mcp 0.6.1 → 0.6.2
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/index.js +2314 -49
- package/package.json +6 -4
- package/dist/client.d.ts +0 -15
- package/dist/client.js +0 -82
- package/dist/client.js.map +0 -1
- package/dist/errors.d.ts +0 -35
- package/dist/errors.js +0 -52
- package/dist/errors.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js.map +0 -1
- package/dist/tools/add-attribute.d.ts +0 -3
- package/dist/tools/add-attribute.js +0 -58
- package/dist/tools/add-attribute.js.map +0 -1
- package/dist/tools/add-connection.d.ts +0 -3
- package/dist/tools/add-connection.js +0 -46
- package/dist/tools/add-connection.js.map +0 -1
- package/dist/tools/add-edge.d.ts +0 -3
- package/dist/tools/add-edge.js +0 -33
- package/dist/tools/add-edge.js.map +0 -1
- package/dist/tools/add-node-type.d.ts +0 -3
- package/dist/tools/add-node-type.js +0 -72
- package/dist/tools/add-node-type.js.map +0 -1
- package/dist/tools/add-node.d.ts +0 -3
- package/dist/tools/add-node.js +0 -36
- package/dist/tools/add-node.js.map +0 -1
- package/dist/tools/add-reaction.d.ts +0 -3
- package/dist/tools/add-reaction.js +0 -34
- package/dist/tools/add-reaction.js.map +0 -1
- package/dist/tools/ask-naumu.d.ts +0 -3
- package/dist/tools/ask-naumu.js +0 -44
- package/dist/tools/ask-naumu.js.map +0 -1
- package/dist/tools/ask.d.ts +0 -3
- package/dist/tools/ask.js +0 -37
- package/dist/tools/ask.js.map +0 -1
- package/dist/tools/batch-reparent.d.ts +0 -3
- package/dist/tools/batch-reparent.js +0 -31
- package/dist/tools/batch-reparent.js.map +0 -1
- package/dist/tools/canvas-add-element.d.ts +0 -3
- package/dist/tools/canvas-add-element.js +0 -46
- package/dist/tools/canvas-add-element.js.map +0 -1
- package/dist/tools/canvas-remove-element.d.ts +0 -3
- package/dist/tools/canvas-remove-element.js +0 -17
- package/dist/tools/canvas-remove-element.js.map +0 -1
- package/dist/tools/canvas-update-element.d.ts +0 -3
- package/dist/tools/canvas-update-element.js +0 -20
- package/dist/tools/canvas-update-element.js.map +0 -1
- package/dist/tools/create-canvas.d.ts +0 -3
- package/dist/tools/create-canvas.js +0 -17
- package/dist/tools/create-canvas.js.map +0 -1
- package/dist/tools/create-graph.d.ts +0 -3
- package/dist/tools/create-graph.js +0 -19
- package/dist/tools/create-graph.js.map +0 -1
- package/dist/tools/create-note.d.ts +0 -3
- package/dist/tools/create-note.js +0 -17
- package/dist/tools/create-note.js.map +0 -1
- package/dist/tools/create-thread.d.ts +0 -3
- package/dist/tools/create-thread.js +0 -63
- package/dist/tools/create-thread.js.map +0 -1
- package/dist/tools/filter.d.ts +0 -3
- package/dist/tools/filter.js +0 -54
- package/dist/tools/filter.js.map +0 -1
- package/dist/tools/get-ai-thread.d.ts +0 -3
- package/dist/tools/get-ai-thread.js +0 -18
- package/dist/tools/get-ai-thread.js.map +0 -1
- package/dist/tools/get-canvas-elements.d.ts +0 -3
- package/dist/tools/get-canvas-elements.js +0 -16
- package/dist/tools/get-canvas-elements.js.map +0 -1
- package/dist/tools/get-canvas-image.d.ts +0 -3
- package/dist/tools/get-canvas-image.js +0 -77
- package/dist/tools/get-canvas-image.js.map +0 -1
- package/dist/tools/get-node.d.ts +0 -3
- package/dist/tools/get-node.js +0 -17
- package/dist/tools/get-node.js.map +0 -1
- package/dist/tools/get-schema.d.ts +0 -3
- package/dist/tools/get-schema.js +0 -67
- package/dist/tools/get-schema.js.map +0 -1
- package/dist/tools/get-thread.d.ts +0 -3
- package/dist/tools/get-thread.js +0 -25
- package/dist/tools/get-thread.js.map +0 -1
- package/dist/tools/get-view.d.ts +0 -3
- package/dist/tools/get-view.js +0 -17
- package/dist/tools/get-view.js.map +0 -1
- package/dist/tools/index.d.ts +0 -16
- package/dist/tools/index.js +0 -155
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/list-canvases.d.ts +0 -3
- package/dist/tools/list-canvases.js +0 -16
- package/dist/tools/list-canvases.js.map +0 -1
- package/dist/tools/list-dense-nodes.d.ts +0 -3
- package/dist/tools/list-dense-nodes.js +0 -29
- package/dist/tools/list-dense-nodes.js.map +0 -1
- package/dist/tools/list-graphs.d.ts +0 -3
- package/dist/tools/list-graphs.js +0 -14
- package/dist/tools/list-graphs.js.map +0 -1
- package/dist/tools/list-node-connections.d.ts +0 -3
- package/dist/tools/list-node-connections.js +0 -32
- package/dist/tools/list-node-connections.js.map +0 -1
- package/dist/tools/list-schema-violations.d.ts +0 -3
- package/dist/tools/list-schema-violations.js +0 -16
- package/dist/tools/list-schema-violations.js.map +0 -1
- package/dist/tools/list-threads.d.ts +0 -3
- package/dist/tools/list-threads.js +0 -56
- package/dist/tools/list-threads.js.map +0 -1
- package/dist/tools/list-view-nodes.d.ts +0 -3
- package/dist/tools/list-view-nodes.js +0 -29
- package/dist/tools/list-view-nodes.js.map +0 -1
- package/dist/tools/naumu-typing.d.ts +0 -3
- package/dist/tools/naumu-typing.js +0 -30
- package/dist/tools/naumu-typing.js.map +0 -1
- package/dist/tools/note-append.d.ts +0 -3
- package/dist/tools/note-append.js +0 -17
- package/dist/tools/note-append.js.map +0 -1
- package/dist/tools/note-delete-section.d.ts +0 -3
- package/dist/tools/note-delete-section.js +0 -22
- package/dist/tools/note-delete-section.js.map +0 -1
- package/dist/tools/note-find-replace.d.ts +0 -3
- package/dist/tools/note-find-replace.js +0 -26
- package/dist/tools/note-find-replace.js.map +0 -1
- package/dist/tools/note-insert.d.ts +0 -3
- package/dist/tools/note-insert.js +0 -24
- package/dist/tools/note-insert.js.map +0 -1
- package/dist/tools/note-read.d.ts +0 -3
- package/dist/tools/note-read.js +0 -16
- package/dist/tools/note-read.js.map +0 -1
- package/dist/tools/note-replace-section.d.ts +0 -3
- package/dist/tools/note-replace-section.js +0 -26
- package/dist/tools/note-replace-section.js.map +0 -1
- package/dist/tools/note-replace.d.ts +0 -3
- package/dist/tools/note-replace.js +0 -17
- package/dist/tools/note-replace.js.map +0 -1
- package/dist/tools/post-message.d.ts +0 -3
- package/dist/tools/post-message.js +0 -45
- package/dist/tools/post-message.js.map +0 -1
- package/dist/tools/react-to-message.d.ts +0 -3
- package/dist/tools/react-to-message.js +0 -34
- package/dist/tools/react-to-message.js.map +0 -1
- package/dist/tools/read-thread.d.ts +0 -3
- package/dist/tools/read-thread.js +0 -43
- package/dist/tools/read-thread.js.map +0 -1
- package/dist/tools/remove-edge.d.ts +0 -3
- package/dist/tools/remove-edge.js +0 -25
- package/dist/tools/remove-edge.js.map +0 -1
- package/dist/tools/remove-edges-bulk.d.ts +0 -3
- package/dist/tools/remove-edges-bulk.js +0 -26
- package/dist/tools/remove-edges-bulk.js.map +0 -1
- package/dist/tools/remove-node.d.ts +0 -3
- package/dist/tools/remove-node.js +0 -17
- package/dist/tools/remove-node.js.map +0 -1
- package/dist/tools/remove-reaction.d.ts +0 -3
- package/dist/tools/remove-reaction.js +0 -34
- package/dist/tools/remove-reaction.js.map +0 -1
- package/dist/tools/reparent.d.ts +0 -3
- package/dist/tools/reparent.js +0 -21
- package/dist/tools/reparent.js.map +0 -1
- package/dist/tools/request-attachment-upload.d.ts +0 -3
- package/dist/tools/request-attachment-upload.js +0 -59
- package/dist/tools/request-attachment-upload.js.map +0 -1
- package/dist/tools/search.d.ts +0 -3
- package/dist/tools/search.js +0 -34
- package/dist/tools/search.js.map +0 -1
- package/dist/tools/semantic-search.d.ts +0 -3
- package/dist/tools/semantic-search.js +0 -34
- package/dist/tools/semantic-search.js.map +0 -1
- package/dist/tools/text-search.d.ts +0 -3
- package/dist/tools/text-search.js +0 -18
- package/dist/tools/text-search.js.map +0 -1
- package/dist/tools/traverse.d.ts +0 -3
- package/dist/tools/traverse.js +0 -19
- package/dist/tools/traverse.js.map +0 -1
- package/dist/tools/update-node.d.ts +0 -30
- package/dist/tools/update-node.js +0 -152
- package/dist/tools/update-node.js.map +0 -1
- package/dist/tools/update-schema.d.ts +0 -3
- package/dist/tools/update-schema.js +0 -63
- package/dist/tools/update-schema.js.map +0 -1
- package/dist/tools/whoami.d.ts +0 -3
- package/dist/tools/whoami.js +0 -31
- package/dist/tools/whoami.js.map +0 -1
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export function registerListThreads(server, client) {
|
|
3
|
-
server.registerTool('naumu_list_threads', {
|
|
4
|
-
title: 'List Threads',
|
|
5
|
-
description: 'List threads sorted by last activity (newest first), for self-discovery before deciding which to engage. With a user API key, pass `graphId` to list threads you can see in that space (resolve it via naumu_list_graphs). With a bot identity key, omit `graphId` to list threads in your own graph — each row carries an `isParticipant` flag (TRUE means you were explicitly invited and your replies fan out via webhook). Page back with `cursor` set to the oldest `lastActivityAt` from the previous page.',
|
|
6
|
-
inputSchema: z.object({
|
|
7
|
-
graphId: z
|
|
8
|
-
.string()
|
|
9
|
-
.optional()
|
|
10
|
-
.describe('Graph (space) ID. Required for user API keys; omit for bot identity keys (defaults to your own graph).'),
|
|
11
|
-
cursor: z
|
|
12
|
-
.number()
|
|
13
|
-
.int()
|
|
14
|
-
.optional()
|
|
15
|
-
.describe('Unix timestamp ms — returns threads with `lastActivityAt` strictly older than this. Omit for the newest page.'),
|
|
16
|
-
limit: z
|
|
17
|
-
.number()
|
|
18
|
-
.int()
|
|
19
|
-
.min(1)
|
|
20
|
-
.max(200)
|
|
21
|
-
.optional()
|
|
22
|
-
.describe('Page size, default 50, max 200.'),
|
|
23
|
-
}),
|
|
24
|
-
}, async ({ graphId, cursor, limit }) => {
|
|
25
|
-
try {
|
|
26
|
-
const params = new URLSearchParams();
|
|
27
|
-
if (cursor !== undefined)
|
|
28
|
-
params.set('cursor', String(cursor));
|
|
29
|
-
if (limit !== undefined)
|
|
30
|
-
params.set('limit', String(limit));
|
|
31
|
-
// User keys are graph-scoped: route to the user-facing paginated
|
|
32
|
-
// listing. Bot keys self-discover their own graph via me/threads.
|
|
33
|
-
let path;
|
|
34
|
-
if (graphId) {
|
|
35
|
-
params.set('graphId', graphId);
|
|
36
|
-
path = `/api/threads/paginated?${params.toString()}`;
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
const qs = params.toString();
|
|
40
|
-
path = `/api/identities/me/threads${qs ? `?${qs}` : ''}`;
|
|
41
|
-
}
|
|
42
|
-
const data = await client.get(path);
|
|
43
|
-
return {
|
|
44
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
catch (err) {
|
|
48
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
49
|
-
return {
|
|
50
|
-
content: [{ type: 'text', text: `Error: ${message}` }],
|
|
51
|
-
isError: true,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=list-threads.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-threads.js","sourceRoot":"","sources":["../../src/tools/list-threads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,mBAAmB,CAAC,MAAiB,EAAE,MAAmB;IACzE,MAAM,CAAC,YAAY,CAClB,oBAAoB,EACpB;QACC,KAAK,EAAE,cAAc;QACrB,WAAW,EACV,mfAAmf;QACpf,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,OAAO,EAAE,CAAC;iBACR,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,wGAAwG,CAAC;YACpH,MAAM,EAAE,CAAC;iBACP,MAAM,EAAE;iBACR,GAAG,EAAE;iBACL,QAAQ,EAAE;iBACV,QAAQ,CAAC,+GAA+G,CAAC;YAC3H,KAAK,EAAE,CAAC;iBACN,MAAM,EAAE;iBACR,GAAG,EAAE;iBACL,GAAG,CAAC,CAAC,CAAC;iBACN,GAAG,CAAC,GAAG,CAAC;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,iCAAiC,CAAC;SAC7C,CAAC;KACF,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;QACpC,IAAI,CAAC;YACJ,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;YACrC,IAAI,MAAM,KAAK,SAAS;gBAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YAC/D,IAAI,KAAK,KAAK,SAAS;gBAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAC5D,iEAAiE;YACjE,kEAAkE;YAClE,IAAI,IAAY,CAAC;YACjB,IAAI,OAAO,EAAE,CAAC;gBACb,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;gBAC/B,IAAI,GAAG,0BAA0B,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC;YACtD,CAAC;iBAAM,CAAC;gBACP,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;gBAC7B,IAAI,GAAG,6BAA6B,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YAC1D,CAAC;YACD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACpC,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aACzE,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACb,CAAC;QACH,CAAC;IACF,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export function registerListViewNodes(server, client) {
|
|
3
|
-
server.registerTool('naumu_list_view_nodes', {
|
|
4
|
-
title: 'List View Nodes',
|
|
5
|
-
description: 'List nodes that match a saved view. Cursor-paginated. Pair with naumu_get_view first to read the view\'s filters and decide what payload size you need.\n\nResponse shape: { nodes, totalCount, nextCursor, hasMore }. Use totalCount to know how many results exist without paging through them. Use hasMore (boolean) to decide whether to fetch the next page; pass nextCursor back as `cursor` to do so.\n\nfields parameter:\n- "summary" (default): {id, label, type} — best for browsing.\n- "id": {id} only — use when you need to count or iterate cheaply.\n- "full": full node payload with all attributes — use when you need every property.\n\nDefault page size 25, max 100.',
|
|
6
|
-
inputSchema: z.object({
|
|
7
|
-
graphId: z.string().describe('The graph (space) ID.'),
|
|
8
|
-
viewId: z.string().describe('The view ID.'),
|
|
9
|
-
cursor: z.string().optional().describe('Opaque cursor from a previous response\'s nextCursor. Omit for the first page.'),
|
|
10
|
-
limit: z.number().int().min(1).max(100).optional().describe('Page size, default 25, max 100.'),
|
|
11
|
-
fields: z.enum(['id', 'summary', 'full']).optional().describe('How much detail per node. Default "summary".'),
|
|
12
|
-
}),
|
|
13
|
-
}, async ({ graphId, viewId, cursor, limit, fields }) => {
|
|
14
|
-
const params = new URLSearchParams();
|
|
15
|
-
if (cursor)
|
|
16
|
-
params.set('cursor', cursor);
|
|
17
|
-
if (limit !== undefined)
|
|
18
|
-
params.set('limit', String(limit));
|
|
19
|
-
if (fields)
|
|
20
|
-
params.set('fields', fields);
|
|
21
|
-
const qs = params.toString();
|
|
22
|
-
const path = `/api/graphs/${graphId}/views/${viewId}/nodes${qs ? `?${qs}` : ''}`;
|
|
23
|
-
const data = await client.get(path);
|
|
24
|
-
return {
|
|
25
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=list-view-nodes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"list-view-nodes.js","sourceRoot":"","sources":["../../src/tools/list-view-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,qBAAqB,CAAC,MAAiB,EAAE,MAAmB;IAC3E,MAAM,CAAC,YAAY,CAClB,uBAAuB,EACvB;QACC,KAAK,EAAE,iBAAiB;QACxB,WAAW,EACV,6pBAA6pB;QAC9pB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;YACrD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;YAC3C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gFAAgF,CAAC;YACxH,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;YAC9F,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;SAC7G,CAAC;KACF,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE;QACpD,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,IAAI,MAAM;YAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACzC,IAAI,KAAK,KAAK,SAAS;YAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC5D,IAAI,MAAM;YAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAEzC,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;QAC7B,MAAM,IAAI,GAAG,eAAe,OAAO,UAAU,MAAM,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACjF,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAEpC,OAAO;YACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SACzE,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export function registerNaumuTyping(server, client) {
|
|
3
|
-
server.registerTool('naumu_typing', {
|
|
4
|
-
title: 'Set Typing Indicator',
|
|
5
|
-
description: 'Show or hide your "is typing…" pill in a thread. Call with `state: "start"` the moment you decide to compose a reply (before any LLM call), and the server holds the pill alive — re-broadcasting on a short interval — until you stop, post a message, or the lease cap (~5 min) fires. You do NOT need to refresh on a timer; that\'s the lease\'s job.\n\nThe pill clears automatically when:\n• you call this tool with `state: "stop"`\n• you call `naumu_post_message` for the same thread (cleared on commit)\n• the lease cap expires\n\nUse `start` whenever you start work, even if you might end up not replying — call `stop` if you decide NOT to post. Calling `start` while a lease is already active renews it (resets the cap), so a long-running run can call `start` again as a heartbeat without breaking the indicator. You must be a participant of the thread.',
|
|
6
|
-
inputSchema: z.object({
|
|
7
|
-
threadId: z
|
|
8
|
-
.string()
|
|
9
|
-
.describe('The thread ID to set typing in. You must be a participant.'),
|
|
10
|
-
state: z
|
|
11
|
-
.enum(['start', 'stop'])
|
|
12
|
-
.describe('"start" acquires/renews the lease; "stop" ends it and clears the pill immediately.'),
|
|
13
|
-
}),
|
|
14
|
-
}, async ({ threadId, state }) => {
|
|
15
|
-
try {
|
|
16
|
-
const data = await client.post(`/api/threads/${threadId}/typing`, { state });
|
|
17
|
-
return {
|
|
18
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
catch (err) {
|
|
22
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
23
|
-
return {
|
|
24
|
-
content: [{ type: 'text', text: `Error: ${message}` }],
|
|
25
|
-
isError: true,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=naumu-typing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"naumu-typing.js","sourceRoot":"","sources":["../../src/tools/naumu-typing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,mBAAmB,CAAC,MAAiB,EAAE,MAAmB;IACzE,MAAM,CAAC,YAAY,CAClB,cAAc,EACd;QACC,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EACV,u1BAAu1B;QACx1B,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,QAAQ,EAAE,CAAC;iBACT,MAAM,EAAE;iBACR,QAAQ,CAAC,4DAA4D,CAAC;YACxE,KAAK,EAAE,CAAC;iBACN,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;iBACvB,QAAQ,CAAC,oFAAoF,CAAC;SAChG,CAAC;KACF,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;QAC7B,IAAI,CAAC;YACJ,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,gBAAgB,QAAQ,SAAS,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;YAC7E,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aACzE,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACb,CAAC;QACH,CAAC;IACF,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export function registerNoteAppend(server, client) {
|
|
3
|
-
server.registerTool('naumu_note_append', {
|
|
4
|
-
title: 'Append to Note',
|
|
5
|
-
description: 'Append markdown blocks to the end of a note. Other participants see your colored cursor while the write lands. Markdown supports headings (1–3), bold/italic/code, lists, blockquotes, code blocks, links, and tables.',
|
|
6
|
-
inputSchema: z.object({
|
|
7
|
-
noteId: z.string().describe('The note (Thought) ID to append to'),
|
|
8
|
-
markdown: z.string().min(1).describe('Markdown content to append at the end of the note'),
|
|
9
|
-
}),
|
|
10
|
-
}, async ({ noteId, markdown }) => {
|
|
11
|
-
const data = await client.post(`/api/notes/${noteId}/append`, { markdown });
|
|
12
|
-
return {
|
|
13
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=note-append.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"note-append.js","sourceRoot":"","sources":["../../src/tools/note-append.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,kBAAkB,CAAC,MAAiB,EAAE,MAAmB;IACxE,MAAM,CAAC,YAAY,CAClB,mBAAmB,EACnB;QACC,KAAK,EAAE,gBAAgB;QACvB,WAAW,EACV,wNAAwN;QACzN,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;YACjE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,mDAAmD,CAAC;SACzF,CAAC;KACF,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC9B,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,cAAc,MAAM,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC5E,OAAO;YACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SACzE,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export function registerNoteDeleteSection(server, client) {
|
|
3
|
-
server.registerTool('naumu_note_delete_section', {
|
|
4
|
-
title: 'Delete Section',
|
|
5
|
-
description: '⚠ DESTRUCTIVE: removes a heading row plus its body (down to the next heading of equal-or-higher level). Anything inside that section is gone — there is no per-call undo. ONLY use when the user explicitly asks to drop a section. If you\'re unsure which heading they meant, call `naumu_note_read` first to see the current structure. Returns 404 if `headingText` does not exactly match any live heading.',
|
|
6
|
-
inputSchema: z.object({
|
|
7
|
-
noteId: z.string().describe('The note (Thought) ID'),
|
|
8
|
-
headingText: z
|
|
9
|
-
.string()
|
|
10
|
-
.min(1)
|
|
11
|
-
.describe('Exact text of the heading whose section will be deleted'),
|
|
12
|
-
}),
|
|
13
|
-
}, async ({ noteId, headingText }) => {
|
|
14
|
-
const data = await client.post(`/api/notes/${noteId}/delete-section`, {
|
|
15
|
-
headingText,
|
|
16
|
-
});
|
|
17
|
-
return {
|
|
18
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=note-delete-section.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"note-delete-section.js","sourceRoot":"","sources":["../../src/tools/note-delete-section.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,yBAAyB,CAAC,MAAiB,EAAE,MAAmB;IAC/E,MAAM,CAAC,YAAY,CAClB,2BAA2B,EAC3B;QACC,KAAK,EAAE,gBAAgB;QACvB,WAAW,EACV,kZAAkZ;QACnZ,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;YACpD,WAAW,EAAE,CAAC;iBACZ,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC,yDAAyD,CAAC;SACrE,CAAC;KACF,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE;QACjC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,cAAc,MAAM,iBAAiB,EAAE;YACrE,WAAW;SACX,CAAC,CAAC;QACH,OAAO;YACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SACzE,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export function registerNoteFindReplace(server, client) {
|
|
3
|
-
server.registerTool('naumu_note_find_replace', {
|
|
4
|
-
title: 'Find/Replace in Note',
|
|
5
|
-
description: 'Literal find/replace within a note\'s text content. Marks (bold, italic, code, etc.) are preserved on the surrounding text. Use this for mid-paragraph tweaks — the section-based tools can\'t target inline substrings. ⚠ The match is literal-substring across every text leaf in the doc; an overly generic `find` (e.g. " a ") can rewrite the doc unrecognizably. Pick a phrase distinctive enough to land where you mean. By default replaces every occurrence; set `all: false` for first-only. Returns `{ replacements }` so you can sanity-check the count.',
|
|
6
|
-
inputSchema: z.object({
|
|
7
|
-
noteId: z.string().describe('The note (Thought) ID'),
|
|
8
|
-
find: z.string().min(1).describe('Substring to search for. Literal — no regex.'),
|
|
9
|
-
replace: z.string().describe('Replacement string. May be empty to delete the match.'),
|
|
10
|
-
all: z
|
|
11
|
-
.boolean()
|
|
12
|
-
.optional()
|
|
13
|
-
.describe('Replace all occurrences (default true). Pass false to replace only the first.'),
|
|
14
|
-
}),
|
|
15
|
-
}, async ({ noteId, find, replace, all }) => {
|
|
16
|
-
const data = await client.post(`/api/notes/${noteId}/find-replace`, {
|
|
17
|
-
find,
|
|
18
|
-
replace,
|
|
19
|
-
all,
|
|
20
|
-
});
|
|
21
|
-
return {
|
|
22
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=note-find-replace.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"note-find-replace.js","sourceRoot":"","sources":["../../src/tools/note-find-replace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,uBAAuB,CAAC,MAAiB,EAAE,MAAmB;IAC7E,MAAM,CAAC,YAAY,CAClB,yBAAyB,EACzB;QACC,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EACV,siBAAsiB;QACviB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;YACpD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,8CAA8C,CAAC;YAChF,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;YACrF,GAAG,EAAE,CAAC;iBACJ,OAAO,EAAE;iBACT,QAAQ,EAAE;iBACV,QAAQ,CAAC,+EAA+E,CAAC;SAC3F,CAAC;KACF,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE;QACxC,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,cAAc,MAAM,eAAe,EAAE;YACnE,IAAI;YACJ,OAAO;YACP,GAAG;SACH,CAAC,CAAC;QACH,OAAO;YACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SACzE,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export function registerNoteInsert(server, client) {
|
|
3
|
-
server.registerTool('naumu_note_insert', {
|
|
4
|
-
title: 'Insert After Heading',
|
|
5
|
-
description: 'Insert markdown content into a note immediately after a named section. The section ends at the next heading of equal-or-higher level (or end of doc). 404 if no heading matches `headingText` exactly — call `naumu_note_read` first to see the live structure.',
|
|
6
|
-
inputSchema: z.object({
|
|
7
|
-
noteId: z.string().describe('The note (Thought) ID'),
|
|
8
|
-
headingText: z
|
|
9
|
-
.string()
|
|
10
|
-
.min(1)
|
|
11
|
-
.describe('Exact text of the heading whose section the new content follows'),
|
|
12
|
-
markdown: z.string().min(1).describe('Markdown content to insert at the end of that section'),
|
|
13
|
-
}),
|
|
14
|
-
}, async ({ noteId, headingText, markdown }) => {
|
|
15
|
-
const data = await client.post(`/api/notes/${noteId}/insert-after`, {
|
|
16
|
-
headingText,
|
|
17
|
-
markdown,
|
|
18
|
-
});
|
|
19
|
-
return {
|
|
20
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
21
|
-
};
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=note-insert.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"note-insert.js","sourceRoot":"","sources":["../../src/tools/note-insert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,kBAAkB,CAAC,MAAiB,EAAE,MAAmB;IACxE,MAAM,CAAC,YAAY,CAClB,mBAAmB,EACnB;QACC,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EACV,iQAAiQ;QAClQ,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;YACpD,WAAW,EAAE,CAAC;iBACZ,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC,iEAAiE,CAAC;YAC7E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,uDAAuD,CAAC;SAC7F,CAAC;KACF,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC3C,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,cAAc,MAAM,eAAe,EAAE;YACnE,WAAW;YACX,QAAQ;SACR,CAAC,CAAC;QACH,OAAO;YACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SACzE,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC"}
|
package/dist/tools/note-read.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export function registerNoteRead(server, client) {
|
|
3
|
-
server.registerTool('naumu_note_read', {
|
|
4
|
-
title: 'Read Note',
|
|
5
|
-
description: 'Read the current contents of a note as markdown. Use before editing so you know what you\'re working with — `naumu_note_find_replace` and the section-based tools (`naumu_note_insert`, `naumu_note_replace_section`, `naumu_note_delete_section`) anchor on text/headings present in the live doc.',
|
|
6
|
-
inputSchema: z.object({
|
|
7
|
-
noteId: z.string().describe('The note (Thought) ID'),
|
|
8
|
-
}),
|
|
9
|
-
}, async ({ noteId }) => {
|
|
10
|
-
const data = await client.get(`/api/notes/${noteId}/markdown`);
|
|
11
|
-
return {
|
|
12
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
13
|
-
};
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=note-read.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"note-read.js","sourceRoot":"","sources":["../../src/tools/note-read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,gBAAgB,CAAC,MAAiB,EAAE,MAAmB;IACtE,MAAM,CAAC,YAAY,CAClB,iBAAiB,EACjB;QACC,KAAK,EAAE,WAAW;QAClB,WAAW,EACV,qSAAqS;QACtS,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;SACpD,CAAC;KACF,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QACpB,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,cAAc,MAAM,WAAW,CAAC,CAAC;QAC/D,OAAO;YACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SACzE,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export function registerNoteReplaceSection(server, client) {
|
|
3
|
-
server.registerTool('naumu_note_replace_section', {
|
|
4
|
-
title: 'Replace Section',
|
|
5
|
-
description: 'Replace the body under a named heading with new markdown. By default the heading row itself is preserved (set `keepHeading: false` to drop it too). 404 if no heading matches.',
|
|
6
|
-
inputSchema: z.object({
|
|
7
|
-
noteId: z.string().describe('The note (Thought) ID'),
|
|
8
|
-
headingText: z.string().min(1).describe('Exact text of the heading anchoring the section'),
|
|
9
|
-
markdown: z.string().describe('Replacement markdown for the section body'),
|
|
10
|
-
keepHeading: z
|
|
11
|
-
.boolean()
|
|
12
|
-
.optional()
|
|
13
|
-
.describe('Whether to keep the heading row itself. Default true.'),
|
|
14
|
-
}),
|
|
15
|
-
}, async ({ noteId, headingText, markdown, keepHeading }) => {
|
|
16
|
-
const data = await client.post(`/api/notes/${noteId}/replace-section`, {
|
|
17
|
-
headingText,
|
|
18
|
-
markdown,
|
|
19
|
-
keepHeading,
|
|
20
|
-
});
|
|
21
|
-
return {
|
|
22
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=note-replace-section.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"note-replace-section.js","sourceRoot":"","sources":["../../src/tools/note-replace-section.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,0BAA0B,CAAC,MAAiB,EAAE,MAAmB;IAChF,MAAM,CAAC,YAAY,CAClB,4BAA4B,EAC5B;QACC,KAAK,EAAE,iBAAiB;QACxB,WAAW,EACV,gLAAgL;QACjL,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;YACpD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iDAAiD,CAAC;YAC1F,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;YAC1E,WAAW,EAAE,CAAC;iBACZ,OAAO,EAAE;iBACT,QAAQ,EAAE;iBACV,QAAQ,CAAC,uDAAuD,CAAC;SACnE,CAAC;KACF,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE;QACxD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,cAAc,MAAM,kBAAkB,EAAE;YACtE,WAAW;YACX,QAAQ;YACR,WAAW;SACX,CAAC,CAAC;QACH,OAAO;YACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SACzE,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export function registerNoteReplace(server, client) {
|
|
3
|
-
server.registerTool('naumu_note_replace', {
|
|
4
|
-
title: 'Replace Note',
|
|
5
|
-
description: '⚠ DESTRUCTIVE: replaces the entire note content with new markdown. Any concurrent human edits made during the call are silently overwritten. ONLY use when the user explicitly asks to rewrite/replace the whole note. For additive work prefer `naumu_note_append`. For section-level edits use `naumu_note_replace_section`. For inline tweaks use `naumu_note_find_replace`. Read with `naumu_note_read` first if you weren\'t the last writer.',
|
|
6
|
-
inputSchema: z.object({
|
|
7
|
-
noteId: z.string().describe('The note (Thought) ID'),
|
|
8
|
-
markdown: z.string().describe('New markdown content for the entire note'),
|
|
9
|
-
}),
|
|
10
|
-
}, async ({ noteId, markdown }) => {
|
|
11
|
-
const data = await client.post(`/api/notes/${noteId}/replace`, { markdown });
|
|
12
|
-
return {
|
|
13
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=note-replace.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"note-replace.js","sourceRoot":"","sources":["../../src/tools/note-replace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,mBAAmB,CAAC,MAAiB,EAAE,MAAmB;IACzE,MAAM,CAAC,YAAY,CAClB,oBAAoB,EACpB;QACC,KAAK,EAAE,cAAc;QACrB,WAAW,EACV,obAAob;QACrb,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;YACpD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;SACzE,CAAC;KACF,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC9B,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,cAAc,MAAM,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7E,OAAO;YACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SACzE,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export function registerPostMessage(server, client) {
|
|
3
|
-
server.registerTool('naumu_post_message', {
|
|
4
|
-
title: 'Post Message',
|
|
5
|
-
description: 'Post a message in a Naumu thread you are participating in. Use this to reply to humans (or other bots) in a thread that pinged you. Plain text is accepted by default; for rendered @mentions, pass a Tiptap JSON document with mention nodes (`{ type: "mention", attrs: { id, label } }`) and set contentFormat to "tiptap". To attach files (reports, images, audio, video) call `naumu_request_attachment_upload` first for each file, PUT the bytes to the returned `uploadUrl`, then pass the resulting `attachmentId`s here as `attachmentIds`. The message must have either `content` or `attachmentIds` (or both). Returns the created message JSON.',
|
|
6
|
-
inputSchema: z.object({
|
|
7
|
-
threadId: z.string().describe('The thread ID to post into. You must be a participant in this thread.'),
|
|
8
|
-
content: z
|
|
9
|
-
.string()
|
|
10
|
-
.optional()
|
|
11
|
-
.describe('Message body. Plain text by default; pass a Tiptap JSON document only if contentFormat is set to "tiptap". Optional when `attachmentIds` is provided.'),
|
|
12
|
-
contentFormat: z
|
|
13
|
-
.enum(['tiptap', 'text'])
|
|
14
|
-
.optional()
|
|
15
|
-
.describe('Format of `content`. Defaults to "text". Use "tiptap" for rendered mentions/embeds, e.g. a doc containing `{ type: "mention", attrs: { id: userIdOrIdentityId, label: displayName } }`.'),
|
|
16
|
-
attachmentIds: z
|
|
17
|
-
.array(z.string().min(1))
|
|
18
|
-
.max(25)
|
|
19
|
-
.optional()
|
|
20
|
-
.describe('Attachment IDs from prior `naumu_request_attachment_upload` calls. Each must be a successfully-uploaded pending attachment in this graph (1-hour TTL). Up to 25 per message.'),
|
|
21
|
-
}),
|
|
22
|
-
}, async ({ threadId, content, contentFormat, attachmentIds }) => {
|
|
23
|
-
try {
|
|
24
|
-
const body = {
|
|
25
|
-
contentFormat: contentFormat ?? 'text',
|
|
26
|
-
};
|
|
27
|
-
if (content !== undefined)
|
|
28
|
-
body.content = content;
|
|
29
|
-
if (attachmentIds && attachmentIds.length > 0)
|
|
30
|
-
body.attachmentIds = attachmentIds;
|
|
31
|
-
const data = await client.post(`/api/threads/${threadId}/messages`, body);
|
|
32
|
-
return {
|
|
33
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
catch (err) {
|
|
37
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
38
|
-
return {
|
|
39
|
-
content: [{ type: 'text', text: `Error: ${message}` }],
|
|
40
|
-
isError: true,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=post-message.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"post-message.js","sourceRoot":"","sources":["../../src/tools/post-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,mBAAmB,CAAC,MAAiB,EAAE,MAAmB;IACzE,MAAM,CAAC,YAAY,CAClB,oBAAoB,EACpB;QACC,KAAK,EAAE,cAAc;QACrB,WAAW,EACV,+nBAA+nB;QAChoB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uEAAuE,CAAC;YACtG,OAAO,EAAE,CAAC;iBACR,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,uJAAuJ,CAAC;YACnK,aAAa,EAAE,CAAC;iBACd,IAAI,CAAC,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;iBACxB,QAAQ,EAAE;iBACV,QAAQ,CAAC,yLAAyL,CAAC;YACrM,aAAa,EAAE,CAAC;iBACd,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;iBACxB,GAAG,CAAC,EAAE,CAAC;iBACP,QAAQ,EAAE;iBACV,QAAQ,CAAC,8KAA8K,CAAC;SAC1L,CAAC;KACF,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,EAAE,EAAE;QAC7D,IAAI,CAAC;YACJ,MAAM,IAAI,GAA4B;gBACrC,aAAa,EAAE,aAAa,IAAI,MAAM;aACtC,CAAC;YACF,IAAI,OAAO,KAAK,SAAS;gBAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YAClD,IAAI,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC;gBAAE,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;YAClF,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,gBAAgB,QAAQ,WAAW,EAAE,IAAI,CAAC,CAAC;YAC1E,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aACzE,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACb,CAAC;QACH,CAAC;IACF,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export function registerReactToMessage(server, client) {
|
|
3
|
-
server.registerTool('naumu_react_to_message', {
|
|
4
|
-
title: 'React to Message',
|
|
5
|
-
description: 'Add an emoji reaction to a message in a thread you are participating in. Idempotent — calling twice with the same emoji is a no-op (use `naumu_remove_reaction` to undo).\n\nWhen to react vs. when to post a message:\n• React (no message) for lightweight acknowledgement (👀, ✅, 👍), appreciation (❤️, 🙌), laughter (😂), or "I saw this".\n• Post a message for direct questions, clarification, important corrections, or final results — situations where words are required.\n• For long tasks: react 👀 first to acknowledge, optionally post a short "On it — I\'ll report back" if the work will take >20s, do the work, then post the final result.\n• Ignore casual human banter, side-conversations someone else already answered, or anything where you would only say "ok"/"nice"/"lol".\n\nUse at most one reaction per message unless explicitly useful. Reactions are social backpressure relief, not a sparkle-confetti channel.',
|
|
6
|
-
inputSchema: z.object({
|
|
7
|
-
threadId: z
|
|
8
|
-
.string()
|
|
9
|
-
.describe('Thread containing the message. You must be a participant.'),
|
|
10
|
-
messageId: z
|
|
11
|
-
.string()
|
|
12
|
-
.describe('The message to react to.'),
|
|
13
|
-
emoji: z
|
|
14
|
-
.string()
|
|
15
|
-
.min(1)
|
|
16
|
-
.describe('Emoji character (e.g. "👀", "✅", "❤️"). Custom-emoji shortcodes are NOT supported here — pass a real Unicode emoji.'),
|
|
17
|
-
}),
|
|
18
|
-
}, async ({ threadId, messageId, emoji }) => {
|
|
19
|
-
try {
|
|
20
|
-
const data = await client.post(`/api/threads/${threadId}/messages/${messageId}/reactions`, { emoji, action: 'add' });
|
|
21
|
-
return {
|
|
22
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
catch (err) {
|
|
26
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
27
|
-
return {
|
|
28
|
-
content: [{ type: 'text', text: `Error: ${message}` }],
|
|
29
|
-
isError: true,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=react-to-message.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-to-message.js","sourceRoot":"","sources":["../../src/tools/react-to-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,sBAAsB,CAAC,MAAiB,EAAE,MAAmB;IAC5E,MAAM,CAAC,YAAY,CAClB,wBAAwB,EACxB;QACC,KAAK,EAAE,kBAAkB;QACzB,WAAW,EACV,w5BAAw5B;QACz5B,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,QAAQ,EAAE,CAAC;iBACT,MAAM,EAAE;iBACR,QAAQ,CAAC,2DAA2D,CAAC;YACvE,SAAS,EAAE,CAAC;iBACV,MAAM,EAAE;iBACR,QAAQ,CAAC,0BAA0B,CAAC;YACtC,KAAK,EAAE,CAAC;iBACN,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC,qHAAqH,CAAC;SACjI,CAAC;KACF,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE;QACxC,IAAI,CAAC;YACJ,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,IAAI,CAC7B,gBAAgB,QAAQ,aAAa,SAAS,YAAY,EAC1D,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CACxB,CAAC;YACF,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aACzE,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACb,CAAC;QACH,CAAC;IACF,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export function registerReadThread(server, client) {
|
|
3
|
-
server.registerTool('naumu_read_thread', {
|
|
4
|
-
title: 'Read Thread',
|
|
5
|
-
description: 'Read messages from a Naumu thread. Returns paginated history ordered newest-first. Use `before` (timestamp ms) to page back further into older history. Default page size 50, max 200.',
|
|
6
|
-
inputSchema: z.object({
|
|
7
|
-
threadId: z.string().describe('The thread ID to read from.'),
|
|
8
|
-
before: z
|
|
9
|
-
.number()
|
|
10
|
-
.optional()
|
|
11
|
-
.describe('Unix timestamp in milliseconds. Returns messages strictly older than this. Omit for the newest page.'),
|
|
12
|
-
limit: z
|
|
13
|
-
.number()
|
|
14
|
-
.int()
|
|
15
|
-
.min(1)
|
|
16
|
-
.max(200)
|
|
17
|
-
.optional()
|
|
18
|
-
.describe('Page size, default 50, max 200.'),
|
|
19
|
-
}),
|
|
20
|
-
}, async ({ threadId, before, limit }) => {
|
|
21
|
-
try {
|
|
22
|
-
const params = new URLSearchParams();
|
|
23
|
-
if (before !== undefined)
|
|
24
|
-
params.set('before', String(before));
|
|
25
|
-
if (limit !== undefined)
|
|
26
|
-
params.set('limit', String(limit));
|
|
27
|
-
const qs = params.toString();
|
|
28
|
-
const path = `/api/threads/${threadId}/messages${qs ? `?${qs}` : ''}`;
|
|
29
|
-
const data = await client.get(path);
|
|
30
|
-
return {
|
|
31
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
36
|
-
return {
|
|
37
|
-
content: [{ type: 'text', text: `Error: ${message}` }],
|
|
38
|
-
isError: true,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=read-thread.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"read-thread.js","sourceRoot":"","sources":["../../src/tools/read-thread.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,kBAAkB,CAAC,MAAiB,EAAE,MAAmB;IACxE,MAAM,CAAC,YAAY,CAClB,mBAAmB,EACnB;QACC,KAAK,EAAE,aAAa;QACpB,WAAW,EACV,wLAAwL;QACzL,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;YAC5D,MAAM,EAAE,CAAC;iBACP,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,sGAAsG,CAAC;YAClH,KAAK,EAAE,CAAC;iBACN,MAAM,EAAE;iBACR,GAAG,EAAE;iBACL,GAAG,CAAC,CAAC,CAAC;iBACN,GAAG,CAAC,GAAG,CAAC;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,iCAAiC,CAAC;SAC7C,CAAC;KACF,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;QACrC,IAAI,CAAC;YACJ,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;YACrC,IAAI,MAAM,KAAK,SAAS;gBAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YAC/D,IAAI,KAAK,KAAK,SAAS;gBAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAE5D,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;YAC7B,MAAM,IAAI,GAAG,gBAAgB,QAAQ,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YACtE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAEpC,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aACzE,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBAC/D,OAAO,EAAE,IAAI;aACb,CAAC;QACH,CAAC;IACF,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export function registerRemoveEdge(server, client) {
|
|
3
|
-
server.registerTool('naumu_remove_edge', {
|
|
4
|
-
title: 'Remove Edge',
|
|
5
|
-
description: 'Delete a single edge identified by `(source, target, label)` tuple. Does NOT delete the endpoint nodes — only the edge between them. System edges (HAS_NODE, HAS_THREAD, OWNS, etc.) are rejected with `error: system_edge_not_removable`. Parent edges (`isParent: true`) are removable but the response includes a warning that the child may now be orphaned — call `naumu_reparent` first if you want connectivity preserved. Response: `{deleted: 0 | 1, warnings: string[]}`. Use for correcting wrong-target edge mistakes; this is a recovery tool, not a routine one. **Prefer `naumu_ask`** when the structural intent is broader than removing one specific edge — `naumu_ask` can reason about the surrounding graph.',
|
|
6
|
-
inputSchema: z.object({
|
|
7
|
-
graphId: z.string().describe('The graph ID'),
|
|
8
|
-
source: z.string().describe('Source node id of the edge to delete'),
|
|
9
|
-
target: z.string().describe('Target node id of the edge to delete'),
|
|
10
|
-
label: z
|
|
11
|
-
.string()
|
|
12
|
-
.describe('Relation label of the edge to delete (e.g. "AUTHORED"). Case-insensitive; non-alphanum chars are normalized.'),
|
|
13
|
-
}),
|
|
14
|
-
}, async ({ graphId, source, target, label }) => {
|
|
15
|
-
const data = await client.del(`/api/graphs/${graphId}/edges`, {
|
|
16
|
-
source,
|
|
17
|
-
target,
|
|
18
|
-
label,
|
|
19
|
-
});
|
|
20
|
-
return {
|
|
21
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
22
|
-
};
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=remove-edge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-edge.js","sourceRoot":"","sources":["../../src/tools/remove-edge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,UAAU,kBAAkB,CAAC,MAAiB,EAAE,MAAmB;IACxE,MAAM,CAAC,YAAY,CAClB,mBAAmB,EACnB;QACC,KAAK,EAAE,aAAa;QACpB,WAAW,EACV,msBAAmsB;QACpsB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;YAC5C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;YACnE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;YACnE,KAAK,EAAE,CAAC;iBACN,MAAM,EAAE;iBACR,QAAQ,CAAC,8GAA8G,CAAC;SAC1H,CAAC;KACF,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE;QAC5C,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,eAAe,OAAO,QAAQ,EAAE;YAC7D,MAAM;YACN,MAAM;YACN,KAAK;SACL,CAAC,CAAC;QACH,OAAO;YACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SACzE,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
const EdgeRef = z.object({
|
|
3
|
-
source: z.string().describe('Source node ID'),
|
|
4
|
-
target: z.string().describe('Target node ID'),
|
|
5
|
-
label: z.string().describe('Relation label of the edge to delete'),
|
|
6
|
-
});
|
|
7
|
-
export function registerRemoveEdgesBulk(server, client) {
|
|
8
|
-
server.registerTool('naumu_remove_edges_bulk', {
|
|
9
|
-
title: 'Remove Edges (bulk)',
|
|
10
|
-
description: 'Delete 1–100 edges in a single atomic call — all-or-none, same semantics as `naumu_add_node`. Does NOT delete endpoint nodes. **System edges** (HAS_NODE, HAS_THREAD, OWNS, etc.) are rejected — if any edge in the batch targets a system relation, the WHOLE batch is rejected with `error: system_edge_not_removable`. **Parent edges** (`isParent: true`) are removable but each parent removal contributes a warning to the response (`{deleted, warnings: string[]}`) — call `naumu_reparent` first if you want connectivity preserved. Use to fix multiple wrong-target edge mistakes in one shot. **Prefer `naumu_ask`** for broader structural cleanup that needs graph-wide reasoning.',
|
|
11
|
-
inputSchema: z.object({
|
|
12
|
-
graphId: z.string().describe('The graph ID'),
|
|
13
|
-
edges: z
|
|
14
|
-
.array(EdgeRef)
|
|
15
|
-
.min(1)
|
|
16
|
-
.max(100)
|
|
17
|
-
.describe('1–100 edges to delete. Atomic per call — all succeed or none do.'),
|
|
18
|
-
}),
|
|
19
|
-
}, async ({ graphId, edges }) => {
|
|
20
|
-
const data = await client.del(`/api/graphs/${graphId}/edges/bulk`, { edges });
|
|
21
|
-
return {
|
|
22
|
-
content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=remove-edges-bulk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-edges-bulk.js","sourceRoot":"","sources":["../../src/tools/remove-edges-bulk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC;IACxB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC7C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAC7C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;CAClE,CAAC,CAAC;AAEH,MAAM,UAAU,uBAAuB,CAAC,MAAiB,EAAE,MAAmB;IAC7E,MAAM,CAAC,YAAY,CAClB,yBAAyB,EACzB;QACC,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EACV,kqBAAkqB;QACnqB,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACrB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;YAC5C,KAAK,EAAE,CAAC;iBACN,KAAK,CAAC,OAAO,CAAC;iBACd,GAAG,CAAC,CAAC,CAAC;iBACN,GAAG,CAAC,GAAG,CAAC;iBACR,QAAQ,CAAC,kEAAkE,CAAC;SAC9E,CAAC;KACF,EACD,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE;QAC5B,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,eAAe,OAAO,aAAa,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC9E,OAAO;YACN,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;SACzE,CAAC;IACH,CAAC,CACD,CAAC;AACH,CAAC"}
|