nexus-agents 2.114.0 → 2.115.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.
Files changed (112) hide show
  1. package/dist/{child-mcp-config-BTYHNG2N.js → child-mcp-config-FIXBPOVD.js} +2 -2
  2. package/dist/{chunk-F6NOHVYQ.js → chunk-24L6ETFP.js} +3 -3
  3. package/dist/{chunk-BXEOO2KK.js → chunk-2JXELXS3.js} +2 -2
  4. package/dist/{chunk-CLL2GXNL.js → chunk-2XEX5PM4.js} +4 -4
  5. package/dist/{chunk-E2ER3LQF.js → chunk-5DOIZUPE.js} +2 -2
  6. package/dist/{chunk-OTRXF5NM.js → chunk-5JWBFZEO.js} +3 -3
  7. package/dist/{chunk-XMNGHZBR.js → chunk-7VD5UJCF.js} +7 -7
  8. package/dist/{chunk-MYN7CMD5.js → chunk-AXKGNVHM.js} +2 -2
  9. package/dist/{chunk-R2G4GZID.js → chunk-CVGJKTO4.js} +3 -3
  10. package/dist/{chunk-ZXF2XA4R.js → chunk-E4K4PLSJ.js} +2 -2
  11. package/dist/{chunk-YQW7MHST.js → chunk-EQLXZKMD.js} +2 -2
  12. package/dist/{chunk-3S4N6OCF.js → chunk-GHMFOI3H.js} +2 -2
  13. package/dist/{chunk-E4HZTSBP.js → chunk-ILGRBYX6.js} +2 -2
  14. package/dist/{chunk-MD6TVSOI.js → chunk-KEZZWT4W.js} +3 -3
  15. package/dist/{chunk-YKNLQLFM.js → chunk-KP77F65U.js} +4 -4
  16. package/dist/{chunk-5RDUP5K7.js → chunk-LFX7W2QN.js} +2 -2
  17. package/dist/{chunk-7BZKZUVR.js → chunk-NEBMJARV.js} +4 -4
  18. package/dist/{chunk-S7RTQRQ3.js → chunk-NF6ZY2XT.js} +2 -2
  19. package/dist/{chunk-N7NCTB3O.js → chunk-NGE7HWKP.js} +3 -3
  20. package/dist/{chunk-7AO4FKAD.js → chunk-NWMWL6MD.js} +2 -2
  21. package/dist/{chunk-AREFHG4Q.js → chunk-NZHV7GEK.js} +7 -7
  22. package/dist/{chunk-Q6HUW6EI.js → chunk-OGJ6Z6T5.js} +2 -2
  23. package/dist/{chunk-FSZNZZO5.js → chunk-PCSWTO6B.js} +7 -7
  24. package/dist/{chunk-VNU7OT7O.js → chunk-PKKV2ZAT.js} +2 -2
  25. package/dist/{chunk-36G75SD2.js → chunk-PZRDGFLY.js} +77 -38
  26. package/dist/{chunk-36G75SD2.js.map → chunk-PZRDGFLY.js.map} +1 -1
  27. package/dist/{chunk-YJSXYHSK.js → chunk-QTMZCTB6.js} +2 -2
  28. package/dist/{chunk-B32GCV25.js → chunk-SLXPSE5W.js} +5 -5
  29. package/dist/{chunk-KTPMJSLZ.js → chunk-TBVXG63Q.js} +3 -3
  30. package/dist/{chunk-IBRRXLMJ.js → chunk-WBE5HPPW.js} +7 -7
  31. package/dist/{chunk-4K4OVG4O.js → chunk-XKK55K2H.js} +2 -2
  32. package/dist/{chunk-ATI7W2FT.js → chunk-Y2QMFZQG.js} +20 -14
  33. package/dist/{chunk-ATI7W2FT.js.map → chunk-Y2QMFZQG.js.map} +1 -1
  34. package/dist/{chunk-WJSQ5FRV.js → chunk-Z7OI5YXE.js} +2 -2
  35. package/dist/{cli-circuit-breaker-OR2Z2ZXU.js → cli-circuit-breaker-PIBTMQZS.js} +4 -4
  36. package/dist/cli.js +38 -38
  37. package/dist/{composite-router-QC4OLIQ5.js → composite-router-MDQ6V7DS.js} +2 -2
  38. package/dist/{consensus-vote-JMIK4USL.js → consensus-vote-T576X4MI.js} +12 -12
  39. package/dist/{context-retriever-CFINY4KH.js → context-retriever-7SVNDBAF.js} +10 -8
  40. package/dist/{doctor-deep-53KZ3IYQ.js → doctor-deep-EFTG4336.js} +3 -3
  41. package/dist/{expert-bridge-WWAGNKZY.js → expert-bridge-66RX5OL4.js} +4 -4
  42. package/dist/factory-HRG64OID.js +21 -0
  43. package/dist/{factory-KIGMY2XP.js → factory-UE3K5WPQ.js} +5 -5
  44. package/dist/{improvement-review-A4HQ7KIQ.js → improvement-review-5HVBJSXJ.js} +4 -4
  45. package/dist/index.js +27 -27
  46. package/dist/{init-opencode-IMP5HG2J.js → init-opencode-VUPL5LMH.js} +5 -5
  47. package/dist/{issue-triage-VPL3N2AG.js → issue-triage-TNIWVBLP.js} +5 -5
  48. package/dist/{pr-reviewer-helpers-6FGXGRYA.js → pr-reviewer-helpers-BXNWNYRF.js} +4 -4
  49. package/dist/{registry-command-IGVBSZX6.js → registry-command-CKZUUPO7.js} +2 -2
  50. package/dist/{repo-security-plan-PWFK3LCK.js → repo-security-plan-FASDE3WF.js} +3 -3
  51. package/dist/{research-helpers-synthesize-IXWXFRKC.js → research-helpers-synthesize-53UJEEYZ.js} +4 -4
  52. package/dist/{routing-memory-RQUM4XHT.js → routing-memory-XB6HE6ZY.js} +2 -2
  53. package/dist/{session-memory-7TDKNMRE.js → session-memory-YSSKNSAI.js} +3 -3
  54. package/dist/{setup-command-MWZ5M3UB.js → setup-command-XCN5CNZO.js} +11 -11
  55. package/dist/{setup-config-ICI5OIGW.js → setup-config-MPHZ4MWR.js} +3 -3
  56. package/dist/{setup-custom-api-IVJLG6WI.js → setup-custom-api-OTD7KVPR.js} +3 -3
  57. package/dist/{tool-memory-USBUCDTD.js → tool-memory-UWRRPM7C.js} +5 -5
  58. package/dist/{weather-report-ZLUBKEG3.js → weather-report-6ARKPGO7.js} +2 -2
  59. package/package.json +1 -1
  60. package/dist/factory-3FKPAH26.js +0 -21
  61. /package/dist/{child-mcp-config-BTYHNG2N.js.map → child-mcp-config-FIXBPOVD.js.map} +0 -0
  62. /package/dist/{chunk-F6NOHVYQ.js.map → chunk-24L6ETFP.js.map} +0 -0
  63. /package/dist/{chunk-BXEOO2KK.js.map → chunk-2JXELXS3.js.map} +0 -0
  64. /package/dist/{chunk-CLL2GXNL.js.map → chunk-2XEX5PM4.js.map} +0 -0
  65. /package/dist/{chunk-E2ER3LQF.js.map → chunk-5DOIZUPE.js.map} +0 -0
  66. /package/dist/{chunk-OTRXF5NM.js.map → chunk-5JWBFZEO.js.map} +0 -0
  67. /package/dist/{chunk-XMNGHZBR.js.map → chunk-7VD5UJCF.js.map} +0 -0
  68. /package/dist/{chunk-MYN7CMD5.js.map → chunk-AXKGNVHM.js.map} +0 -0
  69. /package/dist/{chunk-R2G4GZID.js.map → chunk-CVGJKTO4.js.map} +0 -0
  70. /package/dist/{chunk-ZXF2XA4R.js.map → chunk-E4K4PLSJ.js.map} +0 -0
  71. /package/dist/{chunk-YQW7MHST.js.map → chunk-EQLXZKMD.js.map} +0 -0
  72. /package/dist/{chunk-3S4N6OCF.js.map → chunk-GHMFOI3H.js.map} +0 -0
  73. /package/dist/{chunk-E4HZTSBP.js.map → chunk-ILGRBYX6.js.map} +0 -0
  74. /package/dist/{chunk-MD6TVSOI.js.map → chunk-KEZZWT4W.js.map} +0 -0
  75. /package/dist/{chunk-YKNLQLFM.js.map → chunk-KP77F65U.js.map} +0 -0
  76. /package/dist/{chunk-5RDUP5K7.js.map → chunk-LFX7W2QN.js.map} +0 -0
  77. /package/dist/{chunk-7BZKZUVR.js.map → chunk-NEBMJARV.js.map} +0 -0
  78. /package/dist/{chunk-S7RTQRQ3.js.map → chunk-NF6ZY2XT.js.map} +0 -0
  79. /package/dist/{chunk-N7NCTB3O.js.map → chunk-NGE7HWKP.js.map} +0 -0
  80. /package/dist/{chunk-7AO4FKAD.js.map → chunk-NWMWL6MD.js.map} +0 -0
  81. /package/dist/{chunk-AREFHG4Q.js.map → chunk-NZHV7GEK.js.map} +0 -0
  82. /package/dist/{chunk-Q6HUW6EI.js.map → chunk-OGJ6Z6T5.js.map} +0 -0
  83. /package/dist/{chunk-FSZNZZO5.js.map → chunk-PCSWTO6B.js.map} +0 -0
  84. /package/dist/{chunk-VNU7OT7O.js.map → chunk-PKKV2ZAT.js.map} +0 -0
  85. /package/dist/{chunk-YJSXYHSK.js.map → chunk-QTMZCTB6.js.map} +0 -0
  86. /package/dist/{chunk-B32GCV25.js.map → chunk-SLXPSE5W.js.map} +0 -0
  87. /package/dist/{chunk-KTPMJSLZ.js.map → chunk-TBVXG63Q.js.map} +0 -0
  88. /package/dist/{chunk-IBRRXLMJ.js.map → chunk-WBE5HPPW.js.map} +0 -0
  89. /package/dist/{chunk-4K4OVG4O.js.map → chunk-XKK55K2H.js.map} +0 -0
  90. /package/dist/{chunk-WJSQ5FRV.js.map → chunk-Z7OI5YXE.js.map} +0 -0
  91. /package/dist/{cli-circuit-breaker-OR2Z2ZXU.js.map → cli-circuit-breaker-PIBTMQZS.js.map} +0 -0
  92. /package/dist/{composite-router-QC4OLIQ5.js.map → composite-router-MDQ6V7DS.js.map} +0 -0
  93. /package/dist/{consensus-vote-JMIK4USL.js.map → consensus-vote-T576X4MI.js.map} +0 -0
  94. /package/dist/{context-retriever-CFINY4KH.js.map → context-retriever-7SVNDBAF.js.map} +0 -0
  95. /package/dist/{doctor-deep-53KZ3IYQ.js.map → doctor-deep-EFTG4336.js.map} +0 -0
  96. /package/dist/{expert-bridge-WWAGNKZY.js.map → expert-bridge-66RX5OL4.js.map} +0 -0
  97. /package/dist/{factory-3FKPAH26.js.map → factory-HRG64OID.js.map} +0 -0
  98. /package/dist/{factory-KIGMY2XP.js.map → factory-UE3K5WPQ.js.map} +0 -0
  99. /package/dist/{improvement-review-A4HQ7KIQ.js.map → improvement-review-5HVBJSXJ.js.map} +0 -0
  100. /package/dist/{init-opencode-IMP5HG2J.js.map → init-opencode-VUPL5LMH.js.map} +0 -0
  101. /package/dist/{issue-triage-VPL3N2AG.js.map → issue-triage-TNIWVBLP.js.map} +0 -0
  102. /package/dist/{pr-reviewer-helpers-6FGXGRYA.js.map → pr-reviewer-helpers-BXNWNYRF.js.map} +0 -0
  103. /package/dist/{registry-command-IGVBSZX6.js.map → registry-command-CKZUUPO7.js.map} +0 -0
  104. /package/dist/{repo-security-plan-PWFK3LCK.js.map → repo-security-plan-FASDE3WF.js.map} +0 -0
  105. /package/dist/{research-helpers-synthesize-IXWXFRKC.js.map → research-helpers-synthesize-53UJEEYZ.js.map} +0 -0
  106. /package/dist/{routing-memory-RQUM4XHT.js.map → routing-memory-XB6HE6ZY.js.map} +0 -0
  107. /package/dist/{session-memory-7TDKNMRE.js.map → session-memory-YSSKNSAI.js.map} +0 -0
  108. /package/dist/{setup-command-MWZ5M3UB.js.map → setup-command-XCN5CNZO.js.map} +0 -0
  109. /package/dist/{setup-config-ICI5OIGW.js.map → setup-config-MPHZ4MWR.js.map} +0 -0
  110. /package/dist/{setup-custom-api-IVJLG6WI.js.map → setup-custom-api-OTD7KVPR.js.map} +0 -0
  111. /package/dist/{tool-memory-USBUCDTD.js.map → tool-memory-UWRRPM7C.js.map} +0 -0
  112. /package/dist/{weather-report-ZLUBKEG3.js.map → weather-report-6ARKPGO7.js.map} +0 -0
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-3ACDP4E6.js";
6
6
  import {
7
7
  executeExpert
8
- } from "./chunk-IBRRXLMJ.js";
8
+ } from "./chunk-WBE5HPPW.js";
9
9
  import {
10
10
  EventTopics,
11
11
  JobStatusSchema,
@@ -26,23 +26,23 @@ import {
26
26
  writeJobComplete,
27
27
  writeJobFailed,
28
28
  writeJobPending
29
- } from "./chunk-AREFHG4Q.js";
29
+ } from "./chunk-NZHV7GEK.js";
30
30
  import {
31
31
  normalizeTopicToCanonical,
32
32
  synthesizeResearch
33
- } from "./chunk-N7NCTB3O.js";
33
+ } from "./chunk-NGE7HWKP.js";
34
34
  import {
35
35
  IssueTriage,
36
36
  createAuditTrail,
37
37
  createGraphAuditBridge
38
- } from "./chunk-CLL2GXNL.js";
38
+ } from "./chunk-2XEX5PM4.js";
39
39
  import {
40
40
  resolveEnvMode,
41
41
  sanitizeInput
42
- } from "./chunk-S7RTQRQ3.js";
42
+ } from "./chunk-NF6ZY2XT.js";
43
43
  import {
44
44
  withPrerequisite
45
- } from "./chunk-OTRXF5NM.js";
45
+ } from "./chunk-5JWBFZEO.js";
46
46
  import {
47
47
  NOOP_NOTIFIER,
48
48
  RateLimiter,
@@ -62,10 +62,10 @@ import {
62
62
  withAccessPolicy,
63
63
  withProgressHeartbeat,
64
64
  wrapToolWithTimeout
65
- } from "./chunk-4K4OVG4O.js";
65
+ } from "./chunk-XKK55K2H.js";
66
66
  import {
67
67
  generateSecurityPlan
68
- } from "./chunk-YQW7MHST.js";
68
+ } from "./chunk-EQLXZKMD.js";
69
69
  import {
70
70
  analyzeGitHubRepo
71
71
  } from "./chunk-HFOQKCD2.js";
@@ -88,32 +88,33 @@ import {
88
88
  formatResearchIssueBody,
89
89
  generateStatsJson,
90
90
  getContextForTask,
91
+ getResearchInsightsForTask,
91
92
  getResearchStatus,
92
93
  inferTaskCategory,
93
94
  paperExists,
94
95
  parseRegistry,
95
96
  sourceExistsInRegistry,
96
97
  summarizeContextForPrompt
97
- } from "./chunk-ATI7W2FT.js";
98
+ } from "./chunk-Y2QMFZQG.js";
98
99
  import {
99
100
  getTokenEnvVars,
100
101
  resolveToken
101
- } from "./chunk-YJSXYHSK.js";
102
+ } from "./chunk-QTMZCTB6.js";
102
103
  import {
103
104
  loadPapersRegistry,
104
105
  loadTechniquesRegistry
105
- } from "./chunk-E2ER3LQF.js";
106
+ } from "./chunk-5DOIZUPE.js";
106
107
  import {
107
108
  DEFAULT_RELEVANCE_CONFIG,
108
109
  MemoryImportance,
109
110
  calculateTextJaccardSimilarity,
110
111
  getToolMemory
111
- } from "./chunk-7BZKZUVR.js";
112
+ } from "./chunk-NEBMJARV.js";
112
113
  import {
113
114
  DEFAULT_TASK_TTL_MS,
114
115
  DEFAULT_TOOL_RATE_LIMITS,
115
116
  clampTaskTtl
116
- } from "./chunk-FSZNZZO5.js";
117
+ } from "./chunk-PCSWTO6B.js";
117
118
  import {
118
119
  resolveInsideRoot
119
120
  } from "./chunk-NUBSJGQZ.js";
@@ -128,19 +129,19 @@ import {
128
129
  getAvailableClis,
129
130
  sleep,
130
131
  withTimeout
131
- } from "./chunk-XMNGHZBR.js";
132
+ } from "./chunk-7VD5UJCF.js";
132
133
  import {
133
134
  DEFAULTS
134
- } from "./chunk-7AO4FKAD.js";
135
+ } from "./chunk-NWMWL6MD.js";
135
136
  import {
136
137
  getAvailabilityCache,
137
138
  getCliForModelId,
138
139
  resolveFallback
139
- } from "./chunk-E4HZTSBP.js";
140
+ } from "./chunk-ILGRBYX6.js";
140
141
  import {
141
142
  generateHyphenId,
142
143
  generateUUID
143
- } from "./chunk-BXEOO2KK.js";
144
+ } from "./chunk-2JXELXS3.js";
144
145
  import {
145
146
  BUILT_IN_EXPERTS,
146
147
  BuiltInExpertTypeSchema,
@@ -152,7 +153,7 @@ import {
152
153
  } from "./chunk-PQHVC4BD.js";
153
154
  import {
154
155
  createSessionMemory
155
- } from "./chunk-VNU7OT7O.js";
156
+ } from "./chunk-PKKV2ZAT.js";
156
157
  import {
157
158
  AGENT_ROUTER_TIMEOUTS,
158
159
  ARCHITECTURE_KEYWORDS,
@@ -226,7 +227,7 @@ import {
226
227
  routingArmDisplaySlot,
227
228
  toExpertTaskAnalysisResult,
228
229
  withStep
229
- } from "./chunk-ZXF2XA4R.js";
230
+ } from "./chunk-E4K4PLSJ.js";
230
231
  import {
231
232
  nexusDataPath,
232
233
  nexusDataPathEnsure
@@ -26279,7 +26280,7 @@ async function populateUnifiedContextOnState(state) {
26279
26280
  try {
26280
26281
  const taskCandidate = state["task"];
26281
26282
  if (typeof taskCandidate !== "string" || taskCandidate === "") return;
26282
- const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-CFINY4KH.js");
26283
+ const { getContextForTask: getContextForTask2, inferTaskCategory: inferTaskCategory2 } = await import("./context-retriever-7SVNDBAF.js");
26283
26284
  const ctx = await getContextForTask2({
26284
26285
  task: taskCandidate,
26285
26286
  category: inferTaskCategory2(taskCandidate),
@@ -40756,7 +40757,7 @@ async function tryIssueTriage(task) {
40756
40757
  try {
40757
40758
  const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
40758
40759
  if (issueMatch === null) return null;
40759
- const { createIssueTriage } = await import("./issue-triage-VPL3N2AG.js");
40760
+ const { createIssueTriage } = await import("./issue-triage-TNIWVBLP.js");
40760
40761
  const triage = createIssueTriage();
40761
40762
  const owner = issueMatch[1] ?? "";
40762
40763
  const num = issueMatch[2] ?? "";
@@ -40784,7 +40785,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
40784
40785
  ]);
40785
40786
  async function classifyWithLLM(task) {
40786
40787
  try {
40787
- const { executeExpert: executeExpert2 } = await import("./expert-bridge-WWAGNKZY.js");
40788
+ const { executeExpert: executeExpert2 } = await import("./expert-bridge-66RX5OL4.js");
40788
40789
  const prompt = [
40789
40790
  "Classify this task into exactly one pipeline template.",
40790
40791
  "Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
@@ -41704,7 +41705,7 @@ var memoryInitPromise = null;
41704
41705
  async function initPipelineMemory() {
41705
41706
  if (cachedMemory !== null) return cachedMemory;
41706
41707
  try {
41707
- const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-7TDKNMRE.js");
41708
+ const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-YSSKNSAI.js");
41708
41709
  const { getLearningDir } = await import("./learning-persistence-UKPO7RYK.js");
41709
41710
  const mem = createSessionMemory2(getLearningDir());
41710
41711
  mem.startSession(`pipeline-${String(getTimeProvider().now())}`);
@@ -41761,7 +41762,7 @@ function recordRoutingExperience(category, success, durationMs, tokensUsed = 0)
41761
41762
  callRecord(routingMemoryCache);
41762
41763
  return;
41763
41764
  }
41764
- routingMemoryInitPromise ??= import("./routing-memory-RQUM4XHT.js").then(({ createRoutingMemory }) => {
41765
+ routingMemoryInitPromise ??= import("./routing-memory-XB6HE6ZY.js").then(({ createRoutingMemory }) => {
41765
41766
  routingMemoryCache ??= createRoutingMemory();
41766
41767
  return routingMemoryCache;
41767
41768
  }).catch((error) => {
@@ -41795,7 +41796,7 @@ ${text}` : "";
41795
41796
  }
41796
41797
  async function getWeatherContext() {
41797
41798
  try {
41798
- const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-ZLUBKEG3.js");
41799
+ const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-6ARKPGO7.js");
41799
41800
  const report = generateWeatherReport2({ includeAdaptive: true });
41800
41801
  const mappings = "recommendedMappings" in report ? report.recommendedMappings : [];
41801
41802
  if (!Array.isArray(mappings) || mappings.length === 0) return "";
@@ -41813,7 +41814,7 @@ ${lines}
41813
41814
  }
41814
41815
  async function getMemoryContext(task) {
41815
41816
  try {
41816
- const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-7TDKNMRE.js");
41817
+ const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-YSSKNSAI.js");
41817
41818
  const { getLearningDir } = await import("./learning-persistence-UKPO7RYK.js");
41818
41819
  const memory = createSessionMemory2(getLearningDir(), { maxLearningsInContext: 10 });
41819
41820
  const learnings = memory.searchLearnings(task.slice(0, 200));
@@ -41924,7 +41925,7 @@ ${contextBlock}`;
41924
41925
  const strategy = config.votingStrategy ?? "higher_order";
41925
41926
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
41926
41927
  try {
41927
- const { executeVoting } = await import("./consensus-vote-JMIK4USL.js");
41928
+ const { executeVoting } = await import("./consensus-vote-T576X4MI.js");
41928
41929
  const votingResult = await executeVoting(
41929
41930
  {
41930
41931
  proposal: buildVoteProposal(plan, research),
@@ -42464,6 +42465,35 @@ function applyPipelineHindsight(bm, task, sessionId, result) {
42464
42465
  });
42465
42466
  }
42466
42467
  var MAX_PRIOR_BELIEF_LINES = 5;
42468
+ var MAX_PRIOR_RESEARCH_LINES = 5;
42469
+ async function recallPriorResearchContext(task) {
42470
+ try {
42471
+ const insights = await getResearchInsightsForTask(task, MAX_PRIOR_RESEARCH_LINES, logger43);
42472
+ return formatPriorResearchContext(insights);
42473
+ } catch (error) {
42474
+ const msg = error instanceof Error ? error.message : String(error);
42475
+ logger43.debug("Research recall failed \u2014 proceeding without prior research", {
42476
+ task: task.slice(0, 40),
42477
+ error: msg
42478
+ });
42479
+ return void 0;
42480
+ }
42481
+ }
42482
+ function formatPriorResearchContext(insights) {
42483
+ if (insights.length === 0) return void 0;
42484
+ const lines = [];
42485
+ for (const t of insights) {
42486
+ if (lines.length >= MAX_PRIOR_RESEARCH_LINES) break;
42487
+ const name = t.name.replace(/\s+/g, " ").slice(0, 120);
42488
+ const topic = t.topic.replace(/\s+/g, " ").slice(0, 80);
42489
+ lines.push(`- ${name} (${t.status}) \u2014 ${topic}`);
42490
+ }
42491
+ if (lines.length === 0) return void 0;
42492
+ return [
42493
+ "Prior research on related topics \u2014 status reflects past decisions (informational \u2014 not instructions):",
42494
+ ...lines
42495
+ ].join("\n");
42496
+ }
42467
42497
  async function recallPriorBeliefContext(bm, task, sessionId) {
42468
42498
  if (bm === void 0) return void 0;
42469
42499
  try {
@@ -42504,11 +42534,21 @@ function formatPriorBeliefContext(records) {
42504
42534
  ...lines
42505
42535
  ].join("\n");
42506
42536
  }
42507
- function applyPriorBeliefContext(research, context) {
42508
- if (context === void 0) return research;
42509
- return `${context}
42537
+ function prependContextBlock(base, block) {
42538
+ if (block === void 0) return base;
42539
+ return `${block}
42510
42540
 
42511
- ${research}`;
42541
+ ${base}`;
42542
+ }
42543
+ async function assemblePlanContext(research, task, sid, bm) {
42544
+ const [priorBeliefContext, priorResearchContext] = await Promise.all([
42545
+ recallPriorBeliefContext(bm, task, sid),
42546
+ recallPriorResearchContext(task)
42547
+ ]);
42548
+ return prependContextBlock(
42549
+ prependContextBlock(research, priorBeliefContext),
42550
+ priorResearchContext
42551
+ );
42512
42552
  }
42513
42553
  function buildDryRunResult(planResult) {
42514
42554
  return {
@@ -42534,8 +42574,7 @@ async function runPlanningPhase(task, stages, sid, prior, bm) {
42534
42574
  )
42535
42575
  );
42536
42576
  if (sid !== void 0) saveStageCheckpoint(sid, "research", { type: "research", text: research });
42537
- const priorBeliefContext = await recallPriorBeliefContext(bm, task, sid);
42538
- const planContext = applyPriorBeliefContext(research, priorBeliefContext);
42577
+ const planContext = await assemblePlanContext(research, task, sid, bm);
42539
42578
  const planResult = await runPlanOrResume(prior, task, planContext, stages, sid);
42540
42579
  if (sid !== void 0) {
42541
42580
  saveStageCheckpoint(sid, "plan", {
@@ -42976,7 +43015,7 @@ async function searchCodebaseForTask(task) {
42976
43015
  }
42977
43016
  async function queryResearchRegistry(task) {
42978
43017
  try {
42979
- const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-IXWXFRKC.js");
43018
+ const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-53UJEEYZ.js");
42980
43019
  const topic = task.split(/[.!?\n]/).filter((s) => s.trim().length > 10)[0]?.trim();
42981
43020
  if (topic === void 0) return null;
42982
43021
  const result = await synthesizeResearch2(topic.slice(0, 50));
@@ -43047,7 +43086,7 @@ function createScanStageWrapper() {
43047
43086
  try {
43048
43087
  const slug = ctx.task.match(/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)/)?.[1];
43049
43088
  if (slug !== void 0) {
43050
- const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-PWFK3LCK.js");
43089
+ const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-FASDE3WF.js");
43051
43090
  const plan = await generateSecurityPlan2({ repo: slug, maxScanners: 10 });
43052
43091
  const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
43053
43092
  return output(PIPELINE_STATE_KEYS.FINDINGS, recs, getTimeProvider().now() - start, true);
@@ -44573,7 +44612,7 @@ async function probeSource(source, includeModelIds) {
44573
44612
  }
44574
44613
  }
44575
44614
  async function defaultSources(includeOpenRouter) {
44576
- const { createAllAdapters: createAllAdapters2 } = await import("./factory-3FKPAH26.js");
44615
+ const { createAllAdapters: createAllAdapters2 } = await import("./factory-HRG64OID.js");
44577
44616
  const adapters = createAllAdapters2();
44578
44617
  return buildDefaultModelSources(adapters, { includeOpenRouter });
44579
44618
  }
@@ -48188,7 +48227,7 @@ var GitHubTaskTracker = class {
48188
48227
  cachedProvider = null;
48189
48228
  async getProvider() {
48190
48229
  if (this.cachedProvider !== null) return this.cachedProvider;
48191
- const { createScmProvider } = await import("./factory-KIGMY2XP.js");
48230
+ const { createScmProvider } = await import("./factory-UE3K5WPQ.js");
48192
48231
  const result = await createScmProvider({ repo: this.config.repo ?? "" });
48193
48232
  if (!result.ok) throw new Error(`SCM provider error: ${result.error.message}`);
48194
48233
  this.cachedProvider = result.value;
@@ -48878,4 +48917,4 @@ export {
48878
48917
  detectBackend,
48879
48918
  createTaskTracker
48880
48919
  };
48881
- //# sourceMappingURL=chunk-36G75SD2.js.map
48920
+ //# sourceMappingURL=chunk-PZRDGFLY.js.map