nexus-agents 2.115.1 → 2.116.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.
@@ -40,7 +40,7 @@ import {
40
40
  } from "./chunk-CH7QIDHQ.js";
41
41
 
42
42
  // src/version.ts
43
- var VERSION = true ? "2.115.1" : "dev";
43
+ var VERSION = true ? "2.116.0" : "dev";
44
44
 
45
45
  // src/config/schemas-core.ts
46
46
  import { z } from "zod";
@@ -2099,7 +2099,7 @@ async function runDoctorFix(result) {
2099
2099
  writeLine2("\u2500".repeat(40));
2100
2100
  let fixCount = 0;
2101
2101
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
2102
- const { runSetup } = await import("./setup-command-BVMZQHKM.js");
2102
+ const { runSetup } = await import("./setup-command-QMX662NI.js");
2103
2103
  const setupResult = runSetup({
2104
2104
  skipMcp: true,
2105
2105
  skipRules: true,
@@ -2211,4 +2211,4 @@ export {
2211
2211
  startStdioServer,
2212
2212
  closeServer
2213
2213
  };
2214
- //# sourceMappingURL=chunk-6DHDXNOO.js.map
2214
+ //# sourceMappingURL=chunk-ML3MT7JO.js.map
@@ -114,7 +114,7 @@ import {
114
114
  DEFAULT_TASK_TTL_MS,
115
115
  DEFAULT_TOOL_RATE_LIMITS,
116
116
  clampTaskTtl
117
- } from "./chunk-6DHDXNOO.js";
117
+ } from "./chunk-ML3MT7JO.js";
118
118
  import {
119
119
  resolveInsideRoot
120
120
  } from "./chunk-NUBSJGQZ.js";
@@ -35498,7 +35498,24 @@ function sanitizeExpertSummary(summary) {
35498
35498
  }
35499
35499
  return cleaned.replace(/\b(ignore|forget|disregard)\s+(previous|above|all)\b/gi, "[REDACTED]").slice(0, 2e3);
35500
35500
  }
35501
- function buildTask(input) {
35501
+ async function maybeFetchContextPrefix(task, logger56) {
35502
+ if (process.env["NEXUS_CONTEXT_RETRIEVER_INJECT"] !== "1") return void 0;
35503
+ try {
35504
+ const ctx = await getContextForTask({
35505
+ task,
35506
+ category: inferTaskCategory(task),
35507
+ ...logger56 !== void 0 ? { logger: logger56 } : {}
35508
+ });
35509
+ const summary = summarizeContextForPrompt(ctx);
35510
+ return summary === "" ? void 0 : summary;
35511
+ } catch (error) {
35512
+ logger56?.debug("execute_expert: context retrieval failed \u2014 running without prefix", {
35513
+ error: error instanceof Error ? error.message : String(error)
35514
+ });
35515
+ return void 0;
35516
+ }
35517
+ }
35518
+ function buildTask(input, contextPrefix) {
35502
35519
  const autoTimeout = getExpertTaskTimeout(input.task);
35503
35520
  const timeoutMs = input.timeoutMs ?? autoTimeout;
35504
35521
  let description = input.task;
@@ -35509,6 +35526,12 @@ ${sanitized}
35509
35526
 
35510
35527
  [Your task]
35511
35528
  ${input.task}`;
35529
+ }
35530
+ if (contextPrefix !== void 0) {
35531
+ description = `[Prior context]
35532
+ ${sanitizeExpertSummary(contextPrefix)}
35533
+
35534
+ ${description}`;
35512
35535
  }
35513
35536
  return {
35514
35537
  id: `exec-${String(getTimeProvider().now())}-${getRandomProvider().random().toString(36).slice(2, 9)}`,
@@ -35559,10 +35582,10 @@ function observeExpertContextIfOk(result, expert, task, durationMs, logger56) {
35559
35582
  };
35560
35583
  observeExpertContext(observation, logger56);
35561
35584
  }
35562
- async function deriveExpertAccessPolicy(task, logger56, trustTier) {
35585
+ async function deriveExpertAccessPolicy(objective, logger56, trustTier) {
35563
35586
  const mode = resolveAccessPolicyMode();
35564
35587
  try {
35565
- const policy = await deriveAccessPolicy(task.description, {
35588
+ const policy = await deriveAccessPolicy(objective, {
35566
35589
  mode,
35567
35590
  trustTier: trustTier ?? "4"
35568
35591
  });
@@ -35703,7 +35726,9 @@ async function classifyExpertResult(opts) {
35703
35726
  }
35704
35727
  async function runExpertTask(deps, args, expert) {
35705
35728
  const { expertId } = args;
35706
- const task = buildTask(args);
35729
+ const contextPrefix = await maybeFetchContextPrefix(args.task, deps.logger);
35730
+ const task = buildTask(args, contextPrefix);
35731
+ const policyObjective = buildTask(args).description;
35707
35732
  injectErrorHints(task, expert.role);
35708
35733
  if (isExpertDegraded(expert.role)) {
35709
35734
  deps.logger?.warn("Expert role degraded, trying fallback", { role: expert.role });
@@ -35724,7 +35749,7 @@ async function runExpertTask(deps, args, expert) {
35724
35749
  }, HEARTBEAT_TIMEOUTS.heartbeatIntervalMs);
35725
35750
  let result;
35726
35751
  try {
35727
- const policy = await deriveExpertAccessPolicy(task, deps.logger, void 0);
35752
+ const policy = await deriveExpertAccessPolicy(policyObjective, deps.logger, void 0);
35728
35753
  result = await withAccessPolicy(policy, () => expert.execute(task));
35729
35754
  } finally {
35730
35755
  clearInterval(heartbeatTimer);
@@ -48903,4 +48928,4 @@ export {
48903
48928
  detectBackend,
48904
48929
  createTaskTracker
48905
48930
  };
48906
- //# sourceMappingURL=chunk-KHGBV3ZL.js.map
48931
+ //# sourceMappingURL=chunk-MOA7WCEL.js.map