@arabold/docs-mcp-server 1.2.0 → 1.2.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.
@@ -10912,6 +10912,14 @@ var DocumentStore = class {
10912
10912
  batchSize: 512
10913
10913
  });
10914
10914
  }
10915
+ /**
10916
+ * Escapes a query string for use with SQLite FTS5 MATCH operator.
10917
+ * Wraps the query in double quotes and escapes internal double quotes.
10918
+ */
10919
+ escapeFtsQuery(query) {
10920
+ const escapedQuotes = query.replace(/"/g, '""');
10921
+ return `"${escapedQuotes}"`;
10922
+ }
10915
10923
  /**
10916
10924
  * Initializes database connection and ensures readiness
10917
10925
  */
@@ -11057,6 +11065,7 @@ var DocumentStore = class {
11057
11065
  async findByContent(library, version, query, limit) {
11058
11066
  try {
11059
11067
  const embedding = await this.embeddings.embedQuery(query);
11068
+ const ftsQuery = this.escapeFtsQuery(query);
11060
11069
  const stmt = this.db.prepare(`
11061
11070
  WITH vec_scores AS (
11062
11071
  SELECT
@@ -11099,7 +11108,8 @@ var DocumentStore = class {
11099
11108
  limit,
11100
11109
  library.toLowerCase(),
11101
11110
  version.toLowerCase(),
11102
- query,
11111
+ ftsQuery,
11112
+ // Use the escaped query
11103
11113
  limit
11104
11114
  );
11105
11115
  const rankedResults = this.assignRanks(rawResults);
@@ -11428,4 +11438,4 @@ export {
11428
11438
  RemoveTool,
11429
11439
  DocumentManagementService
11430
11440
  };
11431
- //# sourceMappingURL=chunk-Y3EE54SV.js.map
11441
+ //# sourceMappingURL=chunk-KPQQOEBY.js.map