nexus-prime 5.1.1 → 5.1.3
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 +20 -0
- package/dist/agents/adapters/mcp.d.ts.map +1 -1
- package/dist/agents/adapters/mcp.js +77 -21
- package/dist/agents/adapters/mcp.js.map +1 -1
- package/dist/cli.js +21 -9
- package/dist/cli.js.map +1 -1
- package/dist/dashboard/index.html +44 -6
- 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/automation-runtime.d.ts +1 -0
- package/dist/engines/automation-runtime.d.ts.map +1 -1
- package/dist/engines/automation-runtime.js +55 -25
- package/dist/engines/automation-runtime.js.map +1 -1
- package/dist/engines/bootstrap/bootstrap-fast.d.ts.map +1 -1
- package/dist/engines/bootstrap/bootstrap-fast.js +8 -6
- package/dist/engines/bootstrap/bootstrap-fast.js.map +1 -1
- package/dist/engines/hook-runtime.d.ts +12 -0
- package/dist/engines/hook-runtime.d.ts.map +1 -1
- package/dist/engines/hook-runtime.js +82 -25
- package/dist/engines/hook-runtime.js.map +1 -1
- package/dist/engines/knowledge-fabric.d.ts +14 -0
- package/dist/engines/knowledge-fabric.d.ts.map +1 -1
- package/dist/engines/knowledge-fabric.js +90 -13
- package/dist/engines/knowledge-fabric.js.map +1 -1
- package/dist/engines/memory.d.ts +18 -0
- package/dist/engines/memory.d.ts.map +1 -1
- package/dist/engines/memory.js +61 -0
- package/dist/engines/memory.js.map +1 -1
- package/dist/engines/orchestrator.d.ts +67 -2
- package/dist/engines/orchestrator.d.ts.map +1 -1
- package/dist/engines/orchestrator.js +869 -167
- package/dist/engines/orchestrator.js.map +1 -1
- package/dist/engines/peer-connectors.d.ts +22 -0
- package/dist/engines/peer-connectors.d.ts.map +1 -1
- package/dist/engines/peer-connectors.js +70 -19
- package/dist/engines/peer-connectors.js.map +1 -1
- package/dist/engines/priors/file-priors.d.ts +3 -0
- package/dist/engines/priors/file-priors.d.ts.map +1 -1
- package/dist/engines/priors/file-priors.js +9 -2
- package/dist/engines/priors/file-priors.js.map +1 -1
- package/dist/engines/runtime-health.d.ts +3 -1
- package/dist/engines/runtime-health.d.ts.map +1 -1
- package/dist/engines/runtime-health.js +20 -10
- package/dist/engines/runtime-health.js.map +1 -1
- package/dist/engines/runtime-hygiene.d.ts +15 -0
- package/dist/engines/runtime-hygiene.d.ts.map +1 -0
- package/dist/engines/runtime-hygiene.js +116 -0
- package/dist/engines/runtime-hygiene.js.map +1 -0
- package/dist/engines/runtime-registry.d.ts +19 -0
- package/dist/engines/runtime-registry.d.ts.map +1 -1
- package/dist/engines/runtime-registry.js.map +1 -1
- package/dist/engines/skill-runtime.d.ts +1 -0
- package/dist/engines/skill-runtime.d.ts.map +1 -1
- package/dist/engines/skill-runtime.js +20 -5
- package/dist/engines/skill-runtime.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/engines/workflow-runtime.d.ts +1 -0
- package/dist/engines/workflow-runtime.d.ts.map +1 -1
- package/dist/engines/workflow-runtime.js +20 -5
- package/dist/engines/workflow-runtime.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/dist/phantom/runtime.d.ts.map +1 -1
- package/dist/phantom/runtime.js +57 -15
- package/dist/phantom/runtime.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -629,6 +629,26 @@ 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
|
+
|
|
642
|
+
<details open>
|
|
643
|
+
<summary><b>v5.1.2</b> · 2026-04-09 · Memory Layers & Lifecycle Hooks</summary>
|
|
644
|
+
|
|
645
|
+
- **Explicit memory layer contract**: working, session, project, and pattern layers are now exposed in runtime summaries with auditable contract metadata.
|
|
646
|
+
- **Deterministic lifecycle touchpoints**: memory review, failure summary, and session close surfaces now dispatch in stable catalog-priority order while keeping repo-local `.agents` canonical.
|
|
647
|
+
- **Compatibility preserved**: legacy `.agent` hooks and automations remain loaded as fallback inputs while `.agents` continues to win on duplicate local names.
|
|
648
|
+
|
|
649
|
+
Full notes: [CHANGELOG.md](./CHANGELOG.md)
|
|
650
|
+
</details>
|
|
651
|
+
|
|
632
652
|
<details open>
|
|
633
653
|
<summary><b>v5.1.1</b> · 2026-04-08 · CI Finalization</summary>
|
|
634
654
|
|
|
@@ -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,cAAc;IA6BtB,OAAO,CAAC,oBAAoB;IAsB5B,OAAO,CAAC,eAAe;IAqEvB,OAAO,CAAC,GAAG;;IAqBX,OAAO,CAAC,gBAAgB;IA4BxB,WAAW,CAAC,KAAK,EAAE,UAAU;IAI7B,OAAO,CAAC,sBAAsB;IAK9B,OAAO,CAAC,4BAA4B;IAepC,OAAO,CAAC,0BAA0B;IAkBlC,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,iBAAiB;IAKzB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,yBAAyB;IAqFjC,OAAO,CAAC,uBAAuB;IAY/B,OAAO,CAAC,4BAA4B;IAWpC,OAAO,CAAC,qBAAqB;IAiB7B,OAAO,CAAC,yBAAyB;IA2CjC,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,YAAY;YAON,mBAAmB;IA0DjC,OAAO,CAAC,+BAA+B;IAMvC,OAAO,CAAC,uBAAuB;IA0B/B,OAAO,CAAC,2BAA2B;IAqBnC,OAAO,CAAC,uBAAuB;IAkC/B,cAAc,CAAC,OAAO,GAAE,cAAsC,GAAG,iBAAiB,EAAE;IAIpF,OAAO,CAAC,oBAAoB;IAk/B5B,OAAO,CAAC,iBAAiB;YAkHX,cAAc;IAslF5B,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE;IAItC,OAAO,CAAC,IAAI;IAmBN,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAOxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAoB3B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAYlD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;CAOzC"}
|
|
@@ -35,11 +35,36 @@ import { resolveWorkspaceContext, resolveWorkspaceStateRoot } from '../../engine
|
|
|
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) {
|
|
@@ -419,6 +444,14 @@ function normalizeDetailLevel(value) {
|
|
|
419
444
|
return normalized;
|
|
420
445
|
return 'compact';
|
|
421
446
|
}
|
|
447
|
+
function normalizeBootstrapDepth(value, detailLevel) {
|
|
448
|
+
const normalized = String(value ?? '').toLowerCase();
|
|
449
|
+
if (normalized === 'deep')
|
|
450
|
+
return 'deep';
|
|
451
|
+
if (normalized === 'fast')
|
|
452
|
+
return 'fast';
|
|
453
|
+
return detailLevel === 'debug' ? 'deep' : 'fast';
|
|
454
|
+
}
|
|
422
455
|
function normalizeResponseIntent(value) {
|
|
423
456
|
const normalized = String(value ?? 'inspect').toLowerCase();
|
|
424
457
|
if (normalized === 'plan' || normalized === 'mutate')
|
|
@@ -828,14 +861,14 @@ export class MCPAdapter {
|
|
|
828
861
|
const action = ctx.toolName === 'nexus_store_memory'
|
|
829
862
|
? `nexus_store_memory: ${String(ctx.args.content ?? '')}`
|
|
830
863
|
: `nexusnet_transmit: ${String(ctx.args.content ?? '')}`;
|
|
831
|
-
const guardCheck =
|
|
864
|
+
const guardCheck = getGuardrailEngine().check({ action });
|
|
832
865
|
if (guardCheck.passed)
|
|
833
866
|
return;
|
|
834
867
|
ctx.meta.shortCircuitedBy = 'guardrails';
|
|
835
868
|
ctx.meta.shortCircuitResult = {
|
|
836
869
|
content: [{
|
|
837
870
|
type: 'text',
|
|
838
|
-
text: `❌ GUARDRAIL BLOCKED: ${
|
|
871
|
+
text: `❌ GUARDRAIL BLOCKED: ${getGuardrailEngine().format(guardCheck)}`,
|
|
839
872
|
}],
|
|
840
873
|
};
|
|
841
874
|
},
|
|
@@ -1266,13 +1299,15 @@ export class MCPAdapter {
|
|
|
1266
1299
|
},
|
|
1267
1300
|
{
|
|
1268
1301
|
name: 'nexus_session_bootstrap',
|
|
1269
|
-
description: 'Read-only session-start summary.
|
|
1302
|
+
description: 'Read-only session-start summary. Defaults to fast readiness mode and returns current client identity, memory recall summary, memory stats, recommended next step, recommended execution mode, shortlist recommendations, and whether deeper preparation is still needed.',
|
|
1270
1303
|
inputSchema: {
|
|
1271
1304
|
type: 'object',
|
|
1272
1305
|
properties: {
|
|
1273
1306
|
goal: { type: 'string', description: 'Raw goal or task description for this session' },
|
|
1274
1307
|
files: { type: 'array', items: { type: 'string' }, description: 'Optional candidate file constraints' },
|
|
1275
1308
|
detailLevel: { type: 'string', enum: ['compact', 'standard', 'debug'], description: 'Response verbosity; defaults to compact for MCP callers' },
|
|
1309
|
+
depth: { type: 'string', enum: ['fast', 'deep'], description: 'Optional bootstrap depth override; defaults to fast unless debug mode is requested' },
|
|
1310
|
+
include: { type: 'array', items: { type: 'string' }, description: 'Optional rich payload sections to include for advanced clients' },
|
|
1276
1311
|
intent: { type: 'string', enum: ['inspect', 'plan', 'mutate'], description: 'Requested orchestration stance for the bootstrap summary' },
|
|
1277
1312
|
topology: { type: 'string', enum: ['auto', 'manager-tools', 'handoff', 'dag-pool', 'worktree-swarm'], description: 'Requested orchestration topology hint' },
|
|
1278
1313
|
},
|
|
@@ -2256,11 +2291,13 @@ export class MCPAdapter {
|
|
|
2256
2291
|
}
|
|
2257
2292
|
const callStartedAt = Date.now();
|
|
2258
2293
|
const bootstrapGoal = String(request.params.arguments?.goal ?? request.params.arguments?.prompt ?? '');
|
|
2294
|
+
const detailLevel = normalizeDetailLevel(request.params.arguments?.detailLevel);
|
|
2295
|
+
const bootstrapDepth = normalizeBootstrapDepth(request.params.arguments?.depth, detailLevel);
|
|
2259
2296
|
// Fast-path: if already bootstrapped in this MCP session and receipt is still fresh,
|
|
2260
2297
|
// return a lightweight ack instead of re-running the full expensive bootstrap.
|
|
2261
2298
|
// This makes bootstrap idempotent for loop-based callers (e.g. /loop skill, Antigravity).
|
|
2262
2299
|
// Debug calls always bypass the fast-path so callers get the full structured payload.
|
|
2263
|
-
if (this.telemetry.bootstrapCallCount > 0 &&
|
|
2300
|
+
if (this.telemetry.bootstrapCallCount > 0 && bootstrapDepth !== 'deep') {
|
|
2264
2301
|
const hasFreshReceipt = (() => {
|
|
2265
2302
|
try {
|
|
2266
2303
|
const ws = resolveWorkspaceContext();
|
|
@@ -2292,10 +2329,16 @@ export class MCPAdapter {
|
|
|
2292
2329
|
const files = Array.isArray(request.params.arguments?.files)
|
|
2293
2330
|
? request.params.arguments.files.map(String)
|
|
2294
2331
|
: undefined;
|
|
2295
|
-
const
|
|
2332
|
+
const include = Array.isArray(request.params.arguments?.include)
|
|
2333
|
+
? request.params.arguments.include.map(String)
|
|
2334
|
+
: undefined;
|
|
2296
2335
|
const requestedIntent = normalizeResponseIntent(request.params.arguments?.intent);
|
|
2297
2336
|
const requestedTopology = normalizeResponseTopology(request.params.arguments?.topology);
|
|
2298
|
-
const bootstrap = await this.getOrchestrator().bootstrapSession(bootstrapGoal, {
|
|
2337
|
+
const bootstrap = await this.getOrchestrator().bootstrapSession(bootstrapGoal, {
|
|
2338
|
+
files,
|
|
2339
|
+
depth: bootstrapDepth,
|
|
2340
|
+
include,
|
|
2341
|
+
});
|
|
2299
2342
|
const autoTokenApplied = Boolean(bootstrap.tokenOptimization?.autoApplied);
|
|
2300
2343
|
if (autoTokenApplied) {
|
|
2301
2344
|
this.telemetry.markTokenAutoApplied();
|
|
@@ -2305,7 +2348,7 @@ export class MCPAdapter {
|
|
|
2305
2348
|
}
|
|
2306
2349
|
this.getRuntime().recordClientToolCall('nexus_session_bootstrap', {
|
|
2307
2350
|
bootstrapCalled: true,
|
|
2308
|
-
plannerCalled:
|
|
2351
|
+
plannerCalled: bootstrap.depth === 'deep',
|
|
2309
2352
|
tokenOptimizationApplied: autoTokenApplied,
|
|
2310
2353
|
tokenAutoApplied: autoTokenApplied,
|
|
2311
2354
|
toolProfile: this.getToolProfile(),
|
|
@@ -2339,10 +2382,14 @@ export class MCPAdapter {
|
|
|
2339
2382
|
};
|
|
2340
2383
|
const payload = detailLevel === 'debug'
|
|
2341
2384
|
? {
|
|
2385
|
+
depth: bootstrap.depth,
|
|
2342
2386
|
workspace,
|
|
2343
2387
|
client: bootstrap.client,
|
|
2344
2388
|
memoryRecall: bootstrap.memoryRecall,
|
|
2345
2389
|
memoryStats: bootstrap.memoryStats,
|
|
2390
|
+
memoryHealth: bootstrap.memoryHealth,
|
|
2391
|
+
needsDeepBootstrap: bootstrap.needsDeepBootstrap,
|
|
2392
|
+
changedSinceLastSession: bootstrap.changedSinceLastSession,
|
|
2346
2393
|
recommendedNextStep: bootstrap.recommendedNextStep,
|
|
2347
2394
|
recommendedExecutionMode: bootstrap.recommendedExecutionMode,
|
|
2348
2395
|
shortlist: bootstrap.shortlist,
|
|
@@ -2363,16 +2410,21 @@ export class MCPAdapter {
|
|
|
2363
2410
|
payloadRef: {
|
|
2364
2411
|
workspaceStateKey: workspace.stateKey,
|
|
2365
2412
|
detailLevel,
|
|
2413
|
+
depth: bootstrapDepth,
|
|
2366
2414
|
intent: requestedIntent,
|
|
2367
2415
|
topology: requestedTopology,
|
|
2368
2416
|
},
|
|
2369
2417
|
mcpToolProfile: this.getToolProfile(),
|
|
2370
2418
|
}
|
|
2371
2419
|
: {
|
|
2420
|
+
depth: bootstrap.depth,
|
|
2372
2421
|
workspace,
|
|
2373
2422
|
client: bootstrap.client,
|
|
2374
2423
|
memoryRecall: bootstrap.memoryRecall,
|
|
2375
2424
|
memoryStats: bootstrap.memoryStats,
|
|
2425
|
+
memoryHealth: bootstrap.memoryHealth,
|
|
2426
|
+
needsDeepBootstrap: bootstrap.needsDeepBootstrap,
|
|
2427
|
+
changedSinceLastSession: bootstrap.changedSinceLastSession,
|
|
2376
2428
|
recommendedNextStep: bootstrap.recommendedNextStep,
|
|
2377
2429
|
recommendedExecutionMode: bootstrap.recommendedExecutionMode,
|
|
2378
2430
|
shortlist: bootstrap.shortlist,
|
|
@@ -2392,10 +2444,12 @@ export class MCPAdapter {
|
|
|
2392
2444
|
payloadRef: {
|
|
2393
2445
|
workspaceStateKey: workspace.stateKey,
|
|
2394
2446
|
detailLevel,
|
|
2447
|
+
depth: bootstrapDepth,
|
|
2395
2448
|
intent: requestedIntent,
|
|
2396
2449
|
topology: requestedTopology,
|
|
2397
2450
|
},
|
|
2398
2451
|
summary: {
|
|
2452
|
+
bootstrapDepth: bootstrap.depth ?? bootstrapDepth,
|
|
2399
2453
|
clientBootstrapClients: bootstrap.clientBootstrapStatus?.clients?.length ?? 0,
|
|
2400
2454
|
taskGraphPhases: bootstrap.taskGraphPreview?.phases?.length ?? 0,
|
|
2401
2455
|
totalWorkers: bootstrap.workerPlanPreview?.totalWorkers ?? 0,
|
|
@@ -2410,6 +2464,7 @@ export class MCPAdapter {
|
|
|
2410
2464
|
formatBullets([
|
|
2411
2465
|
`Workspace: ${workspace.repoName} (${workspace.workspaceSource})`,
|
|
2412
2466
|
`Client: ${bootstrap.client?.displayName || bootstrap.client?.clientId || 'unknown'} (${bootstrap.client?.state || 'unknown'})`,
|
|
2467
|
+
`Bootstrap depth: ${bootstrap.depth || bootstrapDepth}`,
|
|
2413
2468
|
`Memory recall: ${bootstrap.memoryRecall?.count ?? 0} result(s)`,
|
|
2414
2469
|
`Memory stats: prefrontal ${bootstrap.memoryStats?.prefrontal ?? 0} · hippocampus ${bootstrap.memoryStats?.hippocampus ?? 0} · cortex ${bootstrap.memoryStats?.cortex ?? 0}`,
|
|
2415
2470
|
`Recommended next step: ${bootstrap.recommendedNextStep || 'nexus_orchestrate'}`,
|
|
@@ -2421,6 +2476,7 @@ export class MCPAdapter {
|
|
|
2421
2476
|
`RAG: ${bootstrap.ragCandidateStatus?.attachedCollections || 0} attached · ${bootstrap.ragCandidateStatus?.retrievedChunks || 0} retrieved`,
|
|
2422
2477
|
`Task graph: ${bootstrap.taskGraphPreview?.phases?.length || 0} phases · ${bootstrap.taskGraphPreview?.independentBranches || 0} branches`,
|
|
2423
2478
|
`Worker plan: ${bootstrap.workerPlanPreview?.totalWorkers || 0} workers planned`,
|
|
2479
|
+
bootstrap.needsDeepBootstrap ? 'Deep preparation: still recommended before risky or cross-file work' : 'Deep preparation: not currently required',
|
|
2424
2480
|
`Payload ref: ${workspace.stateKey} · ${detailLevel}`,
|
|
2425
2481
|
`Session summary: ${bootstrap.sessionSummaryBootstrap?.savedTokens ? `reused ${Number(bootstrap.sessionSummaryBootstrap.savedTokens || 0).toLocaleString()} tokens from the previous visit` : 'none available yet'}`,
|
|
2426
2482
|
bootstrap.projectMemoryBootstrap?.count
|
|
@@ -3214,7 +3270,7 @@ export class MCPAdapter {
|
|
|
3214
3270
|
return { path: resolved, sizeBytes: 0 };
|
|
3215
3271
|
}
|
|
3216
3272
|
});
|
|
3217
|
-
const plan =
|
|
3273
|
+
const plan = getTokenEngine().plan(task, files);
|
|
3218
3274
|
const formatted = formatReadingPlan(plan);
|
|
3219
3275
|
// Persist the decision
|
|
3220
3276
|
this.nexusRef.storeMemory(`Token plan for "${task.slice(0, 80)}": ` +
|
|
@@ -3236,7 +3292,7 @@ export class MCPAdapter {
|
|
|
3236
3292
|
filesToModify: args?.filesToModify,
|
|
3237
3293
|
isDestructive: args?.isDestructive,
|
|
3238
3294
|
};
|
|
3239
|
-
const result =
|
|
3295
|
+
const result = getGuardrailEngine().check(ctx);
|
|
3240
3296
|
// Store violations in Nexus memory
|
|
3241
3297
|
if (result.violations.length > 0) {
|
|
3242
3298
|
this.nexusRef.storeMemory(`[GUARDRAIL BLOCK] ${ctx.action.slice(0, 80)} — ${result.violations.map(v => v.id).join(', ')}`, 0.7, ['#guardrail', '#mindkit']);
|
|
@@ -3252,7 +3308,7 @@ export class MCPAdapter {
|
|
|
3252
3308
|
score: Math.round(result.score * 100),
|
|
3253
3309
|
violations: result.violations,
|
|
3254
3310
|
warnings: result.warnings,
|
|
3255
|
-
summary:
|
|
3311
|
+
summary: getGuardrailEngine().format(result)
|
|
3256
3312
|
}, null, 2) + nudge
|
|
3257
3313
|
}]
|
|
3258
3314
|
};
|
|
@@ -3509,7 +3565,7 @@ export class MCPAdapter {
|
|
|
3509
3565
|
return { path: resolved, sizeBytes: 0 };
|
|
3510
3566
|
}
|
|
3511
3567
|
}).filter(f => f.sizeBytes > 0);
|
|
3512
|
-
const { plan, assembly, budgetConfig } =
|
|
3568
|
+
const { plan, assembly, budgetConfig } = getTokenEngine().hypertuneMax(task, files);
|
|
3513
3569
|
const planText = formatReadingPlan(plan);
|
|
3514
3570
|
const assemblyText = ContextAssembler.format(assembly, budgetConfig);
|
|
3515
3571
|
const savings = plan.savings;
|
|
@@ -4480,9 +4536,9 @@ export class MCPAdapter {
|
|
|
4480
4536
|
throw new McpError(ErrorCode.InvalidParams, "Tokens array cannot be empty");
|
|
4481
4537
|
}
|
|
4482
4538
|
const task = "mcp_compression_request";
|
|
4483
|
-
const encoding =
|
|
4539
|
+
const encoding = getCasEngine().encode(tokens, task);
|
|
4484
4540
|
// Trigger learning of the provided text as a pattern
|
|
4485
|
-
|
|
4541
|
+
getCasEngine().learnPattern(tokens.join(' '), 1);
|
|
4486
4542
|
return {
|
|
4487
4543
|
content: [{
|
|
4488
4544
|
type: 'text',
|
|
@@ -4491,7 +4547,7 @@ export class MCPAdapter {
|
|
|
4491
4547
|
};
|
|
4492
4548
|
}
|
|
4493
4549
|
case 'nexus_kv_bridge_status': {
|
|
4494
|
-
const metrics =
|
|
4550
|
+
const metrics = getKvBridge().getMetrics();
|
|
4495
4551
|
const text = `🌉 KV Bridge Status\n` +
|
|
4496
4552
|
`Decisions: ${metrics.totalDecisions}\n` +
|
|
4497
4553
|
`Merge Rate: ${(metrics.mergeRate * 100).toFixed(1)}%\n` +
|
|
@@ -4511,7 +4567,7 @@ export class MCPAdapter {
|
|
|
4511
4567
|
entropy: 0.2,
|
|
4512
4568
|
taskEmbedding: [1.0, 0.5]
|
|
4513
4569
|
}));
|
|
4514
|
-
const result = await
|
|
4570
|
+
const result = await getKvBridge().adaptToTask(taskType, mockFeatures);
|
|
4515
4571
|
return {
|
|
4516
4572
|
content: [{
|
|
4517
4573
|
type: 'text',
|
|
@@ -4581,7 +4637,7 @@ export class MCPAdapter {
|
|
|
4581
4637
|
const findings = Array.isArray(request.params.arguments?.findings) ? request.params.arguments.findings : [];
|
|
4582
4638
|
const confidence = Number(request.params.arguments?.confidence ?? 0.9);
|
|
4583
4639
|
const trace = { taskId, goal, findings, confidence, timestamp: Date.now() };
|
|
4584
|
-
const result = await
|
|
4640
|
+
const result = await getFederation().publishTrace(trace);
|
|
4585
4641
|
return {
|
|
4586
4642
|
content: [{
|
|
4587
4643
|
type: 'text',
|