@juspay/neurolink 9.3.0 → 9.5.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 (128) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +8 -8
  3. package/dist/cli/commands/config.d.ts +3 -3
  4. package/dist/cli/index.js +1 -0
  5. package/dist/index.d.ts +35 -0
  6. package/dist/index.js +17 -0
  7. package/dist/lib/agent/directTools.d.ts +5 -5
  8. package/dist/lib/index.d.ts +35 -0
  9. package/dist/lib/index.js +17 -0
  10. package/dist/lib/neurolink.d.ts +12 -1
  11. package/dist/lib/neurolink.js +265 -4
  12. package/dist/lib/server/utils/validation.d.ts +8 -8
  13. package/dist/lib/types/generateTypes.d.ts +28 -0
  14. package/dist/lib/types/index.d.ts +6 -0
  15. package/dist/lib/types/index.js +12 -0
  16. package/dist/lib/types/modelTypes.d.ts +2 -2
  17. package/dist/lib/types/streamTypes.d.ts +35 -0
  18. package/dist/lib/types/workflowTypes.d.ts +558 -0
  19. package/dist/lib/types/workflowTypes.js +32 -0
  20. package/dist/lib/workflow/LAYER-EXAMPLES.d.ts +13 -0
  21. package/dist/lib/workflow/LAYER-EXAMPLES.js +312 -0
  22. package/dist/lib/workflow/PROMPT-EXAMPLES.d.ts +117 -0
  23. package/dist/lib/workflow/PROMPT-EXAMPLES.js +246 -0
  24. package/dist/lib/workflow/config.d.ts +1569 -0
  25. package/dist/lib/workflow/config.js +399 -0
  26. package/dist/lib/workflow/core/ensembleExecutor.d.ts +56 -0
  27. package/dist/lib/workflow/core/ensembleExecutor.js +398 -0
  28. package/dist/lib/workflow/core/judgeScorer.d.ts +26 -0
  29. package/dist/lib/workflow/core/judgeScorer.js +527 -0
  30. package/dist/lib/workflow/core/responseConditioner.d.ts +22 -0
  31. package/dist/lib/workflow/core/responseConditioner.js +226 -0
  32. package/dist/lib/workflow/core/types/conditionerTypes.d.ts +7 -0
  33. package/dist/lib/workflow/core/types/conditionerTypes.js +8 -0
  34. package/dist/lib/workflow/core/types/ensembleTypes.d.ts +7 -0
  35. package/dist/lib/workflow/core/types/ensembleTypes.js +8 -0
  36. package/dist/lib/workflow/core/types/index.d.ts +7 -0
  37. package/dist/lib/workflow/core/types/index.js +8 -0
  38. package/dist/lib/workflow/core/types/judgeTypes.d.ts +7 -0
  39. package/dist/lib/workflow/core/types/judgeTypes.js +8 -0
  40. package/dist/lib/workflow/core/types/layerTypes.d.ts +7 -0
  41. package/dist/lib/workflow/core/types/layerTypes.js +8 -0
  42. package/dist/lib/workflow/core/types/registryTypes.d.ts +7 -0
  43. package/dist/lib/workflow/core/types/registryTypes.js +8 -0
  44. package/dist/lib/workflow/core/workflowRegistry.d.ts +73 -0
  45. package/dist/lib/workflow/core/workflowRegistry.js +305 -0
  46. package/dist/lib/workflow/core/workflowRunner.d.ts +115 -0
  47. package/dist/lib/workflow/core/workflowRunner.js +554 -0
  48. package/dist/lib/workflow/index.d.ts +36 -0
  49. package/dist/lib/workflow/index.js +51 -0
  50. package/dist/lib/workflow/types.d.ts +19 -0
  51. package/dist/lib/workflow/types.js +10 -0
  52. package/dist/lib/workflow/utils/types/index.d.ts +7 -0
  53. package/dist/lib/workflow/utils/types/index.js +8 -0
  54. package/dist/lib/workflow/utils/types/metricsTypes.d.ts +7 -0
  55. package/dist/lib/workflow/utils/types/metricsTypes.js +8 -0
  56. package/dist/lib/workflow/utils/types/validationTypes.d.ts +7 -0
  57. package/dist/lib/workflow/utils/types/validationTypes.js +8 -0
  58. package/dist/lib/workflow/utils/workflowMetrics.d.ts +76 -0
  59. package/dist/lib/workflow/utils/workflowMetrics.js +312 -0
  60. package/dist/lib/workflow/utils/workflowValidation.d.ts +29 -0
  61. package/dist/lib/workflow/utils/workflowValidation.js +421 -0
  62. package/dist/lib/workflow/workflows/adaptiveWorkflow.d.ts +72 -0
  63. package/dist/lib/workflow/workflows/adaptiveWorkflow.js +367 -0
  64. package/dist/lib/workflow/workflows/consensusWorkflow.d.ts +69 -0
  65. package/dist/lib/workflow/workflows/consensusWorkflow.js +193 -0
  66. package/dist/lib/workflow/workflows/fallbackWorkflow.d.ts +49 -0
  67. package/dist/lib/workflow/workflows/fallbackWorkflow.js +226 -0
  68. package/dist/lib/workflow/workflows/multiJudgeWorkflow.d.ts +70 -0
  69. package/dist/lib/workflow/workflows/multiJudgeWorkflow.js +352 -0
  70. package/dist/neurolink.d.ts +12 -1
  71. package/dist/neurolink.js +265 -4
  72. package/dist/types/generateTypes.d.ts +28 -0
  73. package/dist/types/index.d.ts +6 -0
  74. package/dist/types/index.js +12 -0
  75. package/dist/types/streamTypes.d.ts +35 -0
  76. package/dist/types/workflowTypes.d.ts +558 -0
  77. package/dist/types/workflowTypes.js +31 -0
  78. package/dist/workflow/LAYER-EXAMPLES.d.ts +13 -0
  79. package/dist/workflow/LAYER-EXAMPLES.js +311 -0
  80. package/dist/workflow/PROMPT-EXAMPLES.d.ts +117 -0
  81. package/dist/workflow/PROMPT-EXAMPLES.js +245 -0
  82. package/dist/workflow/config.d.ts +1569 -0
  83. package/dist/workflow/config.js +398 -0
  84. package/dist/workflow/core/ensembleExecutor.d.ts +56 -0
  85. package/dist/workflow/core/ensembleExecutor.js +397 -0
  86. package/dist/workflow/core/judgeScorer.d.ts +26 -0
  87. package/dist/workflow/core/judgeScorer.js +526 -0
  88. package/dist/workflow/core/responseConditioner.d.ts +22 -0
  89. package/dist/workflow/core/responseConditioner.js +225 -0
  90. package/dist/workflow/core/types/conditionerTypes.d.ts +7 -0
  91. package/dist/workflow/core/types/conditionerTypes.js +7 -0
  92. package/dist/workflow/core/types/ensembleTypes.d.ts +7 -0
  93. package/dist/workflow/core/types/ensembleTypes.js +7 -0
  94. package/dist/workflow/core/types/index.d.ts +7 -0
  95. package/dist/workflow/core/types/index.js +7 -0
  96. package/dist/workflow/core/types/judgeTypes.d.ts +7 -0
  97. package/dist/workflow/core/types/judgeTypes.js +7 -0
  98. package/dist/workflow/core/types/layerTypes.d.ts +7 -0
  99. package/dist/workflow/core/types/layerTypes.js +7 -0
  100. package/dist/workflow/core/types/registryTypes.d.ts +7 -0
  101. package/dist/workflow/core/types/registryTypes.js +7 -0
  102. package/dist/workflow/core/workflowRegistry.d.ts +73 -0
  103. package/dist/workflow/core/workflowRegistry.js +304 -0
  104. package/dist/workflow/core/workflowRunner.d.ts +115 -0
  105. package/dist/workflow/core/workflowRunner.js +553 -0
  106. package/dist/workflow/index.d.ts +36 -0
  107. package/dist/workflow/index.js +50 -0
  108. package/dist/workflow/types.d.ts +19 -0
  109. package/dist/workflow/types.js +9 -0
  110. package/dist/workflow/utils/types/index.d.ts +7 -0
  111. package/dist/workflow/utils/types/index.js +7 -0
  112. package/dist/workflow/utils/types/metricsTypes.d.ts +7 -0
  113. package/dist/workflow/utils/types/metricsTypes.js +7 -0
  114. package/dist/workflow/utils/types/validationTypes.d.ts +7 -0
  115. package/dist/workflow/utils/types/validationTypes.js +7 -0
  116. package/dist/workflow/utils/workflowMetrics.d.ts +76 -0
  117. package/dist/workflow/utils/workflowMetrics.js +311 -0
  118. package/dist/workflow/utils/workflowValidation.d.ts +29 -0
  119. package/dist/workflow/utils/workflowValidation.js +420 -0
  120. package/dist/workflow/workflows/adaptiveWorkflow.d.ts +72 -0
  121. package/dist/workflow/workflows/adaptiveWorkflow.js +366 -0
  122. package/dist/workflow/workflows/consensusWorkflow.d.ts +69 -0
  123. package/dist/workflow/workflows/consensusWorkflow.js +192 -0
  124. package/dist/workflow/workflows/fallbackWorkflow.d.ts +49 -0
  125. package/dist/workflow/workflows/fallbackWorkflow.js +225 -0
  126. package/dist/workflow/workflows/multiJudgeWorkflow.d.ts +70 -0
  127. package/dist/workflow/workflows/multiJudgeWorkflow.js +351 -0
  128. package/package.json +3 -2
@@ -0,0 +1,226 @@
1
+ /**
2
+ * workflow/core/responseConditioner.ts
3
+ * Response conditioning and synthesis
4
+ *
5
+ * Uses judge feedback and ensemble responses to synthesize an improved final response.
6
+ * Combines strengths from multiple responses based on evaluation insights.
7
+ */
8
+ import { logger } from "../../utils/logger.js";
9
+ import { AIProviderFactory } from "../../core/factory.js";
10
+ const functionTag = "ResponseConditioner";
11
+ // ============================================================================
12
+ // CONDITIONING FUNCTIONS
13
+ // ============================================================================
14
+ /**
15
+ * Condition response by synthesizing improved version using judge feedback
16
+ *
17
+ * @param options - Conditioning options including all responses and judge feedback
18
+ * @returns Conditioned result with synthesized improved content
19
+ */
20
+ export async function conditionResponse(options) {
21
+ const startTime = Date.now();
22
+ const { content, selectedResponse, allResponses, judgeScores, config, originalPrompt, } = options;
23
+ logger.debug(`[${functionTag}] Conditioning response with synthesis`, {
24
+ originalLength: content.length,
25
+ provider: selectedResponse.provider,
26
+ model: selectedResponse.model,
27
+ hasConfig: !!config,
28
+ numResponses: allResponses?.length || 0,
29
+ });
30
+ // Check if conditioning is enabled
31
+ if (!config || !config.useConfidence) {
32
+ logger.debug(`[${functionTag}] Conditioning disabled, returning original`);
33
+ return {
34
+ content,
35
+ conditioningTime: Date.now() - startTime,
36
+ metadata: {
37
+ conditioningApplied: false,
38
+ originalLength: content.length,
39
+ finalLength: content.length,
40
+ },
41
+ };
42
+ }
43
+ // If synthesis model not configured, fall back to original with metadata
44
+ if (!config.synthesisModel) {
45
+ logger.debug(`[${functionTag}] No synthesis model configured, returning original with metadata`);
46
+ return addMetadataOnly(content, selectedResponse, judgeScores, config, startTime);
47
+ }
48
+ try {
49
+ // Synthesize improved response using LLM
50
+ const synthesizedContent = await synthesizeImprovedResponse(content, allResponses, judgeScores, originalPrompt, config);
51
+ const conditioningTime = Date.now() - startTime;
52
+ logger.debug(`[${functionTag}] Response synthesized successfully`, {
53
+ conditioningTime,
54
+ originalLength: content.length,
55
+ finalLength: synthesizedContent.length,
56
+ improvement: synthesizedContent.length - content.length,
57
+ });
58
+ return {
59
+ content: synthesizedContent,
60
+ conditioningTime,
61
+ metadata: {
62
+ conditioningApplied: true,
63
+ originalLength: content.length,
64
+ finalLength: synthesizedContent.length,
65
+ confidenceStatementAdded: false,
66
+ modelAttributionAdded: false,
67
+ executionTimeAdded: false,
68
+ synthesisApplied: true,
69
+ },
70
+ };
71
+ }
72
+ catch (error) {
73
+ logger.warn(`[${functionTag}] Synthesis failed, falling back to original`, {
74
+ error: error instanceof Error ? error.message : String(error),
75
+ });
76
+ // Fall back to original with metadata
77
+ return addMetadataOnly(content, selectedResponse, judgeScores, config, startTime);
78
+ }
79
+ }
80
+ /**
81
+ * Check if conditioning is enabled
82
+ * @param config - Conditioning configuration
83
+ * @returns True if conditioning should be applied
84
+ */
85
+ export function isConditioningEnabled(config) {
86
+ return config?.useConfidence === true;
87
+ }
88
+ // ============================================================================
89
+ // SYNTHESIS FUNCTIONS
90
+ // ============================================================================
91
+ /**
92
+ * Synthesize improved response using judge feedback and all ensemble responses
93
+ */
94
+ async function synthesizeImprovedResponse(bestContent, allResponses, judgeScores, originalPrompt, config) {
95
+ const reasoning = judgeScores?.reasoning || "No specific feedback available";
96
+ // Build synthesis prompt
97
+ const synthesisPrompt = `You are a response synthesis expert. Your task is to create an improved, higher-quality response by combining the best elements from multiple AI-generated responses.
98
+
99
+ ORIGINAL USER PROMPT:
100
+ ${originalPrompt || "Not provided"}
101
+
102
+ JUDGE'S EVALUATION:
103
+ ${reasoning}
104
+
105
+ AVAILABLE RESPONSES:
106
+ ${allResponses
107
+ .filter((r) => r.status === "success" && r.content)
108
+ .map((r, i) => `
109
+ Response ${i + 1} (${r.provider}/${r.model}):
110
+ ${r.content}
111
+ `)
112
+ .join("\n---\n")}
113
+
114
+ BEST RESPONSE (Selected by Judge):
115
+ ${bestContent}
116
+
117
+ YOUR TASK:
118
+ Synthesize an improved final response that:
119
+ 1. Incorporates the judge's feedback and addresses any identified weaknesses
120
+ 2. Combines the strongest elements from all responses
121
+ 3. Maintains accuracy and technical correctness
122
+ 4. Improves clarity, completeness, and overall quality
123
+ 5. Maintains the same tone and format as the original responses
124
+ 6. Does NOT add meta-commentary, disclaimers, or explanatory notes
125
+ 7. Provides a direct, polished answer to the user's original question
126
+
127
+ Output ONLY the synthesized response, nothing else.`;
128
+ logger.debug(`[${functionTag}] Calling synthesis model`, {
129
+ model: config?.synthesisModel?.model || "default",
130
+ provider: config?.synthesisModel?.provider || "default",
131
+ });
132
+ // Create provider for synthesis using AIProviderFactory
133
+ const synthesisProvider = config?.synthesisModel?.provider || "azure";
134
+ const synthesisModel = config?.synthesisModel?.model || "gpt-4o";
135
+ const provider = await AIProviderFactory.createProvider(synthesisProvider, synthesisModel);
136
+ // Generate improved response
137
+ const result = await provider.generate({
138
+ prompt: synthesisPrompt,
139
+ temperature: config?.synthesisModel?.temperature || 0.3,
140
+ maxTokens: 2000,
141
+ timeout: 30000,
142
+ });
143
+ if (!result || !result.content) {
144
+ throw new Error("Synthesis model returned empty response");
145
+ }
146
+ return result.content.trim();
147
+ }
148
+ /**
149
+ * Fallback: Add metadata only (original behavior)
150
+ */
151
+ function addMetadataOnly(content, selectedResponse, judgeScores, config, startTime) {
152
+ let conditionedContent = content;
153
+ // Add confidence statement if enabled
154
+ if (config.addConfidenceStatement && judgeScores) {
155
+ const confidenceLevel = getConfidenceLevel(judgeScores.confidenceInJudgment || 0.5, config);
156
+ conditionedContent = addConfidenceStatement(conditionedContent, confidenceLevel, judgeScores.confidenceInJudgment || 0.5);
157
+ }
158
+ // Add model attribution if enabled
159
+ if (config.addModelAttribution) {
160
+ conditionedContent = addModelAttribution(conditionedContent, selectedResponse.provider, selectedResponse.model, judgeScores);
161
+ }
162
+ // Add execution time if enabled
163
+ if (config.addExecutionTime) {
164
+ conditionedContent = addExecutionMetrics(conditionedContent, selectedResponse.responseTime);
165
+ }
166
+ const conditioningTime = Date.now() - startTime;
167
+ return {
168
+ content: conditionedContent,
169
+ conditioningTime,
170
+ metadata: {
171
+ conditioningApplied: true,
172
+ originalLength: content.length,
173
+ finalLength: conditionedContent.length,
174
+ confidenceStatementAdded: config.addConfidenceStatement,
175
+ modelAttributionAdded: config.addModelAttribution,
176
+ executionTimeAdded: config.addExecutionTime,
177
+ },
178
+ };
179
+ }
180
+ // ============================================================================
181
+ // HELPER FUNCTIONS
182
+ // ============================================================================
183
+ /**
184
+ * Determine confidence level from score
185
+ */
186
+ function getConfidenceLevel(confidence, config) {
187
+ const thresholds = config.confidenceThresholds || {
188
+ high: 0.8,
189
+ medium: 0.5,
190
+ low: 0.3,
191
+ };
192
+ if (confidence >= thresholds.high) {
193
+ return "high";
194
+ }
195
+ if (confidence >= thresholds.medium) {
196
+ return "medium";
197
+ }
198
+ return "low";
199
+ }
200
+ /**
201
+ * Add confidence statement to response
202
+ */
203
+ function addConfidenceStatement(content, level, score) {
204
+ const statements = {
205
+ high: `\n\n---\n**Quality Assurance:** This response achieved a high confidence score (${(score * 100).toFixed(0)}%) through multi-model evaluation. The content has been validated for accuracy and completeness.`,
206
+ medium: `\n\n---\n**Quality Note:** This response received a moderate confidence score (${(score * 100).toFixed(0)}%) from the evaluation system. Consider cross-referencing critical details.`,
207
+ low: `\n\n---\n**Advisory:** This response has a lower confidence score (${(score * 100).toFixed(0)}%). Please verify important information independently.`,
208
+ };
209
+ return content + statements[level];
210
+ }
211
+ /**
212
+ * Add model attribution
213
+ */
214
+ function addModelAttribution(content, provider, model, judgeScores) {
215
+ const score = Object.values(judgeScores?.scores || {}).reduce((max, curr) => Math.max(max, curr), 0);
216
+ return (content +
217
+ `\n\n---\n**Source:** Generated by ${provider}/${model} | Evaluation Score: ${score}/100`);
218
+ }
219
+ /**
220
+ * Add execution metrics
221
+ */
222
+ function addExecutionMetrics(content, responseTime) {
223
+ return (content +
224
+ `\n\n---\n**Performance:** Response generated in ${responseTime}ms`);
225
+ }
226
+ //# sourceMappingURL=responseConditioner.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * workflow/core/types/conditionerTypes.ts
3
+ * Type definitions for response conditioning
4
+ *
5
+ * Re-exports from the central types folder for backward compatibility
6
+ */
7
+ export type { ConditionOptions, ConditionResult, } from "../../../types/workflowTypes.js";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * workflow/core/types/conditionerTypes.ts
3
+ * Type definitions for response conditioning
4
+ *
5
+ * Re-exports from the central types folder for backward compatibility
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=conditionerTypes.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * workflow/core/types/ensembleTypes.ts
3
+ * Type definitions for ensemble execution
4
+ *
5
+ * Re-exports from the central types folder for backward compatibility
6
+ */
7
+ export type { ExecuteEnsembleOptions, EnsembleExecutionResult, ExecuteModelOptions, } from "../../../types/workflowTypes.js";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * workflow/core/types/ensembleTypes.ts
3
+ * Type definitions for ensemble execution
4
+ *
5
+ * Re-exports from the central types folder for backward compatibility
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=ensembleTypes.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * workflow/core/types/index.ts
3
+ * Centralized export for all workflow core types
4
+ *
5
+ * Re-exports from the central types folder for backward compatibility
6
+ */
7
+ export type { ConditionOptions, ConditionResult, EnsembleExecutionResult, ExecuteEnsembleOptions, ExecuteModelOptions, ParsedJudgeResponse, ScoreOptions, ScoreResult, ExecuteLayerOptions, LayerExecutionResult, ListOptions, RegisterOptions, RegisterResult, RegistryEntry, RegistryStats, WorkflowMetadata, } from "../../../types/workflowTypes.js";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * workflow/core/types/index.ts
3
+ * Centralized export for all workflow core types
4
+ *
5
+ * Re-exports from the central types folder for backward compatibility
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * workflow/core/types/judgeTypes.ts
3
+ * Type definitions for judge scoring
4
+ *
5
+ * Re-exports from the central types folder for backward compatibility
6
+ */
7
+ export type { ScoreOptions, ScoreResult, ParsedJudgeResponse, } from "../../../types/workflowTypes.js";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * workflow/core/types/judgeTypes.ts
3
+ * Type definitions for judge scoring
4
+ *
5
+ * Re-exports from the central types folder for backward compatibility
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=judgeTypes.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * workflow/core/types/layerTypes.ts
3
+ * Type definitions for layer-based execution
4
+ *
5
+ * Re-exports from the central types folder for backward compatibility
6
+ */
7
+ export type { LayerExecutionResult, ExecuteLayerOptions, } from "../../../types/workflowTypes.js";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * workflow/core/types/layerTypes.ts
3
+ * Type definitions for layer-based execution
4
+ *
5
+ * Re-exports from the central types folder for backward compatibility
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=layerTypes.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * workflow/core/types/registryTypes.ts
3
+ * Type definitions for workflow registry
4
+ *
5
+ * Re-exports from the central types folder for backward compatibility
6
+ */
7
+ export type { RegistryEntry, RegisterOptions, RegisterResult, ListOptions, WorkflowMetadata, RegistryStats, } from "../../../types/workflowTypes.js";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * workflow/core/types/registryTypes.ts
3
+ * Type definitions for workflow registry
4
+ *
5
+ * Re-exports from the central types folder for backward compatibility
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=registryTypes.js.map
@@ -0,0 +1,73 @@
1
+ /**
2
+ * workflow/core/workflowRegistry.ts
3
+ * Registry for managing workflow configurations
4
+ */
5
+ import type { WorkflowConfig } from "../types.js";
6
+ import type { ListOptions, RegisterOptions, RegisterResult, RegistryStats, WorkflowMetadata } from "./types/index.js";
7
+ /**
8
+ * Register a new workflow
9
+ * @param config - Workflow configuration to register
10
+ * @param options - Registration options
11
+ * @returns Registration result
12
+ */
13
+ export declare function registerWorkflow(config: WorkflowConfig, options?: RegisterOptions): RegisterResult;
14
+ /**
15
+ * Unregister a workflow
16
+ * @param workflowId - ID of workflow to unregister
17
+ * @returns True if workflow was unregistered
18
+ */
19
+ export declare function unregisterWorkflow(workflowId: string): boolean;
20
+ /**
21
+ * Get workflow configuration by ID
22
+ * @param workflowId - ID of workflow to retrieve
23
+ * @returns Workflow configuration or undefined
24
+ */
25
+ export declare function getWorkflow(workflowId: string): WorkflowConfig | undefined;
26
+ /**
27
+ * Check if workflow exists
28
+ * @param workflowId - ID of workflow to check
29
+ * @returns True if workflow exists
30
+ */
31
+ export declare function hasWorkflow(workflowId: string): boolean;
32
+ /**
33
+ * List all registered workflows
34
+ * @param options - Listing options for filtering
35
+ * @returns Array of workflow configurations
36
+ */
37
+ export declare function listWorkflows(options?: ListOptions): WorkflowConfig[];
38
+ /**
39
+ * Get workflow metadata (usage stats, timestamps)
40
+ * @param workflowId - ID of workflow
41
+ * @returns Metadata or undefined
42
+ */
43
+ export declare function getWorkflowMetadata(workflowId: string): WorkflowMetadata | undefined;
44
+ /**
45
+ * Update workflow configuration
46
+ * @param workflowId - ID of workflow to update
47
+ * @param updates - Partial workflow config with updates
48
+ * @param options - Update options
49
+ * @returns Update result
50
+ */
51
+ export declare function updateWorkflow(workflowId: string, updates: Partial<WorkflowConfig>, options?: RegisterOptions): RegisterResult;
52
+ /**
53
+ * Clear all workflows from registry
54
+ * WARNING: This will remove all registered workflows
55
+ */
56
+ export declare function clearRegistry(): void;
57
+ /**
58
+ * Get registry statistics
59
+ * @returns Statistics about registered workflows
60
+ */
61
+ export declare function getRegistryStats(): RegistryStats;
62
+ /**
63
+ * Export registry as JSON for backup/sharing
64
+ * @returns JSON string of all workflows
65
+ */
66
+ export declare function exportRegistry(): string;
67
+ /**
68
+ * Import workflows from JSON
69
+ * @param json - JSON string of workflow configs
70
+ * @param options - Import options
71
+ * @returns Array of registration results
72
+ */
73
+ export declare function importRegistry(json: string, options?: RegisterOptions): RegisterResult[];