@smythos/sre 1.5.74 → 1.6.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.
- package/CHANGELOG +16 -10
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/types/Components/Component.class.d.ts +16 -2
- package/dist/types/helpers/AIPerformanceAnalyzer.helper.d.ts +45 -0
- package/dist/types/helpers/AIPerformanceCollector.helper.d.ts +111 -0
- package/dist/types/helpers/Conversation.helper.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/subsystems/IO/VectorDB.service/connectors/MilvusVectorDB.class.d.ts +7 -1
- package/dist/types/subsystems/IO/VectorDB.service/connectors/PineconeVectorDB.class.d.ts +1 -1
- package/dist/types/subsystems/IO/VectorDB.service/connectors/RAMVecrtorDB.class.d.ts +8 -5
- package/dist/types/subsystems/IO/VectorDB.service/connectors/WeaviateVectorDB.class.d.ts +187 -0
- package/dist/types/subsystems/MemoryManager/RuntimeContext.d.ts +1 -0
- package/dist/types/subsystems/PerformanceManager/Performance.service/PerformanceConnector.d.ts +102 -0
- package/dist/types/subsystems/PerformanceManager/Performance.service/connectors/LocalPerformanceConnector.class.d.ts +100 -0
- package/dist/types/subsystems/PerformanceManager/Performance.service/index.d.ts +22 -0
- package/dist/types/subsystems/Security/Account.service/connectors/MySQLAccount.class.d.ts +19 -0
- package/dist/types/types/Performance.types.d.ts +468 -0
- package/package.json +1 -1
- package/src/Components/Component.class.ts +16 -2
- package/src/helpers/Conversation.helper.ts +9 -1
- package/src/index.ts +1 -1
- package/src/index.ts.bak +1 -1
- package/src/subsystems/IO/Storage.service/SmythFS.class.ts +3 -4
- package/src/subsystems/IO/VectorDB.service/connectors/MilvusVectorDB.class.ts +12 -1
- package/src/subsystems/IO/VectorDB.service/connectors/PineconeVectorDB.class.ts +4 -1
- package/src/subsystems/IO/VectorDB.service/connectors/RAMVecrtorDB.class.ts +48 -46
- package/src/subsystems/MemoryManager/Cache.service/connectors/RAMCache.class.ts +14 -1
- package/src/subsystems/MemoryManager/RuntimeContext.ts +9 -2
- package/src/subsystems/Security/Account.service/connectors/JSONFileAccount.class.ts +6 -1
- package/src/subsystems/Security/Account.service/connectors/{AWSAccount.class.ts → MySQLAccount.class.ts} +3 -3
- package/src/subsystems/Security/Account.service/index.ts +2 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ConnectorServiceProvider } from '../../../Core/ConnectorsService';
|
|
2
|
+
/**
|
|
3
|
+
* Performance Service Provider
|
|
4
|
+
*/
|
|
5
|
+
export declare class PerformanceService extends ConnectorServiceProvider {
|
|
6
|
+
private logger;
|
|
7
|
+
/**
|
|
8
|
+
* Register all available performance connectors
|
|
9
|
+
*/
|
|
10
|
+
register(): void;
|
|
11
|
+
/**
|
|
12
|
+
* Initialize performance service
|
|
13
|
+
*/
|
|
14
|
+
init(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Auto-configure performance monitoring based on environment
|
|
17
|
+
*/
|
|
18
|
+
private autoConfigurePerformanceMonitoring;
|
|
19
|
+
}
|
|
20
|
+
export { LocalPerformanceConnector } from './connectors/LocalPerformanceConnector.class';
|
|
21
|
+
export { PerformanceConnector } from './PerformanceConnector';
|
|
22
|
+
export type { IPerformanceRequest } from './PerformanceConnector';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ACL } from '@sre/Security/AccessControl/ACL.class';
|
|
2
|
+
import { AccessRequest } from '@sre/Security/AccessControl/AccessRequest.class';
|
|
3
|
+
import { IAccessCandidate } from '@sre/types/ACL.types';
|
|
4
|
+
import { AccountConnector } from '../AccountConnector';
|
|
5
|
+
import { KeyValueObject } from '@sre/types/Common.types';
|
|
6
|
+
export declare class MySQLAccount extends AccountConnector {
|
|
7
|
+
protected _settings: any;
|
|
8
|
+
name: string;
|
|
9
|
+
private pool;
|
|
10
|
+
constructor(_settings: any);
|
|
11
|
+
isTeamMember(team: string, candidate: IAccessCandidate): Promise<boolean>;
|
|
12
|
+
getCandidateTeam(candidate: IAccessCandidate): Promise<string | undefined>;
|
|
13
|
+
getAllTeamSettings(acRequest: AccessRequest, teamId: string): Promise<KeyValueObject[]>;
|
|
14
|
+
getTeamSetting(acRequest: AccessRequest, teamId: string, settingKey: string): Promise<string>;
|
|
15
|
+
getResourceACL(resourceId: string, candidate: IAccessCandidate): Promise<ACL>;
|
|
16
|
+
getAllUserSettings(acRequest: AccessRequest, accountId: string): Promise<KeyValueObject[]>;
|
|
17
|
+
getUserSetting(acRequest: AccessRequest, accountId: string, settingKey: string): Promise<string>;
|
|
18
|
+
getAgentSetting(acRequest: AccessRequest, agentId: string, settingKey: string): Promise<string>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
export interface AIComponentMetrics {
|
|
2
|
+
/** Component identifier */
|
|
3
|
+
componentName: string;
|
|
4
|
+
/** Agent executing this component */
|
|
5
|
+
agentId: string;
|
|
6
|
+
/** Execution timing breakdown */
|
|
7
|
+
timing: {
|
|
8
|
+
/** Total execution time (ms) */
|
|
9
|
+
total: number;
|
|
10
|
+
/** Time spent on input processing (ms) */
|
|
11
|
+
inputProcessing: number;
|
|
12
|
+
/** Time spent on core logic (ms) */
|
|
13
|
+
coreProcessing: number;
|
|
14
|
+
/** Time spent on output processing (ms) */
|
|
15
|
+
outputProcessing: number;
|
|
16
|
+
/** Queue wait time (ms) */
|
|
17
|
+
queueTime: number;
|
|
18
|
+
};
|
|
19
|
+
/** Memory usage analytics */
|
|
20
|
+
memory: {
|
|
21
|
+
/** Peak memory usage during execution (bytes) */
|
|
22
|
+
peak: number;
|
|
23
|
+
/** Memory delta from start to finish (bytes) */
|
|
24
|
+
delta: number;
|
|
25
|
+
/** Memory pressure level (0-1) */
|
|
26
|
+
pressure: number;
|
|
27
|
+
};
|
|
28
|
+
/** Data flow metrics */
|
|
29
|
+
dataFlow: {
|
|
30
|
+
/** Input data size (bytes) */
|
|
31
|
+
inputSize: number;
|
|
32
|
+
/** Output data size (bytes) */
|
|
33
|
+
outputSize: number;
|
|
34
|
+
/** Data transformation ratio */
|
|
35
|
+
transformationRatio: number;
|
|
36
|
+
/** Data complexity score (0-1) */
|
|
37
|
+
complexityScore: number;
|
|
38
|
+
};
|
|
39
|
+
/** LLM-specific metrics (if applicable) */
|
|
40
|
+
llm?: {
|
|
41
|
+
/** Model used for this execution */
|
|
42
|
+
model: string;
|
|
43
|
+
/** Token usage breakdown */
|
|
44
|
+
tokens: {
|
|
45
|
+
prompt: number;
|
|
46
|
+
completion: number;
|
|
47
|
+
total: number;
|
|
48
|
+
};
|
|
49
|
+
/** Estimated cost in USD */
|
|
50
|
+
estimatedCost: number;
|
|
51
|
+
/** Context window utilization (0-1) */
|
|
52
|
+
contextUtilization: number;
|
|
53
|
+
/** Response quality score (0-1) */
|
|
54
|
+
qualityScore?: number;
|
|
55
|
+
};
|
|
56
|
+
/** Execution result metadata */
|
|
57
|
+
execution: {
|
|
58
|
+
/** Execution timestamp */
|
|
59
|
+
timestamp: number;
|
|
60
|
+
/** Success/failure status */
|
|
61
|
+
success: boolean;
|
|
62
|
+
/** Error type if failed */
|
|
63
|
+
errorType?: string;
|
|
64
|
+
/** Retry count */
|
|
65
|
+
retryCount: number;
|
|
66
|
+
/** Component configuration hash */
|
|
67
|
+
configHash: string;
|
|
68
|
+
};
|
|
69
|
+
/** Performance impact factors */
|
|
70
|
+
impact: {
|
|
71
|
+
/** CPU usage percentage during execution */
|
|
72
|
+
cpuUsage: number;
|
|
73
|
+
/** I/O operations count */
|
|
74
|
+
ioOperations: number;
|
|
75
|
+
/** Network requests made */
|
|
76
|
+
networkRequests: number;
|
|
77
|
+
/** Cache hit/miss status */
|
|
78
|
+
cacheStatus: 'hit' | 'miss' | 'n/a';
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Comprehensive AI agent performance report
|
|
83
|
+
*/
|
|
84
|
+
export interface AIAgentPerformanceReport {
|
|
85
|
+
/** Report metadata */
|
|
86
|
+
metadata: {
|
|
87
|
+
agentId: string;
|
|
88
|
+
agentName: string;
|
|
89
|
+
reportId: string;
|
|
90
|
+
generatedAt: number;
|
|
91
|
+
analysisWindow: {
|
|
92
|
+
start: number;
|
|
93
|
+
end: number;
|
|
94
|
+
duration?: number;
|
|
95
|
+
};
|
|
96
|
+
version: string;
|
|
97
|
+
};
|
|
98
|
+
/** Executive summary */
|
|
99
|
+
summary: {
|
|
100
|
+
/** Total execution time across all components */
|
|
101
|
+
totalExecutionTime: number;
|
|
102
|
+
/** Total LLM costs */
|
|
103
|
+
totalLLMCosts: number;
|
|
104
|
+
/** Success rate percentage */
|
|
105
|
+
successRate: number;
|
|
106
|
+
/** Performance grade (A-F) */
|
|
107
|
+
performanceGrade: 'A' | 'B' | 'C' | 'D' | 'F';
|
|
108
|
+
/** Key performance indicators */
|
|
109
|
+
kpis: {
|
|
110
|
+
throughput: number;
|
|
111
|
+
latency: number;
|
|
112
|
+
efficiency: number;
|
|
113
|
+
reliability: number;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
/** Detailed component analysis */
|
|
117
|
+
components: {
|
|
118
|
+
/** Individual component metrics */
|
|
119
|
+
metrics: AIComponentMetrics[];
|
|
120
|
+
/** Component ranking by performance */
|
|
121
|
+
ranking: Array<{
|
|
122
|
+
componentName: string;
|
|
123
|
+
score: number;
|
|
124
|
+
rank: number;
|
|
125
|
+
}>;
|
|
126
|
+
/** Component dependency graph analysis */
|
|
127
|
+
dependencies: {
|
|
128
|
+
criticalPath: string[];
|
|
129
|
+
parallelizationOpportunities: string[][];
|
|
130
|
+
bottleneckComponents: string[];
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
/** AI-specific insights */
|
|
134
|
+
aiInsights: {
|
|
135
|
+
/** LLM usage optimization opportunities */
|
|
136
|
+
llmOptimization: {
|
|
137
|
+
modelDowngradeOpportunities: Array<{
|
|
138
|
+
component: string;
|
|
139
|
+
currentModel: string;
|
|
140
|
+
suggestedModel: string;
|
|
141
|
+
potentialSavings: number;
|
|
142
|
+
}>;
|
|
143
|
+
cachingOpportunities: Array<{
|
|
144
|
+
component: string;
|
|
145
|
+
repetitionRate: number;
|
|
146
|
+
potentialSavings: number;
|
|
147
|
+
}>;
|
|
148
|
+
batchingOpportunities: Array<{
|
|
149
|
+
components: string[];
|
|
150
|
+
batchSize: number;
|
|
151
|
+
potentialSavings: number;
|
|
152
|
+
}>;
|
|
153
|
+
};
|
|
154
|
+
/** Semantic analysis of component interactions */
|
|
155
|
+
semanticAnalysis: {
|
|
156
|
+
componentAffinity: Record<string, number>;
|
|
157
|
+
dataFlowEfficiency: number;
|
|
158
|
+
informationLossRate: number;
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
/** Performance bottlenecks with AI context */
|
|
162
|
+
bottlenecks: AIPerformanceBottleneck[];
|
|
163
|
+
/** Intelligent optimization recommendations */
|
|
164
|
+
recommendations: AIOptimizationRecommendation[];
|
|
165
|
+
/** Trend analysis and predictions */
|
|
166
|
+
trends: {
|
|
167
|
+
/** Performance trends over time */
|
|
168
|
+
performanceTrend: 'improving' | 'stable' | 'degrading';
|
|
169
|
+
/** Cost trends */
|
|
170
|
+
costTrend: 'improving' | 'stable' | 'degrading';
|
|
171
|
+
/** Predicted future performance */
|
|
172
|
+
predictions: Array<{
|
|
173
|
+
metric: string;
|
|
174
|
+
futureValue: number;
|
|
175
|
+
confidence: number;
|
|
176
|
+
timeframe: number;
|
|
177
|
+
}>;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* AI-aware performance bottleneck
|
|
182
|
+
*/
|
|
183
|
+
export interface AIPerformanceBottleneck {
|
|
184
|
+
/** Bottleneck identification */
|
|
185
|
+
id: string;
|
|
186
|
+
type: AIBottleneckType;
|
|
187
|
+
severity: BottleneckSeverity;
|
|
188
|
+
/** Component(s) affected */
|
|
189
|
+
affectedComponents: string[];
|
|
190
|
+
/** Detailed analysis */
|
|
191
|
+
analysis: {
|
|
192
|
+
description: string;
|
|
193
|
+
rootCause: string;
|
|
194
|
+
impactAssessment: {
|
|
195
|
+
performanceImpact: number;
|
|
196
|
+
costImpact: number;
|
|
197
|
+
userExperienceImpact: 'low' | 'medium' | 'high';
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
/** AI-specific context */
|
|
201
|
+
aiContext?: {
|
|
202
|
+
modelInefficiency?: {
|
|
203
|
+
model: string;
|
|
204
|
+
taskComplexity: number;
|
|
205
|
+
overProvisioningScore: number;
|
|
206
|
+
};
|
|
207
|
+
semanticBottleneck?: {
|
|
208
|
+
informationLoss: number;
|
|
209
|
+
contextFragmentation: number;
|
|
210
|
+
semanticDrift: number;
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
/** Resolution guidance */
|
|
214
|
+
resolution: {
|
|
215
|
+
suggestedFix: string;
|
|
216
|
+
implementationComplexity: 'low' | 'medium' | 'high';
|
|
217
|
+
estimatedResolutionTime: number;
|
|
218
|
+
expectedImprovement: {
|
|
219
|
+
performanceGain: number;
|
|
220
|
+
costReduction: number;
|
|
221
|
+
};
|
|
222
|
+
prerequisites: string[];
|
|
223
|
+
};
|
|
224
|
+
/** Confidence and validation */
|
|
225
|
+
confidence: number;
|
|
226
|
+
validatedBy?: 'static_analysis' | 'runtime_profiling' | 'ml_prediction';
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* AI-driven optimization recommendation
|
|
230
|
+
*/
|
|
231
|
+
export interface AIOptimizationRecommendation {
|
|
232
|
+
/** Recommendation metadata */
|
|
233
|
+
id: string;
|
|
234
|
+
type: AIOptimizationType;
|
|
235
|
+
priority: OptimizationPriority;
|
|
236
|
+
category: 'performance' | 'cost' | 'reliability' | 'scalability';
|
|
237
|
+
/** Target components */
|
|
238
|
+
targetComponents: string[];
|
|
239
|
+
/** Recommendation details */
|
|
240
|
+
recommendation: {
|
|
241
|
+
title: string;
|
|
242
|
+
description: string;
|
|
243
|
+
technicalDetails: string;
|
|
244
|
+
implementation: {
|
|
245
|
+
steps: string[];
|
|
246
|
+
codeExamples: Array<{
|
|
247
|
+
language: string;
|
|
248
|
+
code: string;
|
|
249
|
+
description: string;
|
|
250
|
+
}>;
|
|
251
|
+
configuration: Record<string, any>;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
/** Impact analysis */
|
|
255
|
+
impact: {
|
|
256
|
+
performance: {
|
|
257
|
+
latencyImprovement: number;
|
|
258
|
+
throughputImprovement: number;
|
|
259
|
+
memoryReduction: number;
|
|
260
|
+
};
|
|
261
|
+
cost: {
|
|
262
|
+
operationalSavings: number;
|
|
263
|
+
infrastructureSavings: number;
|
|
264
|
+
llmCostReduction: number;
|
|
265
|
+
};
|
|
266
|
+
reliability: {
|
|
267
|
+
errorReduction: number;
|
|
268
|
+
uptimeImprovement: number;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
/** Implementation guidance */
|
|
272
|
+
implementation: {
|
|
273
|
+
effort: ImplementationEffort;
|
|
274
|
+
timeline: string;
|
|
275
|
+
risks: Array<{
|
|
276
|
+
description: string;
|
|
277
|
+
probability: number;
|
|
278
|
+
impact: 'low' | 'medium' | 'high';
|
|
279
|
+
mitigation: string;
|
|
280
|
+
}>;
|
|
281
|
+
rollbackStrategy: string;
|
|
282
|
+
};
|
|
283
|
+
/** AI-generated insights */
|
|
284
|
+
aiGenerated: {
|
|
285
|
+
confidence: number;
|
|
286
|
+
reasoning: string;
|
|
287
|
+
similarCases: number;
|
|
288
|
+
validationMethod: string;
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Real-time performance monitoring configuration
|
|
293
|
+
*/
|
|
294
|
+
export interface AIPerformanceConfig {
|
|
295
|
+
/** Global monitoring settings */
|
|
296
|
+
global: {
|
|
297
|
+
enabled: boolean;
|
|
298
|
+
samplingRate: number;
|
|
299
|
+
bufferSize: number;
|
|
300
|
+
flushInterval: number;
|
|
301
|
+
};
|
|
302
|
+
/** Component-specific settings */
|
|
303
|
+
components: {
|
|
304
|
+
whitelist: string[];
|
|
305
|
+
blacklist: string[];
|
|
306
|
+
customSamplingRates: Record<string, number>;
|
|
307
|
+
};
|
|
308
|
+
/** LLM monitoring settings */
|
|
309
|
+
llm: {
|
|
310
|
+
trackTokenUsage: boolean;
|
|
311
|
+
trackCosts: boolean;
|
|
312
|
+
trackQuality: boolean;
|
|
313
|
+
costThresholds: {
|
|
314
|
+
warning: number;
|
|
315
|
+
critical: number;
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
/** Alert configuration */
|
|
319
|
+
alerts: {
|
|
320
|
+
enabled: boolean;
|
|
321
|
+
thresholds: {
|
|
322
|
+
latencyP95: number;
|
|
323
|
+
errorRate: number;
|
|
324
|
+
memoryUsage: number;
|
|
325
|
+
costPerOperation: number;
|
|
326
|
+
};
|
|
327
|
+
channels: Array<{
|
|
328
|
+
type: 'console' | 'file' | 'webhook';
|
|
329
|
+
config: Record<string, any>;
|
|
330
|
+
}>;
|
|
331
|
+
};
|
|
332
|
+
/** Advanced features */
|
|
333
|
+
advanced: {
|
|
334
|
+
enablePredictiveAnalysis: boolean;
|
|
335
|
+
enableAutoOptimization: boolean;
|
|
336
|
+
enableSemanticAnalysis: boolean;
|
|
337
|
+
retentionDays: number;
|
|
338
|
+
compressionEnabled: boolean;
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Performance event for real-time streaming
|
|
343
|
+
*/
|
|
344
|
+
export interface AIPerformanceEvent {
|
|
345
|
+
/** Event metadata */
|
|
346
|
+
id: string;
|
|
347
|
+
timestamp: number;
|
|
348
|
+
type: AIPerformanceEventType;
|
|
349
|
+
source: {
|
|
350
|
+
agentId: string;
|
|
351
|
+
componentName: string;
|
|
352
|
+
sessionId?: string;
|
|
353
|
+
};
|
|
354
|
+
/** Event payload */
|
|
355
|
+
payload: {
|
|
356
|
+
metric?: AIComponentMetrics;
|
|
357
|
+
bottleneck?: AIPerformanceBottleneck;
|
|
358
|
+
recommendation?: AIOptimizationRecommendation;
|
|
359
|
+
alert?: {
|
|
360
|
+
level: 'info' | 'warning' | 'error' | 'critical';
|
|
361
|
+
message: string;
|
|
362
|
+
context: Record<string, any>;
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
/** Event processing metadata */
|
|
366
|
+
processing: {
|
|
367
|
+
latency: number;
|
|
368
|
+
batchId?: string;
|
|
369
|
+
sequenceNumber: number;
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
export declare enum AIBottleneckType {
|
|
373
|
+
LLM_OVERPROVISIONING = "llm_overprovisioning",
|
|
374
|
+
CONTEXT_FRAGMENTATION = "context_fragmentation",
|
|
375
|
+
SEMANTIC_BOTTLENECK = "semantic_bottleneck",
|
|
376
|
+
TOKEN_INEFFICIENCY = "token_inefficiency",
|
|
377
|
+
MODEL_MISMATCH = "model_mismatch",
|
|
378
|
+
CACHING_MISS = "caching_miss",
|
|
379
|
+
SEQUENTIAL_DEPENDENCY = "sequential_dependency",
|
|
380
|
+
MEMORY_PRESSURE = "memory_pressure",
|
|
381
|
+
IO_CONTENTION = "io_contention",
|
|
382
|
+
NETWORK_LATENCY = "network_latency"
|
|
383
|
+
}
|
|
384
|
+
export declare enum BottleneckSeverity {
|
|
385
|
+
LOW = "low",
|
|
386
|
+
MEDIUM = "medium",
|
|
387
|
+
HIGH = "high",
|
|
388
|
+
CRITICAL = "critical"
|
|
389
|
+
}
|
|
390
|
+
export declare enum AIOptimizationType {
|
|
391
|
+
LLM_MODEL_OPTIMIZATION = "llm_model_optimization",
|
|
392
|
+
SEMANTIC_CACHING = "semantic_caching",
|
|
393
|
+
CONTEXT_COMPRESSION = "context_compression",
|
|
394
|
+
PARALLEL_PROCESSING = "parallel_processing",
|
|
395
|
+
BATCH_OPTIMIZATION = "batch_optimization",
|
|
396
|
+
MEMORY_POOLING = "memory_pooling",
|
|
397
|
+
PREDICTIVE_LOADING = "predictive_loading",
|
|
398
|
+
ADAPTIVE_SAMPLING = "adaptive_sampling",
|
|
399
|
+
COST_OPTIMIZATION = "cost_optimization",
|
|
400
|
+
QUALITY_IMPROVEMENT = "quality_improvement"
|
|
401
|
+
}
|
|
402
|
+
export declare enum OptimizationPriority {
|
|
403
|
+
LOW = "low",
|
|
404
|
+
MEDIUM = "medium",
|
|
405
|
+
HIGH = "high",
|
|
406
|
+
CRITICAL = "critical"
|
|
407
|
+
}
|
|
408
|
+
export declare enum ImplementationEffort {
|
|
409
|
+
MINIMAL = "minimal",// < 1 day
|
|
410
|
+
LOW = "low",// 1-3 days
|
|
411
|
+
MEDIUM = "medium",// 1-2 weeks
|
|
412
|
+
HIGH = "high",// 2-4 weeks
|
|
413
|
+
EXTENSIVE = "extensive"
|
|
414
|
+
}
|
|
415
|
+
export declare enum AIPerformanceEventType {
|
|
416
|
+
COMPONENT_START = "component_start",
|
|
417
|
+
COMPONENT_END = "component_end",
|
|
418
|
+
BOTTLENECK_DETECTED = "bottleneck_detected",
|
|
419
|
+
OPTIMIZATION_SUGGESTED = "optimization_suggested",
|
|
420
|
+
THRESHOLD_EXCEEDED = "threshold_exceeded",
|
|
421
|
+
ANOMALY_DETECTED = "anomaly_detected",
|
|
422
|
+
TREND_CHANGE = "trend_change"
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Performance metric aggregation window
|
|
426
|
+
*/
|
|
427
|
+
export interface MetricWindow {
|
|
428
|
+
start: number;
|
|
429
|
+
end: number;
|
|
430
|
+
granularity: '1m' | '5m' | '15m' | '1h' | '1d';
|
|
431
|
+
aggregation: 'avg' | 'sum' | 'min' | 'max' | 'p95' | 'p99';
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Component performance baseline
|
|
435
|
+
*/
|
|
436
|
+
export interface ComponentBaseline {
|
|
437
|
+
componentName: string;
|
|
438
|
+
baseline: {
|
|
439
|
+
latency: {
|
|
440
|
+
p50: number;
|
|
441
|
+
p95: number;
|
|
442
|
+
p99: number;
|
|
443
|
+
};
|
|
444
|
+
memoryUsage: {
|
|
445
|
+
avg: number;
|
|
446
|
+
peak: number;
|
|
447
|
+
};
|
|
448
|
+
successRate: number;
|
|
449
|
+
costPerOperation: number;
|
|
450
|
+
};
|
|
451
|
+
established: number;
|
|
452
|
+
sampleSize: number;
|
|
453
|
+
confidence: number;
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Export interface for external monitoring integration
|
|
457
|
+
*/
|
|
458
|
+
export interface ExternalMonitoringExport {
|
|
459
|
+
format: 'prometheus' | 'datadog' | 'newrelic' | 'cloudwatch' | 'grafana';
|
|
460
|
+
endpoint?: string;
|
|
461
|
+
credentials?: Record<string, string>;
|
|
462
|
+
tags?: Record<string, string>;
|
|
463
|
+
filters?: {
|
|
464
|
+
components?: string[];
|
|
465
|
+
metrics?: string[];
|
|
466
|
+
severity?: BottleneckSeverity[];
|
|
467
|
+
};
|
|
468
|
+
}
|
package/package.json
CHANGED
|
@@ -4,19 +4,33 @@ import { Logger } from '@sre/helpers/Log.helper';
|
|
|
4
4
|
import { performTypeInference } from '@sre/helpers/TypeChecker.helper';
|
|
5
5
|
import { hookAsync } from '@sre/Core/HookService';
|
|
6
6
|
|
|
7
|
-
export type
|
|
7
|
+
export type TComponentSchema = {
|
|
8
8
|
name: string;
|
|
9
9
|
settings?: Record<string, any>;
|
|
10
10
|
inputs?: Record<string, any>;
|
|
11
11
|
outputs?: Record<string, any>;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
+
export enum ComponentInputType {
|
|
15
|
+
Any = 'Any',
|
|
16
|
+
Binary = 'Binary',
|
|
17
|
+
String = 'Text',
|
|
18
|
+
Text = 'Text',
|
|
19
|
+
Image = 'Image',
|
|
20
|
+
Video = 'Video',
|
|
21
|
+
Number = 'Number',
|
|
22
|
+
Integer = 'Integer',
|
|
23
|
+
Boolean = 'Boolean',
|
|
24
|
+
Date = 'Date',
|
|
25
|
+
Array = 'Array',
|
|
26
|
+
Object = 'Object',
|
|
27
|
+
}
|
|
14
28
|
export class Component {
|
|
15
29
|
public hasReadOutput = false;
|
|
16
30
|
public hasPostProcess = true;
|
|
17
31
|
public alwaysActive = false; //for components like readable memories
|
|
18
32
|
public exclusive = false; //for components like writable memories : when exclusive components are active, they are processed in a run cycle bofore other components
|
|
19
|
-
protected schema:
|
|
33
|
+
protected schema: TComponentSchema = {
|
|
20
34
|
name: 'Component',
|
|
21
35
|
settings: {},
|
|
22
36
|
inputs: {},
|
|
@@ -121,6 +121,7 @@ export class Conversation extends EventEmitter {
|
|
|
121
121
|
toolsStrategy?: (toolsConfig) => any;
|
|
122
122
|
agentId?: string;
|
|
123
123
|
agentVersion?: string;
|
|
124
|
+
baseUrl?: string;
|
|
124
125
|
}
|
|
125
126
|
) {
|
|
126
127
|
//TODO: handle loading previous session (messages)
|
|
@@ -150,6 +151,8 @@ export class Conversation extends EventEmitter {
|
|
|
150
151
|
this._llmContextStore = _settings.store;
|
|
151
152
|
}
|
|
152
153
|
|
|
154
|
+
this._baseUrl = _settings?.baseUrl;
|
|
155
|
+
|
|
153
156
|
this._agentVersion = _settings?.agentVersion;
|
|
154
157
|
|
|
155
158
|
(async () => {
|
|
@@ -1006,7 +1009,12 @@ export class Conversation extends EventEmitter {
|
|
|
1006
1009
|
return map;
|
|
1007
1010
|
}, {});
|
|
1008
1011
|
|
|
1009
|
-
|
|
1012
|
+
let baseUrl = this._baseUrl || 'http://localhost/';
|
|
1013
|
+
if (baseUrl && !baseUrl.endsWith('/')) {
|
|
1014
|
+
baseUrl += '/';
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
const spec = await agentDataConnector.getOpenAPIJSON(agentData, baseUrl, this._agentVersion, true).catch((error) => null);
|
|
1010
1018
|
return this.patchSpec(spec);
|
|
1011
1019
|
}
|
|
1012
1020
|
|
package/src/index.ts
CHANGED
|
@@ -182,9 +182,9 @@ export * from './subsystems/MemoryManager/Cache.service/connectors/LocalStorageC
|
|
|
182
182
|
export * from './subsystems/MemoryManager/Cache.service/connectors/RAMCache.class';
|
|
183
183
|
export * from './subsystems/MemoryManager/Cache.service/connectors/RedisCache.class';
|
|
184
184
|
export * from './subsystems/MemoryManager/Cache.service/connectors/S3Cache.class';
|
|
185
|
-
export * from './subsystems/Security/Account.service/connectors/AWSAccount.class';
|
|
186
185
|
export * from './subsystems/Security/Account.service/connectors/DummyAccount.class';
|
|
187
186
|
export * from './subsystems/Security/Account.service/connectors/JSONFileAccount.class';
|
|
187
|
+
export * from './subsystems/Security/Account.service/connectors/MySQLAccount.class';
|
|
188
188
|
export * from './subsystems/Security/ManagedVault.service/connectors/NullManagedVault.class';
|
|
189
189
|
export * from './subsystems/Security/ManagedVault.service/connectors/SecretManagerManagedVault';
|
|
190
190
|
export * from './subsystems/Security/Vault.service/connectors/HashicorpVault.class';
|
package/src/index.ts.bak
CHANGED
|
@@ -182,9 +182,9 @@ export * from './subsystems/MemoryManager/Cache.service/connectors/LocalStorageC
|
|
|
182
182
|
export * from './subsystems/MemoryManager/Cache.service/connectors/RAMCache.class';
|
|
183
183
|
export * from './subsystems/MemoryManager/Cache.service/connectors/RedisCache.class';
|
|
184
184
|
export * from './subsystems/MemoryManager/Cache.service/connectors/S3Cache.class';
|
|
185
|
-
export * from './subsystems/Security/Account.service/connectors/AWSAccount.class';
|
|
186
185
|
export * from './subsystems/Security/Account.service/connectors/DummyAccount.class';
|
|
187
186
|
export * from './subsystems/Security/Account.service/connectors/JSONFileAccount.class';
|
|
187
|
+
export * from './subsystems/Security/Account.service/connectors/MySQLAccount.class';
|
|
188
188
|
export * from './subsystems/Security/ManagedVault.service/connectors/NullManagedVault.class';
|
|
189
189
|
export * from './subsystems/Security/ManagedVault.service/connectors/SecretManagerManagedVault';
|
|
190
190
|
export * from './subsystems/Security/Vault.service/connectors/HashicorpVault.class';
|
|
@@ -69,9 +69,9 @@ export class SmythFS {
|
|
|
69
69
|
|
|
70
70
|
private constructor(private storage: StorageConnector, private cache: CacheConnector) {
|
|
71
71
|
//SmythFS cannot be used without SRE
|
|
72
|
-
if (!ConnectorService.ready) {
|
|
73
|
-
|
|
74
|
-
}
|
|
72
|
+
// if (!ConnectorService.ready) {
|
|
73
|
+
// throw new Error('SRE not available');
|
|
74
|
+
// }
|
|
75
75
|
|
|
76
76
|
// Use centralized hash generation method
|
|
77
77
|
this.hash = SmythFS.generateInstanceHash(this.storage.name, this.cache.name);
|
|
@@ -113,7 +113,6 @@ export class SmythFS {
|
|
|
113
113
|
return data ? this.toBuffer(data) : null;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
|
|
117
116
|
public async getMetadata(uri: string, candidate?: IAccessCandidate) {
|
|
118
117
|
const smythURI = await this.URIParser(uri);
|
|
119
118
|
if (!smythURI) throw new Error('Invalid Resource URI');
|
|
@@ -24,8 +24,15 @@ export type IMilvusCredentials = { address: string; token: string } | { address:
|
|
|
24
24
|
type IndexParams = Omit<CreateIndexSimpleReq, 'collection_name'>[] | Omit<CreateIndexSimpleReq, 'collection_name'>;
|
|
25
25
|
|
|
26
26
|
export type MilvusConfig = {
|
|
27
|
+
/**
|
|
28
|
+
* The Milvus connection credentials
|
|
29
|
+
*/
|
|
27
30
|
credentials: IMilvusCredentials;
|
|
28
|
-
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The embeddings model to use
|
|
34
|
+
*/
|
|
35
|
+
embeddings?: TEmbeddings;
|
|
29
36
|
};
|
|
30
37
|
|
|
31
38
|
// Define schema field names as a type for strong typing
|
|
@@ -63,6 +70,10 @@ export class MilvusVectorDB extends VectorDBConnector {
|
|
|
63
70
|
console.info('Milvus client initialized');
|
|
64
71
|
this.accountConnector = ConnectorService.getAccountConnector();
|
|
65
72
|
this.cache = ConnectorService.getCacheConnector();
|
|
73
|
+
|
|
74
|
+
if (!_settings.embeddings) {
|
|
75
|
+
_settings.embeddings = { provider: 'OpenAI', model: 'text-embedding-3-large', params: { dimensions: 1024 } };
|
|
76
|
+
}
|
|
66
77
|
if (!_settings.embeddings.params) _settings.embeddings.params = { dimensions: 1024 };
|
|
67
78
|
if (!_settings.embeddings.params?.dimensions) _settings.embeddings.params.dimensions = 1024;
|
|
68
79
|
|
|
@@ -40,7 +40,7 @@ export type PineconeConfig = {
|
|
|
40
40
|
/**
|
|
41
41
|
* The embeddings model to use
|
|
42
42
|
*/
|
|
43
|
-
embeddings
|
|
43
|
+
embeddings?: TEmbeddings;
|
|
44
44
|
};
|
|
45
45
|
export class PineconeVectorDB extends VectorDBConnector {
|
|
46
46
|
public name = 'PineconeVectorDB';
|
|
@@ -72,6 +72,9 @@ export class PineconeVectorDB extends VectorDBConnector {
|
|
|
72
72
|
this.accountConnector = ConnectorService.getAccountConnector();
|
|
73
73
|
this.cache = ConnectorService.getCacheConnector();
|
|
74
74
|
this.nkvConnector = ConnectorService.getNKVConnector();
|
|
75
|
+
if (!_settings.embeddings) {
|
|
76
|
+
_settings.embeddings = { provider: 'OpenAI', model: 'text-embedding-3-large', params: { dimensions: 1024 } };
|
|
77
|
+
}
|
|
75
78
|
if (!_settings.embeddings.params) _settings.embeddings.params = { dimensions: 1024 };
|
|
76
79
|
if (!_settings.embeddings.params?.dimensions) _settings.embeddings.params.dimensions = 1024;
|
|
77
80
|
|