@timmeck/brain-core 2.36.55 → 2.36.57
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/command-center.html +111 -0
- package/dist/action/__tests__/action-bridge.test.d.ts +1 -0
- package/dist/action/__tests__/action-bridge.test.js +145 -0
- package/dist/action/__tests__/action-bridge.test.js.map +1 -0
- package/dist/action/action-bridge.d.ts +95 -0
- package/dist/action/action-bridge.js +241 -0
- package/dist/action/action-bridge.js.map +1 -0
- package/dist/action/index.d.ts +2 -0
- package/dist/action/index.js +2 -0
- package/dist/action/index.js.map +1 -0
- package/dist/codegen/__tests__/code-forge.test.d.ts +1 -0
- package/dist/codegen/__tests__/code-forge.test.js +105 -0
- package/dist/codegen/__tests__/code-forge.test.js.map +1 -0
- package/dist/codegen/code-forge.d.ts +87 -0
- package/dist/codegen/code-forge.js +211 -0
- package/dist/codegen/code-forge.js.map +1 -0
- package/dist/codegen/index.d.ts +2 -0
- package/dist/codegen/index.js +1 -0
- package/dist/codegen/index.js.map +1 -1
- package/dist/content/__tests__/content-forge.test.d.ts +1 -0
- package/dist/content/__tests__/content-forge.test.js +117 -0
- package/dist/content/__tests__/content-forge.test.js.map +1 -0
- package/dist/content/content-forge.d.ts +104 -0
- package/dist/content/content-forge.js +213 -0
- package/dist/content/content-forge.js.map +1 -0
- package/dist/content/index.d.ts +2 -0
- package/dist/content/index.js +2 -0
- package/dist/content/index.js.map +1 -0
- package/dist/dashboard/command-center-server.d.ts +6 -0
- package/dist/dashboard/command-center-server.js +58 -1
- package/dist/dashboard/command-center-server.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/research/research-orchestrator.d.ts +12 -0
- package/dist/research/research-orchestrator.js +108 -0
- package/dist/research/research-orchestrator.js.map +1 -1
- package/dist/strategy/__tests__/strategy-forge.test.d.ts +1 -0
- package/dist/strategy/__tests__/strategy-forge.test.js +121 -0
- package/dist/strategy/__tests__/strategy-forge.test.js.map +1 -0
- package/dist/strategy/index.d.ts +2 -0
- package/dist/strategy/index.js +2 -0
- package/dist/strategy/index.js.map +1 -0
- package/dist/strategy/strategy-forge.d.ts +111 -0
- package/dist/strategy/strategy-forge.js +264 -0
- package/dist/strategy/strategy-forge.js.map +1 -0
- package/package.json +1 -1
|
@@ -80,6 +80,10 @@ export class ResearchOrchestrator {
|
|
|
80
80
|
causalPlanner = null;
|
|
81
81
|
researchRoadmap = null;
|
|
82
82
|
creativeEngine = null;
|
|
83
|
+
actionBridge = null;
|
|
84
|
+
contentForge = null;
|
|
85
|
+
codeForge = null;
|
|
86
|
+
strategyForge = null;
|
|
83
87
|
lastAutoMissionTime = 0;
|
|
84
88
|
lastGoalMissionTime = 0;
|
|
85
89
|
onSuggestionCallback = null;
|
|
@@ -269,6 +273,14 @@ export class ResearchOrchestrator {
|
|
|
269
273
|
setResearchRoadmap(roadmap) { this.researchRoadmap = roadmap; }
|
|
270
274
|
/** Set the CreativeEngine — cross-domain idea generation. */
|
|
271
275
|
setCreativeEngine(engine) { this.creativeEngine = engine; }
|
|
276
|
+
/** Set the ActionBridgeEngine — risk-assessed action execution. */
|
|
277
|
+
setActionBridge(bridge) { this.actionBridge = bridge; }
|
|
278
|
+
/** Set the ContentForge — autonomous content pipeline. */
|
|
279
|
+
setContentForge(forge) { this.contentForge = forge; }
|
|
280
|
+
/** Set the CodeForge — pattern extraction + auto-apply. */
|
|
281
|
+
setCodeForge(forge) { this.codeForge = forge; }
|
|
282
|
+
/** Set the StrategyForge — autonomous strategy execution. */
|
|
283
|
+
setStrategyForge(forge) { this.strategyForge = forge; }
|
|
272
284
|
/** Set the LLMService — propagates to all engines that can use LLM. */
|
|
273
285
|
setLLMService(llm) {
|
|
274
286
|
this.llmService = llm;
|
|
@@ -2403,6 +2415,102 @@ export class ResearchOrchestrator {
|
|
|
2403
2415
|
this.log.warn(`[orchestrator] Step 58 (creative) error: ${err.message}`);
|
|
2404
2416
|
}
|
|
2405
2417
|
}
|
|
2418
|
+
// Step 59: ActionBridge — process pending action queue (every 5 cycles)
|
|
2419
|
+
if (this.actionBridge && this.cycleCount % 5 === 0) {
|
|
2420
|
+
try {
|
|
2421
|
+
ts?.emit('action_bridge', 'responding', 'Step 59: Processing action queue...', 'routine');
|
|
2422
|
+
const executed = await this.actionBridge.processQueue();
|
|
2423
|
+
if (executed > 0) {
|
|
2424
|
+
this.journal.write({
|
|
2425
|
+
type: 'discovery',
|
|
2426
|
+
title: `ActionBridge: auto-executed ${executed} action(s)`,
|
|
2427
|
+
content: `Queue processed: ${executed} actions executed automatically`,
|
|
2428
|
+
tags: [this.brainName, 'action-bridge', 'auto-execute'],
|
|
2429
|
+
references: [],
|
|
2430
|
+
significance: executed > 3 ? 'notable' : 'routine',
|
|
2431
|
+
data: { executed },
|
|
2432
|
+
});
|
|
2433
|
+
}
|
|
2434
|
+
if (this.metaCognitionLayer)
|
|
2435
|
+
this.metaCognitionLayer.recordStep('action_bridge', this.cycleCount, { insights: executed });
|
|
2436
|
+
}
|
|
2437
|
+
catch (err) {
|
|
2438
|
+
this.log.warn(`[orchestrator] Step 59 error: ${err.message}`);
|
|
2439
|
+
}
|
|
2440
|
+
}
|
|
2441
|
+
// Step 60: ContentForge — generate content from top creative insights (every 10 cycles)
|
|
2442
|
+
if (this.contentForge && this.creativeEngine && this.cycleCount % 10 === 0) {
|
|
2443
|
+
try {
|
|
2444
|
+
ts?.emit('content_forge', 'discovering', 'Step 60: Generating content from insights...', 'routine');
|
|
2445
|
+
const topInsights = this.creativeEngine.getInsights(3, 'raw');
|
|
2446
|
+
let generated = 0;
|
|
2447
|
+
for (const insight of topInsights) {
|
|
2448
|
+
if (insight.noveltyScore > 0.6) {
|
|
2449
|
+
this.contentForge.generateFromInsight(insight);
|
|
2450
|
+
generated++;
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
if (generated > 0) {
|
|
2454
|
+
this.journal.write({
|
|
2455
|
+
type: 'discovery',
|
|
2456
|
+
title: `ContentForge: ${generated} content piece(s) generated`,
|
|
2457
|
+
content: `Generated ${generated} content pieces from creative insights`,
|
|
2458
|
+
tags: [this.brainName, 'content-forge', 'auto-generate'],
|
|
2459
|
+
references: [],
|
|
2460
|
+
significance: 'routine',
|
|
2461
|
+
data: { generated },
|
|
2462
|
+
});
|
|
2463
|
+
}
|
|
2464
|
+
if (this.metaCognitionLayer)
|
|
2465
|
+
this.metaCognitionLayer.recordStep('content_forge', this.cycleCount, { insights: generated });
|
|
2466
|
+
}
|
|
2467
|
+
catch (err) {
|
|
2468
|
+
this.log.warn(`[orchestrator] Step 60 error: ${err.message}`);
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2471
|
+
// Step 61: CodeForge — extract patterns from code health scans (every 15 cycles)
|
|
2472
|
+
if (this.codeForge && this.cycleCount % 15 === 0) {
|
|
2473
|
+
try {
|
|
2474
|
+
ts?.emit('code_forge', 'analyzing', 'Step 61: Extracting code patterns...', 'routine');
|
|
2475
|
+
const patterns = this.codeForge.extractPatterns();
|
|
2476
|
+
if (this.metaCognitionLayer)
|
|
2477
|
+
this.metaCognitionLayer.recordStep('code_forge', this.cycleCount, { insights: patterns.length });
|
|
2478
|
+
}
|
|
2479
|
+
catch (err) {
|
|
2480
|
+
this.log.warn(`[orchestrator] Step 61 error: ${err.message}`);
|
|
2481
|
+
}
|
|
2482
|
+
}
|
|
2483
|
+
// Step 62: StrategyForge — execute active strategies (every 20 cycles)
|
|
2484
|
+
if (this.strategyForge && this.cycleCount % 20 === 0) {
|
|
2485
|
+
try {
|
|
2486
|
+
ts?.emit('strategy_forge', 'experimenting', 'Step 62: Executing active strategies...', 'routine');
|
|
2487
|
+
const active = this.strategyForge.getActive();
|
|
2488
|
+
let totalFired = 0;
|
|
2489
|
+
for (const strategy of active) {
|
|
2490
|
+
try {
|
|
2491
|
+
const result = this.strategyForge.executeStep(strategy.id);
|
|
2492
|
+
totalFired += result.fired;
|
|
2493
|
+
}
|
|
2494
|
+
catch { /* individual strategy execution non-critical */ }
|
|
2495
|
+
}
|
|
2496
|
+
if (totalFired > 0) {
|
|
2497
|
+
this.journal.write({
|
|
2498
|
+
type: 'experiment',
|
|
2499
|
+
title: `StrategyForge: ${totalFired} rule(s) fired across ${active.length} strategies`,
|
|
2500
|
+
content: `Active strategies: ${active.map(s => s.name).join(', ')}`,
|
|
2501
|
+
tags: [this.brainName, 'strategy-forge', 'execution'],
|
|
2502
|
+
references: [],
|
|
2503
|
+
significance: totalFired > 5 ? 'notable' : 'routine',
|
|
2504
|
+
data: { totalFired, activeCount: active.length },
|
|
2505
|
+
});
|
|
2506
|
+
}
|
|
2507
|
+
if (this.metaCognitionLayer)
|
|
2508
|
+
this.metaCognitionLayer.recordStep('strategy_forge', this.cycleCount, { insights: totalFired });
|
|
2509
|
+
}
|
|
2510
|
+
catch (err) {
|
|
2511
|
+
this.log.warn(`[orchestrator] Step 62 error: ${err.message}`);
|
|
2512
|
+
}
|
|
2513
|
+
}
|
|
2406
2514
|
const duration = Date.now() - start;
|
|
2407
2515
|
ts?.emit('orchestrator', 'reflecting', `Feedback Cycle #${this.cycleCount} complete (${duration}ms)`);
|
|
2408
2516
|
this.log.info(`[orchestrator] ─── Feedback Cycle #${this.cycleCount} complete (${duration}ms) ───`);
|