@sunub/obsidian-mcp-server 0.3.4 → 0.3.6

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 (112) hide show
  1. package/build/cli/App.d.ts +1 -0
  2. package/build/cli/App.js +194 -0
  3. package/build/cli/App.js.map +1 -0
  4. package/build/cli/AppContainer.js +15 -194
  5. package/build/cli/AppContainer.js.map +1 -1
  6. package/build/cli/config/mcpServersConfig.js.map +1 -1
  7. package/build/cli/context/KeypressContext.util.js +2 -0
  8. package/build/cli/context/KeypressContext.util.js.map +1 -1
  9. package/build/cli/hooks/useLlmStream/constants.d.ts +4 -0
  10. package/build/cli/hooks/useLlmStream/constants.js +5 -0
  11. package/build/cli/hooks/useLlmStream/constants.js.map +1 -0
  12. package/build/cli/hooks/useLlmStream/index.d.ts +2 -0
  13. package/build/cli/hooks/useLlmStream/index.js +2 -0
  14. package/build/cli/hooks/useLlmStream/index.js.map +1 -0
  15. package/build/cli/hooks/useLlmStream/llmService.d.ts +2 -0
  16. package/build/cli/hooks/useLlmStream/llmService.js +110 -0
  17. package/build/cli/hooks/useLlmStream/llmService.js.map +1 -0
  18. package/build/cli/hooks/useLlmStream/types.d.ts +38 -0
  19. package/build/cli/hooks/useLlmStream/types.js +2 -0
  20. package/build/cli/hooks/useLlmStream/types.js.map +1 -0
  21. package/build/cli/hooks/{useLlmStream.d.ts → useLlmStream/useLlmStream.d.ts} +2 -2
  22. package/build/cli/hooks/useLlmStream/useLlmStream.js +162 -0
  23. package/build/cli/hooks/useLlmStream/useLlmStream.js.map +1 -0
  24. package/build/cli/hooks/useLlmStream/utils.d.ts +15 -0
  25. package/build/cli/hooks/useLlmStream/utils.js +108 -0
  26. package/build/cli/hooks/useLlmStream/utils.js.map +1 -0
  27. package/build/cli/hooks/useMcpClient.js.map +1 -1
  28. package/build/cli/hooks/useMcpManager.d.ts +4 -0
  29. package/build/cli/hooks/useMcpManager.js +5 -2
  30. package/build/cli/hooks/useMcpManager.js.map +1 -1
  31. package/build/cli/hooks/useTerminalSize.d.ts +0 -5
  32. package/build/cli/hooks/useTerminalSize.js +0 -5
  33. package/build/cli/hooks/useTerminalSize.js.map +1 -1
  34. package/build/cli/index.js +2 -31
  35. package/build/cli/index.js.map +1 -1
  36. package/build/cli/key/keyMatchers.d.ts +0 -8
  37. package/build/cli/key/keyMatchers.js +0 -8
  38. package/build/cli/key/keyMatchers.js.map +1 -1
  39. package/build/cli/key/text-buffer.d.ts +0 -3
  40. package/build/cli/key/text-buffer.js +5 -4
  41. package/build/cli/key/text-buffer.js.map +1 -1
  42. package/build/cli/types.d.ts +2 -0
  43. package/build/cli/ui/InputPrompt.d.ts +1 -0
  44. package/build/cli/ui/InputPrompt.js.map +1 -1
  45. package/build/cli/ui/LLMErrorComponent.d.ts +6 -0
  46. package/build/cli/ui/LLMErrorComponent.js +14 -0
  47. package/build/cli/ui/LLMErrorComponent.js.map +1 -0
  48. package/build/cli/ui/LLMHealthChecker.d.ts +8 -0
  49. package/build/cli/ui/LLMHealthChecker.js +22 -0
  50. package/build/cli/ui/LLMHealthChecker.js.map +1 -0
  51. package/build/cli/ui/MCPServers.d.ts +11 -0
  52. package/build/cli/ui/MCPServers.js +18 -0
  53. package/build/cli/ui/MCPServers.js.map +1 -0
  54. package/build/cli/utils/debugLogger.js +1 -1
  55. package/build/cli/utils/debugLogger.js.map +1 -1
  56. package/build/config.d.ts +1 -0
  57. package/build/config.js +7 -0
  58. package/build/config.js.map +1 -1
  59. package/build/index.js +25 -6
  60. package/build/index.js.map +1 -1
  61. package/build/server.js +15 -12
  62. package/build/server.js.map +1 -1
  63. package/build/setup.d.ts +3 -0
  64. package/build/setup.js +112 -0
  65. package/build/setup.js.map +1 -0
  66. package/build/tools/vault/index.d.ts +1 -1
  67. package/build/tools/vault/index.js +5 -6
  68. package/build/tools/vault/index.js.map +1 -1
  69. package/build/tools/vault/params.d.ts +2 -2
  70. package/build/tools/vault/types/collect_context.d.ts +26 -26
  71. package/build/tools/vault/types/list_all.d.ts +44 -44
  72. package/build/tools/vault/types/search.d.ts +70 -70
  73. package/build/tools/vault/utils/actions/search.js +24 -14
  74. package/build/tools/vault/utils/actions/search.js.map +1 -1
  75. package/build/tools/vault/utils.d.ts +0 -1
  76. package/build/tools/vault/utils.js +0 -1
  77. package/build/tools/vault/utils.js.map +1 -1
  78. package/build/utils/Embedder.d.ts +11 -0
  79. package/build/utils/Embedder.js +46 -0
  80. package/build/utils/Embedder.js.map +1 -0
  81. package/build/utils/Indexer.d.ts +2 -0
  82. package/build/utils/Indexer.js +17 -0
  83. package/build/utils/Indexer.js.map +1 -1
  84. package/build/utils/LocalReranker.d.ts +17 -0
  85. package/build/utils/LocalReranker.js +71 -0
  86. package/build/utils/LocalReranker.js.map +1 -0
  87. package/build/utils/RAGIndexer.d.ts +9 -0
  88. package/build/utils/RAGIndexer.js +54 -22
  89. package/build/utils/RAGIndexer.js.map +1 -1
  90. package/build/utils/RerankerClient.d.ts +6 -6
  91. package/build/utils/RerankerClient.js.map +1 -1
  92. package/build/utils/VaultManger/VaultManager.d.ts +36 -0
  93. package/build/utils/VaultManger/VaultManager.js +264 -9
  94. package/build/utils/VaultManger/VaultManager.js.map +1 -1
  95. package/build/utils/VaultWatcher.d.ts +1 -1
  96. package/build/utils/VaultWatcher.js +12 -55
  97. package/build/utils/VaultWatcher.js.map +1 -1
  98. package/build/utils/constants.d.ts +3 -0
  99. package/build/utils/constants.js +14 -0
  100. package/build/utils/constants.js.map +1 -0
  101. package/build/utils/processor/types.d.ts +4 -0
  102. package/build/utils/processor/types.js +1 -0
  103. package/build/utils/processor/types.js.map +1 -1
  104. package/package.json +5 -2
  105. package/build/cli/app.d.ts +0 -1
  106. package/build/cli/app.js +0 -7
  107. package/build/cli/app.js.map +0 -1
  108. package/build/cli/hooks/useLlmStream.js +0 -365
  109. package/build/cli/hooks/useLlmStream.js.map +0 -1
  110. package/build/tools/vault/utils/actions/search_semantic.d.ts +0 -3
  111. package/build/tools/vault/utils/actions/search_semantic.js +0 -71
  112. package/build/tools/vault/utils/actions/search_semantic.js.map +0 -1
package/build/setup.js ADDED
@@ -0,0 +1,112 @@
1
+ import { fileURLToPath } from "node:url";
2
+ import { env, pipeline } from "@huggingface/transformers";
3
+ import chalk from "chalk";
4
+ import inquirer from "inquirer";
5
+ import ora from "ora";
6
+ import { APP_DATA_DIR, ensureAppDataDirs, MODELS_DIR, } from "./utils/constants.js";
7
+ env.localModelPath = MODELS_DIR;
8
+ env.cacheDir = MODELS_DIR;
9
+ env.allowRemoteModels = false;
10
+ async function checkModelStatus(name, type) {
11
+ try {
12
+ await pipeline(type, name, {
13
+ local_files_only: true,
14
+ });
15
+ return true;
16
+ }
17
+ catch (_e) {
18
+ return false;
19
+ }
20
+ }
21
+ export async function setup(options = { force: false }) {
22
+ console.log(chalk.cyan.bold("\n🚀 Obsidian MCP Server: Local Model Setup\n"));
23
+ ensureAppDataDirs();
24
+ const models = [
25
+ {
26
+ name: "Xenova/bge-reranker-base",
27
+ type: "text-classification",
28
+ label: "BGE Reranker (Base)",
29
+ desc: "Improves search relevance by re-ordering results.",
30
+ },
31
+ {
32
+ name: "Xenova/paraphrase-multilingual-MiniLM-L12-v2",
33
+ type: "feature-extraction",
34
+ label: "Multilingual MiniLM",
35
+ desc: "Provides deep understanding of multilingual documents.",
36
+ },
37
+ ];
38
+ console.log(chalk.blue.bold("🔍 Current Model Status:"));
39
+ const statusList = [];
40
+ for (const m of models) {
41
+ const spinner = ora(`Checking ${m.label}...`).start();
42
+ const isReady = await checkModelStatus(m.name, m.type);
43
+ if (isReady) {
44
+ spinner.succeed(`${chalk.bold(m.label)}: ${chalk.green("Ready")}`);
45
+ }
46
+ else {
47
+ spinner.warn(`${chalk.bold(m.label)}: ${chalk.yellow("Not Found or Incomplete")}`);
48
+ }
49
+ statusList.push({ ...m, isReady });
50
+ }
51
+ const allReady = statusList.every((s) => s.isReady);
52
+ if (!options.force && allReady) {
53
+ return true;
54
+ }
55
+ console.log(chalk.blue.bold("\n📦 Installation Details:"));
56
+ console.log(`${chalk.yellow("▶")} ${chalk.bold("Model Path:")} ${chalk.cyan(MODELS_DIR)}`);
57
+ console.log(`${chalk.yellow("▶")} ${chalk.bold("Download Size:")} Approx. ${chalk.green("300MB")}`);
58
+ console.log(`${chalk.yellow("▶")} ${chalk.bold("Uninstallation:")} ${chalk.white(`rm -rf ${APP_DATA_DIR}`)}`);
59
+ console.log(chalk.dim("\n※ All processing happens locally. Your documents are never sent to external servers.\n"));
60
+ const answers = await inquirer.prompt([
61
+ {
62
+ type: "confirm",
63
+ name: "confirmed",
64
+ message: allReady
65
+ ? "All models are already installed. Re-verify them?"
66
+ : "Proceed with the installation?",
67
+ default: !allReady,
68
+ },
69
+ ]);
70
+ if (!answers.confirmed) {
71
+ console.log(chalk.yellow("\n👋 Setup skipped.\n"));
72
+ process.exit(0);
73
+ }
74
+ console.log(chalk.cyan("\n⏳ Starting processing. This may take a few minutes...\n"));
75
+ env.allowRemoteModels = true;
76
+ for (const modelInfo of models) {
77
+ const spinner = ora({
78
+ text: chalk.white(`Processing ${modelInfo.name}...`),
79
+ color: "cyan",
80
+ }).start();
81
+ try {
82
+ await pipeline(modelInfo.type, modelInfo.name);
83
+ spinner.succeed(chalk.green(`Successfully processed ${modelInfo.name}`));
84
+ }
85
+ catch (error) {
86
+ spinner.fail(chalk.red(`Failed to process ${modelInfo.name}: ${error instanceof Error ? error.message : error}`));
87
+ }
88
+ }
89
+ env.allowRemoteModels = false;
90
+ const finalCheckSpinner = ora("Verifying installation...").start();
91
+ const finalResults = await Promise.all(models.map((m) => checkModelStatus(m.name, m.type)));
92
+ if (finalResults.every((r) => r)) {
93
+ finalCheckSpinner.succeed(chalk.green.bold("Verification successful!"));
94
+ console.log(chalk.cyan.bold("\n✨ Setup complete! High-performance hybrid search is enabled.\n"));
95
+ }
96
+ else {
97
+ finalCheckSpinner.fail(chalk.red.bold("Verification failed."));
98
+ console.log(chalk.yellow("\nPlease check your internet and try again.\n"));
99
+ }
100
+ return finalResults.every((r) => r);
101
+ }
102
+ const isMain = process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1];
103
+ console.log(isMain, import.meta.url);
104
+ if (isMain || process.argv[1]?.endsWith("setup.js")) {
105
+ setup({ force: true })
106
+ .catch((error) => {
107
+ console.error(chalk.red("\n🚨 Fatal error during setup:"), error);
108
+ process.exit(1);
109
+ })
110
+ .then(() => process.exit(0));
111
+ }
112
+ //# sourceMappingURL=setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.js","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,GAAG,EAAqB,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EACN,YAAY,EACZ,iBAAiB,EACjB,UAAU,GACV,MAAM,sBAAsB,CAAC;AAE9B,GAAG,CAAC,cAAc,GAAG,UAAU,CAAC;AAChC,GAAG,CAAC,QAAQ,GAAG,UAAU,CAAC;AAC1B,GAAG,CAAC,iBAAiB,GAAG,KAAK,CAAC;AAE9B,KAAK,UAAU,gBAAgB,CAAC,IAAY,EAAE,IAAY;IACzD,IAAI,CAAC;QACJ,MAAM,QAAQ,CAAC,IAAoB,EAAE,IAAI,EAAE;YAC1C,gBAAgB,EAAE,IAAI;SACtB,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;QACb,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE;IACrD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAA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ontextprotocol/sdk/
3
3
  import { type ObsidianContentQueryParams } from "./params.js";
4
4
  export declare const name = "vault";
5
5
  export declare const annotations: ToolAnnotations;
6
- export declare const description = "\n Retrieves and searches the content of Markdown (.md, .mdx) documents stored in an Obsidian vault. Use this tool to find notes related to a specific topic or keyword and understand their core content.\n\n When to use:\n - When you need to find a specific note by its title or a keyword to check its content.\n - When you want to synthesize and summarize information scattered across multiple notes.\n - When looking for answers to questions based on your saved records, such as \"What was the project deadline?\"\n - To discover connections by finding all notes that link to a specific note.\n - When you need to retrieve a list of unfinished tasks (- [ ]) from daily notes or meeting minutes.\n - Use \"search_vault_by_semantic\" for natural language queries that require understanding of the meaning rather than exact keyword matches.\n - Use \"index_vault_to_vectordb\" to manually trigger a full re-indexing of the vault for the vector database.\n\n Returns the content of the most relevant document(s) in text format. It can also include metadata such as the document's title, tags, and creation date.\n\n Requirements: The user's Obsidian Vault path must be correctly configured in an environment variable or a similar setting. For searches, use the exact filename or include core keywords for content-based queries.\n";
6
+ export declare const description = "\n Retrieves and searches the content of Markdown (.md, .mdx) documents stored in an Obsidian vault. Use this tool to find notes related to a specific topic or keyword and understand their core content.\n\n When to use:\n - When you need to find a specific note by its title or a keyword to check its content.\n - When you want to synthesize and summarize information scattered across multiple notes.\n - When looking for answers to questions based on your saved records, such as \"What was the project deadline?\"\n - To discover connections by finding all notes that link to a specific note.\n - When you need to retrieve a list of unfinished tasks (- [ ]) from daily notes or meeting minutes.\n - Use \"index_vault_to_vectordb\" to manually trigger a full re-indexing of the vault for the vector database.\n\n Returns the content of the most relevant document(s) in text format. It can also include metadata such as the document's title, tags, and creation date.\n\n Requirements: The user's Obsidian Vault path must be correctly configured in an environment variable or a similar setting. For searches, use the exact filename or include core keywords for content-based queries.\n\n IMPORTANT INSTRUCTION FOR AI:\n If the tool response includes a 'diagnostic_message' (usually found at the beginning of the text or in a <system_directive> tag), you MUST relay this information to the user exactly once. It contains essential advice on how to improve search quality by running a local setup script via 'bunx obsidian-mcp-setup'. Do not ignore it.\n";
7
7
  export declare const register: (mcpServer: McpServer) => void;
8
8
  export declare const execute: (params: ObsidianContentQueryParams) => Promise<CallToolResult>;
9
9
  export declare const shorthandDescription: {
@@ -3,7 +3,7 @@ import { createToolError } from "../../utils/createToolError.js";
3
3
  import { getGlobalVaultManager } from "../../utils/getVaultManager.js";
4
4
  import { recordVaultResponseMetric } from "./metrics.js";
5
5
  import { obsidianContentQueryParamsZod, } from "./params.js";
6
- import { collectContext, listAllDocuments, loadMemory, readSpecificFile, searchDocuments, searchSemantic, statsAllDocuments, triggerIndexing, } from "./utils.js";
6
+ import { collectContext, listAllDocuments, loadMemory, readSpecificFile, searchDocuments, statsAllDocuments, triggerIndexing, } from "./utils.js";
7
7
  export const name = "vault";
8
8
  export const annotations = {
9
9
  title: "Obsidian Content Getter",
@@ -18,12 +18,14 @@ export const description = `
18
18
  - When looking for answers to questions based on your saved records, such as "What was the project deadline?"
19
19
  - To discover connections by finding all notes that link to a specific note.
20
20
  - When you need to retrieve a list of unfinished tasks (- [ ]) from daily notes or meeting minutes.
21
- - Use "search_vault_by_semantic" for natural language queries that require understanding of the meaning rather than exact keyword matches.
22
21
  - Use "index_vault_to_vectordb" to manually trigger a full re-indexing of the vault for the vector database.
23
22
 
24
23
  Returns the content of the most relevant document(s) in text format. It can also include metadata such as the document's title, tags, and creation date.
25
24
 
26
25
  Requirements: The user's Obsidian Vault path must be correctly configured in an environment variable or a similar setting. For searches, use the exact filename or include core keywords for content-based queries.
26
+
27
+ IMPORTANT INSTRUCTION FOR AI:
28
+ If the tool response includes a 'diagnostic_message' (usually found at the beginning of the text or in a <system_directive> tag), you MUST relay this information to the user exactly once. It contains essential advice on how to improve search quality by running a local setup script via 'bunx obsidian-mcp-setup'. Do not ignore it.
27
29
  `;
28
30
  export const register = (mcpServer) => {
29
31
  mcpServer.registerTool(name, {
@@ -73,14 +75,11 @@ export const execute = async (params) => {
73
75
  case "load_memory":
74
76
  result = await loadMemory(vaultManager, params);
75
77
  break;
76
- case "search_vault_by_semantic":
77
- result = await searchSemantic(params);
78
- break;
79
78
  case "index_vault_to_vectordb":
80
79
  result = await triggerIndexing();
81
80
  break;
82
81
  default:
83
- return createToolError(`Unknown action: ${params.action}`, "Valid actions are: search, read, list_all, stats, collect_context, load_memory, search_vault_by_semantic, index_vault_to_vectordb");
82
+ return createToolError(`Unknown action: ${params.action}`, "Valid actions are: search, read, list_all, stats, collect_context, load_memory, index_vault_to_vectordb");
84
83
  }
85
84
  await recordVaultResponseMetric(params.action, result);
86
85
  return result;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tools/vault/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAEN,6BAA6B,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,cAAc,EACd,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,eAAe,GACf,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC;AAE5B,MAAM,CAAC,MAAM,WAAW,GAAoB;IAC3C,KAAK,EAAE,yBAAyB;IAChC,aAAa,EAAE,IAAI;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;CAe1B,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,SAAoB,EAAE,EAAE;IAChD,SAAS,CAAC,YAAY,CACrB,IAAI,EACJ;QACC,KAAK,EAAE,WAAW,CAAC,KAAK,IAAI,IAAI;QAChC,WAAW,EAAE,WAAW;QACxB,WAAW,EAAE,6BAA6B,CAAC,KAAK;QAChD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AAe,CACrB,qBAAqB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC7E,CAAC;IACH,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;IACnC,EAAE,EAAE,yIAAyI;IAC7I,EAAE,EAAE,wHAAwH;CAC5H,CAAC;AAEF,eAAe;IACd,IAAI;IACJ,WAAW;IACX,WAAW;IACX,WAAW,EAAE,6BAA6B,CAAC,KAAK;IAChD,OAAO;IACP,QAAQ;IACR,oBAAoB;CACpB,CAAC"}
@@ -52,7 +52,7 @@ export declare const obsidianContentQueryParamsZod: z.ZodObject<{
52
52
  memoryMode?: "response_only" | "vault_note" | "both" | undefined;
53
53
  continuationToken?: string | undefined;
54
54
  memoryPath?: string | undefined;
55
- compressionMode?: "aggressive" | "balanced" | "none" | undefined;
55
+ compressionMode?: "none" | "aggressive" | "balanced" | undefined;
56
56
  maxOutputChars?: number | undefined;
57
57
  }, {
58
58
  action: "search" | "read" | "list_all" | "stats" | "collect_context" | "load_memory" | "search_vault_by_semantic" | "index_vault_to_vectordb";
@@ -71,7 +71,7 @@ export declare const obsidianContentQueryParamsZod: z.ZodObject<{
71
71
  memoryMode?: "response_only" | "vault_note" | "both" | undefined;
72
72
  continuationToken?: string | undefined;
73
73
  memoryPath?: string | undefined;
74
- compressionMode?: "aggressive" | "balanced" | "none" | undefined;
74
+ compressionMode?: "none" | "aggressive" | "balanced" | undefined;
75
75
  maxOutputChars?: number | undefined;
76
76
  }>;
77
77
  export type ObsidianContentQueryParams = z.infer<typeof obsidianContentQueryParamsZod>;
@@ -278,18 +278,18 @@ export declare const collectContextPayloadSchema: z.ZodObject<{
278
278
  doc_hash: z.ZodString;
279
279
  mode: z.ZodEnum<["response_only", "vault_note", "both"]>;
280
280
  }, "strip", z.ZodTypeAny, {
281
+ key: string;
281
282
  mode: "response_only" | "vault_note" | "both";
282
283
  hit: boolean;
283
284
  topic: string | null;
284
285
  doc_hash: string;
285
- key: string;
286
286
  schema_version: string;
287
287
  }, {
288
+ key: string;
288
289
  mode: "response_only" | "vault_note" | "both";
289
290
  hit: boolean;
290
291
  topic: string | null;
291
292
  doc_hash: string;
292
- key: string;
293
293
  schema_version: string;
294
294
  }>>;
295
295
  batch: z.ZodObject<{
@@ -373,11 +373,11 @@ export declare const collectContextPayloadSchema: z.ZodObject<{
373
373
  continuation_token: string | null;
374
374
  };
375
375
  cache?: {
376
+ key: string;
376
377
  mode: "response_only" | "vault_note" | "both";
377
378
  hit: boolean;
378
379
  topic: string | null;
379
380
  doc_hash: string;
380
- key: string;
381
381
  schema_version: string;
382
382
  } | undefined;
383
383
  }, {
@@ -436,11 +436,11 @@ export declare const collectContextPayloadSchema: z.ZodObject<{
436
436
  continuation_token: string | null;
437
437
  };
438
438
  cache?: {
439
+ key: string;
439
440
  mode: "response_only" | "vault_note" | "both";
440
441
  hit: boolean;
441
442
  topic: string | null;
442
443
  doc_hash: string;
443
- key: string;
444
444
  schema_version: string;
445
445
  } | undefined;
446
446
  }>;
@@ -453,7 +453,7 @@ export declare const collectContextCompressionSchema: z.ZodObject<{
453
453
  truncated: z.ZodBoolean;
454
454
  expand_hint: z.ZodString;
455
455
  }, "strip", z.ZodTypeAny, {
456
- mode: "aggressive" | "balanced" | "none";
456
+ mode: "none" | "aggressive" | "balanced";
457
457
  estimated_tokens: number;
458
458
  truncated: boolean;
459
459
  output_chars: number;
@@ -467,7 +467,7 @@ export declare const collectContextCompressionSchema: z.ZodObject<{
467
467
  source_chars: number;
468
468
  max_output_chars: number | null;
469
469
  expand_hint: string;
470
- mode?: "aggressive" | "balanced" | "none" | undefined;
470
+ mode?: "none" | "aggressive" | "balanced" | undefined;
471
471
  }>;
472
472
  export declare const collectContextResponseDataSchema: z.ZodObject<{
473
473
  action: z.ZodLiteral<"collect_context">;
@@ -613,18 +613,18 @@ export declare const collectContextResponseDataSchema: z.ZodObject<{
613
613
  doc_hash: z.ZodString;
614
614
  mode: z.ZodEnum<["response_only", "vault_note", "both"]>;
615
615
  }, "strip", z.ZodTypeAny, {
616
+ key: string;
616
617
  mode: "response_only" | "vault_note" | "both";
617
618
  hit: boolean;
618
619
  topic: string | null;
619
620
  doc_hash: string;
620
- key: string;
621
621
  schema_version: string;
622
622
  }, {
623
+ key: string;
623
624
  mode: "response_only" | "vault_note" | "both";
624
625
  hit: boolean;
625
626
  topic: string | null;
626
627
  doc_hash: string;
627
- key: string;
628
628
  schema_version: string;
629
629
  }>>;
630
630
  batch: z.ZodObject<{
@@ -662,7 +662,7 @@ export declare const collectContextResponseDataSchema: z.ZodObject<{
662
662
  truncated: z.ZodBoolean;
663
663
  expand_hint: z.ZodString;
664
664
  }, "strip", z.ZodTypeAny, {
665
- mode: "aggressive" | "balanced" | "none";
665
+ mode: "none" | "aggressive" | "balanced";
666
666
  estimated_tokens: number;
667
667
  truncated: boolean;
668
668
  output_chars: number;
@@ -676,7 +676,7 @@ export declare const collectContextResponseDataSchema: z.ZodObject<{
676
676
  source_chars: number;
677
677
  max_output_chars: number | null;
678
678
  expand_hint: string;
679
- mode?: "aggressive" | "balanced" | "none" | undefined;
679
+ mode?: "none" | "aggressive" | "balanced" | undefined;
680
680
  }>;
681
681
  }, "strip", z.ZodTypeAny, {
682
682
  documents: {
@@ -698,7 +698,7 @@ export declare const collectContextResponseDataSchema: z.ZodObject<{
698
698
  backlinks_count: number;
699
699
  }[];
700
700
  compression: {
701
- mode: "aggressive" | "balanced" | "none";
701
+ mode: "none" | "aggressive" | "balanced";
702
702
  estimated_tokens: number;
703
703
  truncated: boolean;
704
704
  output_chars: number;
@@ -743,11 +743,11 @@ export declare const collectContextResponseDataSchema: z.ZodObject<{
743
743
  continuation_token: string | null;
744
744
  };
745
745
  cache?: {
746
+ key: string;
746
747
  mode: "response_only" | "vault_note" | "both";
747
748
  hit: boolean;
748
749
  topic: string | null;
749
750
  doc_hash: string;
750
- key: string;
751
751
  schema_version: string;
752
752
  } | undefined;
753
753
  }, {
@@ -776,7 +776,7 @@ export declare const collectContextResponseDataSchema: z.ZodObject<{
776
776
  source_chars: number;
777
777
  max_output_chars: number | null;
778
778
  expand_hint: string;
779
- mode?: "aggressive" | "balanced" | "none" | undefined;
779
+ mode?: "none" | "aggressive" | "balanced" | undefined;
780
780
  };
781
781
  action: "collect_context";
782
782
  topic: string | null;
@@ -815,11 +815,11 @@ export declare const collectContextResponseDataSchema: z.ZodObject<{
815
815
  continuation_token: string | null;
816
816
  };
817
817
  cache?: {
818
+ key: string;
818
819
  mode: "response_only" | "vault_note" | "both";
819
820
  hit: boolean;
820
821
  topic: string | null;
821
822
  doc_hash: string;
822
- key: string;
823
823
  schema_version: string;
824
824
  } | undefined;
825
825
  }>;
@@ -969,18 +969,18 @@ export declare const collectContextResponseSchema: z.ZodObject<{
969
969
  doc_hash: z.ZodString;
970
970
  mode: z.ZodEnum<["response_only", "vault_note", "both"]>;
971
971
  }, "strip", z.ZodTypeAny, {
972
+ key: string;
972
973
  mode: "response_only" | "vault_note" | "both";
973
974
  hit: boolean;
974
975
  topic: string | null;
975
976
  doc_hash: string;
976
- key: string;
977
977
  schema_version: string;
978
978
  }, {
979
+ key: string;
979
980
  mode: "response_only" | "vault_note" | "both";
980
981
  hit: boolean;
981
982
  topic: string | null;
982
983
  doc_hash: string;
983
- key: string;
984
984
  schema_version: string;
985
985
  }>>;
986
986
  batch: z.ZodObject<{
@@ -1018,7 +1018,7 @@ export declare const collectContextResponseSchema: z.ZodObject<{
1018
1018
  truncated: z.ZodBoolean;
1019
1019
  expand_hint: z.ZodString;
1020
1020
  }, "strip", z.ZodTypeAny, {
1021
- mode: "aggressive" | "balanced" | "none";
1021
+ mode: "none" | "aggressive" | "balanced";
1022
1022
  estimated_tokens: number;
1023
1023
  truncated: boolean;
1024
1024
  output_chars: number;
@@ -1032,7 +1032,7 @@ export declare const collectContextResponseSchema: z.ZodObject<{
1032
1032
  source_chars: number;
1033
1033
  max_output_chars: number | null;
1034
1034
  expand_hint: string;
1035
- mode?: "aggressive" | "balanced" | "none" | undefined;
1035
+ mode?: "none" | "aggressive" | "balanced" | undefined;
1036
1036
  }>;
1037
1037
  }, "strip", z.ZodTypeAny, {
1038
1038
  documents: {
@@ -1054,7 +1054,7 @@ export declare const collectContextResponseSchema: z.ZodObject<{
1054
1054
  backlinks_count: number;
1055
1055
  }[];
1056
1056
  compression: {
1057
- mode: "aggressive" | "balanced" | "none";
1057
+ mode: "none" | "aggressive" | "balanced";
1058
1058
  estimated_tokens: number;
1059
1059
  truncated: boolean;
1060
1060
  output_chars: number;
@@ -1099,11 +1099,11 @@ export declare const collectContextResponseSchema: z.ZodObject<{
1099
1099
  continuation_token: string | null;
1100
1100
  };
1101
1101
  cache?: {
1102
+ key: string;
1102
1103
  mode: "response_only" | "vault_note" | "both";
1103
1104
  hit: boolean;
1104
1105
  topic: string | null;
1105
1106
  doc_hash: string;
1106
- key: string;
1107
1107
  schema_version: string;
1108
1108
  } | undefined;
1109
1109
  }, {
@@ -1132,7 +1132,7 @@ export declare const collectContextResponseSchema: z.ZodObject<{
1132
1132
  source_chars: number;
1133
1133
  max_output_chars: number | null;
1134
1134
  expand_hint: string;
1135
- mode?: "aggressive" | "balanced" | "none" | undefined;
1135
+ mode?: "none" | "aggressive" | "balanced" | undefined;
1136
1136
  };
1137
1137
  action: "collect_context";
1138
1138
  topic: string | null;
@@ -1171,11 +1171,11 @@ export declare const collectContextResponseSchema: z.ZodObject<{
1171
1171
  continuation_token: string | null;
1172
1172
  };
1173
1173
  cache?: {
1174
+ key: string;
1174
1175
  mode: "response_only" | "vault_note" | "both";
1175
1176
  hit: boolean;
1176
1177
  topic: string | null;
1177
1178
  doc_hash: string;
1178
- key: string;
1179
1179
  schema_version: string;
1180
1180
  } | undefined;
1181
1181
  }>;
@@ -1201,7 +1201,7 @@ export declare const collectContextResponseSchema: z.ZodObject<{
1201
1201
  backlinks_count: number;
1202
1202
  }[];
1203
1203
  compression: {
1204
- mode: "aggressive" | "balanced" | "none";
1204
+ mode: "none" | "aggressive" | "balanced";
1205
1205
  estimated_tokens: number;
1206
1206
  truncated: boolean;
1207
1207
  output_chars: number;
@@ -1246,11 +1246,11 @@ export declare const collectContextResponseSchema: z.ZodObject<{
1246
1246
  continuation_token: string | null;
1247
1247
  };
1248
1248
  cache?: {
1249
+ key: string;
1249
1250
  mode: "response_only" | "vault_note" | "both";
1250
1251
  hit: boolean;
1251
1252
  topic: string | null;
1252
1253
  doc_hash: string;
1253
- key: string;
1254
1254
  schema_version: string;
1255
1255
  } | undefined;
1256
1256
  };
@@ -1282,7 +1282,7 @@ export declare const collectContextResponseSchema: z.ZodObject<{
1282
1282
  source_chars: number;
1283
1283
  max_output_chars: number | null;
1284
1284
  expand_hint: string;
1285
- mode?: "aggressive" | "balanced" | "none" | undefined;
1285
+ mode?: "none" | "aggressive" | "balanced" | undefined;
1286
1286
  };
1287
1287
  action: "collect_context";
1288
1288
  topic: string | null;
@@ -1321,11 +1321,11 @@ export declare const collectContextResponseSchema: z.ZodObject<{
1321
1321
  continuation_token: string | null;
1322
1322
  };
1323
1323
  cache?: {
1324
+ key: string;
1324
1325
  mode: "response_only" | "vault_note" | "both";
1325
1326
  hit: boolean;
1326
1327
  topic: string | null;
1327
1328
  doc_hash: string;
1328
- key: string;
1329
1329
  schema_version: string;
1330
1330
  } | undefined;
1331
1331
  };