nexus-prime 5.1.2 → 5.1.4
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 +10 -0
- package/dist/agents/adapters/mcp.d.ts.map +1 -1
- package/dist/agents/adapters/mcp.js +41 -16
- package/dist/agents/adapters/mcp.js.map +1 -1
- package/dist/dashboard/routes/assets.d.ts.map +1 -1
- package/dist/dashboard/routes/assets.js +11 -25
- package/dist/dashboard/routes/assets.js.map +1 -1
- package/dist/dashboard/routes/governance.d.ts.map +1 -1
- package/dist/dashboard/routes/governance.js +10 -6
- package/dist/dashboard/routes/governance.js.map +1 -1
- package/dist/dashboard/routes/health.js +1 -1
- package/dist/dashboard/routes/health.js.map +1 -1
- package/dist/dashboard/routes/runtime.d.ts.map +1 -1
- package/dist/dashboard/routes/runtime.js +40 -22
- package/dist/dashboard/routes/runtime.js.map +1 -1
- package/dist/dashboard/routes/summary.d.ts.map +1 -1
- package/dist/dashboard/routes/summary.js +1 -1
- package/dist/dashboard/routes/summary.js.map +1 -1
- package/dist/dashboard/routes/surfaces.d.ts.map +1 -1
- package/dist/dashboard/routes/surfaces.js +2 -1
- package/dist/dashboard/routes/surfaces.js.map +1 -1
- package/dist/dashboard/selectors/assets-selector.d.ts +1 -0
- package/dist/dashboard/selectors/assets-selector.d.ts.map +1 -1
- package/dist/dashboard/selectors/assets-selector.js +21 -17
- package/dist/dashboard/selectors/assets-selector.js.map +1 -1
- package/dist/dashboard/selectors/memory-selector.d.ts.map +1 -1
- package/dist/dashboard/selectors/memory-selector.js +3 -2
- package/dist/dashboard/selectors/memory-selector.js.map +1 -1
- package/dist/dashboard/server.d.ts +3 -0
- package/dist/dashboard/server.d.ts.map +1 -1
- package/dist/dashboard/server.js +70 -19
- package/dist/dashboard/server.js.map +1 -1
- package/dist/dashboard/types.d.ts +1 -0
- package/dist/dashboard/types.d.ts.map +1 -1
- package/dist/engines/bootstrap/bootstrap-fast.d.ts.map +1 -1
- package/dist/engines/bootstrap/bootstrap-fast.js +7 -5
- package/dist/engines/bootstrap/bootstrap-fast.js.map +1 -1
- package/dist/engines/knowledge-fabric.d.ts.map +1 -1
- package/dist/engines/knowledge-fabric.js +11 -13
- package/dist/engines/knowledge-fabric.js.map +1 -1
- package/dist/engines/orchestrator.d.ts +14 -0
- package/dist/engines/orchestrator.d.ts.map +1 -1
- package/dist/engines/orchestrator.js +239 -105
- package/dist/engines/orchestrator.js.map +1 -1
- package/dist/engines/task-planner.js +6 -2
- package/dist/engines/task-planner.js.map +1 -1
- package/dist/engines/token-supremacy.d.ts +2 -0
- package/dist/engines/token-supremacy.d.ts.map +1 -1
- package/dist/engines/token-supremacy.js +44 -10
- package/dist/engines/token-supremacy.js.map +1 -1
- package/dist/phantom/runtime.d.ts +1 -0
- package/dist/phantom/runtime.d.ts.map +1 -1
- package/dist/phantom/runtime.js +33 -16
- package/dist/phantom/runtime.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -629,6 +629,16 @@ Inventory Snapshot: 109 skills · 64 workflows · 9 hooks · 5 automations · 7
|
|
|
629
629
|
|
|
630
630
|
## 📜 Release History
|
|
631
631
|
|
|
632
|
+
<details open>
|
|
633
|
+
<summary><b>v5.1.3</b> · 2026-04-09 · Runtime Latency Refinements</summary>
|
|
634
|
+
|
|
635
|
+
- **Shallow orchestrate latency**: caches workspace identity, tracked files, and selector projections to reduce preparation before the first useful response.
|
|
636
|
+
- **Deep-context staging on demand**: Knowledge Fabric compose and broader selector work now stay off the simple path until task complexity actually requires them.
|
|
637
|
+
- **Performance branch landed**: packages the branch's bootstrap, dashboard, and orchestrate response-path reductions into `main` without changing behavior.
|
|
638
|
+
|
|
639
|
+
Full notes: [releases/v5.1.3.md](./releases/v5.1.3.md) · Full history: [CHANGELOG.md](./CHANGELOG.md)
|
|
640
|
+
</details>
|
|
641
|
+
|
|
632
642
|
<details open>
|
|
633
643
|
<summary><b>v5.1.2</b> · 2026-04-09 · Memory Layers & Lifecycle Hooks</summary>
|
|
634
644
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/agents/adapters/mcp.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/agents/adapters/mcp.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AA4H5C,KAAK,cAAc,GAAG,YAAY,GAAG,MAAM,CAAC;AAK5C,KAAK,iBAAiB,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC,CAAC;AA6aF,qBAAa,UAAW,YAAW,OAAO;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAG,KAAK,CAAU;IACtB,SAAS,UAAS;IAClB,MAAM,EAAE,MAAM,EAAE,CAAM;IAEtB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAC,CAAa;IAC9B,OAAO,CAAC,SAAS,CAA4C;IAC7D,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,OAAO,CAAC,CAAkB;IAClC,OAAO,CAAC,uBAAuB,CAAC,CAAS;IACzC,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,eAAe,CAAyB;IAChD,OAAO,CAAC,oBAAoB,CAAgG;IAC5H,OAAO,CAAC,qBAAqB,CAAK;IAClC,OAAO,CAAC,WAAW,CAAM;IACzB,OAAO,CAAC,kBAAkB,CAAqB;IAE/C,OAAO,CAAC,cAA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
|
|
35
35
|
import { hasValidBootstrapReceipt } from '../../engines/bootstrap/index.js';
|
|
36
36
|
import { synapseToolDefinitions, handleSynapseToolCall } from '../../synapse/index.js';
|
|
37
37
|
import { architectsToolDefinitions, handleArchitectsToolCall } from '../../architects/index.js';
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
let _tokenEngine;
|
|
39
|
+
let _guardrailEngine;
|
|
40
|
+
let _casEngine;
|
|
41
|
+
let _kvBridge;
|
|
42
|
+
let _federation;
|
|
43
|
+
function getTokenEngine() {
|
|
44
|
+
if (!_tokenEngine)
|
|
45
|
+
_tokenEngine = new TokenSupremacyEngine();
|
|
46
|
+
return _tokenEngine;
|
|
47
|
+
}
|
|
48
|
+
function getGuardrailEngine() {
|
|
49
|
+
if (!_guardrailEngine)
|
|
50
|
+
_guardrailEngine = new GuardrailEngine();
|
|
51
|
+
return _guardrailEngine;
|
|
52
|
+
}
|
|
53
|
+
function getCasEngine() {
|
|
54
|
+
if (!_casEngine)
|
|
55
|
+
_casEngine = new ContinuousAttentionStream();
|
|
56
|
+
return _casEngine;
|
|
57
|
+
}
|
|
58
|
+
function getKvBridge() {
|
|
59
|
+
if (!_kvBridge)
|
|
60
|
+
_kvBridge = createKVBridge({ agents: 3 });
|
|
61
|
+
return _kvBridge;
|
|
62
|
+
}
|
|
63
|
+
function getFederation() {
|
|
64
|
+
if (!_federation)
|
|
65
|
+
_federation = new FederationEngine();
|
|
66
|
+
return _federation;
|
|
67
|
+
}
|
|
43
68
|
const fallbackRuntimes = new Map();
|
|
44
69
|
const fallbackOrchestrators = new Map();
|
|
45
70
|
function getFallbackRuntime(workspace) {
|
|
@@ -836,14 +861,14 @@ export class MCPAdapter {
|
|
|
836
861
|
const action = ctx.toolName === 'nexus_store_memory'
|
|
837
862
|
? `nexus_store_memory: ${String(ctx.args.content ?? '')}`
|
|
838
863
|
: `nexusnet_transmit: ${String(ctx.args.content ?? '')}`;
|
|
839
|
-
const guardCheck =
|
|
864
|
+
const guardCheck = getGuardrailEngine().check({ action });
|
|
840
865
|
if (guardCheck.passed)
|
|
841
866
|
return;
|
|
842
867
|
ctx.meta.shortCircuitedBy = 'guardrails';
|
|
843
868
|
ctx.meta.shortCircuitResult = {
|
|
844
869
|
content: [{
|
|
845
870
|
type: 'text',
|
|
846
|
-
text: `❌ GUARDRAIL BLOCKED: ${
|
|
871
|
+
text: `❌ GUARDRAIL BLOCKED: ${getGuardrailEngine().format(guardCheck)}`,
|
|
847
872
|
}],
|
|
848
873
|
};
|
|
849
874
|
},
|
|
@@ -3245,7 +3270,7 @@ export class MCPAdapter {
|
|
|
3245
3270
|
return { path: resolved, sizeBytes: 0 };
|
|
3246
3271
|
}
|
|
3247
3272
|
});
|
|
3248
|
-
const plan =
|
|
3273
|
+
const plan = getTokenEngine().plan(task, files);
|
|
3249
3274
|
const formatted = formatReadingPlan(plan);
|
|
3250
3275
|
// Persist the decision
|
|
3251
3276
|
this.nexusRef.storeMemory(`Token plan for "${task.slice(0, 80)}": ` +
|
|
@@ -3267,7 +3292,7 @@ export class MCPAdapter {
|
|
|
3267
3292
|
filesToModify: args?.filesToModify,
|
|
3268
3293
|
isDestructive: args?.isDestructive,
|
|
3269
3294
|
};
|
|
3270
|
-
const result =
|
|
3295
|
+
const result = getGuardrailEngine().check(ctx);
|
|
3271
3296
|
// Store violations in Nexus memory
|
|
3272
3297
|
if (result.violations.length > 0) {
|
|
3273
3298
|
this.nexusRef.storeMemory(`[GUARDRAIL BLOCK] ${ctx.action.slice(0, 80)} — ${result.violations.map(v => v.id).join(', ')}`, 0.7, ['#guardrail', '#mindkit']);
|
|
@@ -3283,7 +3308,7 @@ export class MCPAdapter {
|
|
|
3283
3308
|
score: Math.round(result.score * 100),
|
|
3284
3309
|
violations: result.violations,
|
|
3285
3310
|
warnings: result.warnings,
|
|
3286
|
-
summary:
|
|
3311
|
+
summary: getGuardrailEngine().format(result)
|
|
3287
3312
|
}, null, 2) + nudge
|
|
3288
3313
|
}]
|
|
3289
3314
|
};
|
|
@@ -3540,7 +3565,7 @@ export class MCPAdapter {
|
|
|
3540
3565
|
return { path: resolved, sizeBytes: 0 };
|
|
3541
3566
|
}
|
|
3542
3567
|
}).filter(f => f.sizeBytes > 0);
|
|
3543
|
-
const { plan, assembly, budgetConfig } =
|
|
3568
|
+
const { plan, assembly, budgetConfig } = getTokenEngine().hypertuneMax(task, files);
|
|
3544
3569
|
const planText = formatReadingPlan(plan);
|
|
3545
3570
|
const assemblyText = ContextAssembler.format(assembly, budgetConfig);
|
|
3546
3571
|
const savings = plan.savings;
|
|
@@ -4511,9 +4536,9 @@ export class MCPAdapter {
|
|
|
4511
4536
|
throw new McpError(ErrorCode.InvalidParams, "Tokens array cannot be empty");
|
|
4512
4537
|
}
|
|
4513
4538
|
const task = "mcp_compression_request";
|
|
4514
|
-
const encoding =
|
|
4539
|
+
const encoding = getCasEngine().encode(tokens, task);
|
|
4515
4540
|
// Trigger learning of the provided text as a pattern
|
|
4516
|
-
|
|
4541
|
+
getCasEngine().learnPattern(tokens.join(' '), 1);
|
|
4517
4542
|
return {
|
|
4518
4543
|
content: [{
|
|
4519
4544
|
type: 'text',
|
|
@@ -4522,7 +4547,7 @@ export class MCPAdapter {
|
|
|
4522
4547
|
};
|
|
4523
4548
|
}
|
|
4524
4549
|
case 'nexus_kv_bridge_status': {
|
|
4525
|
-
const metrics =
|
|
4550
|
+
const metrics = getKvBridge().getMetrics();
|
|
4526
4551
|
const text = `🌉 KV Bridge Status\n` +
|
|
4527
4552
|
`Decisions: ${metrics.totalDecisions}\n` +
|
|
4528
4553
|
`Merge Rate: ${(metrics.mergeRate * 100).toFixed(1)}%\n` +
|
|
@@ -4542,7 +4567,7 @@ export class MCPAdapter {
|
|
|
4542
4567
|
entropy: 0.2,
|
|
4543
4568
|
taskEmbedding: [1.0, 0.5]
|
|
4544
4569
|
}));
|
|
4545
|
-
const result = await
|
|
4570
|
+
const result = await getKvBridge().adaptToTask(taskType, mockFeatures);
|
|
4546
4571
|
return {
|
|
4547
4572
|
content: [{
|
|
4548
4573
|
type: 'text',
|
|
@@ -4612,7 +4637,7 @@ export class MCPAdapter {
|
|
|
4612
4637
|
const findings = Array.isArray(request.params.arguments?.findings) ? request.params.arguments.findings : [];
|
|
4613
4638
|
const confidence = Number(request.params.arguments?.confidence ?? 0.9);
|
|
4614
4639
|
const trace = { taskId, goal, findings, confidence, timestamp: Date.now() };
|
|
4615
|
-
const result = await
|
|
4640
|
+
const result = await getFederation().publishTrace(trace);
|
|
4616
4641
|
return {
|
|
4617
4642
|
content: [{
|
|
4618
4643
|
type: 'text',
|