network-ai 4.13.0 → 4.14.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/INTEGRATION_GUIDE.md +2 -2
- package/QUICKSTART.md +9 -0
- package/README.md +14 -3
- package/SKILL.md +2 -0
- package/bin/console.ts +769 -0
- package/dist/bin/console.d.ts +18 -0
- package/dist/bin/console.d.ts.map +1 -0
- package/dist/bin/console.js +799 -0
- package/dist/bin/console.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-runtime.d.ts +310 -0
- package/dist/lib/agent-runtime.d.ts.map +1 -0
- package/dist/lib/agent-runtime.js +630 -0
- package/dist/lib/agent-runtime.js.map +1 -0
- package/dist/lib/console-ui.d.ts +134 -0
- package/dist/lib/console-ui.d.ts.map +1 -0
- package/dist/lib/console-ui.js +276 -0
- package/dist/lib/console-ui.js.map +1 -0
- package/dist/lib/phase-pipeline.js +1 -1
- package/dist/lib/phase-pipeline.js.map +1 -1
- package/dist/lib/strategy-agent.d.ts +320 -0
- package/dist/lib/strategy-agent.d.ts.map +1 -0
- package/dist/lib/strategy-agent.js +601 -0
- package/dist/lib/strategy-agent.js.map +1 -0
- package/package.json +4 -2
|
@@ -0,0 +1,601 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Strategy Agent — AI Meta-Orchestrator for Network-AI
|
|
4
|
+
*
|
|
5
|
+
* The StrategyAgent sits above SwarmOrchestrator and makes high-level decisions
|
|
6
|
+
* about agent allocation, workload distribution, budget partitioning, and
|
|
7
|
+
* adaptive scaling. It is designed for scenarios where a single AI controls
|
|
8
|
+
* thousands to millions of agents.
|
|
9
|
+
*
|
|
10
|
+
* Architecture:
|
|
11
|
+
* - **AgentPool**: Elastic pool of agents from a template — spawn/recycle on demand
|
|
12
|
+
* - **WorkloadPartitioner**: Splits large tasks into chunks and routes to pools
|
|
13
|
+
* - **StrategyPlanner**: Evaluates current state and produces a StrategyPlan
|
|
14
|
+
* - **StrategyAgent**: Facade that composes all of the above
|
|
15
|
+
*
|
|
16
|
+
* Design principles:
|
|
17
|
+
* - Zero external dependencies (Node.js builtins only)
|
|
18
|
+
* - Pluggable strategy functions (bring your own AI decision-making)
|
|
19
|
+
* - Non-destructive: all actions go through existing orchestrator APIs
|
|
20
|
+
* - Observable: every decision is logged and emittable
|
|
21
|
+
*
|
|
22
|
+
* @module StrategyAgent
|
|
23
|
+
* @version 1.0.0
|
|
24
|
+
*/
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.StrategyAgent = exports.WorkloadPartitioner = exports.AgentPool = void 0;
|
|
27
|
+
exports.adaptiveStrategy = adaptiveStrategy;
|
|
28
|
+
const events_1 = require("events");
|
|
29
|
+
// ============================================================================
|
|
30
|
+
// AGENT POOL
|
|
31
|
+
// ============================================================================
|
|
32
|
+
/**
|
|
33
|
+
* Elastic pool of agents from a template. Manages spawn/complete/recycle
|
|
34
|
+
* lifecycle without knowing about specific adapter implementations.
|
|
35
|
+
*/
|
|
36
|
+
class AgentPool {
|
|
37
|
+
template;
|
|
38
|
+
agents = new Map();
|
|
39
|
+
_completedCount = 0;
|
|
40
|
+
_failedCount = 0;
|
|
41
|
+
_totalTokens = 0;
|
|
42
|
+
_events;
|
|
43
|
+
constructor(template, events) {
|
|
44
|
+
this.template = template;
|
|
45
|
+
this._events = events;
|
|
46
|
+
}
|
|
47
|
+
/** Number of currently active (spawning or running) agents */
|
|
48
|
+
get active() {
|
|
49
|
+
let count = 0;
|
|
50
|
+
for (const a of this.agents.values()) {
|
|
51
|
+
if (a.status === 'spawning' || a.status === 'running')
|
|
52
|
+
count++;
|
|
53
|
+
}
|
|
54
|
+
return count;
|
|
55
|
+
}
|
|
56
|
+
/** Total completed agents */
|
|
57
|
+
get completed() { return this._completedCount; }
|
|
58
|
+
/** Total failed agents */
|
|
59
|
+
get failed() { return this._failedCount; }
|
|
60
|
+
/** Total tokens consumed by this pool */
|
|
61
|
+
get totalTokensUsed() { return this._totalTokens; }
|
|
62
|
+
/** Whether the pool can accept more agents */
|
|
63
|
+
get canSpawn() { return this.active < this.template.maxConcurrent; }
|
|
64
|
+
/** How many more agents can be spawned */
|
|
65
|
+
get availableSlots() { return Math.max(0, this.template.maxConcurrent - this.active); }
|
|
66
|
+
/**
|
|
67
|
+
* Reserve a slot and create a ManagedAgent record.
|
|
68
|
+
* Returns null if pool is at capacity.
|
|
69
|
+
*/
|
|
70
|
+
spawn(taskId) {
|
|
71
|
+
if (!this.canSpawn)
|
|
72
|
+
return null;
|
|
73
|
+
const agent = {
|
|
74
|
+
id: `${this.template.id}-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
|
|
75
|
+
templateId: this.template.id,
|
|
76
|
+
status: 'spawning',
|
|
77
|
+
spawnedAt: Date.now(),
|
|
78
|
+
taskId,
|
|
79
|
+
tokensUsed: 0,
|
|
80
|
+
};
|
|
81
|
+
this.agents.set(agent.id, agent);
|
|
82
|
+
this._events.emit('agent:spawned', agent);
|
|
83
|
+
return agent;
|
|
84
|
+
}
|
|
85
|
+
/** Mark an agent as running */
|
|
86
|
+
markRunning(agentId) {
|
|
87
|
+
const agent = this.agents.get(agentId);
|
|
88
|
+
if (agent && (agent.status === 'spawning')) {
|
|
89
|
+
agent.status = 'running';
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/** Mark an agent as completed and record token usage */
|
|
93
|
+
markCompleted(agentId, tokensUsed = 0) {
|
|
94
|
+
const agent = this.agents.get(agentId);
|
|
95
|
+
if (!agent)
|
|
96
|
+
return;
|
|
97
|
+
agent.status = 'completed';
|
|
98
|
+
agent.completedAt = Date.now();
|
|
99
|
+
agent.tokensUsed = tokensUsed;
|
|
100
|
+
this._completedCount++;
|
|
101
|
+
this._totalTokens += tokensUsed;
|
|
102
|
+
this._events.emit('agent:completed', agent);
|
|
103
|
+
}
|
|
104
|
+
/** Mark an agent as failed */
|
|
105
|
+
markFailed(agentId, error) {
|
|
106
|
+
const agent = this.agents.get(agentId);
|
|
107
|
+
if (!agent)
|
|
108
|
+
return;
|
|
109
|
+
agent.status = 'failed';
|
|
110
|
+
agent.completedAt = Date.now();
|
|
111
|
+
this._failedCount++;
|
|
112
|
+
this._events.emit('agent:failed', agent, error);
|
|
113
|
+
}
|
|
114
|
+
/** Recycle completed/failed agents to free slots */
|
|
115
|
+
recycle() {
|
|
116
|
+
let recycled = 0;
|
|
117
|
+
for (const [id, agent] of this.agents) {
|
|
118
|
+
if (agent.status === 'completed' || agent.status === 'failed') {
|
|
119
|
+
agent.status = 'recycled';
|
|
120
|
+
this.agents.delete(id);
|
|
121
|
+
recycled++;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return recycled;
|
|
125
|
+
}
|
|
126
|
+
/** Get a snapshot of pool status */
|
|
127
|
+
getStatus(pendingChunks = 0) {
|
|
128
|
+
return {
|
|
129
|
+
templateId: this.template.id,
|
|
130
|
+
active: this.active,
|
|
131
|
+
maxConcurrent: this.template.maxConcurrent,
|
|
132
|
+
completed: this._completedCount,
|
|
133
|
+
failed: this._failedCount,
|
|
134
|
+
totalTokensUsed: this._totalTokens,
|
|
135
|
+
budgetPerAgent: this.template.budgetPerAgent,
|
|
136
|
+
pendingChunks,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
/** Get all agents (for inspection) */
|
|
140
|
+
getAgents() {
|
|
141
|
+
return Array.from(this.agents.values());
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
exports.AgentPool = AgentPool;
|
|
145
|
+
// ============================================================================
|
|
146
|
+
// WORKLOAD PARTITIONER
|
|
147
|
+
// ============================================================================
|
|
148
|
+
/**
|
|
149
|
+
* Splits large tasks into work chunks and manages the chunk lifecycle.
|
|
150
|
+
*/
|
|
151
|
+
class WorkloadPartitioner {
|
|
152
|
+
chunks = new Map();
|
|
153
|
+
_chunkCounter = 0;
|
|
154
|
+
_events;
|
|
155
|
+
constructor(events) {
|
|
156
|
+
this._events = events;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Create work chunks from an array of inputs.
|
|
160
|
+
* @param inputs - Array of task inputs
|
|
161
|
+
* @param targetPool - Pool template ID to route chunks to
|
|
162
|
+
* @param priority - Priority level (higher = more urgent)
|
|
163
|
+
*/
|
|
164
|
+
partition(inputs, targetPool, priority = 1) {
|
|
165
|
+
const created = [];
|
|
166
|
+
for (const input of inputs) {
|
|
167
|
+
const chunk = {
|
|
168
|
+
id: `chunk-${++this._chunkCounter}`,
|
|
169
|
+
input,
|
|
170
|
+
priority,
|
|
171
|
+
assignedPool: targetPool,
|
|
172
|
+
status: 'pending',
|
|
173
|
+
createdAt: Date.now(),
|
|
174
|
+
};
|
|
175
|
+
this.chunks.set(chunk.id, chunk);
|
|
176
|
+
this._events.emit('chunk:created', chunk);
|
|
177
|
+
created.push(chunk);
|
|
178
|
+
}
|
|
179
|
+
return created;
|
|
180
|
+
}
|
|
181
|
+
/** Get all pending chunks for a pool, sorted by priority (descending) */
|
|
182
|
+
getPendingForPool(poolId) {
|
|
183
|
+
const pending = [];
|
|
184
|
+
for (const chunk of this.chunks.values()) {
|
|
185
|
+
if (chunk.status === 'pending' && chunk.assignedPool === poolId) {
|
|
186
|
+
pending.push(chunk);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return pending.sort((a, b) => b.priority - a.priority);
|
|
190
|
+
}
|
|
191
|
+
/** Assign a chunk to an agent */
|
|
192
|
+
assign(chunkId, agentId) {
|
|
193
|
+
const chunk = this.chunks.get(chunkId);
|
|
194
|
+
if (!chunk || chunk.status !== 'pending')
|
|
195
|
+
return false;
|
|
196
|
+
chunk.status = 'assigned';
|
|
197
|
+
chunk.assignedAgent = agentId;
|
|
198
|
+
this._events.emit('chunk:assigned', chunk);
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
/** Mark a chunk as running */
|
|
202
|
+
markRunning(chunkId) {
|
|
203
|
+
const chunk = this.chunks.get(chunkId);
|
|
204
|
+
if (chunk && chunk.status === 'assigned') {
|
|
205
|
+
chunk.status = 'running';
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/** Mark a chunk as completed */
|
|
209
|
+
markCompleted(chunkId, result) {
|
|
210
|
+
const chunk = this.chunks.get(chunkId);
|
|
211
|
+
if (!chunk)
|
|
212
|
+
return;
|
|
213
|
+
chunk.status = 'completed';
|
|
214
|
+
chunk.result = result;
|
|
215
|
+
chunk.completedAt = Date.now();
|
|
216
|
+
this._events.emit('chunk:completed', chunk);
|
|
217
|
+
}
|
|
218
|
+
/** Mark a chunk as failed */
|
|
219
|
+
markFailed(chunkId, error) {
|
|
220
|
+
const chunk = this.chunks.get(chunkId);
|
|
221
|
+
if (!chunk)
|
|
222
|
+
return;
|
|
223
|
+
chunk.status = 'failed';
|
|
224
|
+
chunk.error = error;
|
|
225
|
+
chunk.completedAt = Date.now();
|
|
226
|
+
this._events.emit('chunk:failed', chunk);
|
|
227
|
+
}
|
|
228
|
+
/** Get counts by status */
|
|
229
|
+
getCounts() {
|
|
230
|
+
let pending = 0, assigned = 0, running = 0, completed = 0, failed = 0;
|
|
231
|
+
for (const chunk of this.chunks.values()) {
|
|
232
|
+
switch (chunk.status) {
|
|
233
|
+
case 'pending':
|
|
234
|
+
pending++;
|
|
235
|
+
break;
|
|
236
|
+
case 'assigned':
|
|
237
|
+
assigned++;
|
|
238
|
+
break;
|
|
239
|
+
case 'running':
|
|
240
|
+
running++;
|
|
241
|
+
break;
|
|
242
|
+
case 'completed':
|
|
243
|
+
completed++;
|
|
244
|
+
break;
|
|
245
|
+
case 'failed':
|
|
246
|
+
failed++;
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return { pending, assigned, running, completed, failed, total: this.chunks.size };
|
|
251
|
+
}
|
|
252
|
+
/** Get all chunks for a pool */
|
|
253
|
+
getChunksForPool(poolId) {
|
|
254
|
+
const result = [];
|
|
255
|
+
for (const chunk of this.chunks.values()) {
|
|
256
|
+
if (chunk.assignedPool === poolId)
|
|
257
|
+
result.push(chunk);
|
|
258
|
+
}
|
|
259
|
+
return result;
|
|
260
|
+
}
|
|
261
|
+
/** Get a chunk by ID */
|
|
262
|
+
getChunk(chunkId) {
|
|
263
|
+
return this.chunks.get(chunkId);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
exports.WorkloadPartitioner = WorkloadPartitioner;
|
|
267
|
+
// ============================================================================
|
|
268
|
+
// STRATEGY PLANNER
|
|
269
|
+
// ============================================================================
|
|
270
|
+
/**
|
|
271
|
+
* Default adaptive strategy that:
|
|
272
|
+
* - Scales up pools with pending work
|
|
273
|
+
* - Scales down idle pools
|
|
274
|
+
* - Reallocates budget from idle to busy pools
|
|
275
|
+
*/
|
|
276
|
+
function adaptiveStrategy(snapshot) {
|
|
277
|
+
const scaleUp = new Map();
|
|
278
|
+
const scaleDown = new Map();
|
|
279
|
+
const budgetReallocation = new Map();
|
|
280
|
+
const newChunks = [];
|
|
281
|
+
const budgetUsedPct = snapshot.totalBudgetCeiling > 0
|
|
282
|
+
? snapshot.totalBudgetSpent / snapshot.totalBudgetCeiling
|
|
283
|
+
: 0;
|
|
284
|
+
const descriptions = [];
|
|
285
|
+
for (const [poolId, pool] of snapshot.pools) {
|
|
286
|
+
const utilization = pool.maxConcurrent > 0 ? pool.active / pool.maxConcurrent : 0;
|
|
287
|
+
const failRate = (pool.completed + pool.failed) > 0
|
|
288
|
+
? pool.failed / (pool.completed + pool.failed)
|
|
289
|
+
: 0;
|
|
290
|
+
// Scale up: pool has pending work and isn't at capacity
|
|
291
|
+
if (pool.pendingChunks > 0 && utilization < 0.8 && budgetUsedPct < 0.9) {
|
|
292
|
+
const target = Math.min(pool.maxConcurrent, pool.active + Math.ceil(pool.pendingChunks * 0.5));
|
|
293
|
+
if (target > pool.active) {
|
|
294
|
+
scaleUp.set(poolId, target);
|
|
295
|
+
descriptions.push(`Scale up ${poolId}: ${pool.active} → ${target}`);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
// Scale down: no pending work and low utilization
|
|
299
|
+
if (pool.pendingChunks === 0 && utilization > 0 && pool.active > 1) {
|
|
300
|
+
const target = Math.max(1, Math.floor(pool.active * 0.5));
|
|
301
|
+
if (target < pool.active) {
|
|
302
|
+
scaleDown.set(poolId, target);
|
|
303
|
+
descriptions.push(`Scale down ${poolId}: ${pool.active} → ${target}`);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
// Budget: reduce allocation for high-fail-rate pools
|
|
307
|
+
if (failRate > 0.3 && pool.budgetPerAgent > 100) {
|
|
308
|
+
const newBudget = Math.max(100, Math.floor(pool.budgetPerAgent * 0.7));
|
|
309
|
+
budgetReallocation.set(poolId, newBudget);
|
|
310
|
+
descriptions.push(`Reduce budget for ${poolId}: ${pool.budgetPerAgent} → ${newBudget}`);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
// Compute confidence based on data quality
|
|
314
|
+
const totalTasks = snapshot.completedTasks + snapshot.failedTasks;
|
|
315
|
+
const confidence = totalTasks > 10 ? 0.8 : totalTasks > 0 ? 0.5 : 0.3;
|
|
316
|
+
return {
|
|
317
|
+
description: descriptions.length > 0 ? descriptions.join('; ') : 'No changes needed',
|
|
318
|
+
scaleUp,
|
|
319
|
+
scaleDown,
|
|
320
|
+
budgetReallocation,
|
|
321
|
+
newChunks,
|
|
322
|
+
confidence,
|
|
323
|
+
createdAt: Date.now(),
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
// ============================================================================
|
|
327
|
+
// STRATEGY AGENT
|
|
328
|
+
// ============================================================================
|
|
329
|
+
/**
|
|
330
|
+
* AI Meta-Orchestrator that manages agent pools, work distribution, and
|
|
331
|
+
* adaptive strategy. Designed for controlling thousands to millions of agents.
|
|
332
|
+
*
|
|
333
|
+
* @example
|
|
334
|
+
* ```typescript
|
|
335
|
+
* const strategy = new StrategyAgent({
|
|
336
|
+
* globalAgentLimit: 10000,
|
|
337
|
+
* globalBudgetLimit: 1_000_000,
|
|
338
|
+
* evaluationInterval: 5000,
|
|
339
|
+
* });
|
|
340
|
+
*
|
|
341
|
+
* // Define agent templates
|
|
342
|
+
* strategy.createPool({
|
|
343
|
+
* id: 'researchers',
|
|
344
|
+
* adapter: 'langchain',
|
|
345
|
+
* defaultAction: 'research',
|
|
346
|
+
* defaultParams: { depth: 'thorough' },
|
|
347
|
+
* maxConcurrent: 500,
|
|
348
|
+
* budgetPerAgent: 1000,
|
|
349
|
+
* tags: ['research', 'data'],
|
|
350
|
+
* });
|
|
351
|
+
*
|
|
352
|
+
* // Distribute work
|
|
353
|
+
* const urls = [...thousandUrls];
|
|
354
|
+
* strategy.distributeWork(urls, 'researchers', 2);
|
|
355
|
+
*
|
|
356
|
+
* // Start auto-evaluation loop
|
|
357
|
+
* strategy.start();
|
|
358
|
+
*
|
|
359
|
+
* // Or manually evaluate + execute
|
|
360
|
+
* const plan = await strategy.evaluate();
|
|
361
|
+
* await strategy.executePlan(plan);
|
|
362
|
+
* ```
|
|
363
|
+
*/
|
|
364
|
+
class StrategyAgent extends events_1.EventEmitter {
|
|
365
|
+
pools = new Map();
|
|
366
|
+
partitioner;
|
|
367
|
+
strategyFn;
|
|
368
|
+
evaluationInterval;
|
|
369
|
+
globalAgentLimit;
|
|
370
|
+
globalBudgetLimit;
|
|
371
|
+
intervalHandle = null;
|
|
372
|
+
_cycleCount = 0;
|
|
373
|
+
_plans = [];
|
|
374
|
+
constructor(options = {}) {
|
|
375
|
+
super();
|
|
376
|
+
this.partitioner = new WorkloadPartitioner(this);
|
|
377
|
+
this.strategyFn = options.strategy ?? adaptiveStrategy;
|
|
378
|
+
this.evaluationInterval = options.evaluationInterval ?? 5000;
|
|
379
|
+
this.globalAgentLimit = options.globalAgentLimit ?? 10000;
|
|
380
|
+
this.globalBudgetLimit = options.globalBudgetLimit ?? Infinity;
|
|
381
|
+
if (options.autoStart)
|
|
382
|
+
this.start();
|
|
383
|
+
}
|
|
384
|
+
// --------------------------------------------------------------------------
|
|
385
|
+
// POOL MANAGEMENT
|
|
386
|
+
// --------------------------------------------------------------------------
|
|
387
|
+
/** Create an agent pool from a template */
|
|
388
|
+
createPool(template) {
|
|
389
|
+
if (this.pools.has(template.id)) {
|
|
390
|
+
throw new Error(`Pool "${template.id}" already exists`);
|
|
391
|
+
}
|
|
392
|
+
const pool = new AgentPool(template, this);
|
|
393
|
+
this.pools.set(template.id, pool);
|
|
394
|
+
this.emit('pool:created', template.id);
|
|
395
|
+
return pool;
|
|
396
|
+
}
|
|
397
|
+
/** Get a pool by template ID */
|
|
398
|
+
getPool(templateId) {
|
|
399
|
+
return this.pools.get(templateId);
|
|
400
|
+
}
|
|
401
|
+
/** List all pools */
|
|
402
|
+
listPools() {
|
|
403
|
+
const result = [];
|
|
404
|
+
for (const [id, pool] of this.pools) {
|
|
405
|
+
const pendingChunks = this.partitioner.getPendingForPool(id).length;
|
|
406
|
+
result.push(pool.getStatus(pendingChunks));
|
|
407
|
+
}
|
|
408
|
+
return result;
|
|
409
|
+
}
|
|
410
|
+
/** Remove a pool (recycles all agents first) */
|
|
411
|
+
removePool(templateId) {
|
|
412
|
+
const pool = this.pools.get(templateId);
|
|
413
|
+
if (!pool)
|
|
414
|
+
return false;
|
|
415
|
+
pool.recycle();
|
|
416
|
+
this.pools.delete(templateId);
|
|
417
|
+
return true;
|
|
418
|
+
}
|
|
419
|
+
/** Total active agents across all pools */
|
|
420
|
+
get totalActiveAgents() {
|
|
421
|
+
let total = 0;
|
|
422
|
+
for (const pool of this.pools.values())
|
|
423
|
+
total += pool.active;
|
|
424
|
+
return total;
|
|
425
|
+
}
|
|
426
|
+
/** Whether the global agent limit has been reached */
|
|
427
|
+
get atCapacity() {
|
|
428
|
+
return this.totalActiveAgents >= this.globalAgentLimit;
|
|
429
|
+
}
|
|
430
|
+
// --------------------------------------------------------------------------
|
|
431
|
+
// WORK DISTRIBUTION
|
|
432
|
+
// --------------------------------------------------------------------------
|
|
433
|
+
/**
|
|
434
|
+
* Distribute work items across a pool.
|
|
435
|
+
* Each input becomes a work chunk assigned to the pool.
|
|
436
|
+
*/
|
|
437
|
+
distributeWork(inputs, targetPool, priority = 1) {
|
|
438
|
+
if (!this.pools.has(targetPool)) {
|
|
439
|
+
throw new Error(`Pool "${targetPool}" does not exist`);
|
|
440
|
+
}
|
|
441
|
+
return this.partitioner.partition(inputs, targetPool, priority);
|
|
442
|
+
}
|
|
443
|
+
/** Get work distribution status */
|
|
444
|
+
getWorkStatus() {
|
|
445
|
+
return this.partitioner.getCounts();
|
|
446
|
+
}
|
|
447
|
+
/** Access the partitioner directly */
|
|
448
|
+
get workload() {
|
|
449
|
+
return this.partitioner;
|
|
450
|
+
}
|
|
451
|
+
// --------------------------------------------------------------------------
|
|
452
|
+
// STRATEGY EVALUATION
|
|
453
|
+
// --------------------------------------------------------------------------
|
|
454
|
+
/** Take a snapshot of the current system state */
|
|
455
|
+
snapshot(budgetSpent = 0, budgetCeiling = 0, fsmState = 'unknown') {
|
|
456
|
+
const pools = new Map();
|
|
457
|
+
let runningAgents = 0;
|
|
458
|
+
let completedTasks = 0;
|
|
459
|
+
let failedTasks = 0;
|
|
460
|
+
let totalDuration = 0;
|
|
461
|
+
let durationCount = 0;
|
|
462
|
+
for (const [id, pool] of this.pools) {
|
|
463
|
+
const pendingChunks = this.partitioner.getPendingForPool(id).length;
|
|
464
|
+
pools.set(id, pool.getStatus(pendingChunks));
|
|
465
|
+
runningAgents += pool.active;
|
|
466
|
+
completedTasks += pool.completed;
|
|
467
|
+
failedTasks += pool.failed;
|
|
468
|
+
// Compute average task duration from completed agents
|
|
469
|
+
for (const agent of pool.getAgents()) {
|
|
470
|
+
if (agent.status === 'completed' && agent.completedAt) {
|
|
471
|
+
totalDuration += agent.completedAt - agent.spawnedAt;
|
|
472
|
+
durationCount++;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
const counts = this.partitioner.getCounts();
|
|
477
|
+
return {
|
|
478
|
+
pools,
|
|
479
|
+
totalBudgetSpent: budgetSpent,
|
|
480
|
+
totalBudgetCeiling: budgetCeiling,
|
|
481
|
+
fsmState,
|
|
482
|
+
pendingChunks: counts.pending,
|
|
483
|
+
runningAgents,
|
|
484
|
+
completedTasks,
|
|
485
|
+
failedTasks,
|
|
486
|
+
averageTaskDuration: durationCount > 0 ? totalDuration / durationCount : 0,
|
|
487
|
+
timestamp: Date.now(),
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
/** Evaluate the current state and produce a strategy plan */
|
|
491
|
+
async evaluate(budgetSpent = 0, budgetCeiling = 0, fsmState = 'unknown') {
|
|
492
|
+
const snap = this.snapshot(budgetSpent, budgetCeiling, fsmState);
|
|
493
|
+
const plan = await this.strategyFn(snap);
|
|
494
|
+
this._plans.push(plan);
|
|
495
|
+
this.emit('plan:created', plan);
|
|
496
|
+
return plan;
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Execute a strategy plan: scale pools, reallocate budgets, create chunks.
|
|
500
|
+
* Returns the number of actions taken.
|
|
501
|
+
*/
|
|
502
|
+
executePlan(plan) {
|
|
503
|
+
let actions = 0;
|
|
504
|
+
// Scale up: spawn agents to reach target
|
|
505
|
+
for (const [poolId, target] of plan.scaleUp) {
|
|
506
|
+
const pool = this.pools.get(poolId);
|
|
507
|
+
if (!pool)
|
|
508
|
+
continue;
|
|
509
|
+
const toSpawn = target - pool.active;
|
|
510
|
+
for (let i = 0; i < toSpawn; i++) {
|
|
511
|
+
if (this.atCapacity)
|
|
512
|
+
break;
|
|
513
|
+
const pending = this.partitioner.getPendingForPool(poolId);
|
|
514
|
+
const chunk = pending[0];
|
|
515
|
+
const agent = pool.spawn(chunk?.id);
|
|
516
|
+
if (agent && chunk) {
|
|
517
|
+
this.partitioner.assign(chunk.id, agent.id);
|
|
518
|
+
}
|
|
519
|
+
if (agent)
|
|
520
|
+
actions++;
|
|
521
|
+
}
|
|
522
|
+
if (toSpawn > 0) {
|
|
523
|
+
this.emit('pool:scaled', poolId, pool.active - toSpawn, pool.active);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
// Scale down: mark excess agents for recycling
|
|
527
|
+
for (const [poolId, target] of plan.scaleDown) {
|
|
528
|
+
const pool = this.pools.get(poolId);
|
|
529
|
+
if (!pool)
|
|
530
|
+
continue;
|
|
531
|
+
const before = pool.active;
|
|
532
|
+
pool.recycle();
|
|
533
|
+
if (pool.active !== before) {
|
|
534
|
+
this.emit('pool:scaled', poolId, before, pool.active);
|
|
535
|
+
actions++;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
// Budget reallocation
|
|
539
|
+
for (const [poolId, newBudget] of plan.budgetReallocation) {
|
|
540
|
+
const pool = this.pools.get(poolId);
|
|
541
|
+
if (!pool)
|
|
542
|
+
continue;
|
|
543
|
+
pool.template.budgetPerAgent = newBudget;
|
|
544
|
+
actions++;
|
|
545
|
+
}
|
|
546
|
+
// Create new chunks
|
|
547
|
+
for (const chunk of plan.newChunks) {
|
|
548
|
+
this.partitioner.partition([chunk.input], chunk.targetPool, chunk.priority);
|
|
549
|
+
actions++;
|
|
550
|
+
}
|
|
551
|
+
this.emit('plan:executed', plan);
|
|
552
|
+
return actions;
|
|
553
|
+
}
|
|
554
|
+
// --------------------------------------------------------------------------
|
|
555
|
+
// EVALUATION LOOP
|
|
556
|
+
// --------------------------------------------------------------------------
|
|
557
|
+
/** Start the automatic evaluation loop */
|
|
558
|
+
start() {
|
|
559
|
+
if (this.intervalHandle)
|
|
560
|
+
return;
|
|
561
|
+
this.intervalHandle = setInterval(async () => {
|
|
562
|
+
this._cycleCount++;
|
|
563
|
+
this.emit('cycle:start', this._cycleCount);
|
|
564
|
+
const plan = await this.evaluate();
|
|
565
|
+
this.executePlan(plan);
|
|
566
|
+
this.emit('cycle:end', this._cycleCount, plan);
|
|
567
|
+
}, this.evaluationInterval);
|
|
568
|
+
}
|
|
569
|
+
/** Stop the evaluation loop */
|
|
570
|
+
stop() {
|
|
571
|
+
if (this.intervalHandle) {
|
|
572
|
+
clearInterval(this.intervalHandle);
|
|
573
|
+
this.intervalHandle = null;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
/** Whether the evaluation loop is running */
|
|
577
|
+
get isRunning() { return this.intervalHandle !== null; }
|
|
578
|
+
/** Number of evaluation cycles completed */
|
|
579
|
+
get cycleCount() { return this._cycleCount; }
|
|
580
|
+
/** All plans produced so far */
|
|
581
|
+
get planHistory() { return this._plans; }
|
|
582
|
+
// --------------------------------------------------------------------------
|
|
583
|
+
// CONVENIENCE
|
|
584
|
+
// --------------------------------------------------------------------------
|
|
585
|
+
/** Get a summary string of the current state */
|
|
586
|
+
summary() {
|
|
587
|
+
const pools = this.listPools();
|
|
588
|
+
const work = this.getWorkStatus();
|
|
589
|
+
const lines = [
|
|
590
|
+
`Pools: ${pools.length} | Active agents: ${this.totalActiveAgents}/${this.globalAgentLimit}`,
|
|
591
|
+
`Work: ${work.pending} pending, ${work.running} running, ${work.completed} completed, ${work.failed} failed`,
|
|
592
|
+
`Plans: ${this._plans.length} | Cycles: ${this._cycleCount}`,
|
|
593
|
+
];
|
|
594
|
+
for (const p of pools) {
|
|
595
|
+
lines.push(` ${p.templateId}: ${p.active}/${p.maxConcurrent} active, ${p.completed} done, ${p.failed} failed, ${p.totalTokensUsed} tokens`);
|
|
596
|
+
}
|
|
597
|
+
return lines.join('\n');
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
exports.StrategyAgent = StrategyAgent;
|
|
601
|
+
//# sourceMappingURL=strategy-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strategy-agent.js","sourceRoot":"","sources":["../../lib/strategy-agent.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;AAqYH,4CA4DC;AA/bD,mCAAsC;AAiItC,+EAA+E;AAC/E,aAAa;AACb,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CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CACF;AAnQD,sCAmQC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "network-ai",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.14.0",
|
|
4
4
|
"description": "AI agent orchestration framework for TypeScript/Node.js - 17 adapters (LangChain, AutoGen, CrewAI, OpenAI Assistants, LlamaIndex, Semantic Kernel, Haystack, DSPy, Agno, MCP, OpenClaw, A2A, Codex, MiniMax, NemoClaw, APS + streaming variants). Built-in CLI, security, swarm intelligence, real-time streaming, and agentic workflow patterns.",
|
|
5
5
|
"homepage": "https://network-ai.org",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"bin": {
|
|
9
9
|
"network-ai": "./dist/bin/cli.js",
|
|
10
|
-
"network-ai-server": "./dist/bin/mcp-server.js"
|
|
10
|
+
"network-ai-server": "./dist/bin/mcp-server.js",
|
|
11
|
+
"network-ai-console": "./dist/bin/console.js"
|
|
11
12
|
},
|
|
12
13
|
"scripts": {
|
|
13
14
|
"build": "tsc -p tsconfig.build.json",
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
"test:qa": "npx ts-node test-qa.ts",
|
|
36
37
|
"test:phase7": "npx ts-node test-phase7.ts",
|
|
37
38
|
"test:phase8": "npx ts-node test-phase8.ts",
|
|
39
|
+
"test:phase9": "npx ts-node test-phase9.ts",
|
|
38
40
|
"test:all": "npx ts-node run-tests.ts",
|
|
39
41
|
"setup": "npx ts-node setup.ts",
|
|
40
42
|
"setup:check": "npx ts-node setup.ts --check",
|