strapi-content-embeddings 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/_chunks/en-B4KWt_jN.js +0 -1
  2. package/dist/_chunks/en-Byx4XI2L.mjs +0 -1
  3. package/dist/admin/index.js +754 -4
  4. package/dist/admin/index.mjs +751 -4
  5. package/dist/server/index.js +234 -231
  6. package/dist/server/index.mjs +234 -231
  7. package/dist/server/src/index.d.ts +5 -0
  8. package/dist/server/src/mcp/schemas/index.d.ts +3 -0
  9. package/dist/server/src/mcp/tools/create-embedding.d.ts +3 -4
  10. package/dist/server/src/mcp/tools/get-embedding.d.ts +3 -3
  11. package/dist/server/src/mcp/tools/index.d.ts +1 -0
  12. package/dist/server/src/mcp/tools/list-embeddings.d.ts +3 -3
  13. package/dist/server/src/mcp/tools/rag-query.d.ts +3 -3
  14. package/dist/server/src/mcp/tools/semantic-search.d.ts +3 -3
  15. package/dist/server/src/services/ai-tools.d.ts +13 -0
  16. package/dist/server/src/services/index.d.ts +5 -0
  17. package/dist/server/src/tools/create-embedding.d.ts +9 -0
  18. package/dist/server/src/tools/get-embedding.d.ts +8 -0
  19. package/dist/server/src/tools/index.d.ts +14 -0
  20. package/dist/server/src/tools/list-embeddings.d.ts +8 -0
  21. package/dist/server/src/tools/rag-query.d.ts +8 -0
  22. package/dist/server/src/tools/semantic-search.d.ts +8 -0
  23. package/dist/server/src/tools/types.d.ts +14 -0
  24. package/package.json +3 -3
  25. package/dist/_chunks/App-ByRBbkZn.js +0 -1600
  26. package/dist/_chunks/App-ByRBbkZn.js.map +0 -1
  27. package/dist/_chunks/App-MjsTrWRS.mjs +0 -1596
  28. package/dist/_chunks/App-MjsTrWRS.mjs.map +0 -1
  29. package/dist/_chunks/en-B4KWt_jN.js.map +0 -1
  30. package/dist/_chunks/en-Byx4XI2L.mjs.map +0 -1
  31. package/dist/_chunks/index-TWbcT-zJ.js +0 -785
  32. package/dist/_chunks/index-TWbcT-zJ.js.map +0 -1
  33. package/dist/_chunks/index-ifqYByO5.mjs +0 -783
  34. package/dist/_chunks/index-ifqYByO5.mjs.map +0 -1
  35. package/dist/admin/index.js.map +0 -1
  36. package/dist/admin/index.mjs.map +0 -1
  37. package/dist/server/index.js.map +0 -1
  38. package/dist/server/index.mjs.map +0 -1
@@ -1,10 +1,10 @@
1
1
  /**
2
- * RAG Query Tool
2
+ * RAG Query Tool — MCP Wrapper
3
3
  *
4
- * Performs Retrieval-Augmented Generation to answer questions using embedded content.
4
+ * Thin MCP adapter that delegates to the canonical tool implementation.
5
5
  */
6
6
  import type { Core } from '@strapi/strapi';
7
- export declare const ragQueryTool: {
7
+ export declare const ragQueryMcpTool: {
8
8
  name: string;
9
9
  description: string;
10
10
  inputSchema: {
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Semantic Search Tool
2
+ * Semantic Search Tool — MCP Wrapper
3
3
  *
4
- * Performs vector similarity search to find relevant content.
4
+ * Thin MCP adapter that delegates to the canonical tool implementation.
5
5
  */
6
6
  import type { Core } from '@strapi/strapi';
7
- export declare const semanticSearchTool: {
7
+ export declare const semanticSearchMcpTool: {
8
8
  name: string;
9
9
  description: string;
10
10
  inputSchema: {
@@ -0,0 +1,13 @@
1
+ /**
2
+ * AI Tools Service — Adapter for AI SDK Discovery
3
+ *
4
+ * Re-exports canonical tool definitions from ../tools for AI SDK registration.
5
+ * The AI SDK discovery loop calls getTools() to register these into its ToolRegistry.
6
+ */
7
+ import type { Core } from '@strapi/strapi';
8
+ declare const _default: ({ strapi }: {
9
+ strapi: Core.Strapi;
10
+ }) => {
11
+ getTools(): import("../tools").ToolDefinition[];
12
+ };
13
+ export default _default;
@@ -44,5 +44,10 @@ declare const _default: {
44
44
  }>;
45
45
  recreateAllEmbeddings(): Promise<import("./sync").RecreateResult>;
46
46
  };
47
+ 'ai-tools': ({ strapi }: {
48
+ strapi: import("@strapi/types/dist/core").Strapi;
49
+ }) => {
50
+ getTools(): import("../tools").ToolDefinition[];
51
+ };
47
52
  };
48
53
  export default _default;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Create Embedding — Canonical Tool Definition
3
+ *
4
+ * Creates a new embedding from text content.
5
+ * Supports automatic chunking for large content.
6
+ * Returns raw result objects (no MCP envelope).
7
+ */
8
+ import type { ToolDefinition } from './types';
9
+ export declare const createEmbeddingTool: ToolDefinition;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Get Embedding — Canonical Tool Definition
3
+ *
4
+ * Retrieves a single embedding by document ID.
5
+ * Returns raw result objects (no MCP envelope).
6
+ */
7
+ import type { ToolDefinition } from './types';
8
+ export declare const getEmbeddingTool: ToolDefinition;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Canonical Tool Definitions for Content Embeddings
3
+ *
4
+ * These are the source-of-truth implementations.
5
+ * Both the AI SDK service (ai-tools.ts) and the MCP server consume these.
6
+ */
7
+ export type { ToolDefinition } from './types';
8
+ export { semanticSearchTool } from './semantic-search';
9
+ export { ragQueryTool } from './rag-query';
10
+ export { listEmbeddingsTool } from './list-embeddings';
11
+ export { getEmbeddingTool } from './get-embedding';
12
+ export { createEmbeddingTool } from './create-embedding';
13
+ import type { ToolDefinition } from './types';
14
+ export declare const tools: ToolDefinition[];
@@ -0,0 +1,8 @@
1
+ /**
2
+ * List Embeddings — Canonical Tool Definition
3
+ *
4
+ * Lists all embeddings stored in the database with pagination.
5
+ * Returns raw result objects (no MCP envelope).
6
+ */
7
+ import type { ToolDefinition } from './types';
8
+ export declare const listEmbeddingsTool: ToolDefinition;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * RAG Query — Canonical Tool Definition
3
+ *
4
+ * Performs Retrieval-Augmented Generation to answer questions using embedded content.
5
+ * Returns raw result objects (no MCP envelope).
6
+ */
7
+ import type { ToolDefinition } from './types';
8
+ export declare const ragQueryTool: ToolDefinition;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Semantic Search — Canonical Tool Definition
3
+ *
4
+ * Performs vector similarity search to find relevant content.
5
+ * Returns raw result objects (no MCP envelope).
6
+ */
7
+ import type { ToolDefinition } from './types';
8
+ export declare const semanticSearchTool: ToolDefinition;
@@ -0,0 +1,14 @@
1
+ import type { Core } from '@strapi/strapi';
2
+ import type { z } from 'zod';
3
+ export interface ToolDefinition {
4
+ name: string;
5
+ description: string;
6
+ schema: z.ZodObject<any>;
7
+ execute: (args: any, strapi: Core.Strapi, context?: {
8
+ adminUserId?: number;
9
+ }) => Promise<unknown>;
10
+ /** If true, tool is only available in AI SDK chat, not exposed via MCP */
11
+ internal?: boolean;
12
+ /** If true, tool is safe for unauthenticated public chat (read-only) */
13
+ publicSafe?: boolean;
14
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "strapi-content-embeddings",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Strapi v5 plugin for vector embeddings with OpenAI and Neon PostgreSQL. Enables semantic search, RAG chat, and MCP (Model Context Protocol) integration.",
5
5
  "keywords": [
6
6
  "strapi",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "type": "commonjs",
28
28
  "overrides": {
29
- "@langchain/core": "1.1.9"
29
+ "@langchain/core": "^1.1.31"
30
30
  },
31
31
  "exports": {
32
32
  "./package.json": "./package.json",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  "dependencies": {
61
61
  "@langchain/community": "^1.1.2",
62
- "@langchain/core": "1.1.9",
62
+ "@langchain/core": "^1.1.31",
63
63
  "@langchain/openai": "^1.2.1",
64
64
  "@mdxeditor/editor": "^3.52.3",
65
65
  "@modelcontextprotocol/sdk": "^1.12.0",