nexus-prime 7.9.24 → 7.9.25

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.
@@ -280,9 +280,10 @@ export function buildMcpToolDefinitions() {
280
280
  specialists: { type: 'array', items: { type: 'string' }, description: 'Optional hard specialist selectors' },
281
281
  optimizationProfile: { type: 'string', enum: ['standard', 'max'], description: 'Planner optimization profile override' },
282
282
  executionPreset: { type: 'string', enum: ['fast', 'balanced', 'deep', 'release'], description: 'Optional execution preset that maps orchestration depth, verification strictness, and backend routing' },
283
- background: { type: 'boolean', description: 'When true, return a queued receipt immediately and let the run continue in the async gate.' },
283
+ background: { type: 'boolean', description: 'Compatibility flag; nexus_orchestrate already returns a queued hiring preflight by default and continues in the async gate.' },
284
284
  async: { type: 'boolean', description: 'Alias for background; useful for clients that prefer explicit async orchestration.' },
285
- waitMs: { type: 'number', description: 'Optional bounded wait before returning a queued receipt. Clamped to 45 seconds; normal orchestrate calls default to 15 seconds.' }
285
+ waitMs: { type: 'number', description: 'Advanced/debug bounded wait for inline execution. Clamped to 45 seconds; normal orchestrate calls return a queued preflight immediately.' },
286
+ inline: { type: 'boolean', description: 'Advanced/debug only: wait for inline orchestrate output instead of the default fast queued preflight.' }
286
287
  },
287
288
  required: ['prompt'],
288
289
  },
@@ -100,6 +100,9 @@ function coerceBoundedWaitMs(value) {
100
100
  function shouldReturnQueuedReceipt(toolName, args) {
101
101
  if (!SLOW_TOOLS.has(toolName))
102
102
  return false;
103
+ if (toolName === 'nexus_orchestrate') {
104
+ return !isTruthyFlag(args.inline) && !isTruthyFlag(args.sync) && !isTruthyFlag(args.blocking);
105
+ }
103
106
  return isTruthyFlag(args.background)
104
107
  || isTruthyFlag(args.async)
105
108
  || isTruthyFlag(args.queue)
@@ -157,29 +160,35 @@ function inferQueuedOrchestratePreview(args, runId) {
157
160
  ...asStringList(args.skillNames),
158
161
  ...extractLinkedSelectors(prompt, '$'),
159
162
  ], 20);
163
+ const isRuntimeControlPlane = /orchestrat|synapse|architect|runtime|mcp|dispatch|route|routing|queue|queued|scheduler|model routing|worker|hiring|workflow selection|token|budget|memory|lifecycle/.test(lower);
164
+ const wantsResearch = /research|paper|literature|deep-research|source-grounded|cited/.test(lower);
165
+ const wantsMemory = /memory|recall|learning|decay|graph|mcp/.test(lower);
166
+ const wantsPerf = /fast|faster|millisecond|latency|performance|budget|token|optim/i.test(lower);
160
167
  const workflows = uniqueList([
161
168
  ...asStringList(args.workflows),
162
169
  ...asStringList(args.workflowSelectors),
163
- lower.match(/orchestrat|route|dispatch|queue|queued/) ? 'orchestration-runtime-workflow' : undefined,
164
- lower.match(/synapse|hiring|operative|sortie/) ? 'synapse-mandate-workflow' : undefined,
165
- lower.match(/memory|recall|learning|decay|graph/) ? 'memory-lifecycle-workflow' : undefined,
166
- lower.match(/token|budget|optim/i) ? 'token-budget-workflow' : undefined,
167
- lower.match(/dashboard|board|ui|ux/) ? 'dashboard-observability-workflow' : undefined,
170
+ isRuntimeControlPlane ? 'orchestration-execution-loop' : undefined,
171
+ isRuntimeControlPlane ? 'backend-execution-loop' : undefined,
172
+ isRuntimeControlPlane ? 'testing-execution-loop' : undefined,
173
+ isRuntimeControlPlane && !wantsResearch ? 'typescript-execution-loop' : undefined,
174
+ wantsResearch ? 'research-and-implement' : undefined,
175
+ lower.match(/dashboard|board|ui|ux/) && !isRuntimeControlPlane ? 'frontend-execution-loop' : undefined,
168
176
  ], 8);
169
177
  const specialists = uniqueList([
170
178
  ...asStringList(args.specialists),
171
- lower.match(/orchestrat|route|dispatch|queue|queued/) ? 'Orchestrator Runtime Engineer' : undefined,
172
- lower.match(/synapse|hiring|operative|sortie/) ? 'Synapse Runtime Engineer' : undefined,
173
- lower.match(/memory|recall|learning|decay|graph/) ? 'Memory Systems Engineer' : undefined,
174
- lower.match(/token|budget|optim/i) ? 'Token Budget Engineer' : undefined,
175
- lower.match(/dashboard|board|ui|ux/) ? 'Dashboard UX Engineer' : undefined,
179
+ isRuntimeControlPlane ? 'Agents Orchestrator' : undefined,
180
+ isRuntimeControlPlane ? 'Backend Architect' : undefined,
181
+ isRuntimeControlPlane ? 'Workflow Optimizer' : undefined,
182
+ wantsPerf ? 'Performance Benchmarker' : undefined,
183
+ wantsMemory && !wantsPerf ? 'Backend Architect' : undefined,
184
+ lower.match(/dashboard|board|ui|ux/) && !isRuntimeControlPlane ? 'Frontend Developer' : undefined,
176
185
  lower.match(/test|verify|qa|release|publish/) ? 'Verification Engineer' : undefined,
177
186
  ], 8);
178
187
  const crew = String(args.crew ?? args.selectedCrew ?? (lower.match(/orchestrat|synapse|runtime|mcp|dispatch|queue|queued/)
179
- ? 'Runtime Reliability Crew'
180
- : lower.match(/memory|token|dashboard/)
181
- ? 'Control Plane Quality Crew'
182
- : 'Nexus Implementation Crew'));
188
+ ? 'Implementation Crew'
189
+ : lower.match(/research|paper|literature/)
190
+ ? 'Research Crew'
191
+ : 'Implementation Crew'));
183
192
  const risk = lower.match(/fix|broken|bug|doesn.?t|failed|queued|runtime|synapse|orchestrat/) ? 'high' : 'medium';
184
193
  const task = {
185
194
  goal: prompt,
@@ -183,6 +183,8 @@ export declare class OrchestratorEngine {
183
183
  private searchIndexedRepoCandidates;
184
184
  private toFileRef;
185
185
  private resolveSelections;
186
+ private inferRuntimeCatalogHints;
187
+ private filterExistingCatalogSelectors;
186
188
  private getSkillCatalogItems;
187
189
  private getWorkflowCatalogItems;
188
190
  private getHookCatalogItems;
@@ -2382,10 +2382,16 @@ export class OrchestratorEngine {
2382
2382
  limit: 5,
2383
2383
  selector: 'name',
2384
2384
  });
2385
- const workflowSelection = this.resolveCatalogVotes('workflow', task, intent, options.workflowSelectors?.length ? allWorkflowItems : workflowItems, {
2385
+ const runtimeCatalogHints = this.inferRuntimeCatalogHints(task, intent, {
2386
+ workflows: allWorkflowItems,
2387
+ specialists: allSpecialistItems,
2388
+ crews: allCrewItems,
2389
+ });
2390
+ const workflowSelection = this.resolveCatalogVotes('workflow', task, intent, options.workflowSelectors?.length || runtimeCatalogHints.workflows.length ? allWorkflowItems : workflowItems, {
2386
2391
  explicit: options.workflowSelectors,
2387
2392
  planner: planner.selectedWorkflows,
2388
2393
  knowledge: knowledgeFabric.recommendations.workflows,
2394
+ runtime: runtimeCatalogHints.workflows,
2389
2395
  scorerLimit: 4,
2390
2396
  limit: 4,
2391
2397
  selector: 'name',
@@ -2423,18 +2429,20 @@ export class OrchestratorEngine {
2423
2429
  limit: intent.taskType === 'release' || this.sessionState.repeatedFailures > 0 ? 3 : 2,
2424
2430
  selector: 'name',
2425
2431
  });
2426
- const specialistSelection = this.resolveCatalogVotes('specialist', task, intent, options.specialistSelectors?.length ? allSpecialistItems : specialistItems, {
2432
+ const specialistSelection = this.resolveCatalogVotes('specialist', task, intent, options.specialistSelectors?.length || runtimeCatalogHints.specialists.length ? allSpecialistItems : specialistItems, {
2427
2433
  explicit: options.specialistSelectors,
2428
2434
  planner: planner.selectedSpecialists.map((specialist) => specialist.specialistId),
2429
2435
  knowledge: knowledgeFabric.recommendations.specialists,
2436
+ runtime: runtimeCatalogHints.specialists,
2430
2437
  scorerLimit: 4,
2431
2438
  limit: 4,
2432
2439
  selector: 'id',
2433
2440
  });
2434
- const crewSelection = this.resolveCatalogVotes('crew', task, intent, options.crewSelectors?.length ? allCrewItems : crewItems, {
2441
+ const crewSelection = this.resolveCatalogVotes('crew', task, intent, options.crewSelectors?.length || runtimeCatalogHints.crews.length ? allCrewItems : crewItems, {
2435
2442
  explicit: options.crewSelectors,
2436
2443
  planner: planner.selectedCrew ? [planner.selectedCrew.crewId] : [],
2437
2444
  knowledge: knowledgeFabric.recommendations.crews,
2445
+ runtime: runtimeCatalogHints.crews,
2438
2446
  scorerLimit: 2,
2439
2447
  limit: 1,
2440
2448
  selector: 'id',
@@ -2504,6 +2512,47 @@ export class OrchestratorEngine {
2504
2512
  },
2505
2513
  };
2506
2514
  }
2515
+ inferRuntimeCatalogHints(task, intent, catalog) {
2516
+ const lower = task.toLowerCase();
2517
+ const isControlPlane = /\b(orchestrat(?:e|or|ion)|synapse|architects?|mcp|dispatch|routing|route|queued?|queue|scheduler|runtime|control plane|agentflow|worker|hiring|specialist|crew|workflow selection|model routing|token budget|memory hook|memory graph|lifecycle)\b/.test(lower);
2518
+ if (!isControlPlane) {
2519
+ return { workflows: [], specialists: [], crews: [] };
2520
+ }
2521
+ const wantsResearch = /\b(research|papers?|literature|source-grounded|cited|deep-research)\b/.test(lower);
2522
+ const wantsMemory = /\b(memory|recall|learning|decay|graph|mcp)\b/.test(lower);
2523
+ const wantsPerf = /\b(fast|faster|milliseconds?|latency|performance|budget|token|optim(?:i|is|iz))\b/.test(lower);
2524
+ const readOnlyResearch = intent.taskType === 'research'
2525
+ && !/\b(fix|patch|implement|refactor|change|add|wire|ship|deploy|release|mutate|improve)\b/.test(lower);
2526
+ const workflowSelectors = [
2527
+ 'orchestration-execution-loop',
2528
+ 'backend-execution-loop',
2529
+ 'testing-execution-loop',
2530
+ wantsResearch ? 'research-and-implement' : 'typescript-execution-loop',
2531
+ ];
2532
+ const specialistSelectors = [
2533
+ 'specialist_specialized-agents-orchestrator',
2534
+ 'specialist_engineering-engineering-backend-architect',
2535
+ 'specialist_testing-testing-workflow-optimizer',
2536
+ wantsPerf
2537
+ ? 'specialist_testing-testing-performance-benchmarker'
2538
+ : wantsMemory
2539
+ ? 'specialist_integrations-mcp-memory-backend-architect-with-memory'
2540
+ : undefined,
2541
+ ];
2542
+ const crewSelectors = [
2543
+ readOnlyResearch ? 'crew_research' : 'crew_implementation',
2544
+ ];
2545
+ return {
2546
+ workflows: this.filterExistingCatalogSelectors(catalog.workflows, workflowSelectors, 'name'),
2547
+ specialists: this.filterExistingCatalogSelectors(catalog.specialists, specialistSelectors, 'id'),
2548
+ crews: this.filterExistingCatalogSelectors(catalog.crews, crewSelectors, 'id'),
2549
+ };
2550
+ }
2551
+ filterExistingCatalogSelectors(items, selectors, selector) {
2552
+ const existing = new Set(items.map((item) => selector === 'id' ? item.id : item.name));
2553
+ return dedupeStrings(selectors.filter((value) => Boolean(value)))
2554
+ .filter((value) => existing.has(value));
2555
+ }
2507
2556
  getSkillCatalogItems() {
2508
2557
  const skills = this.runtime.listSkillsForSelection();
2509
2558
  const signature = skills
@@ -2657,7 +2706,7 @@ export class OrchestratorEngine {
2657
2706
  applyVote(value, 'knowledge-fabric', 0.76, 'medium', 'Knowledge Fabric recommended this artifact from cross-source evidence.');
2658
2707
  });
2659
2708
  (input.runtime ?? []).forEach((value) => {
2660
- applyVote(value, 'runtime-resolver', 0.84, 'high', 'Runtime resolver matched this artifact against the registered catalog for the active goal.');
2709
+ applyVote(value, 'runtime-resolver', 2.0, 'high', 'Runtime resolver matched this artifact against the registered catalog for the active goal.');
2661
2710
  });
2662
2711
  this.pickCatalogEntries(task, intent, items, input.scorerLimit).forEach((entry) => {
2663
2712
  applyVote(input.selector === 'id' ? entry.item.id : entry.item.name, 'scorer', Math.min(0.7, entry.score / 10), entry.score >= 9 ? 'medium' : 'low', `Keyword scorer matched the task with score ${entry.score}.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexus-prime",
3
- "version": "7.9.24",
3
+ "version": "7.9.25",
4
4
  "description": "Local-first MCP control plane for coding agents with bootstrap-orchestrate execution, memory fabric, token budgeting, and worktree-backed swarms",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",