@sparkleideas/integration 3.0.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 +270 -0
- package/package.json +55 -0
- package/src/__tests__/agent-adapter.test.ts +271 -0
- package/src/__tests__/agentic-flow-agent.test.ts +176 -0
- package/src/__tests__/token-optimizer.test.ts +176 -0
- package/src/agent-adapter.ts +651 -0
- package/src/agentic-flow-agent.ts +802 -0
- package/src/agentic-flow-bridge.ts +803 -0
- package/src/attention-coordinator.ts +679 -0
- package/src/feature-flags.ts +485 -0
- package/src/index.ts +466 -0
- package/src/long-running-worker.ts +871 -0
- package/src/multi-model-router.ts +1079 -0
- package/src/provider-adapter.ts +1168 -0
- package/src/sdk-bridge.ts +435 -0
- package/src/sona-adapter.ts +824 -0
- package/src/specialized-worker.ts +864 -0
- package/src/swarm-adapter.ts +1112 -0
- package/src/token-optimizer.ts +306 -0
- package/src/types.ts +494 -0
- package/src/worker-base.ts +822 -0
- package/src/worker-pool.ts +933 -0
- package/tmp.json +0 -0
- package/tsconfig.json +9 -0
package/src/types.ts
ADDED
|
@@ -0,0 +1,494 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V3 Integration Module Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for deep integration with @sparkleideas/agentic-flow@alpha.
|
|
5
|
+
* Implements ADR-001: Adopt @sparkleideas/agentic-flow as Core Foundation
|
|
6
|
+
*
|
|
7
|
+
* @module v3/integration/types
|
|
8
|
+
* @version 3.0.0-alpha.1
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
// ===== SONA Learning Mode Types =====
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* SONA (Self-Optimizing Neural Architecture) learning modes.
|
|
15
|
+
* Each mode optimizes for different performance characteristics.
|
|
16
|
+
*/
|
|
17
|
+
export type SONALearningMode =
|
|
18
|
+
| 'real-time' // ~0.05ms adaptation, sub-millisecond response
|
|
19
|
+
| 'balanced' // General purpose learning, moderate latency
|
|
20
|
+
| 'research' // Deep exploration mode, higher accuracy
|
|
21
|
+
| 'edge' // Resource-constrained environments
|
|
22
|
+
| 'batch'; // High-throughput processing
|
|
23
|
+
|
|
24
|
+
export interface SONAConfiguration {
|
|
25
|
+
/** Active learning mode */
|
|
26
|
+
mode: SONALearningMode;
|
|
27
|
+
/** Learning rate for adaptation (0.0001 - 0.1) */
|
|
28
|
+
learningRate: number;
|
|
29
|
+
/** Pattern similarity threshold (0.0 - 1.0) */
|
|
30
|
+
similarityThreshold: number;
|
|
31
|
+
/** Maximum patterns to retain in memory */
|
|
32
|
+
maxPatterns: number;
|
|
33
|
+
/** Enable trajectory tracking for experience replay */
|
|
34
|
+
enableTrajectoryTracking: boolean;
|
|
35
|
+
/** Consolidation interval in milliseconds */
|
|
36
|
+
consolidationInterval: number;
|
|
37
|
+
/** Enable auto-mode selection based on workload */
|
|
38
|
+
autoModeSelection: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface SONATrajectory {
|
|
42
|
+
/** Unique trajectory identifier */
|
|
43
|
+
id: string;
|
|
44
|
+
/** Associated task identifier */
|
|
45
|
+
taskId: string;
|
|
46
|
+
/** Trajectory steps */
|
|
47
|
+
steps: SONATrajectoryStep[];
|
|
48
|
+
/** Start timestamp */
|
|
49
|
+
startTime: number;
|
|
50
|
+
/** End timestamp (if completed) */
|
|
51
|
+
endTime?: number;
|
|
52
|
+
/** Final verdict */
|
|
53
|
+
verdict?: 'positive' | 'negative' | 'neutral';
|
|
54
|
+
/** Total reward accumulated */
|
|
55
|
+
totalReward: number;
|
|
56
|
+
/** Metadata */
|
|
57
|
+
metadata: Record<string, unknown>;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface SONATrajectoryStep {
|
|
61
|
+
/** Step identifier */
|
|
62
|
+
stepId: string;
|
|
63
|
+
/** Action taken */
|
|
64
|
+
action: string;
|
|
65
|
+
/** Observation/result */
|
|
66
|
+
observation: string;
|
|
67
|
+
/** Step reward */
|
|
68
|
+
reward: number;
|
|
69
|
+
/** Step timestamp */
|
|
70
|
+
timestamp: number;
|
|
71
|
+
/** Embedding vector (optional) */
|
|
72
|
+
embedding?: number[];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface SONAPattern {
|
|
76
|
+
/** Pattern identifier */
|
|
77
|
+
id: string;
|
|
78
|
+
/** Pattern content/description */
|
|
79
|
+
pattern: string;
|
|
80
|
+
/** Solution or approach */
|
|
81
|
+
solution: string;
|
|
82
|
+
/** Category for classification */
|
|
83
|
+
category: string;
|
|
84
|
+
/** Confidence score (0.0 - 1.0) */
|
|
85
|
+
confidence: number;
|
|
86
|
+
/** Usage count */
|
|
87
|
+
usageCount: number;
|
|
88
|
+
/** Creation timestamp */
|
|
89
|
+
createdAt: number;
|
|
90
|
+
/** Last used timestamp */
|
|
91
|
+
lastUsedAt: number;
|
|
92
|
+
/** Embedding vector */
|
|
93
|
+
embedding?: number[];
|
|
94
|
+
/** Associated metadata */
|
|
95
|
+
metadata: Record<string, unknown>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface SONALearningStats {
|
|
99
|
+
/** Total patterns stored */
|
|
100
|
+
totalPatterns: number;
|
|
101
|
+
/** Active trajectories */
|
|
102
|
+
activeTrajectories: number;
|
|
103
|
+
/** Completed trajectories */
|
|
104
|
+
completedTrajectories: number;
|
|
105
|
+
/** Average pattern confidence */
|
|
106
|
+
averageConfidence: number;
|
|
107
|
+
/** Learning cycles completed */
|
|
108
|
+
learningCycles: number;
|
|
109
|
+
/** Last consolidation timestamp */
|
|
110
|
+
lastConsolidation: number;
|
|
111
|
+
/** Memory usage in bytes */
|
|
112
|
+
memoryUsage: number;
|
|
113
|
+
/** Current learning mode */
|
|
114
|
+
currentMode: SONALearningMode;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// ===== Flash Attention Types =====
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Attention mechanism types supported by @sparkleideas/agentic-flow.
|
|
121
|
+
* Flash Attention provides 2.49x-7.47x speedup with 50-75% memory reduction.
|
|
122
|
+
*/
|
|
123
|
+
export type AttentionMechanism =
|
|
124
|
+
| 'flash' // Flash Attention - fastest, 75% memory reduction
|
|
125
|
+
| 'multi-head' // Standard multi-head attention
|
|
126
|
+
| 'linear' // Linear attention for long sequences
|
|
127
|
+
| 'hyperbolic' // Hyperbolic attention for hierarchical data
|
|
128
|
+
| 'moe' // Mixture of Experts attention
|
|
129
|
+
| 'local' // Local/windowed attention
|
|
130
|
+
| 'global' // Global attention
|
|
131
|
+
| 'sparse'; // Sparse attention patterns
|
|
132
|
+
|
|
133
|
+
export interface AttentionConfiguration {
|
|
134
|
+
/** Primary attention mechanism */
|
|
135
|
+
mechanism: AttentionMechanism;
|
|
136
|
+
/** Number of attention heads */
|
|
137
|
+
numHeads: number;
|
|
138
|
+
/** Dimension per head */
|
|
139
|
+
headDim: number;
|
|
140
|
+
/** Dropout rate (0.0 - 1.0) */
|
|
141
|
+
dropoutRate: number;
|
|
142
|
+
/** Enable causal masking */
|
|
143
|
+
causalMask: boolean;
|
|
144
|
+
/** Use rotary position embeddings */
|
|
145
|
+
useRoPE: boolean;
|
|
146
|
+
/** Flash attention optimization level (0-3) */
|
|
147
|
+
flashOptLevel: number;
|
|
148
|
+
/** Memory optimization mode */
|
|
149
|
+
memoryOptimization: 'none' | 'moderate' | 'aggressive';
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface AttentionResult {
|
|
153
|
+
/** Output tensor/array */
|
|
154
|
+
output: number[] | Float32Array;
|
|
155
|
+
/** Attention weights (optional, for debugging) */
|
|
156
|
+
attentionWeights?: number[][];
|
|
157
|
+
/** Execution latency in milliseconds */
|
|
158
|
+
latencyMs: number;
|
|
159
|
+
/** Memory used in bytes */
|
|
160
|
+
memoryBytes: number;
|
|
161
|
+
/** Mechanism used */
|
|
162
|
+
mechanism: AttentionMechanism;
|
|
163
|
+
/** Cache hit indicator */
|
|
164
|
+
cacheHit: boolean;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface AttentionMetrics {
|
|
168
|
+
/** Average latency in milliseconds */
|
|
169
|
+
avgLatencyMs: number;
|
|
170
|
+
/** Throughput (tokens per second) */
|
|
171
|
+
throughputTps: number;
|
|
172
|
+
/** Memory efficiency (0.0 - 1.0) */
|
|
173
|
+
memoryEfficiency: number;
|
|
174
|
+
/** Cache hit rate (0.0 - 1.0) */
|
|
175
|
+
cacheHitRate: number;
|
|
176
|
+
/** Total operations performed */
|
|
177
|
+
totalOperations: number;
|
|
178
|
+
/** Speedup vs baseline */
|
|
179
|
+
speedupFactor: number;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// ===== AgentDB Types =====
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* AgentDB provides 150x-12,500x faster search via HNSW indexing.
|
|
186
|
+
*/
|
|
187
|
+
export interface AgentDBConfiguration {
|
|
188
|
+
/** Vector dimension */
|
|
189
|
+
dimension: number;
|
|
190
|
+
/** Index type */
|
|
191
|
+
indexType: 'hnsw' | 'flat' | 'ivf' | 'pq';
|
|
192
|
+
/** HNSW M parameter (connections per layer) */
|
|
193
|
+
hnswM: number;
|
|
194
|
+
/** HNSW ef_construction parameter */
|
|
195
|
+
hnswEfConstruction: number;
|
|
196
|
+
/** HNSW ef_search parameter */
|
|
197
|
+
hnswEfSearch: number;
|
|
198
|
+
/** Distance metric */
|
|
199
|
+
metric: 'cosine' | 'euclidean' | 'dot_product';
|
|
200
|
+
/** Enable caching */
|
|
201
|
+
enableCache: boolean;
|
|
202
|
+
/** Cache size in MB */
|
|
203
|
+
cacheSizeMb: number;
|
|
204
|
+
/** Database path (for persistent storage) */
|
|
205
|
+
dbPath?: string;
|
|
206
|
+
/** Enable WAL mode for SQLite */
|
|
207
|
+
enableWAL: boolean;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
export interface AgentDBVector {
|
|
211
|
+
/** Vector identifier */
|
|
212
|
+
id: string;
|
|
213
|
+
/** Vector data */
|
|
214
|
+
vector: number[] | Float32Array;
|
|
215
|
+
/** Associated metadata */
|
|
216
|
+
metadata: Record<string, unknown>;
|
|
217
|
+
/** Namespace for isolation */
|
|
218
|
+
namespace: string;
|
|
219
|
+
/** Creation timestamp */
|
|
220
|
+
createdAt: number;
|
|
221
|
+
/** Last updated timestamp */
|
|
222
|
+
updatedAt: number;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export interface AgentDBSearchResult {
|
|
226
|
+
/** Vector identifier */
|
|
227
|
+
id: string;
|
|
228
|
+
/** Similarity score (0.0 - 1.0 for cosine) */
|
|
229
|
+
score: number;
|
|
230
|
+
/** Distance (for euclidean metric) */
|
|
231
|
+
distance?: number;
|
|
232
|
+
/** Associated metadata */
|
|
233
|
+
metadata: Record<string, unknown>;
|
|
234
|
+
/** Original vector (optional) */
|
|
235
|
+
vector?: number[];
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export interface AgentDBStats {
|
|
239
|
+
/** Total vectors stored */
|
|
240
|
+
totalVectors: number;
|
|
241
|
+
/** Index size in bytes */
|
|
242
|
+
indexSizeBytes: number;
|
|
243
|
+
/** Average search latency in milliseconds */
|
|
244
|
+
avgSearchLatencyMs: number;
|
|
245
|
+
/** Average insert latency in milliseconds */
|
|
246
|
+
avgInsertLatencyMs: number;
|
|
247
|
+
/** Cache hit rate (0.0 - 1.0) */
|
|
248
|
+
cacheHitRate: number;
|
|
249
|
+
/** Memory usage in bytes */
|
|
250
|
+
memoryUsage: number;
|
|
251
|
+
/** Namespaces count */
|
|
252
|
+
namespaceCount: number;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// ===== Integration Bridge Types =====
|
|
256
|
+
|
|
257
|
+
export interface IntegrationConfig {
|
|
258
|
+
/** SONA configuration */
|
|
259
|
+
sona: Partial<SONAConfiguration>;
|
|
260
|
+
/** Attention configuration */
|
|
261
|
+
attention: Partial<AttentionConfiguration>;
|
|
262
|
+
/** AgentDB configuration */
|
|
263
|
+
@sparkleideas/agentdb: Partial<AgentDBConfiguration>;
|
|
264
|
+
/** Feature flags */
|
|
265
|
+
features: FeatureFlags;
|
|
266
|
+
/** Runtime preference (auto-detection order) */
|
|
267
|
+
runtimePreference: ('napi' | 'wasm' | 'js')[];
|
|
268
|
+
/** Lazy loading for performance */
|
|
269
|
+
lazyLoad: boolean;
|
|
270
|
+
/** Debug mode */
|
|
271
|
+
debug: boolean;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface FeatureFlags {
|
|
275
|
+
/** Enable SONA learning */
|
|
276
|
+
enableSONA: boolean;
|
|
277
|
+
/** Enable Flash Attention */
|
|
278
|
+
enableFlashAttention: boolean;
|
|
279
|
+
/** Enable AgentDB vector search */
|
|
280
|
+
enableAgentDB: boolean;
|
|
281
|
+
/** Enable trajectory tracking */
|
|
282
|
+
enableTrajectoryTracking: boolean;
|
|
283
|
+
/** Enable GNN query refinement (+12.4% recall) */
|
|
284
|
+
enableGNN: boolean;
|
|
285
|
+
/** Enable intelligence bridge tools */
|
|
286
|
+
enableIntelligenceBridge: boolean;
|
|
287
|
+
/** Enable QUIC transport */
|
|
288
|
+
enableQUICTransport: boolean;
|
|
289
|
+
/** Enable nightly learning */
|
|
290
|
+
enableNightlyLearning: boolean;
|
|
291
|
+
/** Enable auto-consolidation */
|
|
292
|
+
enableAutoConsolidation: boolean;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export interface RuntimeInfo {
|
|
296
|
+
/** Current runtime (napi, wasm, or js) */
|
|
297
|
+
runtime: 'napi' | 'wasm' | 'js';
|
|
298
|
+
/** Platform */
|
|
299
|
+
platform: 'linux' | 'darwin' | 'win32' | 'browser';
|
|
300
|
+
/** Architecture */
|
|
301
|
+
arch: 'x64' | 'arm64' | 'ia32';
|
|
302
|
+
/** Node.js version */
|
|
303
|
+
nodeVersion: string;
|
|
304
|
+
/** WASM support */
|
|
305
|
+
wasmSupport: boolean;
|
|
306
|
+
/** NAPI support */
|
|
307
|
+
napiSupport: boolean;
|
|
308
|
+
/** Performance tier */
|
|
309
|
+
performanceTier: 'optimal' | 'good' | 'fallback';
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export interface IntegrationStatus {
|
|
313
|
+
/** Initialization complete */
|
|
314
|
+
initialized: boolean;
|
|
315
|
+
/** Connected components */
|
|
316
|
+
connectedComponents: string[];
|
|
317
|
+
/** Runtime information */
|
|
318
|
+
runtime: RuntimeInfo;
|
|
319
|
+
/** Feature availability */
|
|
320
|
+
features: Record<string, boolean>;
|
|
321
|
+
/** Component health */
|
|
322
|
+
health: Record<string, ComponentHealth>;
|
|
323
|
+
/** Last health check timestamp */
|
|
324
|
+
lastHealthCheck: number;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export interface ComponentHealth {
|
|
328
|
+
/** Component name */
|
|
329
|
+
name: string;
|
|
330
|
+
/** Health status */
|
|
331
|
+
status: 'healthy' | 'degraded' | 'unhealthy';
|
|
332
|
+
/** Last error (if any) */
|
|
333
|
+
lastError?: string;
|
|
334
|
+
/** Response latency in milliseconds */
|
|
335
|
+
latencyMs: number;
|
|
336
|
+
/** Uptime percentage (0.0 - 1.0) */
|
|
337
|
+
uptime: number;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// ===== SDK Bridge Types =====
|
|
341
|
+
|
|
342
|
+
export interface SDKVersion {
|
|
343
|
+
/** Major version */
|
|
344
|
+
major: number;
|
|
345
|
+
/** Minor version */
|
|
346
|
+
minor: number;
|
|
347
|
+
/** Patch version */
|
|
348
|
+
patch: number;
|
|
349
|
+
/** Pre-release tag */
|
|
350
|
+
prerelease?: string;
|
|
351
|
+
/** Full version string */
|
|
352
|
+
full: string;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export interface SDKCompatibility {
|
|
356
|
+
/** Minimum supported version */
|
|
357
|
+
minVersion: SDKVersion;
|
|
358
|
+
/** Maximum supported version */
|
|
359
|
+
maxVersion: SDKVersion;
|
|
360
|
+
/** Current version */
|
|
361
|
+
currentVersion: SDKVersion;
|
|
362
|
+
/** Compatibility status */
|
|
363
|
+
compatible: boolean;
|
|
364
|
+
/** Required features */
|
|
365
|
+
requiredFeatures: string[];
|
|
366
|
+
/** Optional features */
|
|
367
|
+
optionalFeatures: string[];
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export interface SDKBridgeConfig {
|
|
371
|
+
/** Target SDK version */
|
|
372
|
+
targetVersion: string;
|
|
373
|
+
/** Enable version negotiation */
|
|
374
|
+
enableVersionNegotiation: boolean;
|
|
375
|
+
/** Fallback behavior */
|
|
376
|
+
fallbackBehavior: 'error' | 'warn' | 'silent';
|
|
377
|
+
/** API compatibility layer */
|
|
378
|
+
enableCompatibilityLayer: boolean;
|
|
379
|
+
/** Deprecated API support */
|
|
380
|
+
supportDeprecatedAPIs: boolean;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// ===== Event Types =====
|
|
384
|
+
|
|
385
|
+
export interface IntegrationEvent {
|
|
386
|
+
/** Event type */
|
|
387
|
+
type: IntegrationEventType;
|
|
388
|
+
/** Event timestamp */
|
|
389
|
+
timestamp: number;
|
|
390
|
+
/** Event data */
|
|
391
|
+
data: Record<string, unknown>;
|
|
392
|
+
/** Source component */
|
|
393
|
+
source: string;
|
|
394
|
+
/** Correlation ID */
|
|
395
|
+
correlationId: string;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export type IntegrationEventType =
|
|
399
|
+
| 'initialized'
|
|
400
|
+
| 'component-connected'
|
|
401
|
+
| 'component-disconnected'
|
|
402
|
+
| 'pattern-stored'
|
|
403
|
+
| 'pattern-retrieved'
|
|
404
|
+
| 'trajectory-started'
|
|
405
|
+
| 'trajectory-completed'
|
|
406
|
+
| 'learning-cycle-completed'
|
|
407
|
+
| 'attention-computed'
|
|
408
|
+
| 'search-performed'
|
|
409
|
+
| 'error'
|
|
410
|
+
| 'warning'
|
|
411
|
+
| 'health-check';
|
|
412
|
+
|
|
413
|
+
// ===== Error Types =====
|
|
414
|
+
|
|
415
|
+
export class IntegrationError extends Error {
|
|
416
|
+
constructor(
|
|
417
|
+
message: string,
|
|
418
|
+
public readonly code: IntegrationErrorCode,
|
|
419
|
+
public readonly component: string,
|
|
420
|
+
public readonly cause?: Error
|
|
421
|
+
) {
|
|
422
|
+
super(message);
|
|
423
|
+
this.name = 'IntegrationError';
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
export type IntegrationErrorCode =
|
|
428
|
+
| 'INITIALIZATION_FAILED'
|
|
429
|
+
| 'COMPONENT_UNAVAILABLE'
|
|
430
|
+
| 'VERSION_MISMATCH'
|
|
431
|
+
| 'FEATURE_DISABLED'
|
|
432
|
+
| 'RUNTIME_ERROR'
|
|
433
|
+
| 'TIMEOUT'
|
|
434
|
+
| 'CONFIGURATION_INVALID'
|
|
435
|
+
| 'MEMORY_EXHAUSTED'
|
|
436
|
+
| 'SEARCH_FAILED'
|
|
437
|
+
| 'LEARNING_FAILED';
|
|
438
|
+
|
|
439
|
+
// ===== Default Configurations =====
|
|
440
|
+
|
|
441
|
+
export const DEFAULT_SONA_CONFIG: SONAConfiguration = {
|
|
442
|
+
mode: 'balanced',
|
|
443
|
+
learningRate: 0.001,
|
|
444
|
+
similarityThreshold: 0.7,
|
|
445
|
+
maxPatterns: 10000,
|
|
446
|
+
enableTrajectoryTracking: true,
|
|
447
|
+
consolidationInterval: 3600000, // 1 hour
|
|
448
|
+
autoModeSelection: true,
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
export const DEFAULT_ATTENTION_CONFIG: AttentionConfiguration = {
|
|
452
|
+
mechanism: 'flash',
|
|
453
|
+
numHeads: 8,
|
|
454
|
+
headDim: 64,
|
|
455
|
+
dropoutRate: 0.0,
|
|
456
|
+
causalMask: false,
|
|
457
|
+
useRoPE: true,
|
|
458
|
+
flashOptLevel: 2,
|
|
459
|
+
memoryOptimization: 'moderate',
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
export const DEFAULT_AGENTDB_CONFIG: AgentDBConfiguration = {
|
|
463
|
+
dimension: 1536, // OpenAI embedding dimension
|
|
464
|
+
indexType: 'hnsw',
|
|
465
|
+
hnswM: 16,
|
|
466
|
+
hnswEfConstruction: 200,
|
|
467
|
+
hnswEfSearch: 50,
|
|
468
|
+
metric: 'cosine',
|
|
469
|
+
enableCache: true,
|
|
470
|
+
cacheSizeMb: 256,
|
|
471
|
+
enableWAL: true,
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
export const DEFAULT_FEATURE_FLAGS: FeatureFlags = {
|
|
475
|
+
enableSONA: true,
|
|
476
|
+
enableFlashAttention: true,
|
|
477
|
+
enableAgentDB: true,
|
|
478
|
+
enableTrajectoryTracking: true,
|
|
479
|
+
enableGNN: true,
|
|
480
|
+
enableIntelligenceBridge: true,
|
|
481
|
+
enableQUICTransport: false, // Disabled by default (requires additional setup)
|
|
482
|
+
enableNightlyLearning: false, // Disabled by default (resource intensive)
|
|
483
|
+
enableAutoConsolidation: true,
|
|
484
|
+
};
|
|
485
|
+
|
|
486
|
+
export const DEFAULT_INTEGRATION_CONFIG: IntegrationConfig = {
|
|
487
|
+
sona: DEFAULT_SONA_CONFIG,
|
|
488
|
+
attention: DEFAULT_ATTENTION_CONFIG,
|
|
489
|
+
@sparkleideas/agentdb: DEFAULT_AGENTDB_CONFIG,
|
|
490
|
+
features: DEFAULT_FEATURE_FLAGS,
|
|
491
|
+
runtimePreference: ['napi', 'wasm', 'js'],
|
|
492
|
+
lazyLoad: true,
|
|
493
|
+
debug: false,
|
|
494
|
+
};
|