kontexta 4.7.0 → 4.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/bundle/standalone/CHANGELOG.md +15 -0
  2. package/bundle/standalone/apps/web/.next/BUILD_ID +1 -1
  3. package/bundle/standalone/apps/web/.next/app-build-manifest.json +51 -51
  4. package/bundle/standalone/apps/web/.next/app-path-routes-manifest.json +12 -12
  5. package/bundle/standalone/apps/web/.next/build-manifest.json +2 -2
  6. package/bundle/standalone/apps/web/.next/prerender-manifest.json +13 -13
  7. package/bundle/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/bundle/standalone/apps/web/.next/server/app/_not-found.html +1 -1
  9. package/bundle/standalone/apps/web/.next/server/app/_not-found.rsc +1 -1
  10. package/bundle/standalone/apps/web/.next/server/app/api/about/route_client-reference-manifest.js +1 -1
  11. package/bundle/standalone/apps/web/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
  12. package/bundle/standalone/apps/web/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
  13. package/bundle/standalone/apps/web/.next/server/app/api/auth/setup/route_client-reference-manifest.js +1 -1
  14. package/bundle/standalone/apps/web/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  15. package/bundle/standalone/apps/web/.next/server/app/api/auth/token/route_client-reference-manifest.js +1 -1
  16. package/bundle/standalone/apps/web/.next/server/app/api/calendar/conflicts/route_client-reference-manifest.js +1 -1
  17. package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/[id]/route_client-reference-manifest.js +1 -1
  18. package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/route_client-reference-manifest.js +1 -1
  19. package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/[id]/route_client-reference-manifest.js +1 -1
  20. package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/route_client-reference-manifest.js +1 -1
  21. package/bundle/standalone/apps/web/.next/server/app/api/calendar/ics/route_client-reference-manifest.js +1 -1
  22. package/bundle/standalone/apps/web/.next/server/app/api/calendar/links/route_client-reference-manifest.js +1 -1
  23. package/bundle/standalone/apps/web/.next/server/app/api/calendar/settings/route_client-reference-manifest.js +1 -1
  24. package/bundle/standalone/apps/web/.next/server/app/api/clip/route_client-reference-manifest.js +1 -1
  25. package/bundle/standalone/apps/web/.next/server/app/api/docker-config/route_client-reference-manifest.js +1 -1
  26. package/bundle/standalone/apps/web/.next/server/app/api/export/zip/route_client-reference-manifest.js +1 -1
  27. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/backlinks/route_client-reference-manifest.js +1 -1
  28. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/download/route_client-reference-manifest.js +1 -1
  29. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-html/route_client-reference-manifest.js +1 -1
  30. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-pdf/route_client-reference-manifest.js +1 -1
  31. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/restore/route_client-reference-manifest.js +1 -1
  32. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/route_client-reference-manifest.js +1 -1
  33. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/move/route_client-reference-manifest.js +1 -1
  34. package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/route_client-reference-manifest.js +1 -1
  35. package/bundle/standalone/apps/web/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
  36. package/bundle/standalone/apps/web/.next/server/app/api/files/upload/route_client-reference-manifest.js +1 -1
  37. package/bundle/standalone/apps/web/.next/server/app/api/folders/route_client-reference-manifest.js +1 -1
  38. package/bundle/standalone/apps/web/.next/server/app/api/git/remote/route_client-reference-manifest.js +1 -1
  39. package/bundle/standalone/apps/web/.next/server/app/api/git/sync-all/route_client-reference-manifest.js +1 -1
  40. package/bundle/standalone/apps/web/.next/server/app/api/hands/test-pattern/route_client-reference-manifest.js +1 -1
  41. package/bundle/standalone/apps/web/.next/server/app/api/hands/validate/route_client-reference-manifest.js +1 -1
  42. package/bundle/standalone/apps/web/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  43. package/bundle/standalone/apps/web/.next/server/app/api/install-snippets/route.js +1 -1
  44. package/bundle/standalone/apps/web/.next/server/app/api/install-snippets/route_client-reference-manifest.js +1 -1
  45. package/bundle/standalone/apps/web/.next/server/app/api/mcp-tools/route.js +1 -1
  46. package/bundle/standalone/apps/web/.next/server/app/api/mcp-tools/route_client-reference-manifest.js +1 -1
  47. package/bundle/standalone/apps/web/.next/server/app/api/profile/route_client-reference-manifest.js +1 -1
  48. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/hands-config/route_client-reference-manifest.js +1 -1
  49. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-config/route_client-reference-manifest.js +1 -1
  50. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-status/route_client-reference-manifest.js +1 -1
  51. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/onboard/route_client-reference-manifest.js +1 -1
  52. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/refresh/route_client-reference-manifest.js +1 -1
  53. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -1
  54. package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/sync/route_client-reference-manifest.js +1 -1
  55. package/bundle/standalone/apps/web/.next/server/app/api/projects/onboard/route_client-reference-manifest.js +1 -1
  56. package/bundle/standalone/apps/web/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  57. package/bundle/standalone/apps/web/.next/server/app/api/publish/html/route_client-reference-manifest.js +1 -1
  58. package/bundle/standalone/apps/web/.next/server/app/api/publish/route_client-reference-manifest.js +1 -1
  59. package/bundle/standalone/apps/web/.next/server/app/api/refresh/route_client-reference-manifest.js +1 -1
  60. package/bundle/standalone/apps/web/.next/server/app/api/reindex/route_client-reference-manifest.js +1 -1
  61. package/bundle/standalone/apps/web/.next/server/app/api/reports/resources/[name]/route_client-reference-manifest.js +1 -1
  62. package/bundle/standalone/apps/web/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  63. package/bundle/standalone/apps/web/.next/server/app/api/tags/route_client-reference-manifest.js +1 -1
  64. package/bundle/standalone/apps/web/.next/server/app/api/version-check/route_client-reference-manifest.js +1 -1
  65. package/bundle/standalone/apps/web/.next/server/app/api/welcome/route_client-reference-manifest.js +1 -1
  66. package/bundle/standalone/apps/web/.next/server/app/api/ws-config/route_client-reference-manifest.js +1 -1
  67. package/bundle/standalone/apps/web/.next/server/app/calendar/page_client-reference-manifest.js +1 -1
  68. package/bundle/standalone/apps/web/.next/server/app/login/page_client-reference-manifest.js +1 -1
  69. package/bundle/standalone/apps/web/.next/server/app/page.js +2 -2
  70. package/bundle/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  71. package/bundle/standalone/apps/web/.next/server/app/preview/motifs/page_client-reference-manifest.js +1 -1
  72. package/bundle/standalone/apps/web/.next/server/app/preview/motifs.html +2 -2
  73. package/bundle/standalone/apps/web/.next/server/app/preview/motifs.rsc +1 -1
  74. package/bundle/standalone/apps/web/.next/server/app-paths-manifest.json +12 -12
  75. package/bundle/standalone/apps/web/.next/server/pages/404.html +1 -1
  76. package/bundle/standalone/apps/web/.next/server/pages/500.html +1 -1
  77. package/bundle/standalone/apps/web/.next/server/server-reference-manifest.json +1 -1
  78. package/bundle/standalone/apps/web/.next/static/chunks/app/{page-67aff4652e571aa1.js → page-eccc7438c998fcce.js} +1 -1
  79. package/bundle/standalone/apps/web/package.json +4 -4
  80. package/bundle/standalone/apps/web/src/lib/mcp-tools.json +33 -32
  81. package/bundle/standalone/node_modules/kontexta-mcp/dist/calendar-tools.js +7 -7
  82. package/bundle/standalone/node_modules/kontexta-mcp/dist/calendar-tools.js.map +1 -1
  83. package/bundle/standalone/node_modules/kontexta-mcp/dist/index.js +26 -26
  84. package/bundle/standalone/node_modules/kontexta-mcp/dist/index.js.map +1 -1
  85. package/bundle/standalone/node_modules/kontexta-mcp/package.json +1 -1
  86. package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/index.js +3 -3
  87. package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/index.js.map +1 -1
  88. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/exploration.d.ts.map +1 -1
  89. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/exploration.js +8 -1
  90. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/exploration.js.map +1 -1
  91. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/read-only-investigation.d.ts.map +1 -1
  92. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/read-only-investigation.js +6 -0
  93. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/read-only-investigation.js.map +1 -1
  94. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/refactor.js +2 -2
  95. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/refactor.js.map +1 -1
  96. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tagging-pass.d.ts.map +1 -1
  97. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tagging-pass.js +8 -2
  98. package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tagging-pass.js.map +1 -1
  99. package/bundle/standalone/node_modules/kxta-core/dist/journal/strict-mode.d.ts.map +1 -1
  100. package/bundle/standalone/node_modules/kxta-core/dist/journal/strict-mode.js +10 -2
  101. package/bundle/standalone/node_modules/kxta-core/dist/journal/strict-mode.js.map +1 -1
  102. package/bundle/standalone/node_modules/kxta-core/dist/project-map/index.js +1 -1
  103. package/bundle/standalone/node_modules/kxta-core/package.json +1 -1
  104. package/bundle/standalone/node_modules/kxta-publish/package.json +2 -2
  105. package/bundle/standalone/package.json +1 -1
  106. package/package.json +1 -1
  107. /package/bundle/standalone/apps/web/.next/static/{Na5FCljVLhoIUnyjNShuM → DWDlM7S8dTnMlrhKW9K_X}/_buildManifest.js +0 -0
  108. /package/bundle/standalone/apps/web/.next/static/{Na5FCljVLhoIUnyjNShuM → DWDlM7S8dTnMlrhKW9K_X}/_ssgManifest.js +0 -0
@@ -357,7 +357,7 @@ server.tool("journal.append", "Append a timestamped text entry to today's daily
357
357
  };
358
358
  }
359
359
  });
360
- server.tool("files.create", "Create a new markdown, mermaid, or HTML file in the knowledge base or project. This operation writes a new file to disk and adds it to the local SQLite FTS5 index. Destination can be 'knowledge' (global KB), 'project' (reference file inside a project repo), or 'kontexta' (internal Kontexta schema file). If destination is 'project' or 'kontexta', project_id is strictly required. If destination is 'knowledge', 'kind' is strictly required — pick 'dictionary' (authoritative source-of-truth) or 'note' (informational snapshot); see the kind param for the rubric. No external auth required. Rate limits do not apply (local operation). Returns the created file metadata including its new ID, path, and estimated tokens. If the destination directory does not exist, it will be created automatically. Use this tool to instantiate new contextual documents or notes. To modify an existing file, use 'update_file' instead. Parameters: 'destination' dictates required fields; if 'project' or 'kontexta', 'project_id' must be a valid integer; if 'knowledge', 'kind' must be 'dictionary' or 'note'. 'tags' and 'folder' are optional. Pass format='mmd' to create a Mermaid diagram file (.mmd) or format='html' for HTML reports; defaults to 'md'.", {
360
+ server.tool("files.create", "Create a new markdown, mermaid, or HTML file in the knowledge base or project. This operation writes a new file to disk and adds it to the local SQLite FTS5 index. Destination can be 'knowledge' (global KB), 'project' (reference file inside a project repo), or 'kontexta' (internal Kontexta schema file). If destination is 'project' or 'kontexta', project_id is strictly required. If destination is 'knowledge', 'kind' is strictly required — pick 'dictionary' (authoritative source-of-truth) or 'note' (informational snapshot); see the kind param for the rubric. No external auth required. Rate limits do not apply (local operation). Returns the created file metadata including its new ID, path, and estimated tokens. If the destination directory does not exist, it will be created automatically. Use this tool to instantiate new contextual documents or notes. To modify an existing file, use 'files.update' instead. Parameters: 'destination' dictates required fields; if 'project' or 'kontexta', 'project_id' must be a valid integer; if 'knowledge', 'kind' must be 'dictionary' or 'note'. 'tags' and 'folder' are optional. Pass format='mmd' to create a Mermaid diagram file (.mmd) or format='html' for HTML reports; defaults to 'md'.", {
361
361
  title: z.string().describe("Title of the file"),
362
362
  content: z.string().describe("Content of the file"),
363
363
  destination: z.enum(["knowledge", "project", "kontexta"]).describe("Destination type"),
@@ -427,7 +427,7 @@ server.tool("resources.export_report", "Export an existing HTML report as PDF or
427
427
  return { content: [{ type: "text", text: JSON.stringify({ url, note: `inline_bytes unavailable in this install: ${e?.message ?? String(e)}` }, null, 2) }] };
428
428
  }
429
429
  });
430
- server.tool("files.read", "Read one file's full body and metadata by ID. Read-only; no side effects, auth, or rate limits. Returns title, path, content, tags, est_tokens (so you can budget context before opening more files), and timestamps. Throws if the ID is unknown. Use for a single known file. Prefer `describe_file` to inspect without paying body tokens; `read_files` for batches; `read_file_lines`/`read_section` for partial reads; `read_file_by_path` when you only have the absolute path.", {
430
+ server.tool("files.read", "Read one file's full body and metadata by ID. Read-only; no side effects, auth, or rate limits. Returns title, path, content, tags, est_tokens (so you can budget context before opening more files), and timestamps. Throws if the ID is unknown. Use for a single known file. Prefer `files.describe` to inspect without paying body tokens; `files.read_many` for batches; `files.read_lines`/`files.read_section` for partial reads; `files.read_by_path` when you only have the absolute path.", {
431
431
  id: z.number().describe("File ID"),
432
432
  }, async ({ id }) => {
433
433
  const result = readFile(id);
@@ -435,7 +435,7 @@ server.tool("files.read", "Read one file's full body and metadata by ID. Read-on
435
435
  content: [{ type: "text", text: JSON.stringify(annotateTokens(result), null, 2) }],
436
436
  };
437
437
  });
438
- server.tool("files.read_many", "Batch read up to 200 files by ID in one call. Returns per-file annotated records, an aggregate `total_est_tokens`, and an isolated `errors[]` (one bad ID does NOT abort the batch). Read-only; no side effects, auth, or rate limits. Use instead of looping `read_file` to halve round-trips and get the combined token cost upfront. For >200 IDs, page yourself.", {
438
+ server.tool("files.read_many", "Batch read up to 200 files by ID in one call. Returns per-file annotated records, an aggregate `total_est_tokens`, and an isolated `errors[]` (one bad ID does NOT abort the batch). Read-only; no side effects, auth, or rate limits. Use instead of looping `files.read` to halve round-trips and get the combined token cost upfront. For >200 IDs, page yourself.", {
439
439
  ids: z.array(z.number()).min(1).max(200).describe("File IDs to read (max 200 per call)"),
440
440
  }, async ({ ids }) => {
441
441
  const files = [];
@@ -455,7 +455,7 @@ server.tool("files.read_many", "Batch read up to 200 files by ID in one call. Re
455
455
  content: [{ type: "text", text: JSON.stringify({ files, total_est_tokens, error_count: errors.length, errors }, null, 2) }],
456
456
  };
457
457
  });
458
- server.tool("files.describe", "Return everything ABOUT a file without pulling its content (no token cost from the body). Tags, size, est_tokens, history depth, related-file ids, backlinks, project, folder, last edited. Operates locally with no auth or rate limits. Use this when you'd otherwise chain read_file + list_tags + get_history + find_related just to decide whether to actually read the file. Parameters: 'id' must be a valid integer file ID.", {
458
+ server.tool("files.describe", "Return everything ABOUT a file without pulling its content (no token cost from the body). Tags, size, est_tokens, history depth, related-file ids, backlinks, project, folder, last edited. Operates locally with no auth or rate limits. Use this when you'd otherwise chain files.read + tags.list + files.get_history + files.find_related just to decide whether to actually read the file. Parameters: 'id' must be a valid integer file ID.", {
459
459
  id: z.number().describe("File ID"),
460
460
  }, async ({ id }) => {
461
461
  try {
@@ -613,7 +613,7 @@ server.tool("files.read_lines", "Return a 1-indexed inclusive line slice of a fi
613
613
  };
614
614
  }
615
615
  });
616
- server.tool("files.grep", "Match a JS regex against one file's lines and return matched lines with line numbers (capped: default 100, max 500). Catches what FTS misses: URLs, hyphenated terms, code identifiers. Read-only; no side effects, auth, or rate limits. Invalid regex throws `invalid regex`. Returns `{matches, match_count, truncated}`. Use after `read_file_outline` when you know the file but need a specific reference; for cross-file regex use `regex_search`; for keyword/concept search use `search`.", {
616
+ server.tool("files.grep", "Match a JS regex against one file's lines and return matched lines with line numbers (capped: default 100, max 500). Catches what FTS misses: URLs, hyphenated terms, code identifiers. Read-only; no side effects, auth, or rate limits. Invalid regex throws `invalid regex`. Returns `{matches, match_count, truncated}`. Use after `files.read_outline` when you know the file but need a specific reference; for cross-file regex use `files.regex_search`; for keyword/concept search use `files.search`.", {
617
617
  id: z.number().describe("File ID"),
618
618
  pattern: z.string().describe("Pattern to match. Treated as a JavaScript RegExp source."),
619
619
  case_insensitive: z.boolean().optional().describe("Add the 'i' flag (default false)"),
@@ -664,7 +664,7 @@ server.tool("files.grep", "Match a JS regex against one file's lines and return
664
664
  server.tool("files.regex_search", "Match a JS regex against the body of every file in scope (project, KB, or all) and return per-file hits with line numbers. Slower than FTS `search` because it reads each file's content; use only when FTS misses substrings, URLs, or code identifiers. Read-only; no side effects, auth, or rate limits. Capped at 500 files / 10 hits per file by default; the response reports `files_truncated` and per-file truncation so the agent can re-scope. `project_id: null` = KB only; omit = everywhere; `kind` narrows to one content class. Invalid regex throws.", {
665
665
  pattern: z.string().describe("JavaScript RegExp source"),
666
666
  project_id: z.number().nullable().optional().describe("Scope to one project, null for KB-only, omit for everything"),
667
- case_insensitive: z.boolean().optional(),
667
+ case_insensitive: z.boolean().optional().describe("If true, match pattern case-insensitively (RegExp 'i' flag). Default false."),
668
668
  max_files: z.number().int().positive().max(2000).optional().describe("Cap on files scanned (default 500)"),
669
669
  max_matches_per_file: z.number().int().positive().max(100).optional().describe("Per-file hit cap (default 10)"),
670
670
  kind: z.enum(["dictionary", "note", "journal", "project"]).optional()
@@ -745,7 +745,7 @@ server.tool("files.regex_search", "Match a JS regex against the body of every fi
745
745
  };
746
746
  }
747
747
  });
748
- server.tool("files.update", "Update the entire content of an existing file by its ID. This replaces the file's content on disk and triggers an FTS5 re-index. Returns the updated file metadata including new estimated token counts. Operates locally with no external auth or rate limits. If you only need to modify a single section without replacing the entire file, use 'update_file_section' instead to save context budget. Parameters: 'id' must be a valid integer file ID. 'content' is the complete markdown string that will replace the file.", {
748
+ server.tool("files.update", "Update the entire content of an existing file by its ID. This replaces the file's content on disk and triggers an FTS5 re-index. Returns the updated file metadata including new estimated token counts. Operates locally with no external auth or rate limits. If you only need to modify a single section without replacing the entire file, use 'files.update_section' instead to save context budget. Parameters: 'id' must be a valid integer file ID. 'content' is the complete markdown string that will replace the file.", {
749
749
  id: z.number().describe("File ID"),
750
750
  content: z.string().describe("New content"),
751
751
  }, async ({ id, content }) => {
@@ -754,7 +754,7 @@ server.tool("files.update", "Update the entire content of an existing file by it
754
754
  content: [{ type: "text", text: JSON.stringify(annotateTokens(result), null, 2) }],
755
755
  };
756
756
  });
757
- server.tool("files.delete", "DESTRUCTIVE. Permanently delete one file by ID. KB files are unlinked from disk AND removed from the FTS5 index; project reference files only have their index entry removed (the file on disk is left alone so the watcher does not fight your editor). Not idempotent — deleting an unknown ID throws. No external auth or rate limits. Returns `{success: true}`. Use only when the file is truly obsolete; to deprioritise without losing data, untag (`remove_tags`) or unfavorite (`set_favorite`) instead. Bulk variant: `delete_files`.", {
757
+ server.tool("files.delete", "DESTRUCTIVE. Permanently delete one file by ID. KB files are unlinked from disk AND removed from the FTS5 index; project reference files only have their index entry removed (the file on disk is left alone so the watcher does not fight your editor). Not idempotent — deleting an unknown ID throws. No external auth or rate limits. Returns `{success: true}`. Use only when the file is truly obsolete; to deprioritise without losing data, untag (`tags.remove`) or unfavorite (`tags.set_favorite`) instead. Bulk variant: `files.delete_many`.", {
758
758
  id: z.number().describe("File ID"),
759
759
  }, async ({ id }) => {
760
760
  await deleteFile(id, dataDir);
@@ -797,7 +797,7 @@ server.tool("files.list", "List file metadata with optional filters (project_id,
797
797
  content: [{ type: "text", text: JSON.stringify({ files: annotated, total_est_tokens }, null, 2) }],
798
798
  };
799
799
  });
800
- server.tool("files.search", "Full-text (SQLite FTS5) keyword search across files. Returns ranked matches with inline match_excerpt and title_highlight (no follow-up `read_file` needed for snippets) plus tags, est_tokens, size_bytes, content_class, and aggregate `total_est_tokens`. Read-only; no side effects, auth, or rate limits. Ordering: dictionary hits sort above everything else for the same query (dictionary-wins on conflict), then BM25 rank. FTS is tokenised: it WILL miss URLs, hyphenated terms, and partial substrings — fall back to `regex_search` for those. `project_id: null` searches only the KB; omit the field to span everything; `tags[]` requires ALL listed tags to match; `kind` narrows to one content class. For prompt-ready bundled bodies use `bundle_search`.", {
800
+ server.tool("files.search", "Full-text (SQLite FTS5) keyword search across files. Returns ranked matches with inline match_excerpt and title_highlight (no follow-up `read_file` needed for snippets) plus tags, est_tokens, size_bytes, content_class, and aggregate `total_est_tokens`. Read-only; no side effects, auth, or rate limits. Ordering: dictionary hits sort above everything else for the same query (dictionary-wins on conflict), then BM25 rank. FTS is tokenised: it WILL miss URLs, hyphenated terms, and partial substrings — fall back to `files.regex_search` for those. `project_id: null` searches only the KB; omit the field to span everything; `tags[]` requires ALL listed tags to match; `kind` narrows to one content class. For prompt-ready bundled bodies use `files.bundle_search`.", {
801
801
  query: z.string().describe("Search query"),
802
802
  project_id: z.number().nullable().optional().describe("Filter by project ID. Pass null to search ONLY Knowledge Base files."),
803
803
  tags: z.array(z.string()).optional().describe("Filter by tags (all must match)"),
@@ -830,7 +830,7 @@ server.tool("files.search", "Full-text (SQLite FTS5) keyword search across files
830
830
  content: [{ type: "text", text: JSON.stringify({ matches: annotated, total_est_tokens }, null, 2) }],
831
831
  };
832
832
  });
833
- server.tool("files.bundle_search", "Run an FTS search and concatenate matched bodies into a single prompt-ready bundle (XML `<document>` blocks or markdown headers + fences) capped at `max_tokens`. Files are added in rank order (dictionary-wins first, then BM25) until the next would exceed the budget; the rest go to `skipped[]`. Read-only; no side effects, auth, or rate limits. Use instead of `search` + N×`read_file` when you need several related files as one context blob. Defaults: format=xml, max_tokens=50000. `project_id: null` = KB only; `tags[]` requires ALL to match; `kind` narrows to one content class.", {
833
+ server.tool("files.bundle_search", "Run an FTS search and concatenate matched bodies into a single prompt-ready bundle (XML `<document>` blocks or markdown headers + fences) capped at `max_tokens`. Files are added in rank order (dictionary-wins first, then BM25) until the next would exceed the budget; the rest go to `skipped[]`. Read-only; no side effects, auth, or rate limits. Use instead of `files.search` + N×`files.read` when you need several related files as one context blob. Defaults: format=xml, max_tokens=50000. `project_id: null` = KB only; `tags[]` requires ALL to match; `kind` narrows to one content class.", {
834
834
  query: z.string().describe("Full-text search query"),
835
835
  project_id: z.number().nullable().optional().describe("Filter by project ID. Pass null to bundle ONLY Knowledge Base files."),
836
836
  tags: z.array(z.string()).optional().describe("Filter by tags (all must match)"),
@@ -982,7 +982,7 @@ ERROR CONDITIONS: Returns isError=true if path is missing or unresolvable. Scan
982
982
  recommendationReason =
983
983
  `Your project's agent instructions file is out of date — it still references kontexta workflow rules from an older release. ` +
984
984
  `Files needing an update: ${versions}. Latest rules version is v${RULE_BLOCK_VERSION}. ` +
985
- `Run onboard_agent to refresh the kontexta rules block in-place (your existing project content is preserved).`;
985
+ `Run admin.onboard_agent to refresh the kontexta rules block in-place (your existing project content is preserved).`;
986
986
  }
987
987
  else {
988
988
  recommendationReason =
@@ -994,7 +994,7 @@ ERROR CONDITIONS: Returns isError=true if path is missing or unresolvable. Scan
994
994
  `No AI agent instructions file (e.g. CLAUDE.md, AGENTS.md, GEMINI.md, ANTIGRAVITY.md, .cursor/rules, .continue/rules, .aider/kontexta.md) was found in this project. ` +
995
995
  `These files are how coding agents (Claude Code, Codex, Cursor, Gemini, Aider, etc.) load project-specific context at the start of every session. ` +
996
996
  `Without one, your agent won't know this project is registered with kontexta and will skip the search/read/journal workflow — wasting tokens re-reading files it could have looked up. ` +
997
- `Run onboard_agent with target_agent set to your coding tool to scaffold the right file (CLAUDE.md for Claude Code, .aider/kontexta.md for Aider, etc.) pre-populated with kontexta workflow rules.`;
997
+ `Run admin.onboard_agent with target_agent set to your coding tool to scaffold the right file (CLAUDE.md for Claude Code, .aider/kontexta.md for Aider, etc.) pre-populated with kontexta workflow rules.`;
998
998
  }
999
999
  const needsOnboarding = outdated.length > 0 || detected.length === 0;
1000
1000
  const recommendation = detected.length > 0
@@ -1672,7 +1672,7 @@ server.tool("files.move", "Move/rename a file. Destination 'new_path' must be ab
1672
1672
  };
1673
1673
  }
1674
1674
  });
1675
- server.tool("files.find_related", "Find other files sharing tags with the given file, ranked by `shared_tag_count` descending. Read-only; no side effects, auth, or rate limits. Returns annotated file rows with `shared_tag_count` and `shared_tags`. Empty result means the file has no tags or no other file shares them — try `search`/`regex_search` for content-based discovery, or `suggest_tags` to bootstrap labels first. `kind` narrows to one content class. Default limit 10.", {
1675
+ server.tool("files.find_related", "Find other files sharing tags with the given file, ranked by `shared_tag_count` descending. Read-only; no side effects, auth, or rate limits. Returns annotated file rows with `shared_tag_count` and `shared_tags`. Empty result means the file has no tags or no other file shares them — try `files.search`/`files.regex_search` for content-based discovery, or `tags.suggest` to bootstrap labels first. `kind` narrows to one content class. Default limit 10.", {
1676
1676
  file_id: z.number().describe("ID of the file to find relations for"),
1677
1677
  limit: z.number().optional().describe("Maximum number of related files to return (default 10)"),
1678
1678
  kind: z.enum(["dictionary", "note", "journal", "project"]).optional()
@@ -1695,7 +1695,7 @@ server.tool("files.find_related", "Find other files sharing tags with the given
1695
1695
  ],
1696
1696
  };
1697
1697
  });
1698
- server.tool("files.create_many", "Batch variant of `create_file` — create up to 200 markdown, mermaid, or HTML files in one call. Each item follows the same rules: `project_id` required if `destination` is `project`/`kontexta`; `kind` ('dictionary' or 'note') required if `destination` is `knowledge`. SIDE EFFECTS: writes new files to disk and inserts FTS5 rows; missing folders are mkdir'd. Per-item failures are isolated to `errors[]` and the rest of the batch still commits — partial success is the norm, always inspect `error_count`. No external auth or rate limits. Returns `{created_count, error_count, created, errors}`. Use for bulk ingestion; for >200 items, page yourself. Pass format='mmd' on an item to create a Mermaid diagram file (.mmd) or 'html' for HTML reports; defaults to 'md'.", {
1698
+ server.tool("files.create_many", "Batch variant of `files.create` — create up to 200 markdown, mermaid, or HTML files in one call. Each item follows the same rules: `project_id` required if `destination` is `project`/`kontexta`; `kind` ('dictionary' or 'note') required if `destination` is `knowledge`. SIDE EFFECTS: writes new files to disk and inserts FTS5 rows; missing folders are mkdir'd. Per-item failures are isolated to `errors[]` and the rest of the batch still commits — partial success is the norm, always inspect `error_count`. No external auth or rate limits. Returns `{created_count, error_count, created, errors}`. Use for bulk ingestion; for >200 items, page yourself. Pass format='mmd' on an item to create a Mermaid diagram file (.mmd) or 'html' for HTML reports; defaults to 'md'.", {
1699
1699
  files: z
1700
1700
  .array(z.object({
1701
1701
  title: z.string().describe("File title."),
@@ -1706,7 +1706,7 @@ server.tool("files.create_many", "Batch variant of `create_file` — create up t
1706
1706
  tags: z.array(z.string()).optional().describe("Tags to apply to this file."),
1707
1707
  format: z.enum(["md", "mmd", "html"]).optional().describe("File format: 'md' (default), 'mmd' (Mermaid diagram), or 'html' (report)."),
1708
1708
  kind: z.enum(["dictionary", "note"]).optional()
1709
- .describe("REQUIRED per-item for destination='knowledge'. See create_file for the dictionary/note rubric."),
1709
+ .describe("REQUIRED per-item for destination='knowledge'. See files.create for the dictionary/note rubric."),
1710
1710
  }))
1711
1711
  .min(1)
1712
1712
  .max(200)
@@ -1750,7 +1750,7 @@ server.tool("files.create_many", "Batch variant of `create_file` — create up t
1750
1750
  ],
1751
1751
  };
1752
1752
  });
1753
- server.tool("files.delete_many", "DESTRUCTIVE batch — delete up to 500 files by ID in one call. Same physical-deletion rules as `delete_file` (KB files unlinked from disk; project reference files only de-indexed). Per-ID failures isolated to `errors[]`; the batch keeps going — partial success is the norm. Not idempotent — unknown IDs surface as per-item errors. No external auth or rate limits. Returns `{deleted_count, error_count, deleted, errors}`. To preview the set before deleting, run `list_files` with the same filter and confirm the IDs.", {
1753
+ server.tool("files.delete_many", "DESTRUCTIVE batch — delete up to 500 files by ID in one call. Same physical-deletion rules as `files.delete` (KB files unlinked from disk; project reference files only de-indexed). Per-ID failures isolated to `errors[]`; the batch keeps going — partial success is the norm. Not idempotent — unknown IDs surface as per-item errors. No external auth or rate limits. Returns `{deleted_count, error_count, deleted, errors}`. To preview the set before deleting, run `files.list` with the same filter and confirm the IDs.", {
1754
1754
  ids: z.array(z.number()).min(1).max(500).describe("File IDs to delete (max 500 per call)"),
1755
1755
  }, async ({ ids }) => {
1756
1756
  const deleted = [];
@@ -1773,7 +1773,7 @@ server.tool("files.delete_many", "DESTRUCTIVE batch — delete up to 500 files b
1773
1773
  ],
1774
1774
  };
1775
1775
  });
1776
- server.tool("tags.search", "Bulk-tag — run an FTS `search` and append `add_tags` to every matching file in one call. Side effect: each match gets `addTags` applied (additive, idempotent per tag); the matched files themselves are NOT modified beyond their tag links. Per-file failures isolated to `errors[]`. No external auth or rate limits. There is NO dry-run flag, so ALWAYS run `search` with the same query first to verify the match set before tagging. The `tags[]` filter requires existing tags to ALL match (it scopes the search; it does not control which tags get added). Returns `{matched_count, tagged_count, tags_applied, tagged_ids, errors}`.", {
1776
+ server.tool("tags.search", "Bulk-tag — run an FTS `search` and append `add_tags` to every matching file in one call. Side effect: each match gets `addTags` applied (additive, idempotent per tag); the matched files themselves are NOT modified beyond their tag links. Per-file failures isolated to `errors[]`. No external auth or rate limits. There is NO dry-run flag, so ALWAYS run `files.search` with the same query first to verify the match set before tagging. The `tags[]` filter requires existing tags to ALL match (it scopes the search; it does not control which tags get added). Returns `{matched_count, tagged_count, tags_applied, tagged_ids, errors}`.", {
1777
1777
  query: z.string().describe("Full-text search query"),
1778
1778
  add_tags: z.array(z.string()).min(1).describe("Tags to add to every matching file"),
1779
1779
  project_id: z.number().nullable().optional().describe("Scope search to a specific project. Pass null for KB-only results."),
@@ -1823,7 +1823,7 @@ server.tool("tags.search", "Bulk-tag — run an FTS `search` and append `add_tag
1823
1823
  ],
1824
1824
  };
1825
1825
  });
1826
- server.tool("files.read_by_path", "Look up a file by its absolute on-disk path and return the same shape as `read_file`. The path must EXACTLY match what Kontexta indexed — no symlink resolution, no path normalisation beyond what the OS does, no trailing-slash tolerance. Returns isError if no row matches (the file may exist on disk but not be indexed — try `refresh_index`). Read-only; no side effects, auth, or rate limits. Use when an agent has a path from its working directory but no file ID; if you have the ID, prefer `read_file`.", {
1826
+ server.tool("files.read_by_path", "Look up a file by its absolute on-disk path and return the same shape as `files.read`. The path must EXACTLY match what Kontexta indexed — no symlink resolution, no path normalisation beyond what the OS does, no trailing-slash tolerance. Returns isError if no row matches (the file may exist on disk but not be indexed — try `projects.refresh_index`). Read-only; no side effects, auth, or rate limits. Use when an agent has a path from its working directory but no file ID; if you have the ID, prefer `files.read`.", {
1827
1827
  path: z.string().describe("Absolute path on disk (must match the path stored in Kontexta)"),
1828
1828
  }, async ({ path }) => {
1829
1829
  try {
@@ -1856,7 +1856,7 @@ server.tool("files.read_by_path", "Look up a file by its absolute on-disk path a
1856
1856
  };
1857
1857
  }
1858
1858
  });
1859
- server.tool("admin.stats", "Aggregate counts for a scope: `file_count`, `untagged_count`, `favorite_count`, `top_tags`. With `project_id` omitted (everything), also returns `by_project` breakdown. `include_token_total: true` stat()s every matching file on disk to compute a body-size estimate — measurably slower on large vaults; default false. `project_id: null` = KB only; omit = all. Read-only; no side effects, auth, or rate limits. Use as a cheap dashboard or to spot untagged content for cleanup; for live disk-vs-index drift use `diff_against_disk`.", {
1859
+ server.tool("admin.stats", "Aggregate counts for a scope: `file_count`, `untagged_count`, `favorite_count`, `top_tags`. With `project_id` omitted (everything), also returns `by_project` breakdown. `include_token_total: true` stat()s every matching file on disk to compute a body-size estimate — measurably slower on large vaults; default false. `project_id: null` = KB only; omit = all. Read-only; no side effects, auth, or rate limits. Use as a cheap dashboard or to spot untagged content for cleanup; for live disk-vs-index drift use `files.diff_against_disk`.", {
1860
1860
  project_id: z.number().nullable().optional().describe("Filter to a single project. Pass null for KB-only. Omit for everything."),
1861
1861
  top_tags: z.number().int().positive().max(100).optional().describe("How many top tags to return (default 10)"),
1862
1862
  include_token_total: z.boolean().optional().describe("If true, stat every matching file on disk to compute total est_tokens. Default false (cheap)."),
@@ -1945,7 +1945,7 @@ server.tool("admin.stats", "Aggregate counts for a scope: `file_count`, `untagge
1945
1945
  };
1946
1946
  }
1947
1947
  });
1948
- server.tool("tags.suggest", "Propose tags for a file by mining the existing tag corpus via FTS — picks distinctive terms from the file (≥4 chars, stopword-filtered) and returns tags applied to other files that score high on those terms. No LLM, no network. Already-applied tags are excluded so the suggestions are net-new. Read-only; no side effects, auth, or rate limits. Returns `{file_id, path, existing_tags, suggestions: [{tag, score, sources}]}`. Empty suggestions = no distinctive terms or no overlap with the existing taxonomy yet — bootstrap with `add_tags` first. Default limit 10, max 50. Suggestions are NOT auto-applied.", {
1948
+ server.tool("tags.suggest", "Propose tags for a file by mining the existing tag corpus via FTS — picks distinctive terms from the file (≥4 chars, stopword-filtered) and returns tags applied to other files that score high on those terms. No LLM, no network. Already-applied tags are excluded so the suggestions are net-new. Read-only; no side effects, auth, or rate limits. Returns `{file_id, path, existing_tags, suggestions: [{tag, score, sources}]}`. Empty suggestions = no distinctive terms or no overlap with the existing taxonomy yet — bootstrap with `tags.add` first. Default limit 10, max 50. Suggestions are NOT auto-applied.", {
1949
1949
  file_id: z.number().describe("File ID to suggest tags for"),
1950
1950
  limit: z.number().int().positive().max(50).optional().describe("Max suggestions to return (default 10)"),
1951
1951
  }, async ({ file_id, limit }) => {
@@ -2025,7 +2025,7 @@ server.tool("tags.suggest", "Propose tags for a file by mining the existing tag
2025
2025
  };
2026
2026
  }
2027
2027
  });
2028
- server.tool("files.diff_against_disk", "Diagnose drift between one file's disk content and its FTS index. Status is one of `in_sync`, `diverged`, `disk_unreadable`, or `no_index_row`. On divergence returns sizes, line counts, the first divergent line number, and the disk vs index sample for that line — NOT a full diff (use `get_diff` for full diffs between commits). Read-only; no side effects, auth, or rate limits. Use when search results look stale; if status is `diverged` or `no_index_row`, run `refresh_index` to fix.", {
2028
+ server.tool("files.diff_against_disk", "Diagnose drift between one file's disk content and its FTS index. Status is one of `in_sync`, `diverged`, `disk_unreadable`, or `no_index_row`. On divergence returns sizes, line counts, the first divergent line number, and the disk vs index sample for that line — NOT a full diff (use `files.get_diff` for full diffs between commits). Read-only; no side effects, auth, or rate limits. Use when search results look stale; if status is `diverged` or `no_index_row`, run `projects.refresh_index` to fix.", {
2029
2029
  file_id: z.number().describe("File ID"),
2030
2030
  }, async ({ file_id }) => {
2031
2031
  try {
@@ -2132,7 +2132,7 @@ server.tool("files.diff_against_disk", "Diagnose drift between one file's disk c
2132
2132
  };
2133
2133
  }
2134
2134
  });
2135
- server.tool("projects.refresh_index", "Reconcile the FTS index against disk. For a project (`project_id` set), re-runs `discoverFiles`. For the KB (`project_id` null/omitted), walks `knowledge/`, ingests new .md files, reindexes any whose content hash drifted, and PRUNES rows for files no longer on disk. SIDE-EFFECTFUL: writes/updates/deletes file and FTS rows (the prune is destructive on stale index rows but never deletes files from disk). Idempotent — running twice is a near no-op. Skips files >5MB and standard junk dirs (`node_modules`, `.git`, `dist`, `build`, etc.). No external auth or rate limits. Returns `{scope, newly_indexed, refreshed, pruned}`. Use after editing files outside Kontexta, or when `diff_against_disk` reports drift.", {
2135
+ server.tool("projects.refresh_index", "Reconcile the FTS index against disk. For a project (`project_id` set), re-runs `discoverFiles`. For the KB (`project_id` null/omitted), walks `knowledge/`, ingests new .md files, reindexes any whose content hash drifted, and PRUNES rows for files no longer on disk. SIDE-EFFECTFUL: writes/updates/deletes file and FTS rows (the prune is destructive on stale index rows but never deletes files from disk). Idempotent — running twice is a near no-op. Skips files >5MB and standard junk dirs (`node_modules`, `.git`, `dist`, `build`, etc.). No external auth or rate limits. Returns `{scope, newly_indexed, refreshed, pruned}`. Use after editing files outside Kontexta, or when `files.diff_against_disk` reports drift.", {
2136
2136
  project_id: z.number().nullable().optional().describe("Project ID. Pass null or omit to reindex the Knowledge Base."),
2137
2137
  }, async ({ project_id }) => {
2138
2138
  try {
@@ -2192,7 +2192,7 @@ server.tool("admin.whats_new", "List files created or modified since a checkpoin
2192
2192
  };
2193
2193
  }
2194
2194
  });
2195
- server.tool("projects.map", "Return a compact indented outline of folders, file titles, tags, and IDs in a single dense block — substantially fewer tokens than the equivalent `list_files` JSON for the same scope. Read-only; no side effects, auth, or rate limits. Capped at `max_lines` (default 5000); the response reports `est_tokens` and emits a `warning` field if it exceeds `KONTEXTA_PROJECT_TOKEN_WARN`. `project_id: null` = KB only; omit = everything. Defaults: include_tags=true, show_titles=true. Use to orient yourself in an unfamiliar vault or project; for keyword lookup use `search`.", {
2195
+ server.tool("projects.map", "Return a compact indented outline of folders, file titles, tags, and IDs in a single dense block — substantially fewer tokens than the equivalent `files.list` JSON for the same scope. Read-only; no side effects, auth, or rate limits. Capped at `max_lines` (default 5000); the response reports `est_tokens` and emits a `warning` field if it exceeds `KONTEXTA_PROJECT_TOKEN_WARN`. `project_id: null` = KB only; omit = everything. Defaults: include_tags=true, show_titles=true. Use to orient yourself in an unfamiliar vault or project; for keyword lookup use `files.search`.", {
2196
2196
  project_id: z.number().nullable().optional().describe("Restrict to a single project. Pass null for knowledge-base-only files. Omit for everything."),
2197
2197
  include_tags: z.boolean().optional().describe("Append #tags inline. Default true. Set false to shrink the outline."),
2198
2198
  show_titles: z.boolean().optional().describe("Show file titles instead of filenames. Default true."),
@@ -2271,11 +2271,11 @@ server.resource("File Content", new ResourceTemplate("kontexta://files/{id}", {
2271
2271
  ],
2272
2272
  };
2273
2273
  });
2274
- server.tool("hands.list", "List every Hands command tool currently registered, with project scope, tool name, danger level, confirmation flag, and description. Hands tools come from per-project `kontexta.json` files loaded at register time. Read-only; no side effects, auth, or rate limits. Use to discover what side-effectful project commands the agent is permitted to run; for the `kontexta.json` schema see `describe_hands_schema`; reload after editing one with `reload_hands`.", {}, async () => {
2274
+ server.tool("hands.list", "List every Hands command tool currently registered, with project scope, tool name, danger level, confirmation flag, and description. Hands tools come from per-project `kontexta.json` files loaded at register time. Read-only; no side effects, auth, or rate limits. Use to discover what side-effectful project commands the agent is permitted to run; for the `kontexta.json` schema see `hands.describe_schema`; reload after editing one with `hands.reload`.", {}, async () => {
2275
2275
  const items = handsRegistry.list();
2276
2276
  return { content: [{ type: "text", text: JSON.stringify({ hands: items }, null, 2) }] };
2277
2277
  });
2278
- server.tool("hands.reload", "Re-scan every registered project's `kontexta.json` and rebuild the live Hands tool registry — newly-declared tools become callable immediately, removed tools disappear from `tools/list`. SIDE EFFECT is on the running MCP session's tool inventory only (no disk writes). Idempotent. No external auth or rate limits. Takes no parameters. Returns per-project load results (counts of registered/disabled tools and any validation warnings). Use after editing a `kontexta.json` mid-session; for the schema see `describe_hands_schema`.", {}, async () => {
2278
+ server.tool("hands.reload", "Re-scan every registered project's `kontexta.json` and rebuild the live Hands tool registry — newly-declared tools become callable immediately, removed tools disappear from `tools/list`. SIDE EFFECT is on the running MCP session's tool inventory only (no disk writes). Idempotent. No external auth or rate limits. Takes no parameters. Returns per-project load results (counts of registered/disabled tools and any validation warnings). Use after editing a `kontexta.json` mid-session; for the schema see `hands.describe_schema`.", {}, async () => {
2279
2279
  const projects = listProjects()
2280
2280
  .filter((p) => p.path && existsSync(p.path))
2281
2281
  .map((p) => ({ name: p.name, root: p.path }));
@@ -2295,7 +2295,7 @@ server.tool("hands.confirm", "Approve and EXECUTE a previously-issued Hands invo
2295
2295
  return { content: [{ type: "text", text: `Execution failed after approval: ${e?.message ?? e}` }] };
2296
2296
  }
2297
2297
  });
2298
- server.tool("hands.describe_schema", "Return the complete authoring reference for `kontexta.json`: JSON schema, validation rules, security guarantees, limitations, and an annotated example. Static document — does not read any project file or DB row. Read-only; no side effects, auth, or rate limits. Takes no parameters. Use when helping a user write or fix a `kontexta.json`; to see the loaded tools themselves use `list_hands`; to apply edits use `reload_hands`.", {}, async () => ({ content: [{ type: "text", text: buildSchemaDoc() }] }));
2298
+ server.tool("hands.describe_schema", "Return the complete authoring reference for `kontexta.json`: JSON schema, validation rules, security guarantees, limitations, and an annotated example. Static document — does not read any project file or DB row. Read-only; no side effects, auth, or rate limits. Takes no parameters. Use when helping a user write or fix a `kontexta.json`; to see the loaded tools themselves use `hands.list`; to apply edits use `hands.reload`.", {}, async () => ({ content: [{ type: "text", text: buildSchemaDoc() }] }));
2299
2299
  server.tool("admin.get_profile", "Return the user profile stored in the Knowledge Base. The profile helps AI agents understand the user's context, role, preferences, and goals. Read-only; no side effects, auth, or rate limits. Returns existence status, full content, list of missing required sections, and a hint for new users. Use at session start to understand who you're working with.", {}, async () => {
2300
2300
  const result = handleGetProfile(dataDir);
2301
2301
  return {