@juspay/neurolink 7.6.1 → 7.7.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/CHANGELOG.md +15 -4
- package/README.md +78 -3
- package/dist/cli/commands/config.d.ts +275 -3
- package/dist/cli/commands/config.js +121 -0
- package/dist/cli/commands/mcp.js +77 -28
- package/dist/cli/factories/commandFactory.js +359 -6
- package/dist/core/analytics.js +7 -27
- package/dist/core/baseProvider.js +43 -4
- package/dist/core/constants.d.ts +46 -0
- package/dist/core/constants.js +47 -0
- package/dist/core/dynamicModels.d.ts +16 -4
- package/dist/core/dynamicModels.js +130 -26
- package/dist/core/evaluation.js +5 -1
- package/dist/core/evaluationProviders.d.ts +6 -2
- package/dist/core/evaluationProviders.js +41 -125
- package/dist/core/factory.d.ts +5 -0
- package/dist/core/factory.js +62 -50
- package/dist/core/modelConfiguration.d.ts +246 -0
- package/dist/core/modelConfiguration.js +775 -0
- package/dist/core/types.d.ts +22 -3
- package/dist/core/types.js +5 -1
- package/dist/factories/providerRegistry.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/core/analytics.js +7 -27
- package/dist/lib/core/baseProvider.js +43 -4
- package/dist/lib/core/constants.d.ts +46 -0
- package/dist/lib/core/constants.js +47 -0
- package/dist/lib/core/dynamicModels.d.ts +16 -4
- package/dist/lib/core/dynamicModels.js +130 -26
- package/dist/lib/core/evaluation.js +5 -1
- package/dist/lib/core/evaluationProviders.d.ts +6 -2
- package/dist/lib/core/evaluationProviders.js +41 -125
- package/dist/lib/core/factory.d.ts +5 -0
- package/dist/lib/core/factory.js +63 -50
- package/dist/lib/core/modelConfiguration.d.ts +246 -0
- package/dist/lib/core/modelConfiguration.js +775 -0
- package/dist/lib/core/types.d.ts +22 -3
- package/dist/lib/core/types.js +5 -1
- package/dist/lib/factories/providerRegistry.js +3 -3
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +1 -1
- package/dist/lib/mcp/factory.d.ts +5 -5
- package/dist/lib/mcp/factory.js +2 -2
- package/dist/lib/mcp/servers/utilities/utilityServer.d.ts +1 -1
- package/dist/lib/mcp/servers/utilities/utilityServer.js +1 -1
- package/dist/lib/mcp/toolRegistry.js +2 -2
- package/dist/lib/neurolink.d.ts +168 -12
- package/dist/lib/neurolink.js +685 -123
- package/dist/lib/providers/anthropic.js +52 -2
- package/dist/lib/providers/googleAiStudio.js +4 -0
- package/dist/lib/providers/googleVertex.d.ts +75 -9
- package/dist/lib/providers/googleVertex.js +365 -46
- package/dist/lib/providers/huggingFace.d.ts +52 -11
- package/dist/lib/providers/huggingFace.js +180 -42
- package/dist/lib/providers/litellm.d.ts +9 -9
- package/dist/lib/providers/litellm.js +103 -16
- package/dist/lib/providers/ollama.d.ts +52 -17
- package/dist/lib/providers/ollama.js +276 -68
- package/dist/lib/sdk/toolRegistration.d.ts +42 -0
- package/dist/lib/sdk/toolRegistration.js +269 -27
- package/dist/lib/telemetry/telemetryService.d.ts +6 -0
- package/dist/lib/telemetry/telemetryService.js +38 -3
- package/dist/lib/types/contextTypes.d.ts +75 -11
- package/dist/lib/types/contextTypes.js +227 -1
- package/dist/lib/types/domainTypes.d.ts +62 -0
- package/dist/lib/types/domainTypes.js +5 -0
- package/dist/lib/types/generateTypes.d.ts +52 -0
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/types/mcpTypes.d.ts +1 -1
- package/dist/lib/types/mcpTypes.js +1 -1
- package/dist/lib/types/streamTypes.d.ts +14 -0
- package/dist/lib/types/universalProviderOptions.d.ts +1 -1
- package/dist/lib/utils/errorHandling.d.ts +142 -0
- package/dist/lib/utils/errorHandling.js +316 -0
- package/dist/lib/utils/factoryProcessing.d.ts +74 -0
- package/dist/lib/utils/factoryProcessing.js +588 -0
- package/dist/lib/utils/optionsConversion.d.ts +54 -0
- package/dist/lib/utils/optionsConversion.js +126 -0
- package/dist/lib/utils/optionsUtils.d.ts +246 -0
- package/dist/lib/utils/optionsUtils.js +960 -0
- package/dist/lib/utils/providerConfig.js +6 -2
- package/dist/lib/utils/providerHealth.d.ts +107 -0
- package/dist/lib/utils/providerHealth.js +543 -0
- package/dist/lib/utils/providerUtils.d.ts +17 -0
- package/dist/lib/utils/providerUtils.js +271 -16
- package/dist/lib/utils/timeout.js +1 -1
- package/dist/lib/utils/tokenLimits.d.ts +33 -0
- package/dist/lib/utils/tokenLimits.js +118 -0
- package/dist/mcp/factory.d.ts +5 -5
- package/dist/mcp/factory.js +2 -2
- package/dist/mcp/servers/utilities/utilityServer.d.ts +1 -1
- package/dist/mcp/servers/utilities/utilityServer.js +1 -1
- package/dist/mcp/toolRegistry.js +2 -2
- package/dist/neurolink.d.ts +168 -12
- package/dist/neurolink.js +685 -123
- package/dist/providers/anthropic.js +52 -2
- package/dist/providers/googleAiStudio.js +4 -0
- package/dist/providers/googleVertex.d.ts +75 -9
- package/dist/providers/googleVertex.js +365 -46
- package/dist/providers/huggingFace.d.ts +52 -11
- package/dist/providers/huggingFace.js +181 -43
- package/dist/providers/litellm.d.ts +9 -9
- package/dist/providers/litellm.js +103 -16
- package/dist/providers/ollama.d.ts +52 -17
- package/dist/providers/ollama.js +276 -68
- package/dist/sdk/toolRegistration.d.ts +42 -0
- package/dist/sdk/toolRegistration.js +269 -27
- package/dist/telemetry/telemetryService.d.ts +6 -0
- package/dist/telemetry/telemetryService.js +38 -3
- package/dist/types/contextTypes.d.ts +75 -11
- package/dist/types/contextTypes.js +227 -2
- package/dist/types/domainTypes.d.ts +62 -0
- package/dist/types/domainTypes.js +5 -0
- package/dist/types/generateTypes.d.ts +52 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/mcpTypes.d.ts +1 -1
- package/dist/types/mcpTypes.js +1 -1
- package/dist/types/streamTypes.d.ts +14 -0
- package/dist/types/universalProviderOptions.d.ts +1 -1
- package/dist/types/universalProviderOptions.js +0 -1
- package/dist/utils/errorHandling.d.ts +142 -0
- package/dist/utils/errorHandling.js +316 -0
- package/dist/utils/factoryProcessing.d.ts +74 -0
- package/dist/utils/factoryProcessing.js +588 -0
- package/dist/utils/optionsConversion.d.ts +54 -0
- package/dist/utils/optionsConversion.js +126 -0
- package/dist/utils/optionsUtils.d.ts +246 -0
- package/dist/utils/optionsUtils.js +960 -0
- package/dist/utils/providerConfig.js +6 -2
- package/dist/utils/providerHealth.d.ts +107 -0
- package/dist/utils/providerHealth.js +543 -0
- package/dist/utils/providerUtils.d.ts +17 -0
- package/dist/utils/providerUtils.js +271 -16
- package/dist/utils/timeout.js +1 -1
- package/dist/utils/tokenLimits.d.ts +33 -0
- package/dist/utils/tokenLimits.js +118 -0
- package/package.json +2 -2
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type conversion utilities between GenerateOptions and StreamOptions
|
|
3
|
+
*
|
|
4
|
+
* 🔧 FIX: Addresses Issue #2 - Type System Mismatch
|
|
5
|
+
* Factory patterns need to work with both generate() and stream() methods
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Convert GenerateOptions to StreamOptions
|
|
9
|
+
* Preserves all factory configuration and enhancement data
|
|
10
|
+
*/
|
|
11
|
+
export function convertGenerateToStreamOptions(generateOptions) {
|
|
12
|
+
const streamOptions = {
|
|
13
|
+
// Core input mapping
|
|
14
|
+
input: generateOptions.input,
|
|
15
|
+
// Provider and model settings
|
|
16
|
+
provider: generateOptions.provider,
|
|
17
|
+
model: generateOptions.model,
|
|
18
|
+
temperature: generateOptions.temperature,
|
|
19
|
+
maxTokens: generateOptions.maxTokens,
|
|
20
|
+
systemPrompt: generateOptions.systemPrompt,
|
|
21
|
+
// Tool configuration
|
|
22
|
+
tools: generateOptions.tools,
|
|
23
|
+
disableTools: generateOptions.disableTools,
|
|
24
|
+
// maxSteps only exists in StreamOptions, not GenerateOptions
|
|
25
|
+
// Analytics and evaluation
|
|
26
|
+
enableEvaluation: generateOptions.enableEvaluation,
|
|
27
|
+
enableAnalytics: generateOptions.enableAnalytics,
|
|
28
|
+
context: generateOptions.context,
|
|
29
|
+
// Domain-aware evaluation
|
|
30
|
+
evaluationDomain: generateOptions.evaluationDomain,
|
|
31
|
+
toolUsageContext: generateOptions.toolUsageContext,
|
|
32
|
+
conversationHistory: generateOptions.conversationHistory,
|
|
33
|
+
// 🔧 FIX: Factory configuration (critical for issue #2)
|
|
34
|
+
factoryConfig: generateOptions.factoryConfig,
|
|
35
|
+
// 🔧 FIX: Streaming configuration
|
|
36
|
+
streaming: generateOptions.streaming,
|
|
37
|
+
};
|
|
38
|
+
return streamOptions;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Convert StreamOptions to GenerateOptions
|
|
42
|
+
* Useful for fallback scenarios and unified processing
|
|
43
|
+
*/
|
|
44
|
+
export function convertStreamToGenerateOptions(streamOptions) {
|
|
45
|
+
const generateOptions = {
|
|
46
|
+
// Core input mapping
|
|
47
|
+
input: streamOptions.input,
|
|
48
|
+
// Provider and model settings
|
|
49
|
+
provider: streamOptions.provider,
|
|
50
|
+
model: streamOptions.model,
|
|
51
|
+
temperature: streamOptions.temperature,
|
|
52
|
+
maxTokens: streamOptions.maxTokens,
|
|
53
|
+
systemPrompt: streamOptions.systemPrompt,
|
|
54
|
+
// Tool configuration
|
|
55
|
+
tools: streamOptions.tools,
|
|
56
|
+
disableTools: streamOptions.disableTools,
|
|
57
|
+
// Note: maxSteps exists in StreamOptions but not in GenerateOptions
|
|
58
|
+
// Analytics and evaluation
|
|
59
|
+
enableEvaluation: streamOptions.enableEvaluation,
|
|
60
|
+
enableAnalytics: streamOptions.enableAnalytics,
|
|
61
|
+
context: streamOptions.context,
|
|
62
|
+
// Domain-aware evaluation
|
|
63
|
+
evaluationDomain: streamOptions.evaluationDomain,
|
|
64
|
+
toolUsageContext: streamOptions.toolUsageContext,
|
|
65
|
+
conversationHistory: streamOptions.conversationHistory,
|
|
66
|
+
// 🔧 FIX: Factory configuration (critical for issue #2)
|
|
67
|
+
factoryConfig: streamOptions.factoryConfig,
|
|
68
|
+
// 🔧 FIX: Streaming configuration
|
|
69
|
+
streaming: streamOptions.streaming,
|
|
70
|
+
};
|
|
71
|
+
return generateOptions;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Check if options object has factory configuration
|
|
75
|
+
* Useful for determining if enhanced processing is needed
|
|
76
|
+
*/
|
|
77
|
+
export function hasFactoryConfig(options) {
|
|
78
|
+
return !!options?.factoryConfig;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Extract factory configuration from either options type
|
|
82
|
+
* Returns null if no factory config is present
|
|
83
|
+
*/
|
|
84
|
+
export function extractFactoryConfig(options) {
|
|
85
|
+
const config = options?.factoryConfig;
|
|
86
|
+
return config ? config : null;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Check if options object has streaming configuration
|
|
90
|
+
* Useful for determining if streaming enhancements are needed
|
|
91
|
+
*/
|
|
92
|
+
export function hasStreamingConfig(options) {
|
|
93
|
+
return !!options?.streaming;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Extract streaming configuration from either options type
|
|
97
|
+
* Returns null if no streaming config is present
|
|
98
|
+
*/
|
|
99
|
+
export function extractStreamingConfig(options) {
|
|
100
|
+
const config = options?.streaming;
|
|
101
|
+
return config ? config : null;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Create factory-enhanced StreamOptions from domain configuration
|
|
105
|
+
* This is the key function that addresses Issue #2
|
|
106
|
+
*/
|
|
107
|
+
export function createFactoryAwareStreamOptions(baseOptions, factoryConfig) {
|
|
108
|
+
return {
|
|
109
|
+
input: baseOptions.input || { text: "" },
|
|
110
|
+
...baseOptions,
|
|
111
|
+
factoryConfig,
|
|
112
|
+
enableEvaluation: true, // Enable evaluation when using factory patterns
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Create factory-enhanced GenerateOptions from domain configuration
|
|
117
|
+
* Parallel function for generate() method
|
|
118
|
+
*/
|
|
119
|
+
export function createFactoryAwareGenerateOptions(baseOptions, factoryConfig) {
|
|
120
|
+
return {
|
|
121
|
+
input: baseOptions.input || { text: "" },
|
|
122
|
+
...baseOptions,
|
|
123
|
+
factoryConfig,
|
|
124
|
+
enableEvaluation: true, // Enable evaluation when using factory patterns
|
|
125
|
+
};
|
|
126
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options Enhancement Utilities
|
|
3
|
+
* Provides intelligent enhancement of GenerateOptions with factory patterns
|
|
4
|
+
* Supports domain configuration, streaming optimization, and MCP integration
|
|
5
|
+
*/
|
|
6
|
+
import type { GenerateOptions, UnifiedGenerationOptions } from "../types/generateTypes.js";
|
|
7
|
+
import type { StreamOptions } from "../types/streamTypes.js";
|
|
8
|
+
import type { ExecutionContext } from "../mcp/contracts/mcpContract.js";
|
|
9
|
+
/**
|
|
10
|
+
* Enhancement types for different optimization strategies
|
|
11
|
+
*/
|
|
12
|
+
export type EnhancementType = "streaming-optimization" | "mcp-integration" | "legacy-migration" | "context-conversion" | "domain-configuration" | "batch-parallel-enhancement" | "batch-hybrid-enhancement" | "batch-dependency-enhancement";
|
|
13
|
+
/**
|
|
14
|
+
* Enhancement options for modifying GenerateOptions
|
|
15
|
+
*/
|
|
16
|
+
export interface EnhancementOptions {
|
|
17
|
+
enhancementType: EnhancementType;
|
|
18
|
+
streamingOptions?: {
|
|
19
|
+
enabled?: boolean;
|
|
20
|
+
chunkSize?: number;
|
|
21
|
+
bufferSize?: number;
|
|
22
|
+
enableProgress?: boolean;
|
|
23
|
+
preferStreaming?: boolean;
|
|
24
|
+
};
|
|
25
|
+
mcpOptions?: {
|
|
26
|
+
enableToolRegistry?: boolean;
|
|
27
|
+
contextAware?: boolean;
|
|
28
|
+
executionContext?: ExecutionContext;
|
|
29
|
+
};
|
|
30
|
+
legacyMigration?: {
|
|
31
|
+
legacyContext?: Record<string, unknown>;
|
|
32
|
+
domainType?: string;
|
|
33
|
+
preserveFields?: boolean;
|
|
34
|
+
};
|
|
35
|
+
domainConfiguration?: {
|
|
36
|
+
domainType: string;
|
|
37
|
+
keyTerms?: string[];
|
|
38
|
+
failurePatterns?: string[];
|
|
39
|
+
successPatterns?: string[];
|
|
40
|
+
evaluationCriteria?: Record<string, unknown>;
|
|
41
|
+
};
|
|
42
|
+
performance?: {
|
|
43
|
+
enableAnalytics?: boolean;
|
|
44
|
+
enableEvaluation?: boolean;
|
|
45
|
+
timeout?: number;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Enhancement result with metadata
|
|
50
|
+
*/
|
|
51
|
+
export interface EnhancementResult {
|
|
52
|
+
options: UnifiedGenerationOptions;
|
|
53
|
+
metadata: {
|
|
54
|
+
enhancementApplied: boolean;
|
|
55
|
+
enhancementType: EnhancementType;
|
|
56
|
+
processingTime: number;
|
|
57
|
+
configurationUsed: Record<string, unknown>;
|
|
58
|
+
warnings: string[];
|
|
59
|
+
recommendations: string[];
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Options Enhancement Utility Class
|
|
64
|
+
* Main utility for enhancing GenerateOptions with factory patterns
|
|
65
|
+
*/
|
|
66
|
+
export declare class OptionsEnhancer {
|
|
67
|
+
/**
|
|
68
|
+
* Thread-safe enhancement counter using SharedArrayBuffer and Atomics
|
|
69
|
+
*
|
|
70
|
+
* NOTE ON THREAD-SAFETY:
|
|
71
|
+
* JavaScript's main execution is single-threaded. Thread-safety using SharedArrayBuffer and Atomics
|
|
72
|
+
* is only relevant in environments that support multi-threading, such as web workers (in browsers)
|
|
73
|
+
* or worker threads (in Node.js).
|
|
74
|
+
*
|
|
75
|
+
* RATIONALE FOR THREAD-SAFETY:
|
|
76
|
+
* OptionsEnhancer is used across multiple worker threads in high-performance scenarios:
|
|
77
|
+
* - Parallel batch processing (batchEnhanceParallel function)
|
|
78
|
+
* - Streaming operations with concurrent enhancements
|
|
79
|
+
* - Factory pattern implementations that may run in web workers
|
|
80
|
+
* - Analytics tracking requires accurate counts across all threads
|
|
81
|
+
*
|
|
82
|
+
* SharedArrayBuffer + Atomics ensures accurate statistics without race conditions
|
|
83
|
+
* when enhancement operations occur simultaneously across multiple contexts.
|
|
84
|
+
*
|
|
85
|
+
* NOTE: SharedArrayBuffer requires cross-origin isolation headers in browsers:
|
|
86
|
+
* - Cross-Origin-Opener-Policy: same-origin
|
|
87
|
+
* - Cross-Origin-Embedder-Policy: require-corp
|
|
88
|
+
* Without these, SharedArrayBuffer will be unavailable and thread-safety will be disabled.
|
|
89
|
+
* In Node.js, SharedArrayBuffer is available in worker threads.
|
|
90
|
+
*/
|
|
91
|
+
private static enhancementCountBuffer;
|
|
92
|
+
private static enhancementCountArray;
|
|
93
|
+
private static fallbackEnhancementCount;
|
|
94
|
+
private static get enhancementCount();
|
|
95
|
+
private static incrementEnhancementCount;
|
|
96
|
+
/**
|
|
97
|
+
* Enhance GenerateOptions with factory patterns
|
|
98
|
+
* Primary method for applying enhancements
|
|
99
|
+
*/
|
|
100
|
+
static enhance(options: GenerateOptions, enhancementOptions: EnhancementOptions): EnhancementResult;
|
|
101
|
+
/**
|
|
102
|
+
* Enhance options for streaming optimization
|
|
103
|
+
* Specialized method for streaming enhancements
|
|
104
|
+
*/
|
|
105
|
+
static enhanceForStreaming(options: GenerateOptions, streamingConfig?: {
|
|
106
|
+
chunkSize?: number;
|
|
107
|
+
bufferSize?: number;
|
|
108
|
+
enableProgress?: boolean;
|
|
109
|
+
}): EnhancementResult;
|
|
110
|
+
/**
|
|
111
|
+
* Convert legacy business context to factory options
|
|
112
|
+
* Migration utility for existing business-specific code
|
|
113
|
+
*/
|
|
114
|
+
static migrateFromLegacy(options: GenerateOptions, legacyContext: Record<string, unknown>, domainType: string): EnhancementResult;
|
|
115
|
+
/**
|
|
116
|
+
* Create unified options from separate generation and streaming options
|
|
117
|
+
* Utility for combining different option types
|
|
118
|
+
*/
|
|
119
|
+
static createUnified(generateOptions: GenerateOptions, streamOptions?: Partial<StreamOptions>): UnifiedGenerationOptions;
|
|
120
|
+
/**
|
|
121
|
+
* Enhance GenerateOptions with domain configuration
|
|
122
|
+
* Convenience method for domain-specific enhancements
|
|
123
|
+
*/
|
|
124
|
+
static enhanceWithDomain(options: GenerateOptions, domainConfig: {
|
|
125
|
+
domainType: string;
|
|
126
|
+
keyTerms?: string[];
|
|
127
|
+
failurePatterns?: string[];
|
|
128
|
+
successPatterns?: string[];
|
|
129
|
+
evaluationCriteria?: Record<string, unknown>;
|
|
130
|
+
}): EnhancementResult;
|
|
131
|
+
/**
|
|
132
|
+
* Validate enhancement compatibility
|
|
133
|
+
* Check if enhancement options are compatible with base options
|
|
134
|
+
*/
|
|
135
|
+
static validateEnhancement(options: GenerateOptions, enhancementOptions: EnhancementOptions): {
|
|
136
|
+
valid: boolean;
|
|
137
|
+
warnings: string[];
|
|
138
|
+
recommendations: string[];
|
|
139
|
+
};
|
|
140
|
+
private static applyEnhancement;
|
|
141
|
+
private static applyStreamingOptimization;
|
|
142
|
+
private static applyMcpIntegration;
|
|
143
|
+
private static applyLegacyMigration;
|
|
144
|
+
private static applyContextConversion;
|
|
145
|
+
private static applyDomainConfiguration;
|
|
146
|
+
private static createErrorResult;
|
|
147
|
+
/**
|
|
148
|
+
* Get enhancement statistics
|
|
149
|
+
* Utility for monitoring enhancement usage
|
|
150
|
+
*/
|
|
151
|
+
static getStatistics(): {
|
|
152
|
+
enhancementCount: number;
|
|
153
|
+
lastReset: number;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Reset enhancement statistics
|
|
157
|
+
* Utility for clearing counters
|
|
158
|
+
*/
|
|
159
|
+
static resetStatistics(): void;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Convenience functions for common enhancement patterns
|
|
163
|
+
*/
|
|
164
|
+
/**
|
|
165
|
+
* Quick streaming enhancement
|
|
166
|
+
* Simplified interface for streaming optimization
|
|
167
|
+
*/
|
|
168
|
+
export declare function enhanceForStreaming(options: GenerateOptions, chunkSize?: number): EnhancementResult;
|
|
169
|
+
/**
|
|
170
|
+
* Quick legacy migration
|
|
171
|
+
* Simplified interface for legacy context migration
|
|
172
|
+
*/
|
|
173
|
+
export declare function migrateLegacyContext(options: GenerateOptions, legacyContext: Record<string, unknown>, domainType: string): EnhancementResult;
|
|
174
|
+
/**
|
|
175
|
+
* Batch enhancement utility with intelligent parallel processing
|
|
176
|
+
* Automatically detects independent enhancements for parallel processing
|
|
177
|
+
*/
|
|
178
|
+
export declare function batchEnhance(options: GenerateOptions, enhancements: EnhancementOptions[]): EnhancementResult;
|
|
179
|
+
/**
|
|
180
|
+
* Plugin-based conflict detection system
|
|
181
|
+
* Extensible and configurable enhancement conflict resolution
|
|
182
|
+
*/
|
|
183
|
+
export interface ConflictDetectionPlugin {
|
|
184
|
+
/** Plugin name for identification */
|
|
185
|
+
name: string;
|
|
186
|
+
/** Plugin version for compatibility checks */
|
|
187
|
+
version: string;
|
|
188
|
+
/** Check if two enhancement types conflict */
|
|
189
|
+
detectConflict(enhancementA: EnhancementType, enhancementB: EnhancementType, optionsA?: EnhancementOptions, optionsB?: EnhancementOptions): boolean;
|
|
190
|
+
/** Get conflict severity (low, medium, high) */
|
|
191
|
+
getConflictSeverity?(enhancementA: EnhancementType, enhancementB: EnhancementType): "low" | "medium" | "high";
|
|
192
|
+
/** Suggest resolution strategies */
|
|
193
|
+
suggestResolution?(enhancementA: EnhancementType, enhancementB: EnhancementType): string[];
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Plugin registry for managing conflict detection plugins
|
|
197
|
+
*/
|
|
198
|
+
declare class ConflictDetectionRegistry {
|
|
199
|
+
private plugins;
|
|
200
|
+
private activePlugins;
|
|
201
|
+
constructor();
|
|
202
|
+
/**
|
|
203
|
+
* Register a new conflict detection plugin
|
|
204
|
+
*/
|
|
205
|
+
registerPlugin(plugin: ConflictDetectionPlugin): void;
|
|
206
|
+
/**
|
|
207
|
+
* Set active plugins (in order of priority)
|
|
208
|
+
*/
|
|
209
|
+
setActivePlugins(pluginNames: string[]): void;
|
|
210
|
+
/**
|
|
211
|
+
* Detect conflicts using active plugins
|
|
212
|
+
*/
|
|
213
|
+
detectConflicts(enhancementA: EnhancementType, enhancementB: EnhancementType, optionsA?: EnhancementOptions, optionsB?: EnhancementOptions): {
|
|
214
|
+
hasConflict: boolean;
|
|
215
|
+
severity: "low" | "medium" | "high";
|
|
216
|
+
detectedBy: string[];
|
|
217
|
+
suggestions: string[];
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Get information about registered plugins
|
|
221
|
+
*/
|
|
222
|
+
getPluginInfo(): Array<{
|
|
223
|
+
name: string;
|
|
224
|
+
version: string;
|
|
225
|
+
active: boolean;
|
|
226
|
+
}>;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Get the global conflict detection registry for plugin management
|
|
230
|
+
* Allows external systems to register custom conflict detection plugins
|
|
231
|
+
*/
|
|
232
|
+
export declare function getConflictDetectionRegistry(): ConflictDetectionRegistry;
|
|
233
|
+
/**
|
|
234
|
+
* Parallel batch enhancement utility
|
|
235
|
+
* Apply multiple independent enhancements in parallel for better performance
|
|
236
|
+
* Note: Only use for independent enhancements that don't depend on each other
|
|
237
|
+
*/
|
|
238
|
+
export declare function batchEnhanceParallel(baseOptions: GenerateOptions[], enhancements: EnhancementOptions[]): Promise<EnhancementResult[]>;
|
|
239
|
+
/**
|
|
240
|
+
* Batch enhancement with dependency handling
|
|
241
|
+
* Apply enhancements with proper dependency resolution
|
|
242
|
+
*/
|
|
243
|
+
export declare function batchEnhanceWithDependencies(options: GenerateOptions, enhancements: (EnhancementOptions & {
|
|
244
|
+
dependsOn?: number[];
|
|
245
|
+
})[]): EnhancementResult;
|
|
246
|
+
export {};
|