nexus-prime 3.1.0 → 3.2.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.
Files changed (50) hide show
  1. package/README.md +21 -4
  2. package/dist/agents/adapters/mcp.d.ts.map +1 -1
  3. package/dist/agents/adapters/mcp.js +244 -3
  4. package/dist/agents/adapters/mcp.js.map +1 -1
  5. package/dist/cli.js +16 -0
  6. package/dist/cli.js.map +1 -1
  7. package/dist/dashboard/index.html +455 -722
  8. package/dist/dashboard/server.d.ts +13 -14
  9. package/dist/dashboard/server.d.ts.map +1 -1
  10. package/dist/dashboard/server.js +97 -29
  11. package/dist/dashboard/server.js.map +1 -1
  12. package/dist/engines/index.d.ts +5 -2
  13. package/dist/engines/index.d.ts.map +1 -1
  14. package/dist/engines/index.js +2 -1
  15. package/dist/engines/index.js.map +1 -1
  16. package/dist/engines/memory.d.ts +1 -0
  17. package/dist/engines/memory.d.ts.map +1 -1
  18. package/dist/engines/memory.js +8 -0
  19. package/dist/engines/memory.js.map +1 -1
  20. package/dist/engines/nxl-interpreter.d.ts +5 -0
  21. package/dist/engines/nxl-interpreter.d.ts.map +1 -1
  22. package/dist/engines/nxl-interpreter.js +19 -0
  23. package/dist/engines/nxl-interpreter.js.map +1 -1
  24. package/dist/engines/runtime-assets.d.ts +60 -0
  25. package/dist/engines/runtime-assets.d.ts.map +1 -0
  26. package/dist/engines/runtime-assets.js +252 -0
  27. package/dist/engines/runtime-assets.js.map +1 -0
  28. package/dist/engines/runtime-backends.d.ts +50 -8
  29. package/dist/engines/runtime-backends.d.ts.map +1 -1
  30. package/dist/engines/runtime-backends.js +168 -0
  31. package/dist/engines/runtime-backends.js.map +1 -1
  32. package/dist/engines/skill-runtime.d.ts +24 -17
  33. package/dist/engines/skill-runtime.d.ts.map +1 -1
  34. package/dist/engines/skill-runtime.js +158 -11
  35. package/dist/engines/skill-runtime.js.map +1 -1
  36. package/dist/engines/workflow-runtime.d.ts +78 -0
  37. package/dist/engines/workflow-runtime.d.ts.map +1 -0
  38. package/dist/engines/workflow-runtime.js +288 -0
  39. package/dist/engines/workflow-runtime.js.map +1 -0
  40. package/dist/index.d.ts +1 -0
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +12 -4
  43. package/dist/index.js.map +1 -1
  44. package/dist/phantom/index.d.ts +1 -1
  45. package/dist/phantom/index.d.ts.map +1 -1
  46. package/dist/phantom/runtime.d.ts +86 -8
  47. package/dist/phantom/runtime.d.ts.map +1 -1
  48. package/dist/phantom/runtime.js +487 -120
  49. package/dist/phantom/runtime.js.map +1 -1
  50. package/package.json +2 -2
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  <h1>🧬 Nexus Prime</h1>
3
3
  <p><strong>The Cognitive Operating System for Multi-Agent Swarms</strong></p>
4
4
 
5
- [![Version](https://img.shields.io/badge/version-3.0.0-00ff88?style=for-the-badge&logoRepository=nexus-prime)](https://github.com/sir-ad/nexus-prime/releases)
5
+ [![Version](https://img.shields.io/badge/version-3.2.0-00ff88?style=for-the-badge&logoRepository=nexus-prime)](https://github.com/sir-ad/nexus-prime/releases)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-00d4ff?style=for-the-badge)](LICENSE)
7
7
  [![Agentic OS](https://img.shields.io/badge/Ecosystem-Agentic_OS-8b5cf6?style=for-the-badge)](https://github.com/topics/agentic-os)
8
8
  [![Build Status](https://img.shields.io/badge/build-passing-success?style=for-the-badge)](https://github.com/sir-ad/nexus-prime/actions)
@@ -29,7 +29,7 @@ npx nexus-prime mcp
29
29
 
30
30
  ---
31
31
 
32
- **Nexus Prime** is an autonomous, hyper-optimized, distributed, Byzantine-fault-tolerant cognitive operating system. Exposed as an MCP (Model Context Protocol) server or integrated programmatically, it provides single and multi-agent systems with **permanent memory, mathematically optimized context limits, safety guardrails, and massively parallel Git-worktree execution.**
32
+ **Nexus Prime** is a local-first coding-agent operating system. Exposed as an MCP (Model Context Protocol) server or integrated programmatically, it provides single and multi-agent systems with **persistent memory, selectable runtime backends, guarded live skills, workflow artifacts, a live dashboard, and parallel Git-worktree execution with verification.**
33
33
 
34
34
  ---
35
35
 
@@ -169,7 +169,18 @@ Formulates file-reading as a **Greedy Knapsack Problem**, solving for maximum in
169
169
  Parallelize complex tasks using isolated Git Worktrees. Ghost Pass performs read-only risk analysis, coder workers execute real file mutations in detached worktrees, verifier workers run build/test commands independently, and the Merge Oracle selects the final patch with an auditable artifact trail.
170
170
  </details>
171
171
 
172
- ### 4. Quantum-Inspired Entanglement (Phase 9A)
172
+ ### 4. Live Skills, Workflows, and Derivation
173
+ <details>
174
+ <summary><b>View Details</b></summary>
175
+ Nexus Prime now ships bundled domain skill packs and workflow packs for **marketing, product, backend, frontend, sales, finance, workflows, and orchestration**. Runs can generate new skills and workflows, deploy them at runtime checkpoints, and promote them only after verifier evidence plus multi-tier consensus.
176
+ </details>
177
+
178
+ ### 5. Runtime Console
179
+ <details>
180
+ <summary><b>View Details</b></summary>
181
+ The built-in dashboard exposes active and recent runs, worker states, verifier results, backend catalogs, skills, workflows, live events, and docs/release health from the same runtime ledger that powers CLI and MCP execution.
182
+ </details>
183
+ ### 6. Quantum-Inspired Entanglement (Phase 9A)
173
184
  <details>
174
185
  <summary><b>View Details</b></summary>
175
186
  Agents share mathematical state in a high-dimensional Hilbert space. When an agent acts, the shared probabilistic state collapses, causing entangled agents to automatically make correlated decisions across the swarm without explicit communication overhead.
@@ -177,7 +188,7 @@ Agents share mathematical state in a high-dimensional Hilbert space. When an age
177
188
 
178
189
  ---
179
190
 
180
- ## 🛠️ MCP Tooling Checklist (v1.5)
191
+ ## 🛠️ MCP Tooling Checklist
181
192
 
182
193
  Nexus Prime exposes 20 native MCP tools that any agent can invoke. Below are key examples:
183
194
 
@@ -189,6 +200,9 @@ Nexus Prime exposes 20 native MCP tools that any agent can invoke. Below are key
189
200
  | `nexus_spawn_workers` | Execute parallel worktree swarm with verification and artifacts | Autonomy |
190
201
  | `nexus_mindkit_check` | Guardrail validation | Safety |
191
202
  | `nexus_ghost_pass` | Pre-flight risk analysis | Analysis |
203
+ | `nexus_run_status` | Inspect run ledger state | Runtime |
204
+ | `nexus_skill_generate` | Generate deployable runtime skills | Runtime |
205
+ | `nexus_workflow_run` | Execute workflow artifacts | Runtime |
192
206
  | `nexus_entangle` | Measure entangled agent state | Quantum |
193
207
 
194
208
  ### Real Runtime Execution
@@ -197,6 +211,9 @@ Nexus Prime exposes 20 native MCP tools that any agent can invoke. Below are key
197
211
  nexus-prime execute <agent-id> "apply runtime patch" \
198
212
  --files README.md package.json \
199
213
  --verify "npm run build" \
214
+ --skills backend-playbook orchestration-playbook \
215
+ --workflows backend-execution-loop \
216
+ --compression-backend meta-compression \
200
217
  --actions-file ./actions.json
201
218
 
202
219
  # Execute an NXL graph directly
@@ -1 +1 @@
1
- {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/agents/adapters/mcp.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AA4K5C,qBAAa,UAAW,YAAW,OAAO;IACtC,IAAI,SAAS;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;IAElC,OAAO,CAAC,GAAG;;IAkBX,WAAW,CAAC,KAAK,EAAE,UAAU;IAI7B,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,iBAAiB;YAoWX,cAAc;IAu1B5B,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;IAkB3B,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IACnD,OAAO,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;CAC1C"}
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/agents/adapters/mcp.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AA0K5C,qBAAa,UAAW,YAAW,OAAO;IACtC,IAAI,SAAS;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;IAElC,OAAO,CAAC,GAAG;;IAkBX,WAAW,CAAC,KAAK,EAAE,UAAU;IAI7B,OAAO,CAAC,UAAU;IAYlB,OAAO,CAAC,iBAAiB;YAgcX,cAAc;IAk/B5B,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;IAkB3B,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IACnD,OAAO,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;CAC1C"}
@@ -281,7 +281,13 @@ export class MCPAdapter {
281
281
  workers: { type: 'number', description: 'Number of phantom workers to spawn (max 7)', default: 3 },
282
282
  verify: { type: 'array', items: { type: 'string' }, description: 'Verification commands to run in verifier worktrees' },
283
283
  strategies: { type: 'array', items: { type: 'string' }, description: 'Optional worker strategies such as minimal, standard, thorough' },
284
- actions: { type: 'array', items: { type: 'object' }, description: 'Optional runtime actions or skill bindings to execute in worker worktrees' }
284
+ actions: { type: 'array', items: { type: 'object' }, description: 'Optional runtime actions or skill bindings to execute in worker worktrees' },
285
+ skills: { type: 'array', items: { type: 'string' }, description: 'Runtime skill selectors' },
286
+ workflows: { type: 'array', items: { type: 'string' }, description: 'Workflow selectors' },
287
+ memoryBackend: { type: 'string', description: 'Memory backend selector' },
288
+ compressionBackend: { type: 'string', description: 'Compression backend selector' },
289
+ dslCompiler: { type: 'string', description: 'DSL compiler selector' },
290
+ backendMode: { type: 'string', enum: ['default', 'shadow', 'experimental'], description: 'Backend execution mode' }
285
291
  },
286
292
  required: ['goal', 'files'],
287
293
  },
@@ -351,6 +357,92 @@ export class MCPAdapter {
351
357
  required: ['card'],
352
358
  },
353
359
  },
360
+ {
361
+ name: 'nexus_skill_generate',
362
+ description: 'Generate a live runtime skill artifact that can be deployed to future runs or promoted after evidence-backed execution.',
363
+ inputSchema: {
364
+ type: 'object',
365
+ properties: {
366
+ name: { type: 'string', description: 'Skill name' },
367
+ instructions: { type: 'string', description: 'Instructions for the generated skill' },
368
+ riskClass: { type: 'string', enum: ['read', 'orchestrate', 'mutate'], description: 'Risk class for the skill' },
369
+ scope: { type: 'string', enum: ['session', 'worker', 'global'], description: 'Initial scope for the skill' }
370
+ },
371
+ required: ['name', 'instructions'],
372
+ },
373
+ },
374
+ {
375
+ name: 'nexus_skill_deploy',
376
+ description: 'Promote or deploy a live runtime skill artifact so future runs can activate it.',
377
+ inputSchema: {
378
+ type: 'object',
379
+ properties: {
380
+ skillId: { type: 'string', description: 'Skill artifact ID or exact name' },
381
+ scope: { type: 'string', enum: ['session', 'worker', 'global'], description: 'Deployment scope' }
382
+ },
383
+ required: ['skillId'],
384
+ },
385
+ },
386
+ {
387
+ name: 'nexus_skill_revoke',
388
+ description: 'Revoke a live runtime skill artifact.',
389
+ inputSchema: {
390
+ type: 'object',
391
+ properties: {
392
+ skillId: { type: 'string', description: 'Skill artifact ID or exact name' }
393
+ },
394
+ required: ['skillId'],
395
+ },
396
+ },
397
+ {
398
+ name: 'nexus_workflow_generate',
399
+ description: 'Generate a workflow artifact that can be deployed to runs or promoted through runtime evidence.',
400
+ inputSchema: {
401
+ type: 'object',
402
+ properties: {
403
+ name: { type: 'string', description: 'Workflow name' },
404
+ description: { type: 'string', description: 'Workflow description' },
405
+ domain: { type: 'string', description: 'Optional workflow domain' },
406
+ scope: { type: 'string', enum: ['session', 'worker', 'global'], description: 'Initial workflow scope' }
407
+ },
408
+ required: ['name', 'description'],
409
+ },
410
+ },
411
+ {
412
+ name: 'nexus_workflow_deploy',
413
+ description: 'Deploy or promote a workflow artifact for future runs.',
414
+ inputSchema: {
415
+ type: 'object',
416
+ properties: {
417
+ workflowId: { type: 'string', description: 'Workflow artifact ID or exact name' },
418
+ scope: { type: 'string', enum: ['session', 'worker', 'global'], description: 'Deployment scope' }
419
+ },
420
+ required: ['workflowId'],
421
+ },
422
+ },
423
+ {
424
+ name: 'nexus_workflow_run',
425
+ description: 'Run a workflow artifact through the real execution runtime.',
426
+ inputSchema: {
427
+ type: 'object',
428
+ properties: {
429
+ workflowId: { type: 'string', description: 'Workflow artifact ID or exact name' },
430
+ goal: { type: 'string', description: 'Optional override goal' }
431
+ },
432
+ required: ['workflowId'],
433
+ },
434
+ },
435
+ {
436
+ name: 'nexus_run_status',
437
+ description: 'Return the current recorded state of a runtime execution run.',
438
+ inputSchema: {
439
+ type: 'object',
440
+ properties: {
441
+ runId: { type: 'string', description: 'Execution run ID' }
442
+ },
443
+ required: ['runId'],
444
+ },
445
+ },
354
446
  // ── Darwin Loop ──────────────────────────────────────────────────
355
447
  {
356
448
  name: 'nexus_darwin_propose',
@@ -758,14 +850,36 @@ export class MCPAdapter {
758
850
  const actions = Array.isArray(request.params.arguments?.actions)
759
851
  ? request.params.arguments.actions
760
852
  : [];
853
+ const skills = Array.isArray(request.params.arguments?.skills)
854
+ ? request.params.arguments.skills.map(String)
855
+ : undefined;
856
+ const workflows = Array.isArray(request.params.arguments?.workflows)
857
+ ? request.params.arguments.workflows.map(String)
858
+ : undefined;
859
+ const memoryBackend = request.params.arguments?.memoryBackend
860
+ ? String(request.params.arguments.memoryBackend)
861
+ : undefined;
862
+ const compressionBackend = request.params.arguments?.compressionBackend
863
+ ? String(request.params.arguments.compressionBackend)
864
+ : undefined;
865
+ const dslCompiler = request.params.arguments?.dslCompiler
866
+ ? String(request.params.arguments.dslCompiler)
867
+ : undefined;
868
+ const backendMode = request.params.arguments?.backendMode
869
+ ? String(request.params.arguments.backendMode)
870
+ : undefined;
761
871
  const execution = await this.getRuntime().run({
762
872
  goal,
763
873
  files: rawFiles,
764
874
  workers: workersCount,
765
- roles: ['planner', 'coder', 'verifier'],
875
+ roles: ['planner', 'coder', 'verifier', 'skill-maker', 'research-shadow'],
766
876
  verifyCommands,
767
877
  strategies,
768
878
  actions,
879
+ skillNames: skills,
880
+ workflowSelectors: workflows,
881
+ backendSelectors: { memoryBackend, compressionBackend, dslCompiler },
882
+ backendMode,
769
883
  });
770
884
  const verifiedWorkers = execution.workerResults.filter(result => result.verified).length;
771
885
  const modifiedFiles = execution.workerResults.reduce((sum, result) => sum + result.modifiedFiles.length, 0);
@@ -806,8 +920,11 @@ export class MCPAdapter {
806
920
  `Modified Files: ${modifiedFiles}`,
807
921
  `Decision: ${execution.finalDecision?.action ?? 'none'}`,
808
922
  `Recommended Strategy: ${execution.finalDecision?.recommendedStrategy ?? 'n/a'}`,
923
+ `Planner: ${execution.plannerResult?.summary ?? 'n/a'}`,
809
924
  `Backends: memory=${execution.selectedBackends.memoryBackend}, compression=${execution.selectedBackends.compressionBackend}, consensus=${execution.selectedBackends.consensusPolicy}, dsl=${execution.selectedBackends.dslCompiler}`,
810
925
  `Active Skills: ${execution.activeSkills.length > 0 ? execution.activeSkills.map(skill => `${skill.name}(${skill.riskClass})`).join(', ') : 'none'}`,
926
+ `Active Workflows: ${execution.activeWorkflows.length > 0 ? execution.activeWorkflows.map(workflow => workflow.name).join(', ') : 'none'}`,
927
+ `Promotions: ${execution.promotionDecisions.length > 0 ? execution.promotionDecisions.map(decision => `${decision.kind}:${decision.target}:${decision.approved ? 'approved' : 'held'}`).join(', ') : 'none'}`,
811
928
  '',
812
929
  `Result: ${execution.result}`
813
930
  ].join('\n')
@@ -977,6 +1094,127 @@ export class MCPAdapter {
977
1094
  }]
978
1095
  };
979
1096
  }
1097
+ case 'nexus_skill_generate': {
1098
+ const name = String(request.params.arguments?.name ?? '');
1099
+ const instructions = String(request.params.arguments?.instructions ?? '');
1100
+ const riskClass = String(request.params.arguments?.riskClass ?? 'orchestrate');
1101
+ const scope = String(request.params.arguments?.scope ?? 'session');
1102
+ const artifact = this.getRuntime().generateSkill({ name, instructions, riskClass, scope, provenance: 'mcp:generate' });
1103
+ this.sessionDNA.recordSkillLearned(artifact.name);
1104
+ return {
1105
+ content: [{
1106
+ type: 'text',
1107
+ text: `🧠 Runtime skill generated\nID: ${artifact.skillId}\nName: ${artifact.name}\nRisk: ${artifact.riskClass}\nScope: ${artifact.scope}\nProvenance: ${artifact.provenance}`,
1108
+ }],
1109
+ };
1110
+ }
1111
+ case 'nexus_skill_deploy': {
1112
+ const skillId = String(request.params.arguments?.skillId ?? '');
1113
+ const scope = String(request.params.arguments?.scope ?? 'session');
1114
+ const runtime = this.getRuntime();
1115
+ const known = runtime.listSkills().find((skill) => skill.skillId === skillId || skill.name === skillId);
1116
+ const artifact = known ? runtime.deploySkill(known.skillId, scope) : undefined;
1117
+ if (!artifact) {
1118
+ return { content: [{ type: 'text', text: `❌ Skill not found: ${skillId}` }] };
1119
+ }
1120
+ this.sessionDNA.recordSkill(artifact.name);
1121
+ return {
1122
+ content: [{
1123
+ type: 'text',
1124
+ text: `🚚 Runtime skill deployed\nID: ${artifact.skillId}\nName: ${artifact.name}\nScope: ${artifact.scope}\nRollout: ${artifact.rolloutStatus}`,
1125
+ }],
1126
+ };
1127
+ }
1128
+ case 'nexus_skill_revoke': {
1129
+ const skillId = String(request.params.arguments?.skillId ?? '');
1130
+ const runtime = this.getRuntime();
1131
+ const known = runtime.listSkills().find((skill) => skill.skillId === skillId || skill.name === skillId);
1132
+ const artifact = known ? runtime.revokeSkill(known.skillId) : undefined;
1133
+ if (!artifact) {
1134
+ return { content: [{ type: 'text', text: `❌ Skill not found: ${skillId}` }] };
1135
+ }
1136
+ return {
1137
+ content: [{
1138
+ type: 'text',
1139
+ text: `🧯 Runtime skill revoked\nID: ${artifact.skillId}\nName: ${artifact.name}\nRollout: ${artifact.rolloutStatus}`,
1140
+ }],
1141
+ };
1142
+ }
1143
+ case 'nexus_workflow_generate': {
1144
+ const name = String(request.params.arguments?.name ?? '');
1145
+ const description = String(request.params.arguments?.description ?? '');
1146
+ const domain = request.params.arguments?.domain ? String(request.params.arguments?.domain) : undefined;
1147
+ const scope = String(request.params.arguments?.scope ?? 'session');
1148
+ const artifact = this.getRuntime().generateWorkflow({ name, description, domain, scope });
1149
+ return {
1150
+ content: [{
1151
+ type: 'text',
1152
+ text: `🧭 Workflow generated\nID: ${artifact.workflowId}\nName: ${artifact.name}\nDomain: ${artifact.domain}\nScope: ${artifact.scope}`,
1153
+ }],
1154
+ };
1155
+ }
1156
+ case 'nexus_workflow_deploy': {
1157
+ const workflowId = String(request.params.arguments?.workflowId ?? '');
1158
+ const scope = String(request.params.arguments?.scope ?? 'session');
1159
+ const runtime = this.getRuntime();
1160
+ const known = runtime.listWorkflows().find((workflow) => workflow.workflowId === workflowId || workflow.name === workflowId);
1161
+ const artifact = known ? runtime.deployWorkflow(known.workflowId, scope) : undefined;
1162
+ if (!artifact) {
1163
+ return { content: [{ type: 'text', text: `❌ Workflow not found: ${workflowId}` }] };
1164
+ }
1165
+ return {
1166
+ content: [{
1167
+ type: 'text',
1168
+ text: `🚚 Workflow deployed\nID: ${artifact.workflowId}\nName: ${artifact.name}\nScope: ${artifact.scope}\nRollout: ${artifact.rolloutStatus}`,
1169
+ }],
1170
+ };
1171
+ }
1172
+ case 'nexus_workflow_run': {
1173
+ const workflowId = String(request.params.arguments?.workflowId ?? '');
1174
+ const goalOverride = request.params.arguments?.goal ? String(request.params.arguments.goal) : undefined;
1175
+ try {
1176
+ const execution = await this.getRuntime().runWorkflow(workflowId, goalOverride);
1177
+ return {
1178
+ content: [{
1179
+ type: 'text',
1180
+ text: [
1181
+ `🧭 Workflow Runtime — ${summarizeExecution(execution)}`,
1182
+ `Run ID: ${execution.runId}`,
1183
+ `Artifacts: ${execution.artifactsPath}`,
1184
+ `Decision: ${execution.finalDecision?.action ?? 'none'}`,
1185
+ `Workflows: ${execution.activeWorkflows.map((workflow) => workflow.name).join(', ') || 'none'}`,
1186
+ `Result: ${execution.result}`,
1187
+ ].join('\n'),
1188
+ }],
1189
+ };
1190
+ }
1191
+ catch (error) {
1192
+ return { content: [{ type: 'text', text: `❌ Workflow runtime error: ${error.message}` }] };
1193
+ }
1194
+ }
1195
+ case 'nexus_run_status': {
1196
+ const runId = String(request.params.arguments?.runId ?? '');
1197
+ const run = this.getRuntime().getRun(runId);
1198
+ if (!run) {
1199
+ return { content: [{ type: 'text', text: `❌ Run not found: ${runId}` }] };
1200
+ }
1201
+ return {
1202
+ content: [{
1203
+ type: 'text',
1204
+ text: JSON.stringify({
1205
+ runId: run.runId,
1206
+ state: run.state,
1207
+ result: run.result,
1208
+ artifactsPath: run.artifactsPath,
1209
+ workers: run.workerResults.length,
1210
+ verifiedWorkers: run.workerResults.filter((worker) => worker.verified).length,
1211
+ workflows: run.activeWorkflows.map((workflow) => workflow.name),
1212
+ promotions: run.promotionDecisions,
1213
+ backends: run.selectedBackends,
1214
+ }, null, 2),
1215
+ }],
1216
+ };
1217
+ }
980
1218
  case 'nexus_darwin_propose': {
981
1219
  const hypothesis = String(request.params.arguments?.hypothesis ?? '');
982
1220
  const targetFile = String(request.params.arguments?.targetFile ?? '');
@@ -1238,8 +1476,11 @@ export class MCPAdapter {
1238
1476
  `Workers: ${execution.workerResults.length}`,
1239
1477
  `Verified Workers: ${verifiedWorkers}`,
1240
1478
  `Decision: ${execution.finalDecision?.action ?? 'none'}`,
1479
+ `Planner: ${execution.plannerResult?.summary ?? 'n/a'}`,
1241
1480
  `Backends: memory=${execution.selectedBackends.memoryBackend}, compression=${execution.selectedBackends.compressionBackend}, consensus=${execution.selectedBackends.consensusPolicy}, dsl=${execution.selectedBackends.dslCompiler}`,
1242
1481
  `Active Skills: ${execution.activeSkills.length > 0 ? execution.activeSkills.map(skill => skill.name).join(', ') : 'none'}`,
1482
+ `Active Workflows: ${execution.activeWorkflows.length > 0 ? execution.activeWorkflows.map(workflow => workflow.name).join(', ') : 'none'}`,
1483
+ `Promotions: ${execution.promotionDecisions.length > 0 ? execution.promotionDecisions.map(decision => `${decision.kind}:${decision.target}:${decision.approved ? 'approved' : 'held'}`).join(', ') : 'none'}`,
1243
1484
  '',
1244
1485
  `Result: ${execution.result}`
1245
1486
  ].join('\n')
@@ -1295,7 +1536,7 @@ export class MCPAdapter {
1295
1536
  const transport = new StdioServerTransport();
1296
1537
  await this.server.connect(transport);
1297
1538
  this.connected = true;
1298
- console.error('[MCP Adapter] Connected — 16 tools active');
1539
+ console.error('[MCP Adapter] Connected — runtime tools active');
1299
1540
  }
1300
1541
  async disconnect() {
1301
1542
  // Auto-flush Session DNA on disconnect