@nathapp/nax 0.59.1 → 0.59.2

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 (2) hide show
  1. package/dist/nax.js +19 -9
  2. package/package.json +1 -1
package/dist/nax.js CHANGED
@@ -21475,7 +21475,10 @@ function majorityResolver(proposals, failOpen) {
21475
21475
  return passCount > failCount ? "passed" : "failed";
21476
21476
  }
21477
21477
  async function synthesisResolver(proposals, critiques, opts) {
21478
- const prompt = buildSynthesisPrompt(proposals, critiques);
21478
+ const base = buildSynthesisPrompt(proposals, critiques);
21479
+ const prompt = opts.promptSuffix ? `${base}
21480
+
21481
+ ${opts.promptSuffix}` : base;
21479
21482
  return opts.adapter.complete(prompt, opts.completeOptions);
21480
21483
  }
21481
21484
  async function judgeResolver(proposals, critiques, resolverConfig, opts) {
@@ -21564,7 +21567,7 @@ function resolveModelDefForDebater(debater, tier, config2) {
21564
21567
  return resolveModelForAgent(configModels, debater.agent, "fast", configDefaultAgent);
21565
21568
  }
21566
21569
  }
21567
- async function resolveOutcome(proposalOutputs, critiqueOutputs, stageConfig, config2, storyId, timeoutMs, workdir, featureName, reviewerSession, resolverContext) {
21570
+ async function resolveOutcome(proposalOutputs, critiqueOutputs, stageConfig, config2, storyId, timeoutMs, workdir, featureName, reviewerSession, resolverContext, promptSuffix) {
21568
21571
  const resolverConfig = stageConfig.resolver;
21569
21572
  const logger = _debateSessionDeps.getSafeLogger();
21570
21573
  if (reviewerSession && resolverContext) {
@@ -21633,20 +21636,23 @@ async function resolveOutcome(proposalOutputs, critiqueOutputs, stageConfig, con
21633
21636
  resolverCostUsd: 0
21634
21637
  };
21635
21638
  }
21636
- const implementerSessionName = workdir !== undefined ? buildSessionName(workdir, featureName, storyId, "implementer") : undefined;
21637
21639
  if (resolverConfig.type === "synthesis") {
21638
21640
  const agentName = resolverConfig.agent ?? RESOLVER_FALLBACK_AGENT;
21639
21641
  const adapter = _debateSessionDeps.getAgent(agentName, config2);
21640
21642
  if (adapter) {
21643
+ const synthesisSessionName = workdir !== undefined ? buildSessionName(workdir, featureName, storyId, "synthesis") : undefined;
21641
21644
  const resolverResult = await synthesisResolver(proposalOutputs, critiqueOutputs, {
21642
21645
  adapter,
21646
+ promptSuffix,
21643
21647
  completeOptions: {
21644
21648
  model: resolveDebaterModel({ agent: agentName }, config2),
21645
21649
  config: config2,
21646
21650
  storyId,
21651
+ featureName,
21652
+ workdir,
21647
21653
  sessionRole: "synthesis",
21648
21654
  timeoutMs,
21649
- ...implementerSessionName !== undefined && { sessionName: implementerSessionName }
21655
+ ...synthesisSessionName !== undefined && { sessionName: synthesisSessionName }
21650
21656
  }
21651
21657
  });
21652
21658
  return {
@@ -21659,6 +21665,7 @@ async function resolveOutcome(proposalOutputs, critiqueOutputs, stageConfig, con
21659
21665
  }
21660
21666
  if (resolverConfig.type === "custom") {
21661
21667
  const agentName = resolverConfig.agent ?? RESOLVER_FALLBACK_AGENT;
21668
+ const judgeSessionName = workdir !== undefined ? buildSessionName(workdir, featureName, storyId, "judge") : undefined;
21662
21669
  const resolverResult = await judgeResolver(proposalOutputs, critiqueOutputs, resolverConfig, {
21663
21670
  getAgent: (name) => _debateSessionDeps.getAgent(name, config2),
21664
21671
  defaultAgentName: RESOLVER_FALLBACK_AGENT,
@@ -21666,9 +21673,11 @@ async function resolveOutcome(proposalOutputs, critiqueOutputs, stageConfig, con
21666
21673
  model: resolveDebaterModel({ agent: agentName }, config2),
21667
21674
  config: config2,
21668
21675
  storyId,
21676
+ featureName,
21677
+ workdir,
21669
21678
  sessionRole: "judge",
21670
21679
  timeoutMs,
21671
- ...implementerSessionName !== undefined && { sessionName: implementerSessionName }
21680
+ ...judgeSessionName !== undefined && { sessionName: judgeSessionName }
21672
21681
  }
21673
21682
  });
21674
21683
  return {
@@ -22331,7 +22340,8 @@ Do NOT output the JSON to the conversation. Write the file, then reply with a br
22331
22340
  logger?.warn("debate", "hybrid mode requires sessionMode: stateful for plan \u2014 running as panel");
22332
22341
  }
22333
22342
  const resolverTimeoutMs = (ctx.stageConfig.timeoutSeconds ?? 600) * 1000;
22334
- const outcome = await resolveOutcome(proposalOutputs, critiqueOutputs, ctx.stageConfig, ctx.config, ctx.storyId, resolverTimeoutMs, opts.workdir, opts.feature);
22343
+ const planSynthesisSuffix = "IMPORTANT: Your response must be a single valid JSON object in PRD format (with project, feature, branchName, userStories array, etc.). Do NOT wrap it in markdown fences. Output raw JSON only.";
22344
+ const outcome = await resolveOutcome(proposalOutputs, critiqueOutputs, ctx.stageConfig, ctx.config, ctx.storyId, resolverTimeoutMs, opts.workdir, opts.feature, undefined, undefined, planSynthesisSuffix);
22335
22345
  const winningOutput = outcome.output ?? successful[0].output;
22336
22346
  const proposals = successful.map((p) => ({ debater: p.debater, output: p.output }));
22337
22347
  logger?.info("debate", "debate:result", {
@@ -36133,7 +36143,7 @@ var package_default;
36133
36143
  var init_package = __esm(() => {
36134
36144
  package_default = {
36135
36145
  name: "@nathapp/nax",
36136
- version: "0.59.1",
36146
+ version: "0.59.2",
36137
36147
  description: "AI Coding Agent Orchestrator \u2014 loops until done",
36138
36148
  type: "module",
36139
36149
  bin: {
@@ -36213,8 +36223,8 @@ var init_version = __esm(() => {
36213
36223
  NAX_VERSION = package_default.version;
36214
36224
  NAX_COMMIT = (() => {
36215
36225
  try {
36216
- if (/^[0-9a-f]{6,10}$/.test("b8492d03"))
36217
- return "b8492d03";
36226
+ if (/^[0-9a-f]{6,10}$/.test("d42d47be"))
36227
+ return "d42d47be";
36218
36228
  } catch {}
36219
36229
  try {
36220
36230
  const result = Bun.spawnSync(["git", "rev-parse", "--short", "HEAD"], {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nathapp/nax",
3
- "version": "0.59.1",
3
+ "version": "0.59.2",
4
4
  "description": "AI Coding Agent Orchestrator — loops until done",
5
5
  "type": "module",
6
6
  "bin": {