nexus-agents 2.125.32 → 2.125.33

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.
@@ -122,7 +122,7 @@ import {
122
122
  DEFAULT_TASK_TTL_MS,
123
123
  DEFAULT_TOOL_RATE_LIMITS,
124
124
  clampTaskTtl
125
- } from "./chunk-BDVRPKUV.js";
125
+ } from "./chunk-ZCLKSAWQ.js";
126
126
  import {
127
127
  resolveInsideRoot
128
128
  } from "./chunk-NUBSJGQZ.js";
@@ -41424,7 +41424,7 @@ async function runDevPipelineInner(task, stages, options, sid, prior) {
41424
41424
  logger38.info("Dry run \u2014 stopping after plan+vote");
41425
41425
  return buildDryRunResult(planResult);
41426
41426
  }
41427
- enforceConsensusExecutePolicy(sid);
41427
+ enforceConsensusExecutePolicy(sid, options?.trustTier);
41428
41428
  const tasks = await runOrResumeDecompose(prior, planResult.plan, stages, {
41429
41429
  conditional: planResult.conditional,
41430
41430
  conditions: planResult.conditions,
@@ -41445,16 +41445,17 @@ async function runDevPipelineInner(task, stages, options, sid, prior) {
41445
41445
  applyPipelineHindsight(bm, task, sid, result);
41446
41446
  return result;
41447
41447
  }
41448
- function enforceConsensusExecutePolicy(sessionId) {
41448
+ function enforceConsensusExecutePolicy(sessionId, trustTier) {
41449
41449
  const mode = getGateEnforcementMode();
41450
41450
  if (mode === "off") return;
41451
41451
  const context = {
41452
41452
  taskId: sessionId ?? "dev-pipeline",
41453
41453
  stageId: "consensus-to-execute",
41454
41454
  stageType: "execute",
41455
- // No trustTier in dev-pipeline metadata engine defaults missing tier to
41456
- // untrusted (fail-closed). Safe under WARN (the default); block is opt-in.
41457
- pipelineState: {}
41455
+ // Inline narrowing of the threaded tier into the typed snapshot (#3712):
41456
+ // only a real string tier populates it; undefined keeps the snapshot empty
41457
+ // so the engine fail-closes to untrusted (4). Absence = untrusted.
41458
+ pipelineState: typeof trustTier === "string" ? { trustTier } : {}
41458
41459
  };
41459
41460
  const result = evaluatePipelinePolicy(
41460
41461
  { engine: createDefaultPolicyEngine(), mode, eventBus: getPipelineEventBus() },
@@ -45664,10 +45665,10 @@ async function createStages(input) {
45664
45665
  }
45665
45666
  });
45666
45667
  }
45667
- async function runDevPipelineForGoal(goal) {
45668
+ async function runDevPipelineForGoal(goal, trustTier) {
45668
45669
  const input = DevPipelineInputSchema.parse({ task: goal });
45669
45670
  const stages = await createStages(input);
45670
- return runDevPipeline(goal, stages);
45671
+ return runDevPipeline(goal, stages, trustTier !== void 0 ? { trustTier } : void 0);
45671
45672
  }
45672
45673
  function buildStructuredOutput(result) {
45673
45674
  return {
@@ -45686,7 +45687,7 @@ function buildStructuredOutput(result) {
45686
45687
  };
45687
45688
  }
45688
45689
  var RUN_DEV_PIPELINE_DESCRIPTION = "Run the multi-agent development pipeline. Accepts direct task instructions, a plan file, or a spec file. Supports dry-run (plan+vote only).";
45689
- async function runDevPipelineHandler(args, logger56) {
45690
+ async function runDevPipelineHandler(args, logger56, trustTier) {
45690
45691
  const parsed = DevPipelineInputSchema.safeParse(args);
45691
45692
  if (!parsed.success) {
45692
45693
  return toolStructuredError({
@@ -45705,7 +45706,8 @@ async function runDevPipelineHandler(args, logger56) {
45705
45706
  ...input.sessionId !== void 0 ? { sessionId: input.sessionId } : {},
45706
45707
  ...input.dryRun ? { dryRun: true } : {},
45707
45708
  ...input.mode === "harness" ? { mode: "harness" } : {},
45708
- ...input.qualityGate !== "off" ? { qualityGate: input.qualityGate } : {}
45709
+ ...input.qualityGate !== "off" ? { qualityGate: input.qualityGate } : {},
45710
+ ...trustTier !== void 0 ? { trustTier } : {}
45709
45711
  };
45710
45712
  const hasOptions = Object.keys(pipelineOptions).length > 0;
45711
45713
  const result = await runDevPipeline(taskText, stages, hasOptions ? pipelineOptions : void 0);
@@ -45721,7 +45723,7 @@ async function runDevPipelineHandler(args, logger56) {
45721
45723
  function registerDevPipelineTool(server, deps) {
45722
45724
  const logger56 = deps.logger ?? createLogger({ tool: "run_dev_pipeline" });
45723
45725
  const secureHandler = createSecureHandler(
45724
- (args) => runDevPipelineHandler(args, logger56),
45726
+ (args, ctx) => runDevPipelineHandler(args, logger56, ctx.requestContext.trustTier),
45725
45727
  { toolName: "run_dev_pipeline", rateLimiter: deps.rateLimiter, logger: logger56 }
45726
45728
  );
45727
45729
  const timeoutMs = getToolTimeout("run_dev_pipeline", deps.security);
@@ -45967,12 +45969,14 @@ function routeGoal(input, logger56) {
45967
45969
  note: NOTE
45968
45970
  };
45969
45971
  }
45970
- var DEFAULT_EXECUTORS = {
45971
- "dev-pipeline": (_decision, metaInput) => runDevPipelineForGoal(metaInput.goal),
45972
- pipeline: (_decision, metaInput) => runPipelineForGoal(metaInput.goal),
45973
- research: (_decision, metaInput) => runPipelineForGoal(metaInput.goal),
45974
- consensus: (_decision, metaInput) => runConsensusForGoal(metaInput.goal)
45975
- };
45972
+ function buildDefaultExecutors(trustTier) {
45973
+ return {
45974
+ "dev-pipeline": (_decision, metaInput) => runDevPipelineForGoal(metaInput.goal, trustTier),
45975
+ pipeline: (_decision, metaInput) => runPipelineForGoal(metaInput.goal),
45976
+ research: (_decision, metaInput) => runPipelineForGoal(metaInput.goal),
45977
+ consensus: (_decision, metaInput) => runConsensusForGoal(metaInput.goal)
45978
+ };
45979
+ }
45976
45980
  function isShadowTrainEnabled() {
45977
45981
  return process.env["NEXUS_META_SHADOW_TRAIN"] === "1" && isPersistenceEnabled();
45978
45982
  }
@@ -45995,7 +45999,7 @@ async function executeGoal(input, opts = {}) {
45995
45999
  const decision = selectDecision(input, opts.logger);
45996
46000
  const onOutcome = opts.onOutcome ?? buildShadowTrainObserver(opts.logger);
45997
46001
  const dispatcher = createMetaDispatcher({
45998
- executors: opts.executors ?? DEFAULT_EXECUTORS,
46002
+ executors: opts.executors ?? buildDefaultExecutors(opts.trustTier),
45999
46003
  ...opts.logger !== void 0 ? { logger: opts.logger } : {},
46000
46004
  ...opts.outcomeSink !== void 0 ? { outcomeSink: opts.outcomeSink } : {},
46001
46005
  ...onOutcome !== void 0 ? { onOutcome } : {}
@@ -46010,7 +46014,7 @@ async function executeGoal(input, opts = {}) {
46010
46014
  result: dispatch.result
46011
46015
  };
46012
46016
  }
46013
- async function runHandler(args, logger56) {
46017
+ async function runHandler(args, logger56, trustTier) {
46014
46018
  const parsed = RunInputSchema.safeParse(args);
46015
46019
  if (!parsed.success) {
46016
46020
  return toolStructuredError({
@@ -46020,7 +46024,10 @@ async function runHandler(args, logger56) {
46020
46024
  }
46021
46025
  if (parsed.data.execute === true) {
46022
46026
  try {
46023
- const exec2 = await executeGoal(parsed.data, { logger: logger56 });
46027
+ const exec2 = await executeGoal(parsed.data, {
46028
+ logger: logger56,
46029
+ ...trustTier !== void 0 ? { trustTier } : {}
46030
+ });
46024
46031
  logger56.info("run: executed goal", {
46025
46032
  decisionId: exec2.decisionId,
46026
46033
  strategy: exec2.strategy,
@@ -46046,11 +46053,14 @@ async function runHandler(args, logger56) {
46046
46053
  var DESCRIPTION4 = "DEFAULT ENTRY POINT: give a goal and nexus-agents picks the right strategy (single-shot / dev-pipeline / pipeline / graph-workflow / orchestrate / consensus / spec / research) via the MetaOrchestrator. Default (execute:false) is read-only \u2014 returns the routing decision + recommendedTool. With execute:true it runs the selected strategy inline (currently wired: dev-pipeline, pipeline, research, consensus; others fail closed with a typed error) and returns the engine result, recording the outcome. Use forceStrategy to override. Prefer this over choosing a pipeline tool by hand \u2014 the specialized tools remain available as advanced force-strategy paths.";
46047
46054
  function registerRunTool(server, deps) {
46048
46055
  const logger56 = deps.logger ?? createLogger({ tool: "run" });
46049
- const secureHandler = createSecureHandler((args) => runHandler(args, logger56), {
46050
- toolName: "run",
46051
- rateLimiter: deps.rateLimiter,
46052
- logger: logger56
46053
- });
46056
+ const secureHandler = createSecureHandler(
46057
+ (args, ctx) => runHandler(args, logger56, ctx.requestContext.trustTier),
46058
+ {
46059
+ toolName: "run",
46060
+ rateLimiter: deps.rateLimiter,
46061
+ logger: logger56
46062
+ }
46063
+ );
46054
46064
  const timeoutMs = getToolTimeout("run", deps.security);
46055
46065
  const wrappedHandler = wrapToolWithTimeout("run", secureHandler, { timeoutMs, logger: logger56 });
46056
46066
  const annotations = getMcpAnnotations("run");
@@ -50096,4 +50106,4 @@ export {
50096
50106
  shutdownFeedbackSubscriber,
50097
50107
  createEventBusBridge
50098
50108
  };
50099
- //# sourceMappingURL=chunk-GNOKYH3I.js.map
50109
+ //# sourceMappingURL=chunk-EULSXFFY.js.map