@sparkleideas/plugins 3.0.0-alpha.10 → 3.0.0-alpha.20
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/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Agentic Flow Integration
|
|
3
3
|
*
|
|
4
|
-
* Provides integration with
|
|
4
|
+
* Provides integration with agentic-flow@alpha for:
|
|
5
5
|
* - Swarm coordination
|
|
6
6
|
* - Agent spawning
|
|
7
7
|
* - Task orchestration
|
|
8
8
|
* - Memory management
|
|
9
9
|
*
|
|
10
|
-
* Uses
|
|
10
|
+
* Uses agentic-flow's optimized implementations:
|
|
11
11
|
* - AgentDBFast: 150x-12,500x faster vector search
|
|
12
12
|
* - AttentionCoordinator: Attention-based agent consensus
|
|
13
13
|
* - HybridReasoningBank: Trajectory-based learning
|
|
@@ -21,8 +21,8 @@ import type {
|
|
|
21
21
|
IEventBus,
|
|
22
22
|
} from '../types/index.js';
|
|
23
23
|
|
|
24
|
-
// Lazy-loaded
|
|
25
|
-
// Using 'any' types since
|
|
24
|
+
// Lazy-loaded agentic-flow imports (optional dependency)
|
|
25
|
+
// Using 'any' types since agentic-flow is an optional peer dependency
|
|
26
26
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
27
|
let agenticFlowCore: any | null = null;
|
|
28
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -31,13 +31,13 @@ let agenticFlowAgents: any | null = null;
|
|
|
31
31
|
async function loadAgenticFlow(): Promise<boolean> {
|
|
32
32
|
try {
|
|
33
33
|
// Use dynamic string to bypass TypeScript module resolution
|
|
34
|
-
const corePath = '
|
|
35
|
-
const agentsPath = '
|
|
34
|
+
const corePath = 'agentic-flow/core';
|
|
35
|
+
const agentsPath = 'agentic-flow';
|
|
36
36
|
agenticFlowCore = await import(/* @vite-ignore */ corePath);
|
|
37
37
|
agenticFlowAgents = await import(/* @vite-ignore */ agentsPath);
|
|
38
38
|
return true;
|
|
39
39
|
} catch {
|
|
40
|
-
//
|
|
40
|
+
// agentic-flow not available - use fallback implementations
|
|
41
41
|
return false;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -123,7 +123,7 @@ export type AgenticFlowEvent = typeof AGENTIC_FLOW_EVENTS[keyof typeof AGENTIC_F
|
|
|
123
123
|
// ============================================================================
|
|
124
124
|
|
|
125
125
|
/**
|
|
126
|
-
* Bridge to
|
|
126
|
+
* Bridge to agentic-flow@alpha functionality.
|
|
127
127
|
* Provides a unified interface for swarm coordination, agent spawning, and task orchestration.
|
|
128
128
|
*/
|
|
129
129
|
export class AgenticFlowBridge extends EventEmitter {
|
|
@@ -334,7 +334,7 @@ export class AgenticFlowBridge extends EventEmitter {
|
|
|
334
334
|
timestamp: new Date(),
|
|
335
335
|
});
|
|
336
336
|
|
|
337
|
-
// Execute task via
|
|
337
|
+
// Execute task via agentic-flow task runner
|
|
338
338
|
try {
|
|
339
339
|
const timeout = options.timeout ?? this.config.timeout ?? 30000;
|
|
340
340
|
|
|
@@ -385,23 +385,23 @@ export class AgenticFlowBridge extends EventEmitter {
|
|
|
385
385
|
options: TaskOrchestrationOptions,
|
|
386
386
|
timeout: number
|
|
387
387
|
): Promise<void> {
|
|
388
|
-
// Task execution via
|
|
388
|
+
// Task execution via agentic-flow when available
|
|
389
389
|
return new Promise(async (resolve, reject) => {
|
|
390
390
|
const timer = setTimeout(() => {
|
|
391
391
|
reject(new Error(`Task ${taskId} timed out after ${timeout}ms`));
|
|
392
392
|
}, timeout);
|
|
393
393
|
|
|
394
394
|
try {
|
|
395
|
-
// Attempt
|
|
395
|
+
// Attempt agentic-flow execution
|
|
396
396
|
const loaded = await loadAgenticFlow();
|
|
397
397
|
if (loaded && agenticFlowAgents) {
|
|
398
|
-
// Use
|
|
398
|
+
// Use agentic-flow's MCP command handler for task execution
|
|
399
399
|
await agenticFlowAgents.handleMCPCommand?.({
|
|
400
400
|
command: 'task/execute',
|
|
401
401
|
params: { taskId, taskType: options.taskType, input: options.input }
|
|
402
402
|
});
|
|
403
403
|
}
|
|
404
|
-
// Task completed (either via
|
|
404
|
+
// Task completed (either via agentic-flow or fallback)
|
|
405
405
|
clearTimeout(timer);
|
|
406
406
|
resolve();
|
|
407
407
|
} catch (error) {
|
|
@@ -430,7 +430,7 @@ export class AgenticFlowBridge extends EventEmitter {
|
|
|
430
430
|
// =========================================================================
|
|
431
431
|
|
|
432
432
|
/**
|
|
433
|
-
* Convert plugin agent type to
|
|
433
|
+
* Convert plugin agent type to agentic-flow format.
|
|
434
434
|
*/
|
|
435
435
|
convertAgentType(agentType: AgentTypeDefinition): AgentSpawnOptions {
|
|
436
436
|
return {
|
|
@@ -507,13 +507,13 @@ export interface VectorSearchResult {
|
|
|
507
507
|
* Bridge to AgentDB for vector storage and similarity search.
|
|
508
508
|
* Provides 150x-12,500x faster search compared to traditional methods.
|
|
509
509
|
*
|
|
510
|
-
* Uses
|
|
510
|
+
* Uses agentic-flow's AgentDBFast when available for optimal performance.
|
|
511
511
|
*/
|
|
512
512
|
export class AgentDBBridge extends EventEmitter {
|
|
513
513
|
private readonly config: AgentDBConfig;
|
|
514
514
|
private readonly vectors = new Map<string, VectorEntry>();
|
|
515
515
|
private initialized = false;
|
|
516
|
-
private agentDB: unknown | null = null; //
|
|
516
|
+
private agentDB: unknown | null = null; // agentic-flow AgentDBFast instance
|
|
517
517
|
|
|
518
518
|
constructor(config?: AgentDBConfig) {
|
|
519
519
|
super();
|
|
@@ -528,12 +528,12 @@ export class AgentDBBridge extends EventEmitter {
|
|
|
528
528
|
}
|
|
529
529
|
|
|
530
530
|
/**
|
|
531
|
-
* Initialize AgentDB using
|
|
531
|
+
* Initialize AgentDB using agentic-flow's optimized implementation.
|
|
532
532
|
*/
|
|
533
533
|
async initialize(): Promise<void> {
|
|
534
534
|
if (this.initialized) return;
|
|
535
535
|
|
|
536
|
-
// Try to use
|
|
536
|
+
// Try to use agentic-flow's AgentDBFast for 150x-12,500x speedup
|
|
537
537
|
const loaded = await loadAgenticFlow();
|
|
538
538
|
if (loaded && agenticFlowCore) {
|
|
539
539
|
try {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Integrations Module
|
|
3
3
|
*
|
|
4
4
|
* Provides integration bridges for external systems:
|
|
5
|
-
* -
|
|
5
|
+
* - agentic-flow@alpha for swarm coordination
|
|
6
6
|
* - AgentDB for vector storage and similarity search
|
|
7
7
|
* - RuVector PostgreSQL Bridge for advanced vector operations
|
|
8
8
|
*/
|
package/src/workers/index.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Worker Integration Module
|
|
3
3
|
*
|
|
4
4
|
* Provides comprehensive worker capabilities for plugin development.
|
|
5
|
-
* Integrates with
|
|
5
|
+
* Integrates with agentic-flow worker pools and task execution.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { EventEmitter } from 'events';
|
|
@@ -152,7 +152,7 @@ export class WorkerInstance extends EventEmitter implements IWorkerInstance {
|
|
|
152
152
|
const startTime = Date.now();
|
|
153
153
|
|
|
154
154
|
try {
|
|
155
|
-
// Execute task via
|
|
155
|
+
// Execute task via agentic-flow task runner
|
|
156
156
|
const result = await this.executeTask(task);
|
|
157
157
|
|
|
158
158
|
const duration = Date.now() - startTime;
|
|
@@ -194,7 +194,7 @@ export class WorkerInstance extends EventEmitter implements IWorkerInstance {
|
|
|
194
194
|
tokensUsed?: number;
|
|
195
195
|
metadata?: Record<string, unknown>;
|
|
196
196
|
}> {
|
|
197
|
-
// Task execution handler - delegates to
|
|
197
|
+
// Task execution handler - delegates to agentic-flow task runners
|
|
198
198
|
// Timeout enforcement ensures bounded execution
|
|
199
199
|
const timeout = task.timeout ?? this.definition.timeout ?? 30000;
|
|
200
200
|
|