strapi-content-embeddings 0.2.0 → 0.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.
- package/dist/_chunks/en-B4KWt_jN.js +0 -1
- package/dist/_chunks/en-Byx4XI2L.mjs +0 -1
- package/dist/admin/index.js +686 -4
- package/dist/admin/index.mjs +683 -4
- package/dist/server/index.js +293 -287
- package/dist/server/index.mjs +293 -287
- package/dist/server/src/index.d.ts +5 -0
- package/dist/server/src/mcp/schemas/index.d.ts +3 -0
- package/dist/server/src/mcp/tools/create-embedding.d.ts +3 -4
- package/dist/server/src/mcp/tools/get-embedding.d.ts +3 -3
- package/dist/server/src/mcp/tools/index.d.ts +1 -0
- package/dist/server/src/mcp/tools/list-embeddings.d.ts +3 -3
- package/dist/server/src/mcp/tools/rag-query.d.ts +3 -3
- package/dist/server/src/mcp/tools/semantic-search.d.ts +3 -3
- package/dist/server/src/services/ai-tools.d.ts +13 -0
- package/dist/server/src/services/embeddings.d.ts +2 -2
- package/dist/server/src/services/index.d.ts +5 -0
- package/dist/server/src/tools/create-embedding.d.ts +9 -0
- package/dist/server/src/tools/get-embedding.d.ts +8 -0
- package/dist/server/src/tools/index.d.ts +14 -0
- package/dist/server/src/tools/list-embeddings.d.ts +8 -0
- package/dist/server/src/tools/rag-query.d.ts +8 -0
- package/dist/server/src/tools/semantic-search.d.ts +8 -0
- package/dist/server/src/tools/types.d.ts +14 -0
- package/package.json +1 -1
- package/dist/_chunks/App-ByRBbkZn.js +0 -1600
- package/dist/_chunks/App-ByRBbkZn.js.map +0 -1
- package/dist/_chunks/App-MjsTrWRS.mjs +0 -1596
- package/dist/_chunks/App-MjsTrWRS.mjs.map +0 -1
- package/dist/_chunks/en-B4KWt_jN.js.map +0 -1
- package/dist/_chunks/en-Byx4XI2L.mjs.map +0 -1
- package/dist/_chunks/index-TWbcT-zJ.js +0 -785
- package/dist/_chunks/index-TWbcT-zJ.js.map +0 -1
- package/dist/_chunks/index-ifqYByO5.mjs +0 -783
- package/dist/_chunks/index-ifqYByO5.mjs.map +0 -1
- package/dist/admin/index.js.map +0 -1
- package/dist/admin/index.mjs.map +0 -1
- package/dist/server/index.js.map +0 -1
- package/dist/server/index.mjs.map +0 -1
|
@@ -133,6 +133,11 @@ declare const _default: {
|
|
|
133
133
|
}>;
|
|
134
134
|
recreateAllEmbeddings(): Promise<import("./services/sync").RecreateResult>;
|
|
135
135
|
};
|
|
136
|
+
'ai-tools': ({ strapi }: {
|
|
137
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
138
|
+
}) => {
|
|
139
|
+
getTools(): import("./tools").ToolDefinition[];
|
|
140
|
+
};
|
|
136
141
|
};
|
|
137
142
|
contentTypes: {
|
|
138
143
|
embedding: {
|
|
@@ -49,14 +49,17 @@ export declare const CreateEmbeddingSchema: z.ZodObject<{
|
|
|
49
49
|
title: z.ZodString;
|
|
50
50
|
content: z.ZodString;
|
|
51
51
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
52
|
+
autoChunk: z.ZodOptional<z.ZodBoolean>;
|
|
52
53
|
}, "strip", z.ZodTypeAny, {
|
|
53
54
|
metadata?: Record<string, any>;
|
|
54
55
|
content?: string;
|
|
55
56
|
title?: string;
|
|
57
|
+
autoChunk?: boolean;
|
|
56
58
|
}, {
|
|
57
59
|
metadata?: Record<string, any>;
|
|
58
60
|
content?: string;
|
|
59
61
|
title?: string;
|
|
62
|
+
autoChunk?: boolean;
|
|
60
63
|
}>;
|
|
61
64
|
export declare const ToolSchemas: Record<string, z.ZodSchema>;
|
|
62
65
|
/**
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Create Embedding Tool
|
|
2
|
+
* Create Embedding Tool — MCP Wrapper
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* Supports automatic chunking for large content.
|
|
4
|
+
* Thin MCP adapter that delegates to the canonical tool implementation.
|
|
6
5
|
*/
|
|
7
6
|
import type { Core } from '@strapi/strapi';
|
|
8
|
-
export declare const
|
|
7
|
+
export declare const createEmbeddingMcpTool: {
|
|
9
8
|
name: string;
|
|
10
9
|
description: string;
|
|
11
10
|
inputSchema: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Get Embedding Tool
|
|
2
|
+
* Get Embedding Tool — MCP Wrapper
|
|
3
3
|
*
|
|
4
|
-
*
|
|
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
|
|
7
|
+
export declare const getEmbeddingMcpTool: {
|
|
8
8
|
name: string;
|
|
9
9
|
description: string;
|
|
10
10
|
inputSchema: {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* MCP Tools for Content Embeddings
|
|
3
3
|
*
|
|
4
4
|
* Exposes vector search, RAG queries, and embedding management tools.
|
|
5
|
+
* Each handler is a thin wrapper around canonical tool definitions in ../../tools.
|
|
5
6
|
*/
|
|
6
7
|
import type { Core } from '@strapi/strapi';
|
|
7
8
|
export declare const tools: ({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* List Embeddings Tool
|
|
2
|
+
* List Embeddings Tool — MCP Wrapper
|
|
3
3
|
*
|
|
4
|
-
*
|
|
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
|
|
7
|
+
export declare const listEmbeddingsMcpTool: {
|
|
8
8
|
name: string;
|
|
9
9
|
description: string;
|
|
10
10
|
inputSchema: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* RAG Query Tool
|
|
2
|
+
* RAG Query Tool — MCP Wrapper
|
|
3
3
|
*
|
|
4
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
|
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;
|
|
@@ -64,8 +64,8 @@ declare const embeddings: ({ strapi }: {
|
|
|
64
64
|
*/
|
|
65
65
|
deleteRelatedChunks(documentId: string): Promise<number>;
|
|
66
66
|
/**
|
|
67
|
-
* Update
|
|
68
|
-
*
|
|
67
|
+
* Update embeddings with automatic chunking support
|
|
68
|
+
* Handles re-chunking when content changes and exceeds chunk size
|
|
69
69
|
*/
|
|
70
70
|
updateChunkedEmbedding(id: string, data: UpdateEmbeddingData): Promise<ChunkedEmbeddingResult>;
|
|
71
71
|
updateEmbedding(id: string, data: UpdateEmbeddingData): Promise<any>;
|
|
@@ -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,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.
|
|
3
|
+
"version": "0.2.1",
|
|
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",
|