@equinor/fusion-framework-cli-plugin-ai-mcp 1.0.5 → 2.0.0

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 (35) hide show
  1. package/CHANGELOG.md +67 -2
  2. package/README.md +70 -80
  3. package/dist/esm/index.js +12 -2
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/esm/mcp.js +7 -2
  6. package/dist/esm/mcp.js.map +1 -1
  7. package/dist/esm/tools/fusion-search-api.js +18 -3
  8. package/dist/esm/tools/fusion-search-api.js.map +1 -1
  9. package/dist/esm/tools/fusion-search-cookbook.js +15 -3
  10. package/dist/esm/tools/fusion-search-cookbook.js.map +1 -1
  11. package/dist/esm/tools/fusion-search-eds.js +15 -3
  12. package/dist/esm/tools/fusion-search-eds.js.map +1 -1
  13. package/dist/esm/tools/fusion-search-markdown.js +15 -3
  14. package/dist/esm/tools/fusion-search-markdown.js.map +1 -1
  15. package/dist/esm/tools/fusion-search.tool.js +19 -2
  16. package/dist/esm/tools/fusion-search.tool.js.map +1 -1
  17. package/dist/esm/version.js +1 -1
  18. package/dist/tsconfig.tsbuildinfo +1 -1
  19. package/dist/types/index.d.ts +12 -2
  20. package/dist/types/mcp.d.ts +7 -0
  21. package/dist/types/tools/fusion-search-api.d.ts +18 -3
  22. package/dist/types/tools/fusion-search-cookbook.d.ts +15 -3
  23. package/dist/types/tools/fusion-search-eds.d.ts +15 -3
  24. package/dist/types/tools/fusion-search-markdown.d.ts +15 -3
  25. package/dist/types/tools/fusion-search.tool.d.ts +22 -2
  26. package/dist/types/version.d.ts +1 -1
  27. package/package.json +10 -8
  28. package/src/index.ts +12 -2
  29. package/src/mcp.ts +14 -3
  30. package/src/tools/fusion-search-api.ts +18 -3
  31. package/src/tools/fusion-search-cookbook.ts +15 -3
  32. package/src/tools/fusion-search-eds.ts +15 -3
  33. package/src/tools/fusion-search-markdown.ts +15 -3
  34. package/src/tools/fusion-search.tool.ts +28 -3
  35. package/src/version.ts +1 -1
@@ -1,7 +1,17 @@
1
1
  import type { Command } from 'commander';
2
2
  /**
3
- * Registers the AI MCP server plugin command with the CLI program
4
- * @param program - The Commander program instance to register commands with
3
+ * Registers the AI MCP server plugin with the Fusion Framework CLI.
4
+ *
5
+ * Adds the `ai mcp` subcommand to the given Commander program so that
6
+ * running `ffc ai mcp` starts a Model Context Protocol server.
7
+ *
8
+ * @param program - Root Commander {@link Command} instance provided by the CLI bootstrap
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { registerAiPlugin } from '@equinor/fusion-framework-cli-plugin-ai-mcp';
13
+ * registerAiPlugin(program);
14
+ * ```
5
15
  */
6
16
  export declare function registerAiPlugin(program: Command): void;
7
17
  export default registerAiPlugin;
@@ -1,2 +1,9 @@
1
+ /**
2
+ * Fully-configured Commander {@link Command} for `ai mcp`.
3
+ *
4
+ * Includes all Azure OpenAI embedding and Azure Search options required by
5
+ * the search tools. Chat options are excluded because the MCP server does
6
+ * not perform chat completions.
7
+ */
1
8
  export declare const command: import("commander").Command;
2
9
  export default command;
@@ -1,8 +1,14 @@
1
1
  import type { FrameworkInstance } from '@equinor/fusion-framework-cli-plugin-ai-base';
2
2
  import type { AiOptions } from '@equinor/fusion-framework-cli-plugin-ai-base/command-options';
3
3
  /**
4
- * Tool definition for searching Fusion Framework API reference.
5
- * This tool enables semantic search across TypeScript/TSDoc code documentation, function signatures, and class definitions.
4
+ * MCP tool definition for `fusion_search_api`.
5
+ *
6
+ * Enables semantic search scoped to Fusion Framework TypeScript API
7
+ * reference — TSDoc blocks, function signatures, class definitions,
8
+ * and interface declarations indexed as `tsdoc` documents.
9
+ *
10
+ * Registered with the MCP server so that AI assistants can discover
11
+ * and invoke the tool by name.
6
12
  */
7
13
  export declare const toolDefinition: {
8
14
  readonly name: "fusion_search_api";
@@ -24,7 +30,16 @@ export declare const toolDefinition: {
24
30
  };
25
31
  };
26
32
  /**
27
- * Tool handler for fusion_search_api
33
+ * Handles invocations of the `fusion_search_api` MCP tool.
34
+ *
35
+ * Queries the Azure Cognitive Search vector store with a `tsdoc` category
36
+ * filter and returns matching documents as JSON text content.
37
+ *
38
+ * @param args - Raw tool arguments containing `query` (string) and optional `limit` (number)
39
+ * @param framework - Active {@link FrameworkInstance} with the AI module loaded
40
+ * @param options - AI plugin options including Azure Search index name and optional `verbose` flag
41
+ * @returns MCP-compliant content array with search results, or an error payload
42
+ * @throws {Error} If the vector store is not configured or `query` is missing
28
43
  */
29
44
  export declare function handleTool(args: Record<string, unknown>, framework: FrameworkInstance, options: AiOptions & {
30
45
  verbose?: boolean;
@@ -1,8 +1,11 @@
1
1
  import type { FrameworkInstance } from '@equinor/fusion-framework-cli-plugin-ai-base';
2
2
  import type { AiOptions } from '@equinor/fusion-framework-cli-plugin-ai-base/command-options';
3
3
  /**
4
- * Tool definition for searching Fusion Framework cookbooks.
5
- * This tool enables semantic search across example implementations, tutorials, and how-to guides.
4
+ * MCP tool definition for `fusion_search_cookbook`.
5
+ *
6
+ * Enables semantic search scoped to Fusion Framework cookbook content —
7
+ * example implementations, tutorials, how-to guides, and practical recipes
8
+ * indexed as `cookbook` documents.
6
9
  */
7
10
  export declare const toolDefinition: {
8
11
  readonly name: "fusion_search_cookbook";
@@ -24,7 +27,16 @@ export declare const toolDefinition: {
24
27
  };
25
28
  };
26
29
  /**
27
- * Tool handler for fusion_search_cookbook
30
+ * Handles invocations of the `fusion_search_cookbook` MCP tool.
31
+ *
32
+ * Queries the Azure Cognitive Search vector store with a `cookbook` category
33
+ * filter and returns matching tutorial / recipe documents as JSON text content.
34
+ *
35
+ * @param args - Raw tool arguments containing `query` (string) and optional `limit` (number)
36
+ * @param framework - Active {@link FrameworkInstance} with the AI module loaded
37
+ * @param options - AI plugin options including Azure Search index name and optional `verbose` flag
38
+ * @returns MCP-compliant content array with search results, or an error payload
39
+ * @throws {Error} If the vector store is not configured or `query` is missing
28
40
  */
29
41
  export declare function handleTool(args: Record<string, unknown>, framework: FrameworkInstance, options: AiOptions & {
30
42
  verbose?: boolean;
@@ -1,8 +1,11 @@
1
1
  import type { FrameworkInstance } from '@equinor/fusion-framework-cli-plugin-ai-base';
2
2
  import type { AiOptions } from '@equinor/fusion-framework-cli-plugin-ai-base/command-options';
3
3
  /**
4
- * Tool definition for searching EDS (Equinor Design System) components from Storybook.
5
- * This tool enables semantic search across component examples, props, usage patterns, and Storybook stories.
4
+ * MCP tool definition for `fusion_search_eds`.
5
+ *
6
+ * Enables semantic search scoped to EDS (Equinor Design System) Storybook
7
+ * content — component examples, prop tables, usage patterns, accessibility
8
+ * notes, and design-token references indexed as `storybook` documents.
6
9
  */
7
10
  export declare const toolDefinition: {
8
11
  readonly name: "fusion_search_eds";
@@ -24,7 +27,16 @@ export declare const toolDefinition: {
24
27
  };
25
28
  };
26
29
  /**
27
- * Tool handler for fusion_search_eds
30
+ * Handles invocations of the `fusion_search_eds` MCP tool.
31
+ *
32
+ * Queries the Azure Cognitive Search vector store with a `storybook` category
33
+ * filter and returns matching EDS component documents as JSON text content.
34
+ *
35
+ * @param args - Raw tool arguments containing `query` (string) and optional `limit` (number)
36
+ * @param framework - Active {@link FrameworkInstance} with the AI module loaded
37
+ * @param options - AI plugin options including Azure Search index name and optional `verbose` flag
38
+ * @returns MCP-compliant content array with search results, or an error payload
39
+ * @throws {Error} If the vector store is not configured or `query` is missing
28
40
  */
29
41
  export declare function handleTool(args: Record<string, unknown>, framework: FrameworkInstance, options: AiOptions & {
30
42
  verbose?: boolean;
@@ -1,8 +1,11 @@
1
1
  import type { FrameworkInstance } from '@equinor/fusion-framework-cli-plugin-ai-base';
2
2
  import type { AiOptions } from '@equinor/fusion-framework-cli-plugin-ai-base/command-options';
3
3
  /**
4
- * Tool definition for searching Fusion Framework markdown documentation.
5
- * This tool enables semantic search across markdown files, guides, and documentation.
4
+ * MCP tool definition for `fusion_search_markdown`.
5
+ *
6
+ * Enables semantic search scoped to Fusion Framework markdown
7
+ * documentation — architecture guides, migration notes, conceptual
8
+ * overviews, and README content indexed as `markdown` documents.
6
9
  */
7
10
  export declare const toolDefinition: {
8
11
  readonly name: "fusion_search_markdown";
@@ -24,7 +27,16 @@ export declare const toolDefinition: {
24
27
  };
25
28
  };
26
29
  /**
27
- * Tool handler for fusion_search_markdown
30
+ * Handles invocations of the `fusion_search_markdown` MCP tool.
31
+ *
32
+ * Queries the Azure Cognitive Search vector store with a `markdown` category
33
+ * filter and returns matching documentation pages as JSON text content.
34
+ *
35
+ * @param args - Raw tool arguments containing `query` (string) and optional `limit` (number)
36
+ * @param framework - Active {@link FrameworkInstance} with the AI module loaded
37
+ * @param options - AI plugin options including Azure Search index name and optional `verbose` flag
38
+ * @returns MCP-compliant content array with search results, or an error payload
39
+ * @throws {Error} If the vector store is not configured or `query` is missing
28
40
  */
29
41
  export declare function handleTool(args: Record<string, unknown>, framework: FrameworkInstance, options: AiOptions & {
30
42
  verbose?: boolean;
@@ -2,8 +2,24 @@ import { z } from 'zod';
2
2
  import type { FrameworkInstance } from '@equinor/fusion-framework-cli-plugin-ai-base';
3
3
  import type { AiOptions } from '@equinor/fusion-framework-cli-plugin-ai-base/command-options';
4
4
  import type { ToolCallback } from '@modelcontextprotocol/sdk/server/mcp.js';
5
- /** Valid documentation categories that can be searched */
5
+ /**
6
+ * Valid documentation categories that can be used to scope a search.
7
+ *
8
+ * - `api` — TypeScript API reference (TSDoc, function signatures, interfaces)
9
+ * - `cookbook` — Practical code examples, tutorials, and recipes
10
+ * - `markdown` — Architecture guides, migration docs, and READMEs
11
+ * - `eds` — EDS Storybook stories, component props, and design tokens
12
+ * - `all` — Search across every category without filtering
13
+ */
6
14
  export type FusionSearchCategory = 'api' | 'cookbook' | 'markdown' | 'eds' | 'all';
15
+ /**
16
+ * Zod input schema for the `fusion_search` MCP tool.
17
+ *
18
+ * Validates and documents the parameters that AI assistants supply when
19
+ * invoking the tool: a required `query` string, an optional `limit`
20
+ * (default 5), and an optional `category` filter (currently locked
21
+ * to `'all'`).
22
+ */
7
23
  export declare const inputSchema: z.ZodObject<{
8
24
  query: z.ZodString;
9
25
  limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
@@ -12,7 +28,11 @@ export declare const inputSchema: z.ZodObject<{
12
28
  }>>>;
13
29
  }, z.core.$strip>;
14
30
  /**
15
- * Tool configuration for McpServer.registerTool().
31
+ * Configuration object passed to `McpServer.registerTool()` for the
32
+ * `fusion_search` tool.
33
+ *
34
+ * Contains the human-readable description shown to AI assistants and the
35
+ * Zod {@link inputSchema} used for argument validation.
16
36
  */
17
37
  export declare const toolConfig: {
18
38
  readonly description: string;
@@ -1 +1 @@
1
- export declare const version = "1.0.5";
1
+ export declare const version = "2.0.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-cli-plugin-ai-mcp",
3
- "version": "1.0.5",
3
+ "version": "2.0.0",
4
4
  "description": "MCP server plugin for Fusion Framework CLI providing Model Context Protocol server capabilities",
5
5
  "main": "dist/esm/index.js",
6
6
  "type": "module",
@@ -40,17 +40,19 @@
40
40
  "dependencies": {
41
41
  "@modelcontextprotocol/sdk": "^1.0.4",
42
42
  "commander": "^14.0.1",
43
- "zod": "^4.3.5",
44
- "@equinor/fusion-framework-module-ai": "2.0.2",
45
- "@equinor/fusion-framework-cli-plugin-ai-base": "1.0.5",
46
- "@equinor/fusion-framework-module": "5.0.6"
43
+ "hono": "^4.12.8",
44
+ "zod": "^4.3.6",
45
+ "@equinor/fusion-framework-cli-plugin-ai-base": "2.0.0",
46
+ "@equinor/fusion-framework-module": "6.0.0",
47
+ "@equinor/fusion-framework-module-ai": "3.0.0"
47
48
  },
48
49
  "peerDependencies": {
49
- "@equinor/fusion-framework-cli": "^13.3.16"
50
+ "@equinor/fusion-framework-cli": "^14.0.0"
50
51
  },
51
52
  "devDependencies": {
52
- "typescript": "^5.8.2",
53
- "vitest": "^3.2.4"
53
+ "typescript": "^5.9.3",
54
+ "vitest": "^4.1.0",
55
+ "@equinor/fusion-framework-cli": "^14.0.0"
54
56
  },
55
57
  "scripts": {
56
58
  "build": "tsc -b",
package/src/index.ts CHANGED
@@ -3,8 +3,18 @@ import { registerAiPlugin as registerAiPluginBase } from '@equinor/fusion-framew
3
3
  import { command as mcpCommand } from './mcp.js';
4
4
 
5
5
  /**
6
- * Registers the AI MCP server plugin command with the CLI program
7
- * @param program - The Commander program instance to register commands with
6
+ * Registers the AI MCP server plugin with the Fusion Framework CLI.
7
+ *
8
+ * Adds the `ai mcp` subcommand to the given Commander program so that
9
+ * running `ffc ai mcp` starts a Model Context Protocol server.
10
+ *
11
+ * @param program - Root Commander {@link Command} instance provided by the CLI bootstrap
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * import { registerAiPlugin } from '@equinor/fusion-framework-cli-plugin-ai-mcp';
16
+ * registerAiPlugin(program);
17
+ * ```
8
18
  */
9
19
  export function registerAiPlugin(program: Command): void {
10
20
  registerAiPluginBase(program, mcpCommand);
package/src/mcp.ts CHANGED
@@ -52,8 +52,14 @@ import {
52
52
  * $ ffc ai mcp --verbose
53
53
  * $ ffc ai mcp --azure-search-endpoint https://my-search.search.windows.net
54
54
  */
55
+ /**
56
+ * Combined option set for the `ai mcp` command.
57
+ *
58
+ * Merges the base AI options (Azure OpenAI + Azure Search credentials)
59
+ * with MCP-specific flags such as `verbose`.
60
+ */
55
61
  type CommandOptions = AiOptions & {
56
- /** Enable verbose output for debugging */
62
+ /** When `true`, diagnostic messages are written to stderr during startup and shutdown. */
57
63
  verbose?: boolean;
58
64
  };
59
65
 
@@ -119,8 +125,13 @@ const _command = createCommand('mcp')
119
125
  });
120
126
  });
121
127
 
122
- // Export the command with AI options
123
- // Note: Search tools require embedding deployment, so we include it
128
+ /**
129
+ * Fully-configured Commander {@link Command} for `ai mcp`.
130
+ *
131
+ * Includes all Azure OpenAI embedding and Azure Search options required by
132
+ * the search tools. Chat options are excluded because the MCP server does
133
+ * not perform chat completions.
134
+ */
124
135
  export const command = withAiOptions(_command, {
125
136
  includeChat: false,
126
137
  includeEmbedding: true,
@@ -2,8 +2,14 @@ import type { FrameworkInstance } from '@equinor/fusion-framework-cli-plugin-ai-
2
2
  import type { AiOptions } from '@equinor/fusion-framework-cli-plugin-ai-base/command-options';
3
3
 
4
4
  /**
5
- * Tool definition for searching Fusion Framework API reference.
6
- * This tool enables semantic search across TypeScript/TSDoc code documentation, function signatures, and class definitions.
5
+ * MCP tool definition for `fusion_search_api`.
6
+ *
7
+ * Enables semantic search scoped to Fusion Framework TypeScript API
8
+ * reference — TSDoc blocks, function signatures, class definitions,
9
+ * and interface declarations indexed as `tsdoc` documents.
10
+ *
11
+ * Registered with the MCP server so that AI assistants can discover
12
+ * and invoke the tool by name.
7
13
  */
8
14
  export const toolDefinition = {
9
15
  name: 'fusion_search_api',
@@ -27,7 +33,16 @@ export const toolDefinition = {
27
33
  } as const;
28
34
 
29
35
  /**
30
- * Tool handler for fusion_search_api
36
+ * Handles invocations of the `fusion_search_api` MCP tool.
37
+ *
38
+ * Queries the Azure Cognitive Search vector store with a `tsdoc` category
39
+ * filter and returns matching documents as JSON text content.
40
+ *
41
+ * @param args - Raw tool arguments containing `query` (string) and optional `limit` (number)
42
+ * @param framework - Active {@link FrameworkInstance} with the AI module loaded
43
+ * @param options - AI plugin options including Azure Search index name and optional `verbose` flag
44
+ * @returns MCP-compliant content array with search results, or an error payload
45
+ * @throws {Error} If the vector store is not configured or `query` is missing
31
46
  */
32
47
  export async function handleTool(
33
48
  args: Record<string, unknown>,
@@ -2,8 +2,11 @@ import type { FrameworkInstance } from '@equinor/fusion-framework-cli-plugin-ai-
2
2
  import type { AiOptions } from '@equinor/fusion-framework-cli-plugin-ai-base/command-options';
3
3
 
4
4
  /**
5
- * Tool definition for searching Fusion Framework cookbooks.
6
- * This tool enables semantic search across example implementations, tutorials, and how-to guides.
5
+ * MCP tool definition for `fusion_search_cookbook`.
6
+ *
7
+ * Enables semantic search scoped to Fusion Framework cookbook content —
8
+ * example implementations, tutorials, how-to guides, and practical recipes
9
+ * indexed as `cookbook` documents.
7
10
  */
8
11
  export const toolDefinition = {
9
12
  name: 'fusion_search_cookbook',
@@ -27,7 +30,16 @@ export const toolDefinition = {
27
30
  } as const;
28
31
 
29
32
  /**
30
- * Tool handler for fusion_search_cookbook
33
+ * Handles invocations of the `fusion_search_cookbook` MCP tool.
34
+ *
35
+ * Queries the Azure Cognitive Search vector store with a `cookbook` category
36
+ * filter and returns matching tutorial / recipe documents as JSON text content.
37
+ *
38
+ * @param args - Raw tool arguments containing `query` (string) and optional `limit` (number)
39
+ * @param framework - Active {@link FrameworkInstance} with the AI module loaded
40
+ * @param options - AI plugin options including Azure Search index name and optional `verbose` flag
41
+ * @returns MCP-compliant content array with search results, or an error payload
42
+ * @throws {Error} If the vector store is not configured or `query` is missing
31
43
  */
32
44
  export async function handleTool(
33
45
  args: Record<string, unknown>,
@@ -2,8 +2,11 @@ import type { FrameworkInstance } from '@equinor/fusion-framework-cli-plugin-ai-
2
2
  import type { AiOptions } from '@equinor/fusion-framework-cli-plugin-ai-base/command-options';
3
3
 
4
4
  /**
5
- * Tool definition for searching EDS (Equinor Design System) components from Storybook.
6
- * This tool enables semantic search across component examples, props, usage patterns, and Storybook stories.
5
+ * MCP tool definition for `fusion_search_eds`.
6
+ *
7
+ * Enables semantic search scoped to EDS (Equinor Design System) Storybook
8
+ * content — component examples, prop tables, usage patterns, accessibility
9
+ * notes, and design-token references indexed as `storybook` documents.
7
10
  */
8
11
  export const toolDefinition = {
9
12
  name: 'fusion_search_eds',
@@ -28,7 +31,16 @@ export const toolDefinition = {
28
31
  } as const;
29
32
 
30
33
  /**
31
- * Tool handler for fusion_search_eds
34
+ * Handles invocations of the `fusion_search_eds` MCP tool.
35
+ *
36
+ * Queries the Azure Cognitive Search vector store with a `storybook` category
37
+ * filter and returns matching EDS component documents as JSON text content.
38
+ *
39
+ * @param args - Raw tool arguments containing `query` (string) and optional `limit` (number)
40
+ * @param framework - Active {@link FrameworkInstance} with the AI module loaded
41
+ * @param options - AI plugin options including Azure Search index name and optional `verbose` flag
42
+ * @returns MCP-compliant content array with search results, or an error payload
43
+ * @throws {Error} If the vector store is not configured or `query` is missing
32
44
  */
33
45
  export async function handleTool(
34
46
  args: Record<string, unknown>,
@@ -2,8 +2,11 @@ import type { FrameworkInstance } from '@equinor/fusion-framework-cli-plugin-ai-
2
2
  import type { AiOptions } from '@equinor/fusion-framework-cli-plugin-ai-base/command-options';
3
3
 
4
4
  /**
5
- * Tool definition for searching Fusion Framework markdown documentation.
6
- * This tool enables semantic search across markdown files, guides, and documentation.
5
+ * MCP tool definition for `fusion_search_markdown`.
6
+ *
7
+ * Enables semantic search scoped to Fusion Framework markdown
8
+ * documentation — architecture guides, migration notes, conceptual
9
+ * overviews, and README content indexed as `markdown` documents.
7
10
  */
8
11
  export const toolDefinition = {
9
12
  name: 'fusion_search_markdown',
@@ -27,7 +30,16 @@ export const toolDefinition = {
27
30
  } as const;
28
31
 
29
32
  /**
30
- * Tool handler for fusion_search_markdown
33
+ * Handles invocations of the `fusion_search_markdown` MCP tool.
34
+ *
35
+ * Queries the Azure Cognitive Search vector store with a `markdown` category
36
+ * filter and returns matching documentation pages as JSON text content.
37
+ *
38
+ * @param args - Raw tool arguments containing `query` (string) and optional `limit` (number)
39
+ * @param framework - Active {@link FrameworkInstance} with the AI module loaded
40
+ * @param options - AI plugin options including Azure Search index name and optional `verbose` flag
41
+ * @returns MCP-compliant content array with search results, or an error payload
42
+ * @throws {Error} If the vector store is not configured or `query` is missing
31
43
  */
32
44
  export async function handleTool(
33
45
  args: Record<string, unknown>,
@@ -5,9 +5,25 @@ import type { VectorStoreDocument } from '@equinor/fusion-framework-module-ai/li
5
5
  import type { ToolCallback } from '@modelcontextprotocol/sdk/server/mcp.js';
6
6
  import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
7
7
 
8
- /** Valid documentation categories that can be searched */
8
+ /**
9
+ * Valid documentation categories that can be used to scope a search.
10
+ *
11
+ * - `api` — TypeScript API reference (TSDoc, function signatures, interfaces)
12
+ * - `cookbook` — Practical code examples, tutorials, and recipes
13
+ * - `markdown` — Architecture guides, migration docs, and READMEs
14
+ * - `eds` — EDS Storybook stories, component props, and design tokens
15
+ * - `all` — Search across every category without filtering
16
+ */
9
17
  export type FusionSearchCategory = 'api' | 'cookbook' | 'markdown' | 'eds' | 'all';
10
18
 
19
+ /**
20
+ * Zod input schema for the `fusion_search` MCP tool.
21
+ *
22
+ * Validates and documents the parameters that AI assistants supply when
23
+ * invoking the tool: a required `query` string, an optional `limit`
24
+ * (default 5), and an optional `category` filter (currently locked
25
+ * to `'all'`).
26
+ */
11
27
  export const inputSchema = z.object({
12
28
  query: z
13
29
  .string()
@@ -39,7 +55,11 @@ export const inputSchema = z.object({
39
55
  });
40
56
 
41
57
  /**
42
- * Tool configuration for McpServer.registerTool().
58
+ * Configuration object passed to `McpServer.registerTool()` for the
59
+ * `fusion_search` tool.
60
+ *
61
+ * Contains the human-readable description shown to AI assistants and the
62
+ * Zod {@link inputSchema} used for argument validation.
43
63
  */
44
64
  export const toolConfig = {
45
65
  description: [
@@ -51,7 +71,12 @@ export const toolConfig = {
51
71
  } as const;
52
72
 
53
73
  /**
54
- * Azure Cognitive Search OData filter expressions per category
74
+ * Azure Cognitive Search OData filter expressions keyed by
75
+ * {@link FusionSearchCategory}.
76
+ *
77
+ * Each expression restricts the vector search to documents whose
78
+ * `metadata/attributes` collection contains a matching `type` value.
79
+ * The `all` category maps to `undefined` (no filter applied).
55
80
  */
56
81
  const FILTER_EXPRESSIONS: Readonly<Record<FusionSearchCategory, string | undefined>> = {
57
82
  api: "metadata/attributes/any(x: x/key eq 'type' and x/value eq 'tsdoc')",
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '1.0.5';
2
+ export const version = '2.0.0';