@naumu/mcp 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/dist/index.js +308 -155
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -51,6 +51,7 @@ Add to your Cursor MCP settings:
51
51
  | `naumu_add_edge` | Create a relationship between two nodes |
52
52
  | `naumu_remove_node` | Delete a node and its connections |
53
53
  | `naumu_remove_edge` | Delete a relationship |
54
+ | `naumu_create_topic` | Create a topic (filing destination) in a space; admin-only, name must be a lowercase slug, returns an `id` for `topicIds` params |
54
55
  | `naumu_ask` | Ask @Naumu a question and get a synthesised answer back (answer + sources + confidence + threadId + status); leaves a visible thread in the space |
55
56
  | `naumu_delegate` | Hand @Naumu a task to carry out asynchronously (add knowledge, make changes); returns a `threadId` immediately, then poll with `naumu_read_thread` |
56
57
  | `naumu_read_thread` | Read a thread's messages; each message carries a `status` of `processing` or `complete` |
package/dist/index.js CHANGED
@@ -523,11 +523,11 @@ function registerSearch(server2, client2) {
523
523
  {
524
524
  title: "Search Graph",
525
525
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
526
- description: 'Hybrid search over graph nodes; use for meaning-based lookup when you don\'t know the exact label. Combines exact-token text matching (good for UUIDs, proper nouns, specific labels) with semantic similarity (good for paraphrase and meaning), then fuses both rankings with Reciprocal Rank Fusion. Returns the top matches with a `matchedVia` tag - `both` is the highest-confidence signal, then `semantic`, then `text`. Use `naumu_filter` for structured queries by type and attributes (e.g. "all in-progress Tasks"). Tip: include both synonyms ("authentication login SSO") and exact tokens you remember in the same query - the fusion handles both.',
526
+ description: 'Hybrid search over graph nodes; use for meaning-based lookup when you don\'t know the exact label. Combines text matching, which looks for the whole query as one contiguous substring (good for UUIDs, proper nouns, specific labels), with semantic similarity (good for paraphrase and meaning), then fuses both rankings with Reciprocal Rank Fusion. Returns the top matches with a `matchedVia` tag - `both` is the highest-confidence signal, then `semantic`, then `text`. Use `naumu_filter` for structured queries by type and attributes (e.g. "all in-progress Tasks").',
527
527
  inputSchema: z9.object({
528
528
  graphId: z9.string().describe("The graph ID"),
529
529
  query: z9.string().describe(
530
- 'Search query text. Mix synonyms and exact tokens freely (e.g. "auth login SSO 2fa Twitter handle").'
530
+ "A short contiguous phrase \u2014 an entity name, label, or ID. The text half matches it verbatim as a case-insensitive substring; the semantic half matches meaning."
531
531
  ),
532
532
  limit: z9.number().optional().default(20).describe("Max results to return (default 20, max 200). Adaptive cutoff may return fewer when the top match is weak."),
533
533
  nodeTypes: z9.array(z9.string()).optional().describe('Filter to specific node types (e.g. ["Type A", "Type B"])')
@@ -805,7 +805,7 @@ function registerAddNode(server2, client2) {
805
805
  {
806
806
  title: "Add Nodes (bulk)",
807
807
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
808
- description: 'Create 1-25 nodes in the knowledge graph in a single call; use when you have a vetted, dedup-checked batch ready to insert. Keep batches small and atomic (5-25 nodes) so failures stay contained. Each node MUST include a non-empty `content` describing what it is. Returns one entry per input node with `{id, label, type, status: "created"}` - there is NO server-side dedup, every input becomes a node. Dedup is the caller\'s responsibility: BEFORE calling this tool, run `naumu_search` on each candidate label and skip/route to update if a result has high similarity (\u22650.78) and matching type. Warning: nodes are isolated until you connect them with `naumu_add_edge`. Prefer `naumu_delegate` for general knowledge intake - it discovers and creates connections for you.',
808
+ description: 'Create 1-25 nodes in the knowledge graph in a single call; use when you have a vetted, dedup-checked batch ready to insert. Keep batches small and atomic (5-25 nodes) so failures stay contained. Each node MUST include a non-empty `content` describing what it is. Returns one entry per input node with `{id, label, type, status: "created"}` - there is NO server-side dedup, every input becomes a node. Dedup is the caller\'s responsibility: BEFORE calling this tool, run `naumu_search` on each candidate label and treat a result as the same entity when its `matchedVia` is "semantic" or "both" AND its type matches AND the labels plausibly name the same thing - then reuse/update that node instead of creating one. (The `score` field is a rank-fusion value, not a similarity - do not compare it against a threshold.) Warning: nodes are isolated until you connect them with `naumu_add_edge`. Prefer `naumu_delegate` for general knowledge intake - it discovers and creates connections for you.',
809
809
  inputSchema: z13.object({
810
810
  graphId: z13.string().describe("The graph ID"),
811
811
  nodes: z13.array(NodeInput).min(1).max(25).describe("Batch of 1\u201325 nodes to create. Keep batches small for atomicity.")
@@ -1091,18 +1091,20 @@ function registerPostMessage(server2, client2) {
1091
1091
  idempotentHint: false,
1092
1092
  openWorldHint: false
1093
1093
  },
1094
- description: 'Post a message in a Naumu thread you participate in. Use it 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". @mentioning people loops them in (mention notifications, prompts) without invoking @Naumu. For a human, the mention `id` is their User id (from naumu_list_members or naumu_get_thread participantDetails) or their email - both work; for a bot/agent, use its identity id. To attach files call naumu_request_attachment_upload first, PUT the bytes to the returned uploadUrl, then pass the resulting attachmentIds here. The message needs either `content` or `attachmentIds`. Returns the created message JSON. To get a synthesised answer from @Naumu, use naumu_ask.',
1094
+ description: 'Post a message in a Naumu thread you participate in. Use it to reply to humans (or other bots) in a thread that pinged you. Write `content` in markdown (the default format): **bold**, *italic*, `inline code`, fenced code blocks, `- ` bullets, `1. ` ordered lists, and `> ` quotes all render natively; headings and tables are not supported and render as plain text. Mentions are inline pills: `@[Name](id)` mentions a person or bot and `#[label](topic-id)` tags a topic. For a human the mention id is their User id (from naumu_list_members or naumu_get_thread participantDetails) or their email - both work; for a bot/agent use its identity id; `@[Naumu](naumu-ai)` addresses the @Naumu agent (a bare `@naumu` in prose also summons it, so only type it when you mean to). @mentioning people loops them in (mention notifications, prompts) without invoking @Naumu. Set contentFormat to "tiptap" only when you need rich content beyond the markdown subset, passing a Tiptap JSON document with mention nodes (`{ type: "mention", attrs: { id, label } }`). To attach files call naumu_request_attachment_upload first, PUT the bytes to the returned uploadUrl, then pass the resulting attachmentIds here. The message needs either `content` or `attachmentIds`. Returns the created message JSON. To get a synthesised answer from @Naumu, use naumu_ask.',
1095
1095
  inputSchema: z20.object({
1096
1096
  threadId: z20.string().describe("The thread ID to post into. You must be a participant in this thread."),
1097
- content: z20.string().optional().describe('Message body. Plain text by default; pass a Tiptap JSON document only if contentFormat is set to "tiptap". Optional when `attachmentIds` is provided.'),
1098
- contentFormat: z20.enum(["tiptap", "text"]).optional().describe('Format of `content`. Defaults to "text". Use "tiptap" for rendered mentions/embeds, e.g. a doc containing `{ type: "mention", attrs: { id: userIdOrEmailOrIdentityId, label: displayName } }` (a human mention id is their User id or email; a bot mention id is its identity id).'),
1097
+ content: z20.string().optional().describe('Message body. Markdown by default (see the tool description for the supported subset and the `@[Name](id)` mention pill syntax); a Tiptap JSON document when contentFormat is "tiptap". Optional when `attachmentIds` is provided.'),
1098
+ contentFormat: z20.enum(["tiptap", "markdown"]).optional().describe('Format of `content`. Defaults to "markdown" (rendered subset plus `@[Name](id)` / `#[label](topic-id)` mention pills). Use "tiptap" for full rich content, e.g. a doc containing `{ type: "mention", attrs: { id: userIdOrEmailOrIdentityId, label: displayName } }`.'),
1099
1099
  attachmentIds: z20.array(z20.string().min(1)).max(25).optional().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.")
1100
1100
  })
1101
1101
  },
1102
1102
  async ({ threadId, content, contentFormat, attachmentIds }) => {
1103
1103
  try {
1104
1104
  const body = {
1105
- contentFormat: contentFormat ?? "text"
1105
+ // 'markdown' is the announced name for the API's 'text' mode;
1106
+ // deployed backends may predate the alias, so translate on the wire.
1107
+ contentFormat: contentFormat === "tiptap" ? "tiptap" : "text"
1106
1108
  };
1107
1109
  if (content !== void 0) body.content = content;
1108
1110
  if (attachmentIds && attachmentIds.length > 0) body.attachmentIds = attachmentIds;
@@ -1160,21 +1162,18 @@ function registerReadThread(server2, client2) {
1160
1162
 
1161
1163
  // ../mcp-core/src/tools/whoami.ts
1162
1164
  import { z as z22 } from "zod";
1163
- function registerWhoami(server2, client2, allToolNames) {
1165
+ function registerWhoami(server2, client2) {
1164
1166
  server2.registerTool(
1165
1167
  "naumu_whoami",
1166
1168
  {
1167
1169
  title: "Who Am I",
1168
1170
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
1169
- description: 'Return who the calling key is plus the live MCP tool manifest, so you can bootstrap before the first real operation. A bot identity key returns its Identity row (id, graphId, name, instructions, allowedTools). A user API key returns `kind: "user"` with userId, name, and email - a person spans many graphs, so resolve a specific graph via naumu_list_graphs. No arguments. Always available regardless of the permission grid.',
1171
+ description: 'Return who the calling key is, so you can bootstrap before the first real operation. A bot identity key returns its Identity row (id, graphId, name, instructions, allowedTools) plus its curated MCP tool manifest. A user API key returns `kind: "user"` with userId, name, and email - a person spans many graphs, so resolve a specific graph via naumu_list_graphs. The live tool list is already available from tools/list, so it is not repeated here. No arguments. Always available regardless of the permission grid.',
1170
1172
  inputSchema: z22.object({})
1171
1173
  },
1172
1174
  async () => {
1173
1175
  try {
1174
1176
  const data = await client2.get("/api/identities/me/whoami");
1175
- if (allToolNames && data && typeof data === "object" && data.kind === "user") {
1176
- data.mcpTools = allToolNames;
1177
- }
1178
1177
  return {
1179
1178
  content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
1180
1179
  };
@@ -1288,8 +1287,106 @@ function registerListTopics(server2, client2) {
1288
1287
  );
1289
1288
  }
1290
1289
 
1291
- // ../mcp-core/src/tools/get-thread.ts
1290
+ // ../mcp-core/src/tools/create-topic.ts
1292
1291
  import { z as z25 } from "zod";
1292
+ var TOPIC_NAME_PATTERN = /^[a-z0-9-]+$/;
1293
+ var TOPIC_NAME_MAX_LENGTH = 50;
1294
+ var RESERVED_TOPIC_NAMES = [
1295
+ "all",
1296
+ "everyone",
1297
+ "naumu",
1298
+ "here",
1299
+ "misc",
1300
+ "hidden",
1301
+ "space",
1302
+ "shared-with-you"
1303
+ ];
1304
+ function validateTopicName(name) {
1305
+ const trimmed = name.trim();
1306
+ if (trimmed.length === 0) return "Topic name is required.";
1307
+ if (trimmed.length > TOPIC_NAME_MAX_LENGTH) {
1308
+ return `Topic name must be at most ${TOPIC_NAME_MAX_LENGTH} characters (got ${trimmed.length}).`;
1309
+ }
1310
+ if (!TOPIC_NAME_PATTERN.test(trimmed)) {
1311
+ return `Invalid topic name "${trimmed}". Only lowercase letters, numbers, and "-" are allowed (e.g. "core-team"). Replace spaces with hyphens and drop any other characters.`;
1312
+ }
1313
+ if (RESERVED_TOPIC_NAMES.includes(trimmed.toLowerCase())) {
1314
+ return `Topic name "${trimmed}" is reserved. Reserved names: ${RESERVED_TOPIC_NAMES.join(", ")}.`;
1315
+ }
1316
+ return null;
1317
+ }
1318
+ function registerCreateTopic(server2, client2) {
1319
+ server2.registerTool(
1320
+ "naumu_create_topic",
1321
+ {
1322
+ title: "Create Topic",
1323
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
1324
+ description: 'Create a new topic (filing destination) in a space; use when the topic a thread or note should be filed into does not exist yet. Check `naumu_list_topics` first so you reuse an existing topic instead of creating a near-duplicate. Returns the created topic `{id, name, color, visibilityMode, archived, openToWeb, webParticipation, createdAt, createdBy, memberIds, isMember}` - pass the returned `id` to the `topicIds` param of naumu_delegate, naumu_ask or naumu_create_note to file work into it. Name rules (validated before the call): lowercase letters, numbers and "-" only (channel-slug style, e.g. "core-team"), at most 50 characters, and never one of the reserved names all, everyone, naumu, here, misc, hidden, space, shared-with-you. Names are unique per space, case-insensitively. Requires admin rights on the space: editors and bot identities always get a 403, so do not attempt this on behalf of a bot. `visibilityMode` defaults to "open"; the caller is always added as a member, and `openToWeb` cannot be combined with a "closed" topic. Resolve `graphId` via naumu_list_graphs first.',
1325
+ inputSchema: z25.object({
1326
+ graphId: z25.string().describe("The space (graph) id to create the topic in."),
1327
+ name: z25.string().min(1).describe(
1328
+ 'Topic name in channel-slug form: lowercase letters, numbers and "-" only, max 50 chars, not a reserved name. Unique per space (case-insensitive).'
1329
+ ),
1330
+ color: z25.string().optional().describe("Optional named color token for the topic badge. Omit unless the user asked for a specific color."),
1331
+ visibilityMode: z25.enum(["default", "open", "closed"]).optional().describe(
1332
+ 'Who can see and join the topic. "open" (the default) lets any space member join, "default" is the space default, "closed" is invite-only.'
1333
+ ),
1334
+ openToWeb: z25.boolean().optional().describe('Expose the topic publicly on the web. Invalid together with visibilityMode "closed".'),
1335
+ webParticipation: z25.enum(["participate", "view-only"]).optional().describe('What public web visitors may do when openToWeb is true. Defaults to "view-only".'),
1336
+ memberIds: z25.array(z25.string()).optional().describe(
1337
+ "User ids to add as topic members (get them from naumu_list_members). Ids that are not current space members are silently dropped. The caller is always added regardless."
1338
+ )
1339
+ })
1340
+ },
1341
+ async ({ graphId, name, color, visibilityMode, openToWeb, webParticipation, memberIds }) => {
1342
+ const nameError = validateTopicName(name);
1343
+ if (nameError) {
1344
+ return {
1345
+ content: [
1346
+ {
1347
+ type: "text",
1348
+ text: `Topic name validation failed - no topic was created: ${nameError}`
1349
+ }
1350
+ ],
1351
+ isError: true
1352
+ };
1353
+ }
1354
+ if (openToWeb === true && visibilityMode === "closed") {
1355
+ return {
1356
+ content: [
1357
+ {
1358
+ type: "text",
1359
+ text: 'Topic validation failed - no topic was created: public web access is only available on open or default topics, so openToWeb cannot be true when visibilityMode is "closed".'
1360
+ }
1361
+ ],
1362
+ isError: true
1363
+ };
1364
+ }
1365
+ try {
1366
+ const data = await client2.post(`/api/graphs/${graphId}/topics`, {
1367
+ name: name.trim(),
1368
+ color,
1369
+ visibilityMode,
1370
+ openToWeb,
1371
+ webParticipation,
1372
+ memberIds
1373
+ });
1374
+ return {
1375
+ content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
1376
+ };
1377
+ } catch (err) {
1378
+ const message = err instanceof Error ? err.message : String(err);
1379
+ return {
1380
+ content: [{ type: "text", text: `Error: ${message}` }],
1381
+ isError: true
1382
+ };
1383
+ }
1384
+ }
1385
+ );
1386
+ }
1387
+
1388
+ // ../mcp-core/src/tools/get-thread.ts
1389
+ import { z as z26 } from "zod";
1293
1390
  function sanitizeThreadParticipants2(thread) {
1294
1391
  if (!thread || typeof thread !== "object" || !("participantEmails" in thread)) {
1295
1392
  return thread;
@@ -1304,8 +1401,8 @@ function registerGetThread(server2, client2) {
1304
1401
  title: "Get Thread",
1305
1402
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
1306
1403
  description: "Fetch a single thread, including the human participant roster (`participantDetails` \u2014 userId, name, image) and bot roster (`identityParticipants` \u2014 id, name, isSystem). Use this when `naumu_list_threads` surfaced a candidate and you want to know exactly who is in it before posting. Pair with `naumu_read_thread` for message history.",
1307
- inputSchema: z25.object({
1308
- threadId: z25.string().describe("The thread ID to fetch.")
1404
+ inputSchema: z26.object({
1405
+ threadId: z26.string().describe("The thread ID to fetch.")
1309
1406
  })
1310
1407
  },
1311
1408
  async ({ threadId }) => {
@@ -1327,7 +1424,7 @@ function registerGetThread(server2, client2) {
1327
1424
  }
1328
1425
 
1329
1426
  // ../mcp-core/src/tools/create-thread.ts
1330
- import { z as z26 } from "zod";
1427
+ import { z as z27 } from "zod";
1331
1428
  function registerCreateThread(server2, client2) {
1332
1429
  server2.registerTool(
1333
1430
  "naumu_create_thread",
@@ -1342,23 +1439,23 @@ function registerCreateThread(server2, client2) {
1342
1439
  openWorldHint: false
1343
1440
  },
1344
1441
  description: "Start a new conversation in a space. You are auto-attached as a participant, and the thread's formal creator is your primary owner (the user who registered you), so it shows in their sidebar. Optional `participants` adds humans (by userId) and other bots (by identityId) at creation. Optional `initialMessage` opens the conversation as your first message. Optional `topicIds` files the new thread into one or more topics (see naumu_list_topics for ids): it becomes visible to those topics' members from birth instead of staying a private thread between you and your owner. Filing is creation-only and only ever widens - it never removes the thread from a topic later. Tagging people loops them in without invoking @Naumu; only an explicit @Naumu mention, or naumu_ask, brings the agent in. Returns the created thread (including its id) so you can follow up with naumu_post_message.",
1345
- inputSchema: z26.object({
1346
- title: z26.string().min(1).max(200).optional().describe('Thread title shown in the sidebar. If omitted, Naumu generates a default like "Conversation YYYY-MM-DD".'),
1347
- participants: z26.array(
1348
- z26.discriminatedUnion("type", [
1349
- z26.object({
1350
- type: z26.literal("user"),
1351
- userId: z26.string().min(1).describe("User UUID \u2014 get these from `naumu_get_thread`/`naumu_read_thread` participant rosters or webhook payloads.")
1442
+ inputSchema: z27.object({
1443
+ title: z27.string().min(1).max(200).optional().describe('Thread title shown in the sidebar. If omitted, Naumu generates a default like "Conversation YYYY-MM-DD".'),
1444
+ participants: z27.array(
1445
+ z27.discriminatedUnion("type", [
1446
+ z27.object({
1447
+ type: z27.literal("user"),
1448
+ userId: z27.string().min(1).describe("User UUID \u2014 get these from `naumu_get_thread`/`naumu_read_thread` participant rosters or webhook payloads.")
1352
1449
  }),
1353
- z26.object({
1354
- type: z26.literal("identity"),
1355
- identityId: z26.string().min(1).describe("Identity id (`identity-\u2026` or `id-\u2026`). Other bots in the same graph can be co-attached to multi-bot threads.")
1450
+ z27.object({
1451
+ type: z27.literal("identity"),
1452
+ identityId: z27.string().min(1).describe("Identity id (`identity-\u2026` or `id-\u2026`). Other bots in the same graph can be co-attached to multi-bot threads.")
1356
1453
  })
1357
1454
  ])
1358
1455
  ).max(32).optional().describe("Up to 32 humans and/or other bots to attach at creation. Your primary owner is added automatically \u2014 you do NOT need to list them here."),
1359
- initialMessage: z26.string().min(1).max(32e3).optional().describe("Markdown body for the first message. Authored by you (the bot), so it appears in the thread under your name."),
1360
- visibility: z26.enum(["restricted", "internal", "open"]).optional().describe("`restricted` (invite-only, default) hides from non-participants. `internal` is visible to space members. `open` is visible to anyone who can see the space."),
1361
- topicIds: z26.array(z26.string()).max(8).optional().describe(
1456
+ initialMessage: z27.string().min(1).max(32e3).optional().describe("Markdown body for the first message. Authored by you (the bot), so it appears in the thread under your name."),
1457
+ visibility: z27.enum(["restricted", "internal", "open"]).optional().describe("`restricted` (invite-only, default) hides from non-participants. `internal` is visible to space members. `open` is visible to anyone who can see the space."),
1458
+ topicIds: z27.array(z27.string()).max(8).optional().describe(
1362
1459
  "Topic ids (from naumu_list_topics) to file the NEW thread into, making it visible to those topics' members from birth. Creation-only and only ever widens - it never removes the thread from a topic later. Omit to keep the default private thread between you and your owner."
1363
1460
  )
1364
1461
  })
@@ -1387,32 +1484,53 @@ function registerCreateThread(server2, client2) {
1387
1484
  }
1388
1485
 
1389
1486
  // ../mcp-core/src/tools/request-attachment-upload.ts
1390
- import { z as z27 } from "zod";
1487
+ import { z as z28 } from "zod";
1391
1488
  function registerRequestAttachmentUpload(server2, client2) {
1392
1489
  server2.registerTool(
1393
1490
  "naumu_request_attachment_upload",
1394
1491
  {
1395
1492
  title: "Request Attachment Upload",
1396
1493
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
1397
- description: 'Request a presigned S3 upload URL to attach a file to a message; use when you want to deliver generated content as a file (a markdown report, a PDF, an image, an audio recording, a video). Same flow Naumu users use for file uploads: get a signed URL, PUT the bytes to it directly, then call `naumu_post_message` with the returned `attachmentId` in `attachmentIds`. Per-MIME size caps apply (typically 50MB umbrella, 10MB for agent-readable types).\n\nReturns `{ attachmentId, uploadUrl, method, requiredHeaders, expiresAt }`. Use these EXACTLY:\n\u2022 `method` is "PUT".\n\u2022 Send every header in `requiredHeaders` (Content-Type matters for S3 signature validation).\n\u2022 Do NOT add an Authorization header - the URL itself is the auth.\n\u2022 Do NOT log `uploadUrl` - it is a bearer capability for the duration of the TTL.\n\u2022 `expiresAt` is a Unix-ms timestamp; the pending attachment vanishes at that moment whether or not you uploaded. Call `naumu_post_message` with the attachmentId before then or the upload orphans.\n\nServer-side checks at post time enforce that the attachment was uploaded by you, in this graph, for this thread - you cannot reuse an upload across threads.',
1398
- inputSchema: z27.object({
1399
- threadId: z27.string().describe("Thread the attachment will land in. You must be a participant. The pending attachment is keyed to this thread - you cannot reuse it for a different one."),
1400
- fileName: z27.string().min(1).describe("Original filename (with extension). Used as the display name in the message and for the S3 object suffix. Special characters are sanitized server-side."),
1401
- fileType: z27.string().min(1).describe("MIME type, e.g. `application/pdf`, `image/png`, `text/markdown`, `audio/mpeg`, `video/mp4`. The S3 PUT will enforce this Content-Type."),
1402
- fileSize: z27.number().int().positive().describe("File size in bytes. Validated against per-MIME caps before the URL is issued - exceeding the cap returns a 400."),
1403
- audioDurationSec: z27.number().positive().optional().describe("For audio attachments, duration in seconds. Validated against the audio recording cap (currently 8 hours).")
1404
- })
1494
+ description: "Request a presigned S3 upload URL to attach a file - pass exactly one of `threadId`, `noteId`, or `canvasId` for where the upload will land, then PUT the bytes directly to the returned URL. Same flow Naumu users use for file uploads. User API keys and OAuth sessions must also pass `graphId` (a user spans many spaces; resolve it via `naumu_list_graphs`); bot keys resolve it automatically.\n\nThree destinations, three follow-up calls:\n\u2022 Thread: presign with `threadId` \u2192 PUT the bytes \u2192 call `naumu_post_message` with the returned `attachmentId` in `attachmentIds`.\n\u2022 Note: presign with `noteId` \u2192 PUT the bytes \u2192 call `naumu_note_append` (or any note write tool) with `![alt](attachment://<attachmentId>)` in the markdown. That single call binds the upload, embeds it inline as the note's canonical media node, and files it into the space's Files & Media library - the same syntax works for images, video, audio, and other files, dispatched by the upload's MIME type.\n\u2022 Canvas: presign with `canvasId` \u2192 PUT the bytes \u2192 call `naumu_persist_canvas_attachment` to extend the upload past its default 1-hour TTL. Placing the persisted attachment onto the canvas itself still happens in the app UI.\n\nTo attach media to a graph node, upload into a thread that originated or modified that node - files surface on the node via its threads; there is no separate node-attachment flow.\n\nPer-MIME size caps apply: 10MB for types the agent reads whole (image, text, PDF, office docs), otherwise the space plan's umbrella cap (50MB free, 500MB team, 1GB max). Audio takes the plan cap, NOT the 10MB agent-read budget - it is transcribed on upload and only the transcript reaches an agent, so a multi-hour recording is a legitimate attachment. Over-cap requests are refused with HTTP 413 before any URL is minted, and the size is re-checked at bind time against the object that actually landed - so an oversized upload is refused there too, not silently accepted.\n\nReturns `{ attachmentId, uploadUrl, method, requiredHeaders, expiresAt }`. Use these EXACTLY:\n\u2022 `method` is \"PUT\".\n\u2022 Send every header in `requiredHeaders`. It carries BOTH `Content-Type` and `Content-Length`, and both are load-bearing: `Content-Length` is signed INTO the URL, so the body must be exactly that many bytes or S3 answers 403. PUT the whole file as one fixed-length body - do not stream it, do not use chunked transfer encoding, and do not send a different byte count than the `fileSize` you declared here.\n\u2022 Do NOT add an Authorization header - the URL itself is the auth.\n\u2022 Do NOT log `uploadUrl` - it is a bearer capability for the duration of the TTL.\n\u2022 `expiresAt` is a Unix-ms timestamp; the pending attachment vanishes at that moment whether or not you uploaded. Bind it (post the message, embed the note reference, or persist the canvas attachment) before then or the upload orphans.\n\nServer-side checks at bind time enforce that the attachment was uploaded by you, in this graph, for this thread/note/canvas - you cannot reuse an upload across destinations.",
1495
+ inputSchema: z28.object({
1496
+ graphId: z28.string().optional().describe("Graph (space) UUID the destination lives in. REQUIRED for user API keys and OAuth sessions - a user spans many spaces, so nothing can infer it; resolve it once via `naumu_list_graphs` and reuse it. Bot keys may omit it: a bot is pinned to one graph and the tool resolves it automatically."),
1497
+ threadId: z28.string().optional().describe("Destination thread - presign for a thread when the upload will be attached to a chat message via `naumu_post_message`'s `attachmentIds`. You must be a participant. Exactly one of `threadId`, `noteId`, or `canvasId` is required. The pending attachment is keyed to this thread - you cannot reuse it for a different one."),
1498
+ noteId: z28.string().optional().describe("Destination note (Thought) - presign for a note when the upload will be embedded via `![alt](attachment://<attachmentId>)` in a note write tool call. Exactly one of `threadId`, `noteId`, or `canvasId` is required. The pending attachment is keyed to this note - you cannot reuse it for a different one."),
1499
+ canvasId: z28.string().optional().describe("Destination canvas - presign for a canvas when the upload will be placed on a canvas; follow up with `naumu_persist_canvas_attachment` to extend its TTL. Exactly one of `threadId`, `noteId`, or `canvasId` is required. The pending attachment is keyed to this canvas - you cannot reuse it for a different one."),
1500
+ fileName: z28.string().min(1).describe("Original filename (with extension). Used as the display name and for the S3 object suffix. Special characters are sanitized server-side."),
1501
+ fileType: z28.string().min(1).describe("MIME type, e.g. `application/pdf`, `image/png`, `text/markdown`, `audio/mpeg`, `video/mp4`. The S3 PUT will enforce this Content-Type."),
1502
+ fileSize: z28.number().int().positive().describe("File size in bytes, exact. Validated against per-MIME caps before the URL is issued - exceeding the cap returns a 413 (not a 400; 400 means a different rejection). This number is also signed into the upload URL as `Content-Length`, so it is a commitment, not an estimate: PUT exactly this many bytes. Audio is validated against the plan umbrella cap (50MB free / 500MB team / 1GB max), not the 10MB agent-read budget."),
1503
+ audioDurationSec: z28.number().positive().optional().describe("For audio attachments, duration in seconds. Send it whenever you know it: audio carries an 8-hour ceiling on top of the size cap, and nothing measures the file server-side, so that ceiling is checked ONLY against a length you report. Omitting it skips the check rather than failing it - the size cap is what still binds you. Omit it rather than guessing: a wrong value is worse than none, and a deliberate under-report is a policy violation, not a workaround.")
1504
+ }).refine(
1505
+ (data) => [data.threadId, data.noteId, data.canvasId].filter((v) => v !== void 0).length === 1,
1506
+ { message: "Exactly one of threadId, noteId, or canvasId is required - pick the single destination this upload is for." }
1507
+ )
1405
1508
  },
1406
- async ({ threadId, fileName, fileType, fileSize, audioDurationSec }) => {
1509
+ async ({ graphId, threadId, noteId, canvasId, fileName, fileType, fileSize, audioDurationSec }) => {
1407
1510
  try {
1408
- const me = await client2.get("/api/identities/me/whoami");
1511
+ let resolvedGraphId = graphId;
1512
+ if (resolvedGraphId === void 0) {
1513
+ const me = await client2.get("/api/identities/me/whoami");
1514
+ resolvedGraphId = me.graphId;
1515
+ }
1516
+ if (resolvedGraphId === void 0) {
1517
+ return {
1518
+ content: [{
1519
+ type: "text",
1520
+ text: "Error: graphId is required for this session. Your key is a user key, which spans multiple spaces - call naumu_list_graphs, pick the target space, and pass its id as graphId."
1521
+ }],
1522
+ isError: true
1523
+ };
1524
+ }
1409
1525
  const body = {
1410
- graphId: me.graphId,
1411
- threadId,
1526
+ graphId: resolvedGraphId,
1412
1527
  fileName,
1413
1528
  fileType,
1414
1529
  fileSize
1415
1530
  };
1531
+ if (threadId !== void 0) body.threadId = threadId;
1532
+ if (noteId !== void 0) body.noteId = noteId;
1533
+ if (canvasId !== void 0) body.canvasId = canvasId;
1416
1534
  if (audioDurationSec !== void 0) body.audioDurationSec = audioDurationSec;
1417
1535
  const data = await client2.post("/api/attachments/presign", body);
1418
1536
  return {
@@ -1429,8 +1547,38 @@ function registerRequestAttachmentUpload(server2, client2) {
1429
1547
  );
1430
1548
  }
1431
1549
 
1550
+ // ../mcp-core/src/tools/persist-canvas-attachment.ts
1551
+ import { z as z29 } from "zod";
1552
+ function registerPersistCanvasAttachment(server2, client2) {
1553
+ server2.registerTool(
1554
+ "naumu_persist_canvas_attachment",
1555
+ {
1556
+ title: "Persist Canvas Attachment",
1557
+ annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
1558
+ description: "Extend a canvas-bound pending attachment's TTL from its default 1 hour to 30 days; call right after `naumu_request_attachment_upload` (with `canvasId` set) and the S3 PUT, so the upload survives long enough to be used. This only persists the upload - actually placing it onto the canvas still happens in the app UI, there is no MCP canvas-editing tool yet. Safe to call more than once for the same attachmentId.",
1559
+ inputSchema: z29.object({
1560
+ attachmentId: z29.string().min(1).describe("The `attachmentId` returned by `naumu_request_attachment_upload` for this canvas.")
1561
+ })
1562
+ },
1563
+ async ({ attachmentId }) => {
1564
+ try {
1565
+ const data = await client2.post(`/api/attachments/${attachmentId}/persist-canvas`);
1566
+ return {
1567
+ content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
1568
+ };
1569
+ } catch (err) {
1570
+ const message = err instanceof Error ? err.message : String(err);
1571
+ return {
1572
+ content: [{ type: "text", text: `Error: ${message}` }],
1573
+ isError: true
1574
+ };
1575
+ }
1576
+ }
1577
+ );
1578
+ }
1579
+
1432
1580
  // ../mcp-core/src/tools/add-reaction.ts
1433
- import { z as z28 } from "zod";
1581
+ import { z as z30 } from "zod";
1434
1582
  function registerAddReaction(server2, client2) {
1435
1583
  server2.registerTool(
1436
1584
  "naumu_add_reaction",
@@ -1438,10 +1586,10 @@ function registerAddReaction(server2, client2) {
1438
1586
  title: "Add Reaction",
1439
1587
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
1440
1588
  description: 'Add an emoji reaction to a message in a thread you are participating in; use for lightweight acknowledgement instead of posting a message. Idempotent - calling twice with the same emoji is a no-op (use `naumu_remove_reaction` to undo). Returns `{ ok, messageId, emoji, alreadyExisted, reactionCount, reactions }` so you can confirm the state without re-reading the thread; `alreadyExisted: true` means the reaction was already on the message and the call was a no-op.\n\nWhen to react vs. when to post a message:\n\u2022 React (no message) for lightweight acknowledgement (\u{1F440}, \u2705, \u{1F44D}), appreciation (\u2764\uFE0F, \u{1F64C}), laughter (\u{1F602}), or "I saw this".\n\u2022 Post a message for direct questions, clarification, important corrections, or final results - situations where words are required.\n\u2022 For long tasks: react \u{1F440} 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\u2022 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.',
1441
- inputSchema: z28.object({
1442
- threadId: z28.string().describe("Thread containing the message. You must be a participant."),
1443
- messageId: z28.string().describe("The message to react to."),
1444
- emoji: z28.string().min(1).describe('Emoji character (e.g. "\u{1F440}", "\u2705", "\u2764\uFE0F"). Custom-emoji shortcodes are NOT supported here - pass a real Unicode emoji.')
1589
+ inputSchema: z30.object({
1590
+ threadId: z30.string().describe("Thread containing the message. You must be a participant."),
1591
+ messageId: z30.string().describe("The message to react to."),
1592
+ emoji: z30.string().min(1).describe('Emoji character (e.g. "\u{1F440}", "\u2705", "\u2764\uFE0F"). Custom-emoji shortcodes are NOT supported here - pass a real Unicode emoji.')
1445
1593
  })
1446
1594
  },
1447
1595
  async ({ threadId, messageId, emoji }) => {
@@ -1465,7 +1613,7 @@ function registerAddReaction(server2, client2) {
1465
1613
  }
1466
1614
 
1467
1615
  // ../mcp-core/src/tools/remove-reaction.ts
1468
- import { z as z29 } from "zod";
1616
+ import { z as z31 } from "zod";
1469
1617
  function registerRemoveReaction(server2, client2) {
1470
1618
  server2.registerTool(
1471
1619
  "naumu_remove_reaction",
@@ -1473,10 +1621,10 @@ function registerRemoveReaction(server2, client2) {
1473
1621
  title: "Remove Reaction",
1474
1622
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
1475
1623
  description: "Remove your own emoji reaction from a message; use to walk back an acknowledgement you previously added. Idempotent - calling on a reaction you never added is a no-op. Pair with `naumu_add_reaction` (e.g. you reacted \u{1F440} to start a task and want to clear it after a final result message lands). Returns `{ ok, messageId, emoji, alreadyExisted, reactionCount, reactions }` - `alreadyExisted: false` means there was nothing to remove and the call was a no-op.",
1476
- inputSchema: z29.object({
1477
- threadId: z29.string().describe("Thread containing the message. You must be a participant."),
1478
- messageId: z29.string().describe("The message to remove your reaction from."),
1479
- emoji: z29.string().min(1).describe("Emoji character to remove (must match what you originally reacted with).")
1624
+ inputSchema: z31.object({
1625
+ threadId: z31.string().describe("Thread containing the message. You must be a participant."),
1626
+ messageId: z31.string().describe("The message to remove your reaction from."),
1627
+ emoji: z31.string().min(1).describe("Emoji character to remove (must match what you originally reacted with).")
1480
1628
  })
1481
1629
  },
1482
1630
  async ({ threadId, messageId, emoji }) => {
@@ -1500,7 +1648,7 @@ function registerRemoveReaction(server2, client2) {
1500
1648
  }
1501
1649
 
1502
1650
  // ../mcp-core/src/tools/naumu-typing.ts
1503
- import { z as z30 } from "zod";
1651
+ import { z as z32 } from "zod";
1504
1652
  function registerNaumuTyping(server2, client2) {
1505
1653
  server2.registerTool(
1506
1654
  "naumu_typing",
@@ -1511,9 +1659,9 @@ function registerNaumuTyping(server2, client2) {
1511
1659
  // repeating the same state is a no-op renew, so idempotent.
1512
1660
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
1513
1661
  description: 'Show or hide your "is typing\u2026" pill in a thread; use to signal that you are composing a reply. 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\u2022 you call this tool with `state: "stop"`\n\u2022 you call `naumu_post_message` for the same thread (cleared on commit)\n\u2022 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.',
1514
- inputSchema: z30.object({
1515
- threadId: z30.string().describe("The thread ID to set typing in. You must be a participant."),
1516
- state: z30.enum(["start", "stop"]).describe('"start" acquires/renews the lease; "stop" ends it and clears the pill immediately.')
1662
+ inputSchema: z32.object({
1663
+ threadId: z32.string().describe("The thread ID to set typing in. You must be a participant."),
1664
+ state: z32.enum(["start", "stop"]).describe('"start" acquires/renews the lease; "stop" ends it and clears the pill immediately.')
1517
1665
  })
1518
1666
  },
1519
1667
  async ({ threadId, state }) => {
@@ -1534,7 +1682,7 @@ function registerNaumuTyping(server2, client2) {
1534
1682
  }
1535
1683
 
1536
1684
  // ../mcp-core/src/tools/note-read.ts
1537
- import { z as z31 } from "zod";
1685
+ import { z as z33 } from "zod";
1538
1686
  function registerNoteRead(server2, client2) {
1539
1687
  server2.registerTool(
1540
1688
  "naumu_note_read",
@@ -1542,8 +1690,8 @@ function registerNoteRead(server2, client2) {
1542
1690
  title: "Read Note",
1543
1691
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
1544
1692
  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.",
1545
- inputSchema: z31.object({
1546
- noteId: z31.string().describe("The note (Thought) ID")
1693
+ inputSchema: z33.object({
1694
+ noteId: z33.string().describe("The note (Thought) ID")
1547
1695
  })
1548
1696
  },
1549
1697
  async ({ noteId }) => {
@@ -1556,17 +1704,17 @@ function registerNoteRead(server2, client2) {
1556
1704
  }
1557
1705
 
1558
1706
  // ../mcp-core/src/tools/note-append.ts
1559
- import { z as z32 } from "zod";
1707
+ import { z as z34 } from "zod";
1560
1708
  function registerNoteAppend(server2, client2) {
1561
1709
  server2.registerTool(
1562
1710
  "naumu_note_append",
1563
1711
  {
1564
1712
  title: "Append to Note",
1565
1713
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
1566
- description: "Append markdown blocks to the end of a note; use for additive note writing that never touches existing content. 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.",
1567
- inputSchema: z32.object({
1568
- noteId: z32.string().describe("The note (Thought) ID to append to"),
1569
- markdown: z32.string().min(1).describe("Markdown content to append at the end of the note")
1714
+ description: "Append markdown blocks to the end of a note; use for additive note writing that never touches existing content. 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. To embed media, write `![alt](attachment://<attachmentId>)` as a sole-line image - the id must come from `naumu_request_attachment_upload` presigned with this same `noteId`. The one syntax covers images, video, audio, and other files, dispatched by the upload's MIME type into the note's canonical media node; an unresolvable or wrong-note id fails the whole write with a 400 naming the bad id. An id already embedded in the note can be repeated safely without re-uploading.",
1715
+ inputSchema: z34.object({
1716
+ noteId: z34.string().describe("The note (Thought) ID to append to"),
1717
+ markdown: z34.string().min(1).describe("Markdown content to append at the end of the note")
1570
1718
  })
1571
1719
  },
1572
1720
  async ({ noteId, markdown }) => {
@@ -1579,18 +1727,18 @@ function registerNoteAppend(server2, client2) {
1579
1727
  }
1580
1728
 
1581
1729
  // ../mcp-core/src/tools/note-insert.ts
1582
- import { z as z33 } from "zod";
1730
+ import { z as z35 } from "zod";
1583
1731
  function registerNoteInsert(server2, client2) {
1584
1732
  server2.registerTool(
1585
1733
  "naumu_note_insert",
1586
1734
  {
1587
1735
  title: "Insert After Heading",
1588
1736
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
1589
- description: "Insert markdown content into a note immediately after a named section; use to add content under a specific heading without rewriting it. 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.",
1590
- inputSchema: z33.object({
1591
- noteId: z33.string().describe("The note (Thought) ID"),
1592
- headingText: z33.string().min(1).describe("Exact text of the heading whose section the new content follows"),
1593
- markdown: z33.string().min(1).describe("Markdown content to insert at the end of that section")
1737
+ description: "Insert markdown content into a note immediately after a named section; use to add content under a specific heading without rewriting it. 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. To embed media, write `![alt](attachment://<attachmentId>)` as a sole-line image - the id must come from `naumu_request_attachment_upload` presigned with this same `noteId`. The one syntax covers images, video, audio, and other files, dispatched by the upload's MIME type; an unresolvable or wrong-note id fails the whole write with a 400 naming the bad id.",
1738
+ inputSchema: z35.object({
1739
+ noteId: z35.string().describe("The note (Thought) ID"),
1740
+ headingText: z35.string().min(1).describe("Exact text of the heading whose section the new content follows"),
1741
+ markdown: z35.string().min(1).describe("Markdown content to insert at the end of that section")
1594
1742
  })
1595
1743
  },
1596
1744
  async ({ noteId, headingText, markdown }) => {
@@ -1606,19 +1754,19 @@ function registerNoteInsert(server2, client2) {
1606
1754
  }
1607
1755
 
1608
1756
  // ../mcp-core/src/tools/note-replace-section.ts
1609
- import { z as z34 } from "zod";
1757
+ import { z as z36 } from "zod";
1610
1758
  function registerNoteReplaceSection(server2, client2) {
1611
1759
  server2.registerTool(
1612
1760
  "naumu_note_replace_section",
1613
1761
  {
1614
1762
  title: "Replace Section",
1615
1763
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
1616
- description: "Replace the body under a named heading with new markdown; use to rewrite one section of a note while leaving the rest intact. By default the heading row itself is preserved (set `keepHeading: false` to drop it too). 404 if no heading matches.",
1617
- inputSchema: z34.object({
1618
- noteId: z34.string().describe("The note (Thought) ID"),
1619
- headingText: z34.string().min(1).describe("Exact text of the heading anchoring the section"),
1620
- markdown: z34.string().describe("Replacement markdown for the section body"),
1621
- keepHeading: z34.boolean().optional().describe("Whether to keep the heading row itself. Default true.")
1764
+ description: "Replace the body under a named heading with new markdown; use to rewrite one section of a note while leaving the rest intact. By default the heading row itself is preserved (set `keepHeading: false` to drop it too). 404 if no heading matches. To embed media, write `![alt](attachment://<attachmentId>)` as a sole-line image - the id must come from `naumu_request_attachment_upload` presigned with this same `noteId`. The one syntax covers images, video, audio, and other files, dispatched by the upload's MIME type; an unresolvable or wrong-note id fails the whole write with a 400 naming the bad id. An id already embedded elsewhere in the note can be repeated safely without re-uploading.",
1765
+ inputSchema: z36.object({
1766
+ noteId: z36.string().describe("The note (Thought) ID"),
1767
+ headingText: z36.string().min(1).describe("Exact text of the heading anchoring the section"),
1768
+ markdown: z36.string().describe("Replacement markdown for the section body"),
1769
+ keepHeading: z36.boolean().optional().describe("Whether to keep the heading row itself. Default true.")
1622
1770
  })
1623
1771
  },
1624
1772
  async ({ noteId, headingText, markdown, keepHeading }) => {
@@ -1635,7 +1783,7 @@ function registerNoteReplaceSection(server2, client2) {
1635
1783
  }
1636
1784
 
1637
1785
  // ../mcp-core/src/tools/note-delete-section.ts
1638
- import { z as z35 } from "zod";
1786
+ import { z as z37 } from "zod";
1639
1787
  function registerNoteDeleteSection(server2, client2) {
1640
1788
  server2.registerTool(
1641
1789
  "naumu_note_delete_section",
@@ -1643,9 +1791,9 @@ function registerNoteDeleteSection(server2, client2) {
1643
1791
  title: "Delete Section",
1644
1792
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
1645
1793
  description: "\u26A0 DESTRUCTIVE: remove a heading row plus its body (down to the next heading of equal-or-higher level); ONLY use when the user explicitly asks to drop a section. Anything inside that section is gone - there is no per-call undo. 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.",
1646
- inputSchema: z35.object({
1647
- noteId: z35.string().describe("The note (Thought) ID"),
1648
- headingText: z35.string().min(1).describe("Exact text of the heading whose section will be deleted")
1794
+ inputSchema: z37.object({
1795
+ noteId: z37.string().describe("The note (Thought) ID"),
1796
+ headingText: z37.string().min(1).describe("Exact text of the heading whose section will be deleted")
1649
1797
  })
1650
1798
  },
1651
1799
  async ({ noteId, headingText }) => {
@@ -1660,17 +1808,17 @@ function registerNoteDeleteSection(server2, client2) {
1660
1808
  }
1661
1809
 
1662
1810
  // ../mcp-core/src/tools/note-replace.ts
1663
- import { z as z36 } from "zod";
1811
+ import { z as z38 } from "zod";
1664
1812
  function registerNoteReplace(server2, client2) {
1665
1813
  server2.registerTool(
1666
1814
  "naumu_note_replace",
1667
1815
  {
1668
1816
  title: "Replace Note",
1669
1817
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
1670
- description: "\u26A0 DESTRUCTIVE: replace the entire note content with new markdown; ONLY use when the user explicitly asks to rewrite/replace the whole note. Any concurrent human edits made during the call are silently overwritten. 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.",
1671
- inputSchema: z36.object({
1672
- noteId: z36.string().describe("The note (Thought) ID"),
1673
- markdown: z36.string().describe("New markdown content for the entire note")
1818
+ description: "\u26A0 DESTRUCTIVE: replace the entire note content with new markdown; ONLY use when the user explicitly asks to rewrite/replace the whole note. Any concurrent human edits made during the call are silently overwritten. 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. To embed media, write `![alt](attachment://<attachmentId>)` as a sole-line image - the id must come from `naumu_request_attachment_upload` presigned with this same `noteId`. The one syntax covers images, video, audio, and other files, dispatched by the upload's MIME type; an unresolvable or wrong-note id fails the whole write with a 400 naming the bad id. Ids already embedded in the note (read them back via `naumu_note_read`) can be repeated safely without re-uploading.",
1819
+ inputSchema: z38.object({
1820
+ noteId: z38.string().describe("The note (Thought) ID"),
1821
+ markdown: z38.string().describe("New markdown content for the entire note")
1674
1822
  })
1675
1823
  },
1676
1824
  async ({ noteId, markdown }) => {
@@ -1683,19 +1831,19 @@ function registerNoteReplace(server2, client2) {
1683
1831
  }
1684
1832
 
1685
1833
  // ../mcp-core/src/tools/note-find-replace.ts
1686
- import { z as z37 } from "zod";
1834
+ import { z as z39 } from "zod";
1687
1835
  function registerNoteFindReplace(server2, client2) {
1688
1836
  server2.registerTool(
1689
1837
  "naumu_note_find_replace",
1690
1838
  {
1691
1839
  title: "Find/Replace in Note",
1692
1840
  annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false },
1693
- description: "Literal find/replace within a note's text content; use for mid-paragraph tweaks the section-based tools can't target. Marks (bold, italic, code, etc.) are preserved on the surrounding text. \u26A0 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.",
1694
- inputSchema: z37.object({
1695
- noteId: z37.string().describe("The note (Thought) ID"),
1696
- find: z37.string().min(1).describe("Substring to search for. Literal - no regex."),
1697
- replace: z37.string().describe("Replacement string. May be empty to delete the match."),
1698
- all: z37.boolean().optional().describe("Replace all occurrences (default true). Pass false to replace only the first.")
1841
+ description: "Literal find/replace within a note's text content; use for mid-paragraph tweaks the section-based tools can't target. Marks (bold, italic, code, etc.) are preserved on the surrounding text. \u26A0 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. `replace` can embed media by containing `![alt](attachment://<attachmentId>)` as a sole-line image - the id must come from `naumu_request_attachment_upload` presigned with this same `noteId`; an unresolvable or wrong-note id fails the whole write with a 400 naming the bad id.",
1842
+ inputSchema: z39.object({
1843
+ noteId: z39.string().describe("The note (Thought) ID"),
1844
+ find: z39.string().min(1).describe("Substring to search for. Literal - no regex."),
1845
+ replace: z39.string().describe("Replacement string. May be empty to delete the match."),
1846
+ all: z39.boolean().optional().describe("Replace all occurrences (default true). Pass false to replace only the first.")
1699
1847
  })
1700
1848
  },
1701
1849
  async ({ noteId, find, replace, all }) => {
@@ -1712,7 +1860,7 @@ function registerNoteFindReplace(server2, client2) {
1712
1860
  }
1713
1861
 
1714
1862
  // ../mcp-core/src/tools/create-note.ts
1715
- import { z as z38 } from "zod";
1863
+ import { z as z40 } from "zod";
1716
1864
  function registerCreateNote(server2, client2) {
1717
1865
  server2.registerTool(
1718
1866
  "naumu_create_note",
@@ -1720,11 +1868,11 @@ function registerCreateNote(server2, client2) {
1720
1868
  title: "Create Note",
1721
1869
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false },
1722
1870
  description: "Create a new empty note in a graph; use when you need a fresh note to write into. Returns the new note row including its `id` - pass that id to `naumu_note_append` / `naumu_note_replace` to fill in the content. Bots can only create notes in their own graph, and a bot-created note is private (participants only) unless `sharedWithSpace` is set true. Bots cannot file notes into topics \u2014 a bot passing `topicIds` is rejected (bots hold no topic membership); use `sharedWithSpace` instead.",
1723
- inputSchema: z38.object({
1724
- graphId: z38.string().describe("The graph ID to create the note in"),
1725
- title: z38.string().optional().describe("Optional title for the note"),
1726
- sharedWithSpace: z38.boolean().optional().describe("Share the note with everyone in the space. Omit (or false) to keep it private to its participants."),
1727
- topicIds: z38.array(z38.string()).max(8).optional().describe("File the note into these topics (get ids from naumu_list_topics), making it visible to those topics' members. Not available to bots.")
1871
+ inputSchema: z40.object({
1872
+ graphId: z40.string().describe("The graph ID to create the note in"),
1873
+ title: z40.string().optional().describe("Optional title for the note"),
1874
+ sharedWithSpace: z40.boolean().optional().describe("Share the note with everyone in the space. Omit (or false) to keep it private to its participants."),
1875
+ topicIds: z40.array(z40.string()).max(8).optional().describe("File the note into these topics (get ids from naumu_list_topics), making it visible to those topics' members. Not available to bots.")
1728
1876
  })
1729
1877
  },
1730
1878
  async ({ graphId, title, sharedWithSpace, topicIds }) => {
@@ -1737,7 +1885,7 @@ function registerCreateNote(server2, client2) {
1737
1885
  }
1738
1886
 
1739
1887
  // ../mcp-core/src/tools/list-schema-violations.ts
1740
- import { z as z39 } from "zod";
1888
+ import { z as z41 } from "zod";
1741
1889
  var DEFAULT_EXAMPLE_LIMIT = 5;
1742
1890
  var rowsForKind = (violations, kind) => {
1743
1891
  const rows = [];
@@ -1763,12 +1911,12 @@ function registerListSchemaViolations(server2, client2) {
1763
1911
  title: "List Schema Violations",
1764
1912
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
1765
1913
  description: "Audit a graph against its schema. By default returns a compact summary: total counts plus, for each violation kind, its count and up to 5 example nodes (id/label/type/message) \u2014 small enough not to flood the client. Violation kinds: parent_missing (schema expects a parent edge that does not exist), parent_multiple (more than one parent edge where one is expected), parent_mismatch (parent edge has wrong target type or relation label), parent_not_backbone (an edge uses a backbone/parent relation but is not stored as a backbone edge, so the subtree stays off the hierarchy), unknown_relation (edge uses a relation not in the schema), invalid_connection_target (edge connects to a type the schema does not allow for this source), unknown_type (node carries a type no longer in the schema), disconnected (node heads a group with no backbone path to the main tree). To see every node for one kind, pass `kind` to filter; `limit` caps how many rows are returned (examples in the default summary, or full rows when `kind` is set). Use for audits, import-verification, and CI-style checks after batch writes.",
1766
- inputSchema: z39.object({
1767
- graphId: z39.string().describe("The graph ID"),
1768
- kind: z39.string().optional().describe(
1914
+ inputSchema: z41.object({
1915
+ graphId: z41.string().describe("The graph ID"),
1916
+ kind: z41.string().optional().describe(
1769
1917
  'Drill into one violation kind (e.g. "parent_not_backbone"). Returns the full list of nodes with that kind, up to `limit`, instead of the summary.'
1770
1918
  ),
1771
- limit: z39.number().int().min(1).optional().describe(
1919
+ limit: z41.number().int().min(1).optional().describe(
1772
1920
  "Max rows to return. When `kind` is set, caps the full drill-down list (default: all). Otherwise caps example nodes per kind in the summary (default: 5)."
1773
1921
  )
1774
1922
  })
@@ -1820,7 +1968,7 @@ function registerListSchemaViolations(server2, client2) {
1820
1968
  }
1821
1969
 
1822
1970
  // ../mcp-core/src/tools/list-dense-nodes.ts
1823
- import { z as z40 } from "zod";
1971
+ import { z as z42 } from "zod";
1824
1972
  function registerListDenseNodes(server2, client2) {
1825
1973
  server2.registerTool(
1826
1974
  "naumu_list_dense_nodes",
@@ -1828,10 +1976,10 @@ function registerListDenseNodes(server2, client2) {
1828
1976
  title: "List Dense Nodes",
1829
1977
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
1830
1978
  description: 'Return nodes whose child count (children via parent edges; mesh cross-links don\'t count) is \u2265 minConnections, grouped by type; use for /restructure hub detection. Each row includes `same_typed_child_count` - the number of children of the SAME type as the node (the Naumu hub-pattern signal) and `connection_count` - its total children. Sort the response by `same_typed_child_count` descending and route any node with \u226510 same-typed children through a mini-hub split. Pass `nodeTypes` (comma-separated) to restrict to a subset (e.g. ["Type A","Type B"]). Cheap to call - runs a single Cypher aggregation.',
1831
- inputSchema: z40.object({
1832
- graphId: z40.string().describe("The graph ID"),
1833
- minConnections: z40.number().int().min(1).describe("Minimum number of children (parent edges; mesh cross-links excluded). Typical: 10 for hub detection, 11 to count only hubs that exceed the round-4 \u226410 threshold."),
1834
- nodeTypes: z40.array(z40.string()).optional().describe("Optional list of node types to restrict the scan to.")
1979
+ inputSchema: z42.object({
1980
+ graphId: z42.string().describe("The graph ID"),
1981
+ minConnections: z42.number().int().min(1).describe("Minimum number of children (parent edges; mesh cross-links excluded). Typical: 10 for hub detection, 11 to count only hubs that exceed the round-4 \u226410 threshold."),
1982
+ nodeTypes: z42.array(z42.string()).optional().describe("Optional list of node types to restrict the scan to.")
1835
1983
  })
1836
1984
  },
1837
1985
  async ({ graphId, minConnections, nodeTypes }) => {
@@ -1849,7 +1997,7 @@ function registerListDenseNodes(server2, client2) {
1849
1997
  }
1850
1998
 
1851
1999
  // ../mcp-core/src/tools/list-node-connections.ts
1852
- import { z as z41 } from "zod";
2000
+ import { z as z43 } from "zod";
1853
2001
  function registerListNodeConnections(server2, client2) {
1854
2002
  server2.registerTool(
1855
2003
  "naumu_list_node_connections",
@@ -1857,11 +2005,11 @@ function registerListNodeConnections(server2, client2) {
1857
2005
  title: "List Node Connections",
1858
2006
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
1859
2007
  description: 'Return a single node\'s edges (non-system) with the connected node on the other side; use during /restructure to confirm mini-hub candidates and verify reparenting outcomes. Filter with `edgeType` (relation label) and `direction` ("in" | "out" | "both", default both). Response: `{ node: {id,label,type}, edges: [{relation, direction, isParent, other: {id,label,type}}] }`.',
1860
- inputSchema: z41.object({
1861
- graphId: z41.string().describe("The graph ID"),
1862
- nodeId: z41.string().describe("The node ID to inspect"),
1863
- edgeType: z41.string().optional().describe('Restrict to a specific relation label (e.g. "ASSOCIATED_WITH"). Case-insensitive; non-alphanum chars are normalized.'),
1864
- direction: z41.enum(["in", "out", "both"]).optional().describe('Edge direction filter - "in" (incoming), "out" (outgoing), "both" (default).')
2008
+ inputSchema: z43.object({
2009
+ graphId: z43.string().describe("The graph ID"),
2010
+ nodeId: z43.string().describe("The node ID to inspect"),
2011
+ edgeType: z43.string().optional().describe('Restrict to a specific relation label (e.g. "ASSOCIATED_WITH"). Case-insensitive; non-alphanum chars are normalized.'),
2012
+ direction: z43.enum(["in", "out", "both"]).optional().describe('Edge direction filter - "in" (incoming), "out" (outgoing), "both" (default).')
1865
2013
  })
1866
2014
  },
1867
2015
  async ({ graphId, nodeId, edgeType, direction }) => {
@@ -1879,7 +2027,7 @@ function registerListNodeConnections(server2, client2) {
1879
2027
  }
1880
2028
 
1881
2029
  // ../mcp-core/src/tools/reparent.ts
1882
- import { z as z42 } from "zod";
2030
+ import { z as z44 } from "zod";
1883
2031
  function registerReparent(server2, client2) {
1884
2032
  server2.registerTool(
1885
2033
  "naumu_reparent",
@@ -1887,11 +2035,11 @@ function registerReparent(server2, client2) {
1887
2035
  title: "Reparent Node",
1888
2036
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
1889
2037
  description: 'Atomically swap a node\'s parent edge; use to move a child under a different parent (e.g. during /restructure to reparent children under newly-created mini-hubs). Deletes any existing `isParent: true` edges on the node and creates a new one to `newParentId` with relation `newRelation`. Preserves the node\'s id, content, attributes, and embedding - does NOT trigger embedding regeneration because only the parent edge changes. Idempotent: if the node already has the requested parent edge, response is `status: "skipped"`. Response shape: `{nodeId, oldParentId, newParentId, newRelation, status: "moved" | "skipped"}`.',
1890
- inputSchema: z42.object({
1891
- graphId: z42.string().describe("The graph ID"),
1892
- nodeId: z42.string().describe("The child node to reparent"),
1893
- newParentId: z42.string().describe("The new parent node id"),
1894
- newRelation: z42.string().describe('The new parent edge relation label (e.g. "PART_OF"). Must be valid per the schema for (child.type, relation, parent.type).')
2038
+ inputSchema: z44.object({
2039
+ graphId: z44.string().describe("The graph ID"),
2040
+ nodeId: z44.string().describe("The child node to reparent"),
2041
+ newParentId: z44.string().describe("The new parent node id"),
2042
+ newRelation: z44.string().describe('The new parent edge relation label (e.g. "PART_OF"). Must be valid per the schema for (child.type, relation, parent.type).')
1895
2043
  })
1896
2044
  },
1897
2045
  async ({ graphId, nodeId, newParentId, newRelation }) => {
@@ -1907,7 +2055,7 @@ function registerReparent(server2, client2) {
1907
2055
  }
1908
2056
 
1909
2057
  // ../mcp-core/src/tools/batch-reparent.ts
1910
- import { z as z43 } from "zod";
2058
+ import { z as z45 } from "zod";
1911
2059
  function registerBatchReparent(server2, client2) {
1912
2060
  server2.registerTool(
1913
2061
  "naumu_batch_reparent",
@@ -1915,11 +2063,11 @@ function registerBatchReparent(server2, client2) {
1915
2063
  title: "Batch Reparent Nodes",
1916
2064
  annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
1917
2065
  description: 'Reparent 1-25 nodes onto a shared `newParentId` with the same `newRelation`; use to move a same-typed cluster under a freshly-created mini-hub in /restructure. Same semantics as `naumu_reparent` per-node: atomic swap of the isParent edge, preserves id/content/attributes/embedding, no re-embedding. Idempotent per node (already-parented nodes return `status: "skipped"`). Per-node response array: `[{nodeId, oldParentId, newParentId, status: "moved" | "skipped" | "error", error?}]`.',
1918
- inputSchema: z43.object({
1919
- graphId: z43.string().describe("The graph ID"),
1920
- newParentId: z43.string().describe("Parent node id every nodeId in the batch will be parented to"),
1921
- newRelation: z43.string().describe("Parent edge relation label (must be valid per schema for child.type \u2192 parent.type)"),
1922
- nodeIds: z43.array(z43.string()).min(1).max(25).describe("1\u201325 child node ids to reparent under `newParentId`")
2066
+ inputSchema: z45.object({
2067
+ graphId: z45.string().describe("The graph ID"),
2068
+ newParentId: z45.string().describe("Parent node id every nodeId in the batch will be parented to"),
2069
+ newRelation: z45.string().describe("Parent edge relation label (must be valid per schema for child.type \u2192 parent.type)"),
2070
+ nodeIds: z45.array(z45.string()).min(1).max(25).describe("1\u201325 child node ids to reparent under `newParentId`")
1923
2071
  })
1924
2072
  },
1925
2073
  async ({ graphId, newParentId, newRelation, nodeIds }) => {
@@ -1936,7 +2084,7 @@ function registerBatchReparent(server2, client2) {
1936
2084
  }
1937
2085
 
1938
2086
  // ../mcp-core/src/tools/chatgpt-search.ts
1939
- import { z as z44 } from "zod";
2087
+ import { z as z46 } from "zod";
1940
2088
 
1941
2089
  // ../mcp-core/src/public-origin.ts
1942
2090
  function publicOrigin() {
@@ -1990,8 +2138,10 @@ function registerChatgptSearch(server2, client2) {
1990
2138
  title: "Search",
1991
2139
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
1992
2140
  description: "Search across all of the knowledge graphs (spaces) you can access and return the most relevant nodes. Returns `{ results: [{ id, title, url }] }`. Pass each result `id` to the `fetch` tool to read the full node. (This is the cross-space entry point for ChatGPT/Deep Research; within a single space, `naumu_search` exposes more controls.)",
1993
- inputSchema: z44.object({
1994
- query: z44.string().describe('Search query text. Mix synonyms and exact tokens freely (e.g. "auth login SSO 2fa").')
2141
+ inputSchema: z46.object({
2142
+ query: z46.string().describe(
2143
+ "A short contiguous phrase \u2014 an entity name, label, or ID. The text half matches it verbatim as a case-insensitive substring; the semantic half matches meaning."
2144
+ )
1995
2145
  })
1996
2146
  },
1997
2147
  async ({ query }) => {
@@ -2023,7 +2173,7 @@ function registerChatgptSearch(server2, client2) {
2023
2173
  }
2024
2174
 
2025
2175
  // ../mcp-core/src/tools/chatgpt-fetch.ts
2026
- import { z as z45 } from "zod";
2176
+ import { z as z47 } from "zod";
2027
2177
  var NON_ATTRIBUTE_PROPS = /* @__PURE__ */ new Set([
2028
2178
  "id",
2029
2179
  "label",
@@ -2088,8 +2238,8 @@ function registerChatgptFetch(server2, client2) {
2088
2238
  title: "Fetch",
2089
2239
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
2090
2240
  description: "Fetch the full contents of a node returned by the `search` tool. Pass the result `id` verbatim (format `<graphId>:<nodeId>`). Returns `{ id, title, text, url }` where `text` is the node content plus its type, attributes, and connections.",
2091
- inputSchema: z45.object({
2092
- id: z45.string().describe("A resource id from a previous `search` result, in the form `<graphId>:<nodeId>`.")
2241
+ inputSchema: z47.object({
2242
+ id: z47.string().describe("A resource id from a previous `search` result, in the form `<graphId>:<nodeId>`.")
2093
2243
  })
2094
2244
  },
2095
2245
  async ({ id }) => {
@@ -2132,7 +2282,7 @@ function registerChatgptFetch(server2, client2) {
2132
2282
  }
2133
2283
 
2134
2284
  // ../mcp-core/src/tools/admission-status.ts
2135
- import { z as z46 } from "zod";
2285
+ import { z as z48 } from "zod";
2136
2286
  function registerAdmissionStatus(server2, client2) {
2137
2287
  server2.registerTool(
2138
2288
  "naumu_admission_status",
@@ -2140,8 +2290,8 @@ function registerAdmissionStatus(server2, client2) {
2140
2290
  title: "Admission Status",
2141
2291
  annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
2142
2292
  description: "Show who can auto-join a Naumu space (graph) and who is waiting for approval: the whitelisted emails (people who join the moment they sign in with that email), the auto-join domain wildcards, and the count of pending join requests. When there are pending requests, this also returns the full list (who requested, their email, git-email hint, and message) so you can act on them with naumu_resolve_join_request. Use it during repo init to review or seed access, or whenever the user asks who has access to a space or who is asking to join.",
2143
- inputSchema: z46.object({
2144
- graphId: z46.string().describe("The space (graph) ID to inspect admission for. You must be a member of this space.")
2293
+ inputSchema: z48.object({
2294
+ graphId: z48.string().describe("The space (graph) ID to inspect admission for. You must be a member of this space.")
2145
2295
  })
2146
2296
  },
2147
2297
  async ({ graphId }) => {
@@ -2171,7 +2321,7 @@ function registerAdmissionStatus(server2, client2) {
2171
2321
  }
2172
2322
 
2173
2323
  // ../mcp-core/src/tools/whitelist-members.ts
2174
- import { z as z47 } from "zod";
2324
+ import { z as z49 } from "zod";
2175
2325
  function registerWhitelistMembers(server2, client2) {
2176
2326
  server2.registerTool(
2177
2327
  "naumu_whitelist_members",
@@ -2184,10 +2334,10 @@ function registerWhitelistMembers(server2, client2) {
2184
2334
  openWorldHint: false
2185
2335
  },
2186
2336
  description: "Whitelist emails so those people auto-join a Naumu space (graph) the moment they sign in with that email. Use this during repo init: after you scrub git history, present the curated list of collaborators to the user, and get their explicit confirmation, call this with the confirmed emails. It is silent - it sends no invite emails, it just pre-authorizes those addresses. Returns which entries were created and which were skipped (already whitelisted or already members). Set repoInit true when this call is part of the repo init flow.",
2187
- inputSchema: z47.object({
2188
- graphId: z47.string().describe("The space (graph) ID to whitelist emails for. You must be a member of this space."),
2189
- emails: z47.array(z47.string()).min(1).describe("The emails to whitelist. Each becomes an exact-match auto-join entry. Present these to the user and get confirmation before calling."),
2190
- repoInit: z47.boolean().optional().describe("Set true when this whitelist is being seeded as part of the repo init flow, so onboarding is tracked correctly.")
2337
+ inputSchema: z49.object({
2338
+ graphId: z49.string().describe("The space (graph) ID to whitelist emails for. You must be a member of this space."),
2339
+ emails: z49.array(z49.string()).min(1).describe("The emails to whitelist. Each becomes an exact-match auto-join entry. Present these to the user and get confirmation before calling."),
2340
+ repoInit: z49.boolean().optional().describe("Set true when this whitelist is being seeded as part of the repo init flow, so onboarding is tracked correctly.")
2191
2341
  })
2192
2342
  },
2193
2343
  async ({ graphId, emails, repoInit }) => {
@@ -2211,7 +2361,7 @@ function registerWhitelistMembers(server2, client2) {
2211
2361
  }
2212
2362
 
2213
2363
  // ../mcp-core/src/tools/resolve-admission.ts
2214
- import { z as z48 } from "zod";
2364
+ import { z as z50 } from "zod";
2215
2365
  function registerResolveAdmission(server2, client2) {
2216
2366
  server2.registerTool(
2217
2367
  "naumu_resolve_admission",
@@ -2224,9 +2374,9 @@ function registerResolveAdmission(server2, client2) {
2224
2374
  openWorldHint: false
2225
2375
  },
2226
2376
  description: "The call a coding agent makes right after connecting when a repo's .naumu references a space the user is not yet a member of. It evaluates whether the user can join and does it: outcome is joined-whitelist or joined-wildcard (the user is now a member - proceed), already-member (nothing to do), request-created (a join request was just filed and is awaiting a member's approval), or request-pending (a request was already open). When the response also carries reason 'seat-limit' on a request-created/request-pending outcome, the user WOULD have auto-joined via a whitelist/domain match but the space is at its seat limit - so their access is pending an admin approving them or upgrading the plan; relay that specific reason honestly, do not just say 'no match'. Pass gitEmailHint from `git config user.email` so a matching whitelist or domain rule can admit them. Relay the outcome to the user honestly: say plainly whether they joined or are waiting for approval - never imply access that is still pending.",
2227
- inputSchema: z48.object({
2228
- graphId: z48.string().describe("The space (graph) ID referenced by the repo .naumu file that the user wants to join."),
2229
- gitEmailHint: z48.string().optional().describe("The email from `git config user.email`, used to match whitelist entries and auto-join domains.")
2377
+ inputSchema: z50.object({
2378
+ graphId: z50.string().describe("The space (graph) ID referenced by the repo .naumu file that the user wants to join."),
2379
+ gitEmailHint: z50.string().optional().describe("The email from `git config user.email`, used to match whitelist entries and auto-join domains.")
2230
2380
  })
2231
2381
  },
2232
2382
  async ({ graphId, gitEmailHint }) => {
@@ -2250,7 +2400,7 @@ function registerResolveAdmission(server2, client2) {
2250
2400
  }
2251
2401
 
2252
2402
  // ../mcp-core/src/tools/resolve-join-request.ts
2253
- import { z as z49 } from "zod";
2403
+ import { z as z51 } from "zod";
2254
2404
  function registerResolveJoinRequest(server2, client2) {
2255
2405
  server2.registerTool(
2256
2406
  "naumu_resolve_join_request",
@@ -2263,10 +2413,10 @@ function registerResolveJoinRequest(server2, client2) {
2263
2413
  openWorldHint: false
2264
2414
  },
2265
2415
  description: "For a member resolving a pending join request surfaced by naumu_admission_status. Approve to add the requester to the space as a member, or deny to reject the request. Get the requestId from naumu_admission_status's pending list, and confirm the decision with the user before calling since approving grants access.",
2266
- inputSchema: z49.object({
2267
- graphId: z49.string().describe("The space (graph) ID the request is for. You must be a member of this space."),
2268
- requestId: z49.string().describe("The pending join request ID, taken from naumu_admission_status."),
2269
- action: z49.enum(["approve", "deny"]).describe("approve adds the requester as a member; deny rejects the request.")
2416
+ inputSchema: z51.object({
2417
+ graphId: z51.string().describe("The space (graph) ID the request is for. You must be a member of this space."),
2418
+ requestId: z51.string().describe("The pending join request ID, taken from naumu_admission_status."),
2419
+ action: z51.enum(["approve", "deny"]).describe("approve adds the requester as a member; deny rejects the request.")
2270
2420
  })
2271
2421
  },
2272
2422
  async ({ graphId, requestId, action }) => {
@@ -2316,9 +2466,16 @@ var TOOL_REGISTRARS = {
2316
2466
  naumu_whoami: registerWhoami,
2317
2467
  naumu_list_threads: registerListThreads,
2318
2468
  naumu_list_topics: registerListTopics,
2469
+ // User-surface only. `POST /api/graphs/:id/topics` requires the ADMIN-only
2470
+ // `space:manage-topics` permission, and bot identities always resolve to the
2471
+ // editor role, so a bot calling this could only ever 403. It is therefore
2472
+ // omitted from BOT_ONLY_TOOL_NAMES and has no entry in the backend
2473
+ // PERMISSION_TO_MCP_TOOLS map (same treatment as the admission tools below).
2474
+ naumu_create_topic: registerCreateTopic,
2319
2475
  naumu_get_thread: registerGetThread,
2320
2476
  naumu_create_thread: registerCreateThread,
2321
2477
  naumu_request_attachment_upload: registerRequestAttachmentUpload,
2478
+ naumu_persist_canvas_attachment: registerPersistCanvasAttachment,
2322
2479
  naumu_add_reaction: registerAddReaction,
2323
2480
  naumu_remove_reaction: registerRemoveReaction,
2324
2481
  naumu_typing: registerNaumuTyping,
@@ -2356,11 +2513,7 @@ var ALL_TOOL_NAMES = Object.keys(TOOL_REGISTRARS).filter(
2356
2513
  function registerAllTools(server2, client2) {
2357
2514
  for (const [name, registrar] of Object.entries(TOOL_REGISTRARS)) {
2358
2515
  if (BOT_ONLY_TOOL_NAMES.has(name)) continue;
2359
- if (name === "naumu_whoami") {
2360
- registerWhoami(server2, client2, ALL_TOOL_NAMES);
2361
- } else {
2362
- registrar(server2, client2);
2363
- }
2516
+ registrar(server2, client2);
2364
2517
  }
2365
2518
  }
2366
2519
  function registerNamedTools(server2, client2, toolNames) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naumu/mcp",
3
- "version": "0.8.0",
3
+ "version": "0.10.0",
4
4
  "description": "MCP server for Naumu – access your knowledge graph from Claude Code, Cursor, and other AI coding agents",
5
5
  "license": "MIT",
6
6
  "author": "Naumu <hello@naumu.ai>",