@equinor/fusion-framework-cli-plugin-ai-index 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 (92) hide show
  1. package/CHANGELOG.md +91 -2
  2. package/README.md +105 -69
  3. package/dist/esm/bin/embed.js +28 -13
  4. package/dist/esm/bin/embed.js.map +1 -1
  5. package/dist/esm/delete-command.js +100 -0
  6. package/dist/esm/delete-command.js.map +1 -0
  7. package/dist/esm/delete-command.options.js +43 -0
  8. package/dist/esm/delete-command.options.js.map +1 -0
  9. package/dist/esm/{command.js → embeddings-command.js} +42 -28
  10. package/dist/esm/embeddings-command.js.map +1 -0
  11. package/dist/esm/{command.options.js → embeddings-command.options.js} +14 -7
  12. package/dist/esm/embeddings-command.options.js.map +1 -0
  13. package/dist/esm/index.js +37 -4
  14. package/dist/esm/index.js.map +1 -1
  15. package/dist/esm/search-command.js +198 -0
  16. package/dist/esm/search-command.js.map +1 -0
  17. package/dist/esm/utils/generate-chunk-id.js +17 -5
  18. package/dist/esm/utils/generate-chunk-id.js.map +1 -1
  19. package/dist/esm/utils/git/file-changes.js +26 -11
  20. package/dist/esm/utils/git/file-changes.js.map +1 -1
  21. package/dist/esm/utils/git/git-client.js +16 -7
  22. package/dist/esm/utils/git/git-client.js.map +1 -1
  23. package/dist/esm/utils/git/metadata.js +7 -3
  24. package/dist/esm/utils/git/metadata.js.map +1 -1
  25. package/dist/esm/utils/git/status.js +9 -3
  26. package/dist/esm/utils/git/status.js.map +1 -1
  27. package/dist/esm/utils/markdown/parser.js +53 -13
  28. package/dist/esm/utils/markdown/parser.js.map +1 -1
  29. package/dist/esm/utils/package-resolver.js +10 -6
  30. package/dist/esm/utils/package-resolver.js.map +1 -1
  31. package/dist/esm/utils/ts-doc/constants.js +4 -1
  32. package/dist/esm/utils/ts-doc/constants.js.map +1 -1
  33. package/dist/esm/utils/ts-doc/extractors.js +27 -13
  34. package/dist/esm/utils/ts-doc/extractors.js.map +1 -1
  35. package/dist/esm/utils/ts-doc/parser.js +19 -10
  36. package/dist/esm/utils/ts-doc/parser.js.map +1 -1
  37. package/dist/esm/version.js +1 -1
  38. package/dist/tsconfig.tsbuildinfo +1 -1
  39. package/dist/types/config.d.ts +51 -10
  40. package/dist/types/delete-command.d.ts +9 -0
  41. package/dist/types/delete-command.options.d.ts +32 -0
  42. package/dist/types/embeddings-command.d.ts +11 -0
  43. package/dist/types/embeddings-command.options.d.ts +40 -0
  44. package/dist/types/index.d.ts +19 -2
  45. package/dist/types/search-command.d.ts +8 -0
  46. package/dist/types/utils/generate-chunk-id.d.ts +17 -5
  47. package/dist/types/utils/git/file-changes.d.ts +26 -11
  48. package/dist/types/utils/git/git-client.d.ts +16 -7
  49. package/dist/types/utils/git/metadata.d.ts +7 -3
  50. package/dist/types/utils/git/status.d.ts +9 -3
  51. package/dist/types/utils/git/types.d.ts +15 -9
  52. package/dist/types/utils/markdown/parser.d.ts +23 -10
  53. package/dist/types/utils/markdown/types.d.ts +13 -2
  54. package/dist/types/utils/package-resolver.d.ts +8 -5
  55. package/dist/types/utils/ts-doc/constants.d.ts +4 -1
  56. package/dist/types/utils/ts-doc/extractors.d.ts +27 -13
  57. package/dist/types/utils/ts-doc/parser.d.ts +19 -10
  58. package/dist/types/utils/ts-doc/types.d.ts +12 -4
  59. package/dist/types/utils/types.d.ts +10 -6
  60. package/dist/types/version.d.ts +1 -1
  61. package/package.json +13 -11
  62. package/src/bin/delete-removed-files.ts +1 -1
  63. package/src/bin/embed.ts +47 -18
  64. package/src/bin/file-stream.ts +1 -1
  65. package/src/bin/get-diff.ts +1 -1
  66. package/src/bin/types.ts +1 -1
  67. package/src/config.ts +52 -10
  68. package/src/delete-command.options.ts +51 -0
  69. package/src/delete-command.ts +117 -0
  70. package/src/{command.options.ts → embeddings-command.options.ts} +16 -9
  71. package/src/{command.ts → embeddings-command.ts} +46 -28
  72. package/src/index.ts +38 -4
  73. package/src/search-command.ts +259 -0
  74. package/src/utils/generate-chunk-id.ts +17 -5
  75. package/src/utils/git/file-changes.ts +26 -11
  76. package/src/utils/git/git-client.ts +16 -7
  77. package/src/utils/git/metadata.ts +7 -3
  78. package/src/utils/git/status.ts +9 -3
  79. package/src/utils/git/types.ts +15 -9
  80. package/src/utils/markdown/parser.ts +54 -13
  81. package/src/utils/markdown/types.ts +13 -2
  82. package/src/utils/package-resolver.ts +10 -6
  83. package/src/utils/ts-doc/constants.ts +4 -1
  84. package/src/utils/ts-doc/extractors.ts +27 -13
  85. package/src/utils/ts-doc/parser.ts +19 -10
  86. package/src/utils/ts-doc/types.ts +12 -4
  87. package/src/utils/types.ts +10 -6
  88. package/src/version.ts +1 -1
  89. package/dist/esm/command.js.map +0 -1
  90. package/dist/esm/command.options.js.map +0 -1
  91. package/dist/types/command.d.ts +0 -2
  92. package/dist/types/command.options.d.ts +0 -33
@@ -10,9 +10,8 @@ import type { MarkdownDocument, MarkdownMetadata } from './types.js';
10
10
  import { generateChunkId } from '../generate-chunk-id.js';
11
11
 
12
12
  const markdownConfig = {
13
- chunkSize: 3000,
13
+ chunkSize: 2000,
14
14
  chunkOverlap: 300,
15
- keepSeparator: true,
16
15
  separators: [
17
16
  '\n# ',
18
17
  '\n## ',
@@ -21,25 +20,52 @@ const markdownConfig = {
21
20
  '\n##### ',
22
21
  '\n###### ',
23
22
  '\n```',
23
+ '\n```\n',
24
24
  '\n---\n',
25
25
  '\n\n',
26
+ '\n',
26
27
  ],
28
+ keepSeparator: true,
27
29
  };
28
30
 
29
31
  /**
30
- * Check if a file is a markdown or MDX file
31
- * @param filePath - File path to check
32
- * @returns True if file has .md or .mdx extension
32
+ * Checks whether a file path has a Markdown (`.md`) or MDX (`.mdx`) extension.
33
+ *
34
+ * @param filePath - Absolute or relative file path.
35
+ * @returns `true` when the extension is `.md` or `.mdx`.
33
36
  */
34
37
  export const isMarkdownFile = (filePath: string): boolean => {
35
38
  return filePath.endsWith('.md') || filePath.endsWith('.mdx');
36
39
  };
37
40
 
38
41
  /**
39
- * Parse markdown or MDX content into document chunks
40
- * @param content - Markdown or MDX content string
41
- * @param source - Source file path
42
- * @returns Array of markdown documents
42
+ * Validates that a text chunk contains meaningful content.
43
+ *
44
+ * Filters out empty strings and chunks consisting solely of code-fence
45
+ * markers (e.g. ` ``` ` or ` ```ts `).
46
+ *
47
+ * @param chunk - Content chunk to validate.
48
+ * @returns `true` if the chunk has substantive content.
49
+ */
50
+ const isValidChunk = (chunk: string): boolean => {
51
+ const trimmed = chunk.trim();
52
+ if (!trimmed) return false;
53
+ // Skip chunks that are only code fence markers
54
+ if (/^`{3,}[\w-]*$/.test(trimmed)) return false;
55
+ return true;
56
+ };
57
+
58
+ /**
59
+ * Parses Markdown or MDX content into chunked vector-store documents.
60
+ *
61
+ * Extracts YAML frontmatter via `gray-matter`, splits the body using
62
+ * {@link RecursiveCharacterTextSplitter}, and returns one
63
+ * {@link MarkdownDocument} per valid chunk.
64
+ *
65
+ * @template T - Additional frontmatter attributes.
66
+ * @param content - Raw Markdown / MDX string.
67
+ * @param source - Relative source file path used as the document key.
68
+ * @returns Array of chunked Markdown documents.
43
69
  */
44
70
  export const parseMarkdown = async <T extends Record<string, unknown> = Record<string, unknown>>(
45
71
  content: string,
@@ -57,7 +83,16 @@ export const parseMarkdown = async <T extends Record<string, unknown> = Record<s
57
83
  );
58
84
  const textSplitter = new RecursiveCharacterTextSplitter(markdownConfig);
59
85
  const chunks = await textSplitter.splitText(markdownContent);
60
- return chunks.map(
86
+
87
+ // Filter out empty chunks and chunks that are just code fence markers
88
+ const validChunks = chunks.filter((chunk) => {
89
+ if (!isValidChunk(chunk)) {
90
+ return false;
91
+ }
92
+ return true;
93
+ });
94
+
95
+ return validChunks.map(
61
96
  (chunk, _index): MarkdownDocument<T> => ({
62
97
  id: generateChunkId(source, _index),
63
98
  pageContent: chunk,
@@ -70,9 +105,15 @@ export const parseMarkdown = async <T extends Record<string, unknown> = Record<s
70
105
  };
71
106
 
72
107
  /**
73
- * Parse a markdown or MDX file into document chunks
74
- * @param file - Source file object
75
- * @returns Array of markdown documents with root path metadata
108
+ * Reads a Markdown or MDX file from disk and parses it into chunked documents.
109
+ *
110
+ * Delegates to {@link parseMarkdown} after reading the file content, then
111
+ * enriches each resulting document with the `rootPath` from the source file.
112
+ *
113
+ * @template T - Additional frontmatter attributes.
114
+ * @param file - Source file descriptor with path and optional project root.
115
+ * @returns Array of Markdown documents with root-path metadata.
116
+ * @throws {AssertionError} If the file does not have a `.md` or `.mdx` extension.
76
117
  */
77
118
  export const parseMarkdownFile = async <
78
119
  T extends Record<string, unknown> = Record<string, unknown>,
@@ -4,17 +4,28 @@ import type {
4
4
  } from '@equinor/fusion-framework-module-ai/lib';
5
5
 
6
6
  /**
7
- * Markdown document metadata
7
+ * Metadata shape for documents generated from Markdown / MDX files.
8
+ *
9
+ * Extends the base vector-store metadata with a `'markdown'` type discriminator
10
+ * and any frontmatter key-value pairs (prefixed with `md_`).
11
+ *
12
+ * @template T - Additional frontmatter attributes.
8
13
  */
9
14
  export type MarkdownMetadata<T extends Record<string, unknown> = Record<string, unknown>> =
10
15
  VectorStoreDocumentMetadata<
11
16
  T & {
17
+ /** Discriminator identifying the document as extracted from Markdown. */
12
18
  type: 'markdown';
13
19
  }
14
20
  >;
15
21
 
16
22
  /**
17
- * Markdown document
23
+ * A vector-store document originating from a Markdown or MDX file.
24
+ *
25
+ * Contains a text chunk of the markdown content together with
26
+ * {@link MarkdownMetadata}.
27
+ *
28
+ * @template T - Additional frontmatter attributes.
18
29
  */
19
30
  export type MarkdownDocument<T extends Record<string, unknown> = Record<string, unknown>> =
20
31
  VectorStoreDocument<MarkdownMetadata<T>>;
@@ -2,20 +2,24 @@ import { dirname } from 'node:path';
2
2
  import { readPackageUp, type PackageJson } from 'read-package-up';
3
3
 
4
4
  /**
5
- * Map of package base directories to package.json
5
+ * In-memory cache mapping package root directories to their parsed `package.json`.
6
+ * Avoids repeated file-system lookups when processing many files from the same package.
6
7
  */
7
8
  const packageMap = new Map<string, PackageJson>();
8
9
 
9
10
  /**
10
- * Resolves which package a file path belongs to.
11
- * First checks the cache map, then uses read-package-up if no match found.
11
+ * Resolves the nearest `package.json` for a given file path.
12
12
  *
13
- * @param filePath - Absolute or relative file path (e.g., '/path/to/packages/cli/src/index.ts')
14
- * @returns Package.json if found, undefined otherwise
13
+ * Uses an in-memory cache keyed by the package’s directory to avoid
14
+ * redundant file-system lookups when many files share the same package.
15
+ *
16
+ * @param filePath - Absolute path to a source file.
17
+ * @returns The parsed `PackageJson` if found, or `undefined`.
15
18
  *
16
19
  * @example
17
20
  * ```ts
18
- * const packageJson = await resolvePackage('/path/to/packages/cli/src/index.ts');
21
+ * const pkg = await resolvePackage('/repo/packages/cli/src/index.ts');
22
+ * console.log(pkg?.name); // '@equinor/fusion-framework-cli'
19
23
  * ```
20
24
  */
21
25
  export async function resolvePackage(filePath: string): Promise<PackageJson | undefined> {
@@ -1,7 +1,10 @@
1
1
  import { SyntaxKind } from 'ts-morph';
2
2
 
3
3
  /**
4
- * Supported TSDoc node kinds for top-level processing
4
+ * Top-level TypeScript syntax kinds that the TSDoc extractor inspects.
5
+ *
6
+ * Only nodes matching one of these kinds are considered for document
7
+ * extraction; all other descendants are skipped.
5
8
  */
6
9
  export const nodeKinds = [
7
10
  SyntaxKind.FunctionDeclaration,
@@ -46,11 +46,16 @@ const createTypescriptDocument = (
46
46
  };
47
47
 
48
48
  /**
49
- * Extracts a TSDoc document from a class node, including TSDoc, constructor, and public member signatures.
50
- * @param classNode - The ClassDeclaration node to process.
51
- * @param sourceFile - The source file containing the node.
52
- * @param options - Optional parsing configuration.
53
- * @returns A TypeScript document with TSDoc and class interface, or null if no TSDoc is found.
49
+ * Extracts a vector-store document from a TypeScript class declaration.
50
+ *
51
+ * Collects the class-level TSDoc comment, constructor signature (if documented),
52
+ * and all public members with TSDoc into a single document whose `pageContent`
53
+ * mirrors a minimal class interface.
54
+ *
55
+ * @param classNode - The `ts-morph` {@link ClassDeclaration} node to inspect.
56
+ * @param sourceFile - The project source file that contains the class.
57
+ * @param _options - Optional parsing configuration.
58
+ * @returns A {@link TypescriptDocument}, or `null` when the class has no TSDoc.
54
59
  */
55
60
  export const extractDocumentFromClassNode = (
56
61
  classNode: ClassDeclaration,
@@ -128,12 +133,19 @@ export const extractDocumentFromClassNode = (
128
133
  };
129
134
 
130
135
  /**
131
- * Extracts a TSDoc document from a single node.
132
- * @param node - The TypeScript node to process.
133
- * @param sourceFile - The source file containing the node.
136
+ * Extracts a vector-store document from a single TypeScript AST node.
137
+ *
138
+ * Handles function declarations, variable statements (arrow / function
139
+ * expressions), interfaces, type aliases, enums, and classes. Delegates
140
+ * to {@link extractDocumentFromClassNode} for class declarations.
141
+ *
142
+ * @param node - The `ts-morph` AST node to inspect.
143
+ * @param sourceFile - The project source file that contains the node.
134
144
  * @param options - Optional parsing configuration.
135
- * @param nodeOptions - Optional node-specific configuration (e.g., skipKindCheck for VariableStatement).
136
- * @returns A TypeScript document with TSDoc metadata, or null if no TSDoc is found.
145
+ * @param nodeOptions - Optional flags (e.g. `skipKindCheck`) to override default
146
+ * kind filtering.
147
+ * @returns A {@link TypescriptDocument}, or `null` when the node has no TSDoc or
148
+ * is not a supported kind.
137
149
  */
138
150
  export const extractDocumentFromNode = (
139
151
  node: Node,
@@ -224,10 +236,12 @@ export const extractDocumentFromNode = (
224
236
  };
225
237
 
226
238
  /**
227
- * Processes a TypeScript source file to extract TSDoc documents.
228
- * @param sourceFile - The source file to process.
239
+ * Walks a TypeScript source file and extracts a {@link TypescriptDocument}
240
+ * for every top-level declaration that carries a TSDoc comment.
241
+ *
242
+ * @param sourceFile - The `ts-morph` source file to traverse.
229
243
  * @param options - Optional parsing configuration.
230
- * @returns An array of TypeScript documents with TSDoc metadata.
244
+ * @returns Array of extracted documents (one per documented declaration).
231
245
  */
232
246
  export const processSourceFile = (
233
247
  sourceFile: ProjectSourceFile,
@@ -7,19 +7,24 @@ import type { TypescriptDocument, ParseTsDocOptions } from './types.js';
7
7
  import { processSourceFile } from './extractors.js';
8
8
 
9
9
  /**
10
- * Checks if a file is a TypeScript or TSX file based on its extension.
11
- * @param filePath - The path to the file.
12
- * @returns True if the file ends with .ts or .tsx, false otherwise.
10
+ * Checks whether a file path has a TypeScript (`.ts`) or TSX (`.tsx`) extension.
11
+ *
12
+ * @param filePath - Absolute or relative file path.
13
+ * @returns `true` if the file extension is `.ts` or `.tsx`.
13
14
  */
14
15
  export const isTypescriptFile = (filePath: string): boolean => {
15
16
  return filePath.endsWith('.ts') || filePath.endsWith('.tsx');
16
17
  };
17
18
 
18
19
  /**
19
- * Parses TSDoc from a string of TypeScript code.
20
- * @param content - The TypeScript code content.
20
+ * Parses TSDoc comments from an in-memory TypeScript code string.
21
+ *
22
+ * Creates a temporary `ts-morph` project, analyses the source, and returns
23
+ * one {@link TypescriptDocument} per documented top-level declaration.
24
+ *
25
+ * @param content - TypeScript source code to parse.
21
26
  * @param options - Optional parsing configuration.
22
- * @returns An array of TypeScript documents with TSDoc metadata.
27
+ * @returns Array of extracted TypeScript documents with TSDoc metadata.
23
28
  */
24
29
  export const parseTsDocSync = (
25
30
  content: string,
@@ -31,11 +36,15 @@ export const parseTsDocSync = (
31
36
  };
32
37
 
33
38
  /**
34
- * Parses TSDoc from a TypeScript file by path.
35
- * @param file - The source file object.
39
+ * Parses TSDoc comments from a TypeScript file on disk.
40
+ *
41
+ * Reads the file synchronously, creates a `ts-morph` project, and returns
42
+ * one {@link TypescriptDocument} per documented top-level declaration.
43
+ *
44
+ * @param file - Source file descriptor with path and optional project root.
36
45
  * @param options - Optional parsing configuration.
37
- * @returns An array of TypeScript documents with TSDoc metadata.
38
- * @throws If the file is not a TypeScript file.
46
+ * @returns Array of extracted TypeScript documents.
47
+ * @throws {AssertionError} If the file does not have a `.ts` or `.tsx` extension.
39
48
  */
40
49
  export const parseTsDocFromFileSync = (
41
50
  file: SourceFile,
@@ -4,23 +4,31 @@ import type {
4
4
  } from '@equinor/fusion-framework-module-ai/lib';
5
5
 
6
6
  /**
7
- * TypeScript document metadata
7
+ * Metadata shape for documents generated from TypeScript source files.
8
+ *
9
+ * Extends the base vector-store metadata with TSDoc-specific fields.
8
10
  */
9
11
  export type TypescriptMetadata = VectorStoreDocumentMetadata<{
12
+ /** Discriminator identifying the document as extracted from TSDoc. */
10
13
  type: 'tsdoc';
14
+ /** The `ts-morph` syntax-kind name (e.g. `'FunctionDeclaration'`). */
11
15
  ts_kind: string;
16
+ /** Name of the TypeScript symbol (function, class, interface, etc.). */
12
17
  ts_name: string;
13
18
  }>;
14
19
 
15
20
  /**
16
- * TypeScript document with TSDoc metadata
21
+ * A vector-store document originating from a TypeScript source file.
22
+ *
23
+ * Contains the extracted TSDoc comment (and optionally the type signature)
24
+ * together with {@link TypescriptMetadata}.
17
25
  */
18
26
  export type TypescriptDocument = VectorStoreDocument<TypescriptMetadata>;
19
27
 
20
28
  /**
21
- * Options for parsing TypeScript documents
29
+ * Options for controlling TypeScript document parsing behaviour.
22
30
  */
23
31
  export interface ParseTsDocOptions {
24
- /** The project root path for generating relative paths */
32
+ /** Absolute path to the project root, used to compute relative source paths. */
25
33
  projectRoot?: string;
26
34
  }
@@ -1,18 +1,22 @@
1
1
  /**
2
- * File change status in git
2
+ * Git-tracked change status of a source file.
3
+ *
4
+ * - `'new'` — file is untracked or newly added.
5
+ * - `'modified'` — file is tracked and has been changed.
6
+ * - `'removed'` — file has been deleted.
3
7
  */
4
8
  export type FileStatus = 'new' | 'modified' | 'removed';
5
9
 
6
10
  /**
7
- * Source file information for processing
11
+ * Represents a source file to be indexed, enriched with path and git status info.
8
12
  */
9
13
  export type SourceFile = {
10
- /** Absolute file path */
14
+ /** Absolute file system path. */
11
15
  path: string;
12
- /** Project root directory (git repository root) */
16
+ /** Absolute path to the git repository root. */
13
17
  projectRoot?: string;
14
- /** Relative path from project root */
18
+ /** Path relative to {@link projectRoot}. */
15
19
  relativePath?: string;
16
- /** Git change status */
20
+ /** Current git change status. */
17
21
  status: FileStatus;
18
22
  };
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';
@@ -1 +0,0 @@
1
- {"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AAClG,OAAO,EAAE,WAAW,IAAI,aAAa,EAAE,MAAM,8DAA8D,CAAC;AAE5G,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAuB,MAAM,sBAAsB,CAAC;AAGjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,QAAQ,GAAG,aAAa,CAAC,YAAY,CAAC;KACzC,WAAW,CAAC,kEAAkE,CAAC;KAC/E,SAAS,CACR,YAAY,CAAC,WAAW,EAAE,wDAAwD,CAAC,CAAC,OAAO,CACzF,KAAK,CACN,CACF;KACA,SAAS,CAAC,YAAY,CAAC,mBAAmB,EAAE,uBAAuB,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;KACjG,SAAS,CAAC,YAAY,CAAC,QAAQ,EAAE,4CAA4C,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAC9F,SAAS,CAAC,YAAY,CAAC,kBAAkB,EAAE,kCAAkC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;KACjG,SAAS,CACR,YAAY,CACV,SAAS,EACT,uEAAuE,CACxE,CAAC,OAAO,CAAC,KAAK,CAAC,CACjB;KACA,QAAQ,CAAC,oBAAoB,EAAE,2DAA2D,CAAC;KAC3F,MAAM,CAAC,KAAK,EAAE,QAAkB,EAAE,cAA8B,EAAE,EAAE;IACnE,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAA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C"}
@@ -1,2 +0,0 @@
1
- export declare const command: import("commander").Command;
2
- export default command;
@@ -1,33 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * Zod schema for validating command options for the embeddings command.
4
- *
5
- * This schema extends the base AI options schema with embeddings-specific options,
6
- * ensuring type safety and runtime validation of command arguments.
7
- *
8
- * Note: Some optional AI options become required for the embeddings command
9
- * (openaiEmbeddingDeployment, azureSearchEndpoint, azureSearchApiKey, azureSearchIndexName)
10
- * because the command uses withAiOptions with includeEmbedding and includeSearch set to true.
11
- */
12
- export declare const CommandOptionsSchema: z.ZodObject<{
13
- openaiApiKey: z.ZodString;
14
- openaiApiVersion: z.ZodString;
15
- openaiInstance: z.ZodString;
16
- openaiChatDeployment: z.ZodOptional<z.ZodString>;
17
- openaiEmbeddingDeployment: z.ZodString;
18
- azureSearchEndpoint: z.ZodString;
19
- azureSearchApiKey: z.ZodString;
20
- azureSearchIndexName: z.ZodString;
21
- dryRun: z.ZodBoolean;
22
- config: z.ZodString;
23
- diff: z.ZodBoolean;
24
- baseRef: z.ZodOptional<z.ZodString>;
25
- clean: z.ZodBoolean;
26
- }, z.core.$strip>;
27
- /**
28
- * Type representing the validated command options.
29
- *
30
- * This type is inferred from the Zod schema and should be used throughout the command
31
- * to ensure type safety and consistency with the schema.
32
- */
33
- export type CommandOptions = z.infer<typeof CommandOptionsSchema>;