@nexus-cortex/core 4.51.0 → 4.51.1

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 (68) hide show
  1. package/dist/adapters/ChatCompletionsAPIAdapter.d.ts.map +1 -1
  2. package/dist/adapters/ChatCompletionsAPIAdapter.js +16 -0
  3. package/dist/adapters/ChatCompletionsAPIAdapter.js.map +1 -1
  4. package/dist/adapters/FormatAdapter.interface.d.ts +4 -4
  5. package/dist/adapters/FormatAdapter.interface.js +4 -4
  6. package/dist/adapters/ToolNamingHandler.d.ts +4 -4
  7. package/dist/adapters/ToolNamingHandler.js +4 -4
  8. package/dist/agents/AgentStore.d.ts.map +1 -1
  9. package/dist/agents/AgentStore.js +5 -2
  10. package/dist/agents/AgentStore.js.map +1 -1
  11. package/dist/config/RuntimeConfigRegistry.d.ts.map +1 -1
  12. package/dist/config/RuntimeConfigRegistry.js +1 -0
  13. package/dist/config/RuntimeConfigRegistry.js.map +1 -1
  14. package/dist/config/SettingsLoader.js +1 -1
  15. package/dist/config/SettingsLoader.js.map +1 -1
  16. package/dist/config/SettingsSchema.d.ts +2 -2
  17. package/dist/config/SettingsSchema.d.ts.map +1 -1
  18. package/dist/config/SettingsSchema.js +13 -8
  19. package/dist/config/SettingsSchema.js.map +1 -1
  20. package/dist/conversation/ContextBudgetManager.d.ts.map +1 -1
  21. package/dist/conversation/ContextBudgetManager.js +4 -2
  22. package/dist/conversation/ContextBudgetManager.js.map +1 -1
  23. package/dist/middleware/PermissionsMiddleware.d.ts +2 -2
  24. package/dist/middleware/PermissionsMiddleware.js +2 -2
  25. package/dist/middleware/permissions/BashCommandPolicy.d.ts +2 -2
  26. package/dist/middleware/permissions/BashCommandPolicy.js +2 -2
  27. package/dist/middleware/permissions/BlacklistPolicy.d.ts +1 -1
  28. package/dist/middleware/permissions/BlacklistPolicy.js +1 -1
  29. package/dist/middleware/permissions/FileOperationPolicy.d.ts +2 -2
  30. package/dist/middleware/permissions/FileOperationPolicy.js +2 -2
  31. package/dist/middleware/permissions/PermissionAuditLogger.d.ts +1 -1
  32. package/dist/middleware/permissions/PermissionAuditLogger.js +1 -1
  33. package/dist/middleware/permissions/PermissionConfig.js +2 -2
  34. package/dist/middleware/permissions/PermissionConfig.js.map +1 -1
  35. package/dist/middleware/permissions/PermissionEvaluator.d.ts +2 -2
  36. package/dist/middleware/permissions/PermissionEvaluator.js +2 -2
  37. package/dist/middleware/permissions/WhitelistPolicy.d.ts +2 -2
  38. package/dist/middleware/permissions/WhitelistPolicy.js +2 -2
  39. package/dist/middleware/permissions/WorkspaceBoundaryPolicy.d.ts.map +1 -1
  40. package/dist/middleware/permissions/WorkspaceBoundaryPolicy.js +2 -3
  41. package/dist/middleware/permissions/WorkspaceBoundaryPolicy.js.map +1 -1
  42. package/dist/models/ModelConfig.interface.js +1 -1
  43. package/dist/orchestrator/CortexOrchestrator.d.ts.map +1 -1
  44. package/dist/orchestrator/CortexOrchestrator.js +13 -15
  45. package/dist/orchestrator/CortexOrchestrator.js.map +1 -1
  46. package/dist/orchestrator/OrchestratorFactory.js +1 -1
  47. package/dist/orchestrator/OrchestratorFactory.js.map +1 -1
  48. package/dist/orchestrator/SubAgentPermissionChecker.d.ts.map +1 -1
  49. package/dist/orchestrator/SubAgentPermissionChecker.js +13 -2
  50. package/dist/orchestrator/SubAgentPermissionChecker.js.map +1 -1
  51. package/dist/system-messages/SystemReminderInjector.d.ts +3 -3
  52. package/dist/system-messages/SystemReminderInjector.d.ts.map +1 -1
  53. package/dist/system-messages/SystemReminderInjector.js +4 -4
  54. package/dist/system-messages/SystemReminderInjector.js.map +1 -1
  55. package/dist/system-messages/messages/EXAMPLES.md +18 -18
  56. package/dist/system-messages/messages/SYSTEM_PROMPT.md +15 -13
  57. package/dist/system-messages/messages/TASK_AGENT_GUIDE.md +2 -2
  58. package/dist/system-messages/messages/TOOL_USAGE_GUIDE.md +43 -42
  59. package/dist/system-messages/messages/WORK_QUALITY.md +10 -10
  60. package/dist/tools/ToolFactory.d.ts.map +1 -1
  61. package/dist/tools/ToolFactory.js +3 -1
  62. package/dist/tools/ToolFactory.js.map +1 -1
  63. package/dist/tools/context-management/InitCortexContext.js +1 -1
  64. package/dist/tools/context-management/InitCortexContext.js.map +1 -1
  65. package/dist/tools/mcp-management/InitMcpConfig.js +1 -1
  66. package/dist/tools/registries/BaseToolRegistry.js +45 -45
  67. package/dist/tools/registries/BaseToolRegistry.js.map +1 -1
  68. package/package.json +3 -3
@@ -1104,16 +1104,16 @@ export class CortexOrchestrator {
1104
1104
  ? ' You ran edit/write/bash this turn: in `verification` list every build/test/lint command you ACTUALLY ran with the real result line you saw — do not claim a check you did not run.'
1105
1105
  : '';
1106
1106
  const endTurnReminderText = !endTurnCalled
1107
- ? ('<system-reminder>You used tools this turn but have not called end_turn. ' +
1108
- 'You MUST call end_turn before any final answer. It is generative, not a checkbox: ' +
1107
+ ? ('<system-reminder>You used tools this turn but have not called EndTurn. ' +
1108
+ 'You MUST call EndTurn before any final answer. It is generative, not a checkbox: ' +
1109
1109
  'reconstruct `citations` (array of {reference, verbatim_source}), `verification` ' +
1110
1110
  '(array of {command, observed_result}), `summary`, `open_items`, and a skeptical ' +
1111
1111
  '`self_review` (what you did NOT check, what is assumed/possibly wrong, what one ' +
1112
1112
  'more tool call would verify).' +
1113
1113
  citEmphasis +
1114
1114
  verEmphasis +
1115
- ' Call end_turn now — do not produce a final answer until you have.</system-reminder>')
1116
- : ('<system-reminder>end_turn REJECTED. Your drafted answer asserts line number(s) ' +
1115
+ ' Call EndTurn now — do not produce a final answer until you have.</system-reminder>')
1116
+ : ('<system-reminder>EndTurn REJECTED. Your drafted answer asserts line number(s) ' +
1117
1117
  stage3Violations.map((v) => v.line).join(', ') +
1118
1118
  ' that are NOT backed by any citation whose verbatim_source actually sits at that ' +
1119
1119
  "line in what you read this turn — a regurgitated coordinate, not an observation, " +
@@ -1122,7 +1122,7 @@ export class CortexOrchestrator {
1122
1122
  "is the EXACT code copied from that line of this turn's read output; " +
1123
1123
  '(2) for any you cannot ground, DELETE the number and quote the verbatim code ' +
1124
1124
  'instead — a quote with no number is correct; a wrong number is a failed answer. ' +
1125
- 'Then call end_turn again with corrected citations and produce the answer.</system-reminder>');
1125
+ 'Then call EndTurn again with corrected citations and produce the answer.</system-reminder>');
1126
1126
  const endTurnReminder = {
1127
1127
  uuid: uuidv4(),
1128
1128
  timestamp: new Date().toISOString(),
@@ -1407,9 +1407,9 @@ export class CortexOrchestrator {
1407
1407
  .join('\n');
1408
1408
  tr.is_error = true;
1409
1409
  tr.content =
1410
- `end_turn REJECTED — these citations are not grounded in anything you read this turn:\n${bad}\n\n` +
1410
+ `EndTurn REJECTED — these citations are not grounded in anything you read this turn:\n${bad}\n\n` +
1411
1411
  `A quote or coordinate you did not transcribe from this turn's tool output is a fabrication (a regurgitated guess), exactly like a non-matching edit old_string. ` +
1412
- `Either RE-READ the exact region and copy the real text, or DELETE that reference from your answer (quote only code you can ground), then call end_turn again.`;
1412
+ `Either RE-READ the exact region and copy the real text, or DELETE that reference from your answer (quote only code you can ground), then call EndTurn again.`;
1413
1413
  console.warn(`[Orchestrator] Stage2: EndTurn rejected — ${verdict.ungrounded.length} ungrounded citation(s).`);
1414
1414
  }
1415
1415
  }
@@ -3469,7 +3469,7 @@ export class CortexOrchestrator {
3469
3469
  isMutationTool(toolName) {
3470
3470
  const mutationTools = new Set([
3471
3471
  'Write', 'Edit', 'NotebookEdit',
3472
- 'TodoCreate', 'TodoUpdate', 'TodoWrite',
3472
+ 'TodoCreate', 'TodoUpdate',
3473
3473
  'Bash',
3474
3474
  ]);
3475
3475
  return mutationTools.has(toolName);
@@ -4085,18 +4085,16 @@ export class CortexOrchestrator {
4085
4085
  const truncated = this.truncateToolOutput(toolOutput, MAX_TOOL_OUTPUT_TOKENS);
4086
4086
  const toolLower = toolName.toLowerCase();
4087
4087
  let toolSpecificHint = '';
4088
- if (toolLower === 'read' || toolLower === 'readfile') {
4088
+ if (toolLower === 'read') {
4089
4089
  toolSpecificHint = `This file is too large to read ${MAX_TOOL_OUTPUT_TOKENS.toLocaleString()} tokens at once. ` +
4090
4090
  `Re-read with limit: 500 (or smaller) and use offset to navigate to the section you need.\n\n`;
4091
4091
  }
4092
4092
  const guidanceMessage = `Tool result too large (~${estimatedTokens.toLocaleString()} tokens, limit ${MAX_TOOL_OUTPUT_TOKENS.toLocaleString()}).\n\n` +
4093
4093
  toolSpecificHint +
4094
4094
  `Please try a more targeted approach:\n` +
4095
- `• For read: Use limit: 500 (or smaller) with offset to read manageable chunks\n` +
4096
- `• For grep/rg: Add --max-count=100 or search specific paths\n` +
4097
- `• For find: Use -maxdepth N to limit recursion\n` +
4098
- `• For ls: Target specific directories instead of -R\n` +
4099
- `• For bash: Pipe to 'head -n 100' or use more specific filters\n\n` +
4095
+ `• For Read: Use limit: 500 (or smaller) with offset to read manageable chunks\n` +
4096
+ `• For Grep: Use head_limit (e.g. 100) or search specific paths\n` +
4097
+ `• For Bash: pipe to 'head -n 100', use find -maxdepth N, and target specific directories instead of ls -R\n\n` +
4100
4098
  `Preview of truncated output (first/last portions shown):\n` +
4101
4099
  `${'='.repeat(70)}\n${truncated}\n${'='.repeat(70)}\n\n` +
4102
4100
  `If you cannot be more specific, acknowledge this and request the truncated output, ` +
@@ -6557,7 +6555,7 @@ export class CortexOrchestrator {
6557
6555
  lines.push(`- ${convert(d.name)} — ${firstSentence}`);
6558
6556
  }
6559
6557
  }
6560
- return `<harness-note source="automated-harness" from-user="false">\nThe following is automated context injected by the harness — NOT a message from the user. The tools below are available but their schemas are NOT loaded yet. To use any of them, call search_tools first to load the schema, then call the tool.\n${lines.join('\n')}\n</harness-note>`;
6558
+ return `<harness-note source="automated-harness" from-user="false">\nThe following is automated context injected by the harness — NOT a message from the user. The tools below are available but their schemas are NOT loaded yet. To use any of them, call ${convert('SearchTools')} first to load the schema, then call the tool.\n${lines.join('\n')}\n</harness-note>`;
6561
6559
  }
6562
6560
  }
6563
6561
  //# sourceMappingURL=CortexOrchestrator.js.map