minovative-mind-cli 2.13.5 → 2.14.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/README.md +104 -39
- package/dist/services/agent/slashCommands.js +57 -8
- package/dist/services/agent/syntaxAgent.js +13 -0
- package/dist/services/agent-tools.d.ts +1 -1
- package/dist/services/agent-tools.js +2 -2
- package/dist/services/agent.js +119 -7
- package/dist/services/ai.d.ts +19 -0
- package/dist/services/ai.js +97 -5
- package/dist/services/contextAgent.js +23 -0
- package/dist/services/investigationComplexity.js +1 -1
- package/dist/services/mentionEngine.d.ts +385 -0
- package/dist/services/mentionEngine.js +1395 -0
- package/dist/services/orchestration/investigationAgent.js +6 -2
- package/dist/services/orchestration/messageBus.d.ts +26 -3
- package/dist/services/orchestration/messageBus.js +204 -14
- package/dist/services/orchestration/orchestrator.js +4 -0
- package/dist/services/orchestration/scopedTools.js +16 -2
- package/dist/services/orchestration/subAgent.js +14 -2
- package/dist/services/proxyClient.d.ts +38 -2
- package/dist/services/proxyClient.js +42 -24
- package/dist/utils/config.d.ts +75 -0
- package/dist/utils/config.js +93 -0
- package/dist/utils/contextPrompts.d.ts +28 -4
- package/dist/utils/contextPrompts.js +70 -1
- package/dist/utils/historyPrompt.d.ts +166 -7
- package/dist/utils/historyPrompt.js +775 -30
- package/dist/utils/symbolExtractor.d.ts +111 -8
- package/dist/utils/symbolExtractor.js +616 -64
- package/dist/utils/systemPrompts.d.ts +3 -3
- package/dist/utils/systemPrompts.js +5 -3
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -1,36 +1,139 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Supported classification kinds for extracted AST symbols and definition chunks.
|
|
3
|
+
*/
|
|
4
|
+
export type SymbolKind = 'function' | 'class' | 'method' | 'constructor' | 'interface' | 'type' | 'enum' | 'variable' | 'trait' | 'struct' | 'impl' | 'constant' | 'property' | 'other';
|
|
5
|
+
/**
|
|
6
|
+
* Represents an extracted symbol's location and metadata within a source file.
|
|
3
7
|
*/
|
|
4
8
|
export interface ExtractedSymbol {
|
|
5
|
-
/** The name of the symbol (function, class, variable, etc.) */
|
|
9
|
+
/** The name of the symbol (function, class, variable, method, etc.) */
|
|
6
10
|
symbol: string;
|
|
7
|
-
/** The 0-indexed starting line number of the symbol declaration/block */
|
|
11
|
+
/** The 0-indexed starting line number of the symbol declaration/block (including docstrings/decorators) */
|
|
8
12
|
startLine: number;
|
|
9
13
|
/** The 0-indexed ending line number of the symbol block */
|
|
10
14
|
endLine: number;
|
|
15
|
+
/** The classified kind of symbol */
|
|
16
|
+
kind?: SymbolKind;
|
|
17
|
+
/** Clean declaration signature (e.g. `function foo(x: number): void` or `class Bar`) */
|
|
18
|
+
signature?: string;
|
|
19
|
+
/** Preceding documentation or docstring content if present */
|
|
20
|
+
doc?: string;
|
|
21
|
+
/** Optional parent enclosing class/struct/impl/trait name for nested members */
|
|
22
|
+
parentSymbol?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Represents a discrete, self-contained definition chunk for granular context injection and retrieval.
|
|
26
|
+
*/
|
|
27
|
+
export interface DefinitionChunk {
|
|
28
|
+
/** Unique chunk identifier (e.g. `src/utils.ts:UserService#getUser` or `src/utils.ts:fetchAllUsers`) */
|
|
29
|
+
id: string;
|
|
30
|
+
/** The primary symbol name */
|
|
31
|
+
symbol: string;
|
|
32
|
+
/** Enclosing parent symbol if applicable */
|
|
33
|
+
parentSymbol?: string;
|
|
34
|
+
/** The classified kind of definition */
|
|
35
|
+
kind: SymbolKind;
|
|
36
|
+
/** 0-indexed starting line number */
|
|
37
|
+
startLine: number;
|
|
38
|
+
/** 0-indexed ending line number */
|
|
39
|
+
endLine: number;
|
|
40
|
+
/** Declaration signature */
|
|
41
|
+
signature: string;
|
|
42
|
+
/** Preceding documentation or docstring if present */
|
|
43
|
+
doc?: string;
|
|
44
|
+
/** The exact extracted content of the chunk */
|
|
45
|
+
content: string;
|
|
46
|
+
/** Estimated token consumption for this chunk */
|
|
47
|
+
tokenEstimate: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Options for configuring definition chunk extraction.
|
|
51
|
+
*/
|
|
52
|
+
export interface DefinitionChunkOptions {
|
|
53
|
+
/** Maximum number of lines per definition chunk before truncation */
|
|
54
|
+
maxChunkLines?: number;
|
|
55
|
+
/** Whether to include full implementation bodies or only declaration signatures with stubs */
|
|
56
|
+
includeBodies?: boolean;
|
|
57
|
+
/** Filter to specific symbol kinds (e.g. ['function', 'class']) */
|
|
58
|
+
filterKinds?: SymbolKind[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Options for configuring symbol extraction output formatting.
|
|
62
|
+
*/
|
|
63
|
+
export interface ExtractSymbolsOptions {
|
|
64
|
+
/** Maximum lines per extracted symbol */
|
|
65
|
+
maxLinesPerSymbol?: number;
|
|
66
|
+
/** Whether to output only declaration signatures with stubs instead of full bodies */
|
|
67
|
+
includeSignaturesOnly?: boolean;
|
|
11
68
|
}
|
|
12
69
|
/**
|
|
13
|
-
*
|
|
70
|
+
* Estimates token consumption for a given string using a standard ~3.8 characters per token heuristic.
|
|
71
|
+
*
|
|
72
|
+
* @param text - The input string to estimate
|
|
73
|
+
* @returns Estimated token count
|
|
74
|
+
*/
|
|
75
|
+
export declare function estimateTokens(text: string): number;
|
|
76
|
+
/**
|
|
77
|
+
* Parses a target symbol identifier into potential parent and member components.
|
|
78
|
+
* Handles patterns such as:
|
|
79
|
+
* - `UserService.getUser` -> `{ parentName: 'UserService', memberName: 'getUser' }`
|
|
80
|
+
* - `UserService#getUser` -> `{ parentName: 'UserService', memberName: 'getUser' }`
|
|
81
|
+
* - `UserService::getUser` -> `{ parentName: 'UserService', memberName: 'getUser' }`
|
|
82
|
+
* - `getUser` -> `{ parentName: null, memberName: 'getUser' }`
|
|
83
|
+
*
|
|
84
|
+
* @param rawTarget - The raw symbol string provided by the caller
|
|
85
|
+
* @returns Object with optional parentName and memberName
|
|
86
|
+
*/
|
|
87
|
+
export declare function parseTargetSymbol(rawTarget: string): {
|
|
88
|
+
parentName: string | null;
|
|
89
|
+
memberName: string;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Extracts specified target symbols from source file content and returns their line number ranges, kind, and signatures.
|
|
93
|
+
* Supports granular dotted member extraction (e.g. `UserService.getUser` or `User#new`).
|
|
14
94
|
*
|
|
15
95
|
* @param content - The full raw string content of the source file
|
|
16
96
|
* @param filePath - The file path (used to determine language syntax rules via file extension)
|
|
17
|
-
* @param targetElements - An array of symbol names to extract
|
|
18
|
-
* @returns Array of ExtractedSymbol objects containing symbol name,
|
|
97
|
+
* @param targetElements - An array of symbol names or dotted member targets to extract
|
|
98
|
+
* @returns Array of ExtractedSymbol objects containing symbol name, line ranges, and metadata
|
|
19
99
|
*/
|
|
20
100
|
export declare function extractSymbolMetadata(content: string, filePath: string, targetElements: string[]): ExtractedSymbol[];
|
|
21
101
|
/**
|
|
22
|
-
*
|
|
102
|
+
* Scans a source file and extracts a comprehensive index of all declared symbols (classes, functions,
|
|
103
|
+
* methods, interfaces, structs, enums, types, etc.) along with their kind, line boundaries, and signatures.
|
|
104
|
+
*
|
|
105
|
+
* @param content - Source file content
|
|
106
|
+
* @param filePath - File path used to infer language and syntax rules
|
|
107
|
+
* @returns Array of all discovered ExtractedSymbol objects
|
|
108
|
+
*/
|
|
109
|
+
export declare function extractSymbolIndex(content: string, filePath: string): ExtractedSymbol[];
|
|
110
|
+
/**
|
|
111
|
+
* Chunks a source code file into discrete, structured {@link DefinitionChunk} objects.
|
|
112
|
+
* Each chunk encapsulates a class, interface, function, method, struct, or type declaration
|
|
113
|
+
* along with its line range, signature, estimated token count, and content.
|
|
114
|
+
*
|
|
115
|
+
* @param content - Source file content
|
|
116
|
+
* @param filePath - File path used for identifier naming and language rules
|
|
117
|
+
* @param options - Chunking configuration options
|
|
118
|
+
* @returns Array of DefinitionChunk objects
|
|
119
|
+
*/
|
|
120
|
+
export declare function chunkDefinitions(content: string, filePath: string, options?: DefinitionChunkOptions): DefinitionChunk[];
|
|
121
|
+
/**
|
|
122
|
+
* Extracts specified target symbols (functions, classes, methods, variables, interfaces, etc.) from source file content
|
|
23
123
|
* using multi-language regex declarations, doc/decorator context gathering, and balanced brace/indentation block parsing.
|
|
24
124
|
*
|
|
125
|
+
* Supports dotted / scoped member targeting (e.g. `['UserService.getUser']` or `['User#new']`).
|
|
126
|
+
*
|
|
25
127
|
* This function significantly reduces token usage when reading large files by returning only the requested symbols
|
|
26
128
|
* along with their context and omission separators.
|
|
27
129
|
*
|
|
28
130
|
* @param content - The full raw string content of the source file
|
|
29
131
|
* @param filePath - The file path (used to determine language syntax rules via file extension)
|
|
30
132
|
* @param targetElements - An array of symbol names to extract (e.g. `['extractSymbols', 'ExtractedSymbol']`)
|
|
133
|
+
* @param options - Formatting and chunking options
|
|
31
134
|
* @returns The filtered source string containing only the matched symbol blocks and omission markers
|
|
32
135
|
*/
|
|
33
|
-
export declare function extractSymbols(content: string, filePath: string, targetElements: string[]): string;
|
|
136
|
+
export declare function extractSymbols(content: string, filePath: string, targetElements: string[], options?: ExtractSymbolsOptions): string;
|
|
34
137
|
/**
|
|
35
138
|
* Extracts a compact declarations outline (type/interface definitions, class skeletons,
|
|
36
139
|
* and function signatures without full implementation bodies) across TypeScript/JavaScript,
|