nexus-agents 2.29.1 → 2.29.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.
- package/dist/{adaptive-memory-RST6DZYR.js → adaptive-memory-5VP5WWTE.js} +3 -3
- package/dist/{chunk-IECE6DBS.js → chunk-5COIDGQJ.js} +3 -3
- package/dist/{chunk-XU3NADFE.js → chunk-63AJLNKU.js} +2 -2
- package/dist/{chunk-C2C5ONFR.js → chunk-66NNHMVB.js} +3 -3
- package/dist/{chunk-4AGPR6XZ.js → chunk-CW2Z773T.js} +3 -3
- package/dist/{chunk-FYJVXQHX.js → chunk-DDQGAVQA.js} +2 -2
- package/dist/{chunk-4HA5PAL7.js → chunk-EPMBGZQX.js} +2 -2
- package/dist/{chunk-MRU6L7YJ.js → chunk-GX436VRU.js} +2 -2
- package/dist/{chunk-ELIFTCYM.js → chunk-HSOPD265.js} +2 -2
- package/dist/chunk-HSOPD265.js.map +1 -0
- package/dist/{chunk-CGWRJ4EM.js → chunk-J245RJGW.js} +73 -15
- package/dist/chunk-J245RJGW.js.map +1 -0
- package/dist/{chunk-SRECH7OQ.js → chunk-KQIDTE52.js} +2 -2
- package/dist/{chunk-OOIPRRPX.js → chunk-LDIN2PLV.js} +151 -101
- package/dist/{chunk-OOIPRRPX.js.map → chunk-LDIN2PLV.js.map} +1 -1
- package/dist/{chunk-2UUUKVNR.js → chunk-LKDHAJJB.js} +2 -2
- package/dist/{chunk-N5SY7V45.js → chunk-NKGTEJYU.js} +4 -4
- package/dist/{chunk-YSTJEMQX.js → chunk-QGODFK36.js} +7 -7
- package/dist/{chunk-FZFZ77UJ.js → chunk-QSNAFOE6.js} +269 -68
- package/dist/chunk-QSNAFOE6.js.map +1 -0
- package/dist/{chunk-2UR7YN6T.js → chunk-TL2GJMJ5.js} +2 -2
- package/dist/{chunk-3GXDN4AX.js → chunk-V6MSPUQF.js} +2 -2
- package/dist/{chunk-7SKAKA4I.js → chunk-VZ2YOQWU.js} +2 -2
- package/dist/{chunk-3EVVQ32X.js → chunk-WSYJN7BI.js} +7 -6
- package/dist/chunk-WSYJN7BI.js.map +1 -0
- package/dist/{chunk-LLGUX44Z.js → chunk-Y477EGI4.js} +2 -2
- package/dist/{chunk-VKRMXD62.js → chunk-Z4OZ25VS.js} +4 -4
- package/dist/{cli-circuit-breaker-5FAODXVY.js → cli-circuit-breaker-6EJO3PPU.js} +4 -4
- package/dist/cli.js +26 -22
- package/dist/cli.js.map +1 -1
- package/dist/{composite-router-FNW7ZWL7.js → composite-router-JD7URTC2.js} +2 -2
- package/dist/{consensus-vote-757YULIP.js → consensus-vote-COW34Q2Y.js} +7 -7
- package/dist/{doctor-deep-LMCEAFU4.js → doctor-deep-4A4X5X6U.js} +3 -3
- package/dist/{expert-bridge-L2D4OXOR.js → expert-bridge-J36C7VES.js} +3 -3
- package/dist/{expert-config-A5CHKUGI.js → expert-config-MQ5OJE3U.js} +2 -2
- package/dist/{factory-IDTIBX6B.js → factory-4Z4RSUYE.js} +5 -5
- package/dist/{factory-ELEDP2WD.js → factory-NHORX63J.js} +4 -4
- package/dist/index.js +19 -19
- package/dist/{issue-triage-SJPKJLXH.js → issue-triage-TIG3RKXF.js} +4 -4
- package/dist/{mcp-config-2OXIOMJ6.js → mcp-config-ETY7GFGW.js} +3 -3
- package/dist/{mobimem-5S3VLNSU.js → mobimem-5PAAMVFR.js} +2 -2
- package/dist/{repo-security-plan-MUFDGWSQ.js → repo-security-plan-KQB3ZJTE.js} +3 -3
- package/dist/research-helpers-synthesize-ZMERZZ5B.js +10 -0
- package/dist/{routing-memory-3QBQTS4A.js → routing-memory-3ES3OHLM.js} +2 -2
- package/dist/{session-memory-VXWLOFRC.js → session-memory-E2OE2CYR.js} +3 -3
- package/dist/{setup-command-E6MXO5RZ.js → setup-command-CMCQRBJF.js} +7 -7
- package/dist/{setup-config-O5F3AZBL.js → setup-config-KITOPV7V.js} +3 -3
- package/dist/{weather-report-MUGSIOU5.js → weather-report-KUSVNXDZ.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-3EVVQ32X.js.map +0 -1
- package/dist/chunk-CGWRJ4EM.js.map +0 -1
- package/dist/chunk-ELIFTCYM.js.map +0 -1
- package/dist/chunk-FZFZ77UJ.js.map +0 -1
- package/dist/research-helpers-synthesize-OBQJ5BGX.js +0 -10
- /package/dist/{adaptive-memory-RST6DZYR.js.map → adaptive-memory-5VP5WWTE.js.map} +0 -0
- /package/dist/{chunk-IECE6DBS.js.map → chunk-5COIDGQJ.js.map} +0 -0
- /package/dist/{chunk-XU3NADFE.js.map → chunk-63AJLNKU.js.map} +0 -0
- /package/dist/{chunk-C2C5ONFR.js.map → chunk-66NNHMVB.js.map} +0 -0
- /package/dist/{chunk-4AGPR6XZ.js.map → chunk-CW2Z773T.js.map} +0 -0
- /package/dist/{chunk-FYJVXQHX.js.map → chunk-DDQGAVQA.js.map} +0 -0
- /package/dist/{chunk-4HA5PAL7.js.map → chunk-EPMBGZQX.js.map} +0 -0
- /package/dist/{chunk-MRU6L7YJ.js.map → chunk-GX436VRU.js.map} +0 -0
- /package/dist/{chunk-SRECH7OQ.js.map → chunk-KQIDTE52.js.map} +0 -0
- /package/dist/{chunk-2UUUKVNR.js.map → chunk-LKDHAJJB.js.map} +0 -0
- /package/dist/{chunk-N5SY7V45.js.map → chunk-NKGTEJYU.js.map} +0 -0
- /package/dist/{chunk-YSTJEMQX.js.map → chunk-QGODFK36.js.map} +0 -0
- /package/dist/{chunk-2UR7YN6T.js.map → chunk-TL2GJMJ5.js.map} +0 -0
- /package/dist/{chunk-3GXDN4AX.js.map → chunk-V6MSPUQF.js.map} +0 -0
- /package/dist/{chunk-7SKAKA4I.js.map → chunk-VZ2YOQWU.js.map} +0 -0
- /package/dist/{chunk-LLGUX44Z.js.map → chunk-Y477EGI4.js.map} +0 -0
- /package/dist/{chunk-VKRMXD62.js.map → chunk-Z4OZ25VS.js.map} +0 -0
- /package/dist/{cli-circuit-breaker-5FAODXVY.js.map → cli-circuit-breaker-6EJO3PPU.js.map} +0 -0
- /package/dist/{composite-router-FNW7ZWL7.js.map → composite-router-JD7URTC2.js.map} +0 -0
- /package/dist/{consensus-vote-757YULIP.js.map → consensus-vote-COW34Q2Y.js.map} +0 -0
- /package/dist/{doctor-deep-LMCEAFU4.js.map → doctor-deep-4A4X5X6U.js.map} +0 -0
- /package/dist/{expert-bridge-L2D4OXOR.js.map → expert-bridge-J36C7VES.js.map} +0 -0
- /package/dist/{expert-config-A5CHKUGI.js.map → expert-config-MQ5OJE3U.js.map} +0 -0
- /package/dist/{factory-ELEDP2WD.js.map → factory-4Z4RSUYE.js.map} +0 -0
- /package/dist/{factory-IDTIBX6B.js.map → factory-NHORX63J.js.map} +0 -0
- /package/dist/{issue-triage-SJPKJLXH.js.map → issue-triage-TIG3RKXF.js.map} +0 -0
- /package/dist/{mcp-config-2OXIOMJ6.js.map → mcp-config-ETY7GFGW.js.map} +0 -0
- /package/dist/{mobimem-5S3VLNSU.js.map → mobimem-5PAAMVFR.js.map} +0 -0
- /package/dist/{repo-security-plan-MUFDGWSQ.js.map → repo-security-plan-KQB3ZJTE.js.map} +0 -0
- /package/dist/{research-helpers-synthesize-OBQJ5BGX.js.map → research-helpers-synthesize-ZMERZZ5B.js.map} +0 -0
- /package/dist/{routing-memory-3QBQTS4A.js.map → routing-memory-3ES3OHLM.js.map} +0 -0
- /package/dist/{session-memory-VXWLOFRC.js.map → session-memory-E2OE2CYR.js.map} +0 -0
- /package/dist/{setup-command-E6MXO5RZ.js.map → setup-command-CMCQRBJF.js.map} +0 -0
- /package/dist/{setup-config-O5F3AZBL.js.map → setup-config-KITOPV7V.js.map} +0 -0
- /package/dist/{weather-report-MUGSIOU5.js.map → weather-report-KUSVNXDZ.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createLogger
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HSOPD265.js";
|
|
4
4
|
|
|
5
5
|
// src/swe-bench/mcp-config.ts
|
|
6
6
|
import { writeFile, mkdtemp, rm } from "fs/promises";
|
|
@@ -58,4 +58,4 @@ export {
|
|
|
58
58
|
generateMcpConfig,
|
|
59
59
|
getDefaultAllowedTools
|
|
60
60
|
};
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-LKDHAJJB.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveToken
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VZ2YOQWU.js";
|
|
4
4
|
import {
|
|
5
5
|
GitHubProvider,
|
|
6
6
|
ScmError
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EPMBGZQX.js";
|
|
8
8
|
import {
|
|
9
9
|
err,
|
|
10
10
|
ok
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HSOPD265.js";
|
|
12
12
|
|
|
13
13
|
// src/scm/factory.ts
|
|
14
14
|
async function createScmProvider(config) {
|
|
@@ -41,4 +41,4 @@ export {
|
|
|
41
41
|
createScmProvider,
|
|
42
42
|
createGitHubProvider
|
|
43
43
|
};
|
|
44
|
-
//# sourceMappingURL=chunk-
|
|
44
|
+
//# sourceMappingURL=chunk-NKGTEJYU.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
createLogger,
|
|
3
3
|
getTimeProvider,
|
|
4
4
|
isRateLimitText
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-HSOPD265.js";
|
|
6
6
|
|
|
7
7
|
// src/pipeline/expert-bridge.ts
|
|
8
8
|
var logger = createLogger({ component: "expert-bridge" });
|
|
@@ -12,7 +12,7 @@ var cachedMcpConfigPath = null;
|
|
|
12
12
|
async function getMcpConfigPath() {
|
|
13
13
|
if (cachedMcpConfigPath !== null) return cachedMcpConfigPath;
|
|
14
14
|
try {
|
|
15
|
-
const { generateMcpConfig } = await import("./mcp-config-
|
|
15
|
+
const { generateMcpConfig } = await import("./mcp-config-ETY7GFGW.js");
|
|
16
16
|
const config = await generateMcpConfig();
|
|
17
17
|
cachedMcpConfigPath = config.configPath;
|
|
18
18
|
return cachedMcpConfigPath;
|
|
@@ -23,13 +23,13 @@ async function getMcpConfigPath() {
|
|
|
23
23
|
var cachedCircuitBreaker = null;
|
|
24
24
|
async function getRouter() {
|
|
25
25
|
if (cachedRouter !== null) return cachedRouter;
|
|
26
|
-
const { createAllAdapters } = await import("./factory-
|
|
27
|
-
const { createCompositeRouter } = await import("./composite-router-
|
|
26
|
+
const { createAllAdapters } = await import("./factory-NHORX63J.js");
|
|
27
|
+
const { createCompositeRouter } = await import("./composite-router-JD7URTC2.js");
|
|
28
28
|
const adapters = createAllAdapters();
|
|
29
29
|
if (adapters.size === 0) return null;
|
|
30
30
|
cachedRouter = createCompositeRouter(adapters);
|
|
31
31
|
try {
|
|
32
|
-
const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-
|
|
32
|
+
const { createCliCircuitBreakerIntegration } = await import("./cli-circuit-breaker-6EJO3PPU.js");
|
|
33
33
|
cachedCircuitBreaker = createCliCircuitBreakerIntegration([...adapters.values()]);
|
|
34
34
|
} catch {
|
|
35
35
|
}
|
|
@@ -76,7 +76,7 @@ async function dispatchWithRateLimitRetry(router, task, expertType, start) {
|
|
|
76
76
|
async function executeExpert(expertType, prompt) {
|
|
77
77
|
const start = getTimeProvider().now();
|
|
78
78
|
try {
|
|
79
|
-
const { BUILT_IN_EXPERTS } = await import("./expert-config-
|
|
79
|
+
const { BUILT_IN_EXPERTS } = await import("./expert-config-MQ5OJE3U.js");
|
|
80
80
|
const config = BUILT_IN_EXPERTS[expertType];
|
|
81
81
|
const fullPrompt = `${config.systemPrompt}
|
|
82
82
|
|
|
@@ -119,4 +119,4 @@ ${prompt}`;
|
|
|
119
119
|
export {
|
|
120
120
|
executeExpert
|
|
121
121
|
};
|
|
122
|
-
//# sourceMappingURL=chunk-
|
|
122
|
+
//# sourceMappingURL=chunk-QGODFK36.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getTokenEnvVars,
|
|
3
3
|
resolveToken
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VZ2YOQWU.js";
|
|
5
5
|
import {
|
|
6
6
|
ClaudeAdapter,
|
|
7
7
|
DEFAULT_RELEVANCE_CONFIG,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
toolSuccessStructured,
|
|
26
26
|
withProgressHeartbeat,
|
|
27
27
|
wrapToolWithTimeout
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-J245RJGW.js";
|
|
29
29
|
import {
|
|
30
30
|
REGISTRY_PATH,
|
|
31
31
|
getProjectRoot,
|
|
@@ -35,14 +35,14 @@ import {
|
|
|
35
35
|
resolveInsideRoot,
|
|
36
36
|
savePapersRegistry,
|
|
37
37
|
synthesizeResearch
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-GX436VRU.js";
|
|
39
39
|
import {
|
|
40
40
|
IssueTriage,
|
|
41
41
|
sanitizeInput
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-5COIDGQJ.js";
|
|
43
43
|
import {
|
|
44
44
|
generateSecurityPlan
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-TL2GJMJ5.js";
|
|
46
46
|
import {
|
|
47
47
|
analyzeGitHubRepo
|
|
48
48
|
} from "./chunk-BC3M4VLP.js";
|
|
@@ -61,18 +61,18 @@ import {
|
|
|
61
61
|
BuiltInExpertTypeSchema,
|
|
62
62
|
ExpertConfigSchema,
|
|
63
63
|
getSecurityKnowledgePrompt
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-LDIN2PLV.js";
|
|
65
65
|
import {
|
|
66
66
|
DEFAULT_TASK_TTL_MS,
|
|
67
67
|
clampTaskTtl
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-WSYJN7BI.js";
|
|
69
69
|
import {
|
|
70
70
|
createSessionMemory
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-KQIDTE52.js";
|
|
72
72
|
import {
|
|
73
73
|
MemoryImportance,
|
|
74
74
|
calculateTextJaccardSimilarity
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-DDQGAVQA.js";
|
|
76
76
|
import {
|
|
77
77
|
STOPWORDS,
|
|
78
78
|
capitalize,
|
|
@@ -81,13 +81,13 @@ import {
|
|
|
81
81
|
} from "./chunk-633WH2ML.js";
|
|
82
82
|
import {
|
|
83
83
|
generateMcpConfig
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-LKDHAJJB.js";
|
|
85
85
|
import {
|
|
86
86
|
getFallbackChainForCategory
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-66NNHMVB.js";
|
|
88
88
|
import {
|
|
89
89
|
executeExpert
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-QGODFK36.js";
|
|
91
91
|
import {
|
|
92
92
|
ClaudeCliAdapter,
|
|
93
93
|
CliDetectionCache,
|
|
@@ -96,7 +96,7 @@ import {
|
|
|
96
96
|
getAvailableClis,
|
|
97
97
|
sleep,
|
|
98
98
|
withTimeout
|
|
99
|
-
} from "./chunk-
|
|
99
|
+
} from "./chunk-CW2Z773T.js";
|
|
100
100
|
import {
|
|
101
101
|
AGENT_ROUTER_TIMEOUTS,
|
|
102
102
|
API_TIMEOUTS,
|
|
@@ -164,7 +164,7 @@ import {
|
|
|
164
164
|
modelSupportsAll,
|
|
165
165
|
ok,
|
|
166
166
|
toExpertTaskAnalysisResult
|
|
167
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-HSOPD265.js";
|
|
168
168
|
import {
|
|
169
169
|
isPersistenceEnabled
|
|
170
170
|
} from "./chunk-CLYZ7FWP.js";
|
|
@@ -174,7 +174,8 @@ import { z } from "zod";
|
|
|
174
174
|
var LoggingConfigSchema = z.object({
|
|
175
175
|
level: z.enum(["debug", "info", "warn", "error"]).default("info"),
|
|
176
176
|
format: z.enum(["json", "pretty"]).default("json"),
|
|
177
|
-
|
|
177
|
+
// Default to stderr: MCP stdio transport reserves stdout for JSON-RPC frames.
|
|
178
|
+
destination: z.enum(["stdout", "stderr", "file"]).default("stderr"),
|
|
178
179
|
filePath: z.string().optional()
|
|
179
180
|
});
|
|
180
181
|
var ProviderConfigSchema = z.object({
|
|
@@ -673,7 +674,9 @@ var defaultConfig = {
|
|
|
673
674
|
logging: {
|
|
674
675
|
level: "info",
|
|
675
676
|
format: "json",
|
|
676
|
-
|
|
677
|
+
// stderr is the safe default: MCP stdio transport reserves stdout for
|
|
678
|
+
// JSON-RPC frames. Any log written to stdout corrupts the transport.
|
|
679
|
+
destination: "stderr"
|
|
677
680
|
},
|
|
678
681
|
security: {
|
|
679
682
|
allowedPaths: ["./"],
|
|
@@ -9977,6 +9980,19 @@ When reviewing web-facing code, check for presence and correctness of these head
|
|
|
9977
9980
|
|
|
9978
9981
|
**Severity guidance:** Missing frame-ancestors/X-Frame-Options \u2192 medium. Missing SRI on external scripts \u2192 high. unsafe-eval without wasm-unsafe-eval justification \u2192 high. No CSP at all on public-facing app \u2192 high.
|
|
9979
9982
|
|
|
9983
|
+
### Reference Implementation
|
|
9984
|
+
- **Test-secrets canon**: \`packages/nexus-agents/src/testing/test-secrets.ts\` \u2014 FAKE_* constants (obviously fake by construction) that satisfy GitHub secret-scanning without false positives. Import these instead of inventing new fakes.
|
|
9985
|
+
- **Threat model + sandbox**: \`docs/architecture/SECURITY.md\` \u2014 canonical threat model, sandbox boundaries, CVE mitigations. Cite its sections when making recommendations.
|
|
9986
|
+
- **Untrusted-input policy**: \`docs/architecture/UNTRUSTED_INPUT_HARDENING.md\` \u2014 trust tiers, Rule of Two, typed actions, corroboration requirements. Use when evaluating new agent/MCP surfaces.
|
|
9987
|
+
- **Security rules summary**: \`.claude/rules/security.md\` \u2014 quick reference the agent operator sees first.
|
|
9988
|
+
|
|
9989
|
+
### Anti-Pattern Prohibitions
|
|
9990
|
+
- No security-through-obscurity \u2014 don't recommend hiding endpoints or obfuscating code as a substitute for actual access control
|
|
9991
|
+
- No relaxing CSP for a library \u2014 pick a CSP-safe alternative instead; \`unsafe-eval\`/\`unsafe-inline\` need a documented threat-model justification
|
|
9992
|
+
- No suggesting encryption without first stating the threat model \u2014 encryption choice depends on the adversary; "encrypt it" without "from whom?" is theater
|
|
9993
|
+
- No string-concatenated SQL/shell/HTML \u2014 always use parameterized queries, \`execFile\` over \`exec\`, and templating engines that auto-escape
|
|
9994
|
+
- No client-side-only validation \u2014 every server-trusted decision must be re-validated server-side, regardless of frontend checks
|
|
9995
|
+
|
|
9980
9996
|
### Failure Patterns to Avoid
|
|
9981
9997
|
- Do not flag test files for containing fake secrets (they use FAKE_* constants by design)
|
|
9982
9998
|
- Do not report generic OWASP findings without codebase-specific evidence
|
|
@@ -9994,6 +10010,10 @@ var TESTING_EXPERT_BASE_PROMPT = `You are a testing expert specializing in test-
|
|
|
9994
10010
|
5. Include edge cases and error scenarios
|
|
9995
10011
|
|
|
9996
10012
|
## Output Format
|
|
10013
|
+
|
|
10014
|
+
**Default: flexible output.** When generating tests, lead with the runnable test code in fenced code blocks (with the target test file path as block info, e.g. \`\`\`typescript src/foo.test.ts). Include brief inline rationale only where non-obvious. Use JSON structure only when the caller is a programmatic consumer requesting it (e.g., coverage dashboards, PR-bot integrations).
|
|
10015
|
+
|
|
10016
|
+
**Structured JSON (optional, for programmatic consumers):**
|
|
9997
10017
|
Respond with JSON matching this structure:
|
|
9998
10018
|
{
|
|
9999
10019
|
"content": "Summary of testing analysis",
|
|
@@ -10061,38 +10081,193 @@ Respond with JSON matching this structure:
|
|
|
10061
10081
|
- For broad "add tests" requests, start with untested critical paths rather than attempting exhaustive coverage
|
|
10062
10082
|
- Prefer completing thorough tests for one module over shallow tests across many modules
|
|
10063
10083
|
|
|
10084
|
+
### Reference Implementation
|
|
10085
|
+
- **Structural template**: \`packages/nexus-agents/src/agents/experts/expert-prompts/prompt-composer.test.ts\` \u2014 focused unit tests, clear describe/it nesting, no hidden fixtures.
|
|
10086
|
+
- **\`describe.each\` pattern**: \`packages/nexus-agents/src/agents/experts/code-architecture-mode-split.test.ts\` \u2014 shared-invariant testing across multiple modes/variants. Use when asserting the same invariant across parameterized subjects.
|
|
10087
|
+
- **MCP integration testing**: use \`InMemoryTransport\` from \`@modelcontextprotocol/sdk/inMemory.js\` as shown in \`.claude/rules/testing.md\`. Prefer over mocked transport.
|
|
10088
|
+
- **Canonical test-secrets**: import FAKE_* constants from \`packages/nexus-agents/src/testing/test-secrets.ts\` \u2014 never invent new fake secrets.
|
|
10089
|
+
|
|
10064
10090
|
### Output Guidance
|
|
10065
10091
|
- Always include a confidence score (0-1) with reasoning for the score
|
|
10066
10092
|
- Reference specific files by absolute path (file:line format) when reporting coverage gaps
|
|
10067
10093
|
- If test suite analysis would exceed context, focus on critical paths first
|
|
10068
10094
|
- When generating tests, include happy path + error case + edge case for each function
|
|
10069
10095
|
|
|
10096
|
+
### Anti-Pattern Prohibitions
|
|
10097
|
+
- No tests for code that doesn't exist yet \u2014 confirm the target file/function is in the tree before writing
|
|
10098
|
+
- No mocking everything \u2014 at integration boundaries (DB, file I/O, MCP transport) prefer real dependencies; use \`InMemoryTransport\` over mocked transport
|
|
10099
|
+
- No testing implementation details that will change \u2014 assert on behavior (return value, side effect) not internal call sequence
|
|
10100
|
+
- No tests duplicating existing ones \u2014 search for the function name in \`*.test.ts\` first
|
|
10101
|
+
- No \`expect(true).toBe(true)\` placeholders \u2014 if a test isn't ready, mark it \`.skip\` with a reason, don't fake a green
|
|
10102
|
+
|
|
10070
10103
|
### Failure Patterns to Avoid
|
|
10071
10104
|
- Do not generate tests that exceed max-lines-per-function (50) without extracting helpers
|
|
10072
10105
|
- Do not recommend _ prefix for unused variables \u2014 ESLint still flags them; use destructuring guards
|
|
10073
10106
|
- Do not assert exact timing values \u2014 use toBeGreaterThanOrEqual(0) for duration assertions
|
|
10074
10107
|
- Validate that test target functions and modules actually exist before generating tests`;
|
|
10075
10108
|
|
|
10076
|
-
// src/agents/experts/expert-prompts/
|
|
10077
|
-
var
|
|
10109
|
+
// src/agents/experts/expert-prompts/code-expert.ts
|
|
10110
|
+
var SHARED_CORE = `## Core Principles
|
|
10111
|
+
1. Write clean, readable, maintainable code
|
|
10112
|
+
2. Follow language-specific conventions and idioms
|
|
10113
|
+
3. Prioritize correctness, then clarity, then performance
|
|
10114
|
+
4. Apply SOLID principles and design patterns only when justified by \u22652 concrete use sites
|
|
10115
|
+
5. Consider edge cases and error handling
|
|
10116
|
+
|
|
10117
|
+
## Codebase Rules (mandatory, both modes)
|
|
10118
|
+
- Follow canonical paths \u2014 one implementation per concern; never fork, always refactor
|
|
10119
|
+
- Anti-sprawl \u2014 modify existing files; never create \`enhanced_*\`, \`v2_*\`, \`new_*\` files
|
|
10120
|
+
- Priority order \u2014 correctness > simplicity > performance > cleverness
|
|
10121
|
+
- YAGNI \u2014 do not build for hypothetical future requirements
|
|
10122
|
+
|
|
10123
|
+
## TypeScript & ESLint Constraints
|
|
10124
|
+
- \`no-explicit-any: error\` \u2014 use \`unknown\` + type guards or Zod validation
|
|
10125
|
+
- \`max-lines-per-function: 50\` \u2014 extract helpers for complex logic
|
|
10126
|
+
- \`max-lines: 400\` per file \u2014 split large modules into focused files
|
|
10127
|
+
- \`max-params: 5\` \u2014 use options objects for functions with more
|
|
10128
|
+
- Use \`Result<T, E>\` for fallible operations, never exceptions for control flow
|
|
10129
|
+
|
|
10130
|
+
## Anti-Pattern Prohibitions
|
|
10131
|
+
- No premature generalization \u2014 two instances is a coincidence, three is a pattern worth extracting
|
|
10132
|
+
- No new utility files when a matching one exists; add to the existing module
|
|
10133
|
+
- No refactors that span >3 files without a tracking issue
|
|
10134
|
+
- No speculative error handling for scenarios that cannot happen \u2014 trust internal code
|
|
10135
|
+
- No "improvements" to code that doesn't have a reported problem
|
|
10136
|
+
|
|
10137
|
+
## Reference Implementation
|
|
10138
|
+
This codebase's canonical patterns live in:
|
|
10139
|
+
- **Adapter registry**: \`src/adapters/unified-registry.ts\` \u2014 single entry point, global singleton pattern done right
|
|
10140
|
+
- **Result<T, E>**: \`src/core/types/index.ts\` \u2014 never use throw for control flow
|
|
10141
|
+
- **Expert prompts**: \`src/agents/experts/expert-prompts/*.ts\` \u2014 short focused files, one concern each
|
|
10142
|
+
- **Testing structure**: \`src/agents/experts/expert-prompts/prompt-composer.test.ts\` \u2014 template for structure
|
|
10143
|
+
|
|
10144
|
+
When suggesting a pattern, cite one of these (or a better example from the same directory) by path.
|
|
10145
|
+
|
|
10146
|
+
## Push-Back Cues
|
|
10147
|
+
- If a refactor would break >1 call site, ask for scope clarification before proceeding
|
|
10148
|
+
- If the task description contradicts a canonical path (e.g., "write a new adapter registry"), push back and cite the existing canonical module
|
|
10149
|
+
- If the requested change has no test and is non-trivial, recommend writing the test first
|
|
10150
|
+
- If confidence <0.6 because assumptions depend on unread code, say so and list what you need to read`;
|
|
10151
|
+
var REVIEW_PROMPT = `You are a code expert in **review mode**. Your job is to audit code for correctness, style, performance, security, and maintainability. Produce structured findings; do not write replacement code unless the caller asks.
|
|
10152
|
+
|
|
10153
|
+
${SHARED_CORE}
|
|
10154
|
+
|
|
10155
|
+
## Output Format (strict JSON)
|
|
10156
|
+
Respond with JSON matching this structure:
|
|
10157
|
+
{
|
|
10158
|
+
"content": "Summary of code analysis",
|
|
10159
|
+
"issues": [
|
|
10160
|
+
{
|
|
10161
|
+
"severity": "error" | "warning" | "info",
|
|
10162
|
+
"type": "bug" | "style" | "performance" | "security" | "maintainability",
|
|
10163
|
+
"description": "Issue description",
|
|
10164
|
+
"location": "file:line",
|
|
10165
|
+
"suggestion": "How to fix"
|
|
10166
|
+
}
|
|
10167
|
+
],
|
|
10168
|
+
"suggestions": [
|
|
10169
|
+
{
|
|
10170
|
+
"type": "refactor" | "optimize" | "simplify",
|
|
10171
|
+
"description": "Suggestion description",
|
|
10172
|
+
"before": "// current code",
|
|
10173
|
+
"after": "// improved code"
|
|
10174
|
+
}
|
|
10175
|
+
],
|
|
10176
|
+
"recommendations": ["Code improvement 1"],
|
|
10177
|
+
"warnings": ["Code concern 1"],
|
|
10178
|
+
"confidence": 0.0-1.0
|
|
10179
|
+
}
|
|
10078
10180
|
|
|
10079
|
-
##
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
4. Consider scalability and performance
|
|
10084
|
-
5. Document architectural decisions (ADRs)
|
|
10181
|
+
## Task Scope Management
|
|
10182
|
+
- For broad review requests (>3 files or >200 LOC of change), focus on the highest-severity issues first
|
|
10183
|
+
- If analysis would exceed context, cut lower-severity issues and note what was skipped
|
|
10184
|
+
- Confidence <0.5 only when conclusions depend on unread code; say which files you'd need
|
|
10085
10185
|
|
|
10086
|
-
##
|
|
10186
|
+
## Failure Patterns to Avoid
|
|
10187
|
+
- Do not propose changes that conflict with canonical paths \u2014 cite the canonical module instead
|
|
10188
|
+
- Do not recommend abstractions for one-time operations
|
|
10189
|
+
- Validate file:line references before reporting
|
|
10190
|
+
- Do not flag style choices that match documented project conventions`;
|
|
10191
|
+
var GENERATE_PROMPT = `You are a code expert in **generate mode**. Your job is to write code \u2014 refactors, optimizations, new implementations, migrations. Output running code with inline rationale; JSON structure is optional.
|
|
10192
|
+
|
|
10193
|
+
${SHARED_CORE}
|
|
10194
|
+
|
|
10195
|
+
## Output Format (flexible)
|
|
10196
|
+
Lead with a one-line statement of the change (what + why). Then provide:
|
|
10197
|
+
|
|
10198
|
+
1. **Running code** in fenced blocks with the target file path as the block info, e.g. \`\`\`typescript src/foo/bar.ts
|
|
10199
|
+
2. **Inline rationale** as code comments only when the "why" is non-obvious
|
|
10200
|
+
3. **Short summary** of follow-ups (tests to add, dependent files to update, call-site migrations)
|
|
10201
|
+
|
|
10202
|
+
Only use JSON output if the caller is a programmatic consumer asking for structure.
|
|
10203
|
+
|
|
10204
|
+
## Generation Directives
|
|
10205
|
+
- Write the minimum code to make the stated requirement pass. No speculative flags, no unused parameters.
|
|
10206
|
+
- When refactoring: preserve existing behavior unless the task specifies otherwise. Diff should be reviewable.
|
|
10207
|
+
- When optimizing: measure or cite the bottleneck. Never optimize without evidence.
|
|
10208
|
+
- When migrating: do the conservative migration first; flag divergent-behavior cases separately.
|
|
10209
|
+
|
|
10210
|
+
## Task Scope Management
|
|
10211
|
+
- For broad "refactor the module" requests, narrow to the most impactful change and note remaining work
|
|
10212
|
+
- Prefer completing one focused subtask well over partially completing a broad task
|
|
10213
|
+
- If the task requires changes in >3 files, produce the highest-leverage one and list the rest as follow-up
|
|
10214
|
+
|
|
10215
|
+
## Failure Patterns to Avoid
|
|
10216
|
+
- Do not add features, refactor, or introduce abstractions beyond what the task requires
|
|
10217
|
+
- Do not add error handling, fallbacks, or validation for scenarios that can't happen
|
|
10218
|
+
- Do not write multi-paragraph docstrings; one short comment max when the why is non-obvious
|
|
10219
|
+
- Do not reference the current task or callers in code comments \u2014 those belong in the PR description
|
|
10220
|
+
- Do not hide tradeoffs \u2014 if your choice has a known cost, name it in the rationale`;
|
|
10221
|
+
|
|
10222
|
+
// src/agents/experts/expert-prompts/architecture-expert.ts
|
|
10223
|
+
var SHARED_CORE2 = `## Core Principles
|
|
10224
|
+
1. Follow SOLID principles when they fit \u2014 not by reflex
|
|
10225
|
+
2. Favor composition over inheritance
|
|
10226
|
+
3. Design for change with evidence, not speculation
|
|
10227
|
+
4. Consider scalability and performance in context (not as abstract ideals)
|
|
10228
|
+
5. Document architectural decisions (ADRs) when the choice is non-obvious or reversible
|
|
10229
|
+
|
|
10230
|
+
## Codebase Rules (mandatory, both modes)
|
|
10231
|
+
- Follow canonical paths \u2014 one implementation per concern; never fork, always refactor
|
|
10232
|
+
- Anti-sprawl \u2014 modify existing files; never create \`enhanced_*\`, \`v2_*\`, \`new_*\` files
|
|
10233
|
+
- Priority order \u2014 correctness > simplicity > performance > cleverness
|
|
10234
|
+
- Do not recommend abstractions for one-time operations
|
|
10235
|
+
|
|
10236
|
+
## Anti-Pattern Prohibitions
|
|
10237
|
+
- No factory pattern for single-use objects
|
|
10238
|
+
- No adapter layer unless \u22652 incompatible consumer APIs exist
|
|
10239
|
+
- No "future-proofing" abstractions without a concrete second use case
|
|
10240
|
+
- No layered-architecture-for-its-own-sake \u2014 every layer must pay its coupling cost
|
|
10241
|
+
- No premature service extraction \u2014 keep it a module until boundaries are clear
|
|
10242
|
+
|
|
10243
|
+
## Reference Implementation
|
|
10244
|
+
This codebase's canonical architectural patterns:
|
|
10245
|
+
- **Adapter registry + lifecycle**: \`src/adapters/unified-registry.ts\` + \`src/adapters/resilient-adapter.ts\` \u2014 singleton + lifecycle wrapper, clean separation
|
|
10246
|
+
- **Graph / orchestration boundary**: \`src/orchestration/graph/graph-builder.ts\` \u2014 template-driven, explicit contract
|
|
10247
|
+
- **Pipeline primitives**: \`src/pipeline/pipeline-runner.ts\` + \`task-contract.ts\` + \`plugin-registry.ts\` \u2014 small, composable, each file one concern
|
|
10248
|
+
- **CompositeRouter**: \`src/cli-adapters/composite-router.ts\` \u2014 chain of stages with explicit ordering
|
|
10249
|
+
|
|
10250
|
+
When proposing a pattern, cite one of these (or a better example from the same directory) and explain what it demonstrates.
|
|
10251
|
+
|
|
10252
|
+
## Push-Back Cues
|
|
10253
|
+
- If request contradicts canonical paths, push back and cite the existing module instead of designing something new
|
|
10254
|
+
- If request asks for a new abstraction with only one concrete use site, refuse and propose inlining
|
|
10255
|
+
- If request seeks architectural "cleanup" without a stated pain point, ask what problem it solves
|
|
10256
|
+
- Confidence <0.6 when recommendation depends on unmeasured non-functional requirements (scalability targets, latency budgets, team size)`;
|
|
10257
|
+
var AUDIT_PROMPT = `You are an architecture expert in **audit mode**. Your job is to validate existing design against canonical paths, identify drift, assess tradeoffs of current choices, and flag boundary violations. You do NOT propose greenfield designs \u2014 use design mode for that.
|
|
10258
|
+
|
|
10259
|
+
${SHARED_CORE2}
|
|
10260
|
+
|
|
10261
|
+
## Output Format (strict JSON)
|
|
10087
10262
|
Respond with JSON matching this structure:
|
|
10088
10263
|
{
|
|
10089
|
-
"content": "Summary of architectural
|
|
10264
|
+
"content": "Summary of architectural audit",
|
|
10090
10265
|
"patterns": [
|
|
10091
10266
|
{
|
|
10092
|
-
"name": "Pattern
|
|
10267
|
+
"name": "Pattern in use",
|
|
10093
10268
|
"category": "creational" | "structural" | "behavioral" | "architectural",
|
|
10094
|
-
"applicability": "
|
|
10095
|
-
"tradeoffs": ["
|
|
10269
|
+
"applicability": "Why this pattern is here",
|
|
10270
|
+
"tradeoffs": ["Current cost", "Current benefit"]
|
|
10096
10271
|
}
|
|
10097
10272
|
],
|
|
10098
10273
|
"components": [
|
|
@@ -10108,34 +10283,47 @@ Respond with JSON matching this structure:
|
|
|
10108
10283
|
"confidence": 0.0-1.0
|
|
10109
10284
|
}
|
|
10110
10285
|
|
|
10111
|
-
##
|
|
10112
|
-
-
|
|
10113
|
-
-
|
|
10114
|
-
-
|
|
10115
|
-
|
|
10116
|
-
## Project-Specific Conventions
|
|
10117
|
-
|
|
10118
|
-
### Codebase Rules
|
|
10119
|
-
- Follow canonical paths (one implementation per concern) \u2014 never fork, always refactor
|
|
10120
|
-
- Anti-sprawl: modify existing files, never create enhanced_*, v2_*, or new_* files
|
|
10121
|
-
- Priority order: correctness > simplicity > performance > cleverness
|
|
10122
|
-
- Do not recommend abstractions for one-time operations (YAGNI)
|
|
10123
|
-
|
|
10124
|
-
### Output Guidance
|
|
10125
|
-
- Always include a confidence score (0-1) with reasoning for the score
|
|
10126
|
-
- Reference specific files by absolute path when making recommendations
|
|
10127
|
-
- If full ADR analysis would exceed context, provide a focused summary instead
|
|
10286
|
+
## Task Scope Management
|
|
10287
|
+
- For broad audit requests, focus on the 3 most impactful components rather than the whole system
|
|
10288
|
+
- Keep total response under 3000 tokens \u2014 focused findings beat exhaustive documentation
|
|
10289
|
+
- Prefer depth over breadth: thorough audit of one concern beats shallow coverage of many
|
|
10128
10290
|
|
|
10129
|
-
|
|
10130
|
-
- For broad architecture review requests, focus on the 3 most impactful components rather than analyzing the entire system
|
|
10131
|
-
- Keep total response under 3000 tokens \u2014 provide focused recommendations, not exhaustive documentation
|
|
10132
|
-
- If an ADR analysis would be too large, produce a decision summary with trade-offs and recommend a follow-up for full analysis
|
|
10133
|
-
- Prefer depth over breadth: thorough analysis of one architectural concern beats shallow coverage of many
|
|
10134
|
-
|
|
10135
|
-
### Failure Patterns to Avoid
|
|
10291
|
+
## Failure Patterns to Avoid
|
|
10136
10292
|
- Do not propose changes that conflict with existing canonical paths
|
|
10137
|
-
- Validate that referenced files and modules actually exist
|
|
10138
|
-
- Do not add speculative layers or interfaces
|
|
10293
|
+
- Validate that referenced files and modules actually exist
|
|
10294
|
+
- Do not add speculative layers or interfaces in an audit \u2014 that's design-mode work
|
|
10295
|
+
- Do not recommend migrations without stating the triggering pain point`;
|
|
10296
|
+
var DESIGN_PROMPT = `You are an architecture expert in **design mode**. Your job is to produce greenfield design proposals, component topology, and explicit boundary commitments. Lead with the design, not with a schema.
|
|
10297
|
+
|
|
10298
|
+
${SHARED_CORE2}
|
|
10299
|
+
|
|
10300
|
+
## Output Format (flexible)
|
|
10301
|
+
1. **Problem statement** \u2014 one paragraph, what we're designing and why
|
|
10302
|
+
2. **Decision** \u2014 the recommended approach in plain language (include diagrams as ASCII or mermaid if useful)
|
|
10303
|
+
3. **Rationale** \u2014 why this over alternatives (\u22643 alternatives; name them and explain the rejection)
|
|
10304
|
+
4. **Component boundaries** \u2014 what owns what, what's coupled, what's not
|
|
10305
|
+
5. **Tradeoffs accepted** \u2014 name the cost of the chosen path explicitly
|
|
10306
|
+
6. **Open questions** \u2014 what would need to be decided or measured before implementation
|
|
10307
|
+
|
|
10308
|
+
JSON output optional, use only if the caller is programmatic.
|
|
10309
|
+
|
|
10310
|
+
## Design Directives
|
|
10311
|
+
- Commit to one design; don't offer three equivalent options \u2014 that's indecision
|
|
10312
|
+
- Every proposed component must have a single named responsibility
|
|
10313
|
+
- Every proposed boundary must have a stated reason (change axis, security, testability, latency)
|
|
10314
|
+
- If the design duplicates an existing canonical pattern, use the existing one and explain the adaptation
|
|
10315
|
+
|
|
10316
|
+
## Task Scope Management
|
|
10317
|
+
- Produce one focused design at a time \u2014 composition can come later
|
|
10318
|
+
- If the scope includes >3 new components, narrow to the 1-2 highest-leverage ones and note the rest as follow-up
|
|
10319
|
+
- Match depth to risk: conservative for reversible choices, detailed for irreversible
|
|
10320
|
+
|
|
10321
|
+
## Failure Patterns to Avoid
|
|
10322
|
+
- Do not design for hypothetical future requirements
|
|
10323
|
+
- Do not propose CQRS/microservices/event-sourcing unless the scale demands it
|
|
10324
|
+
- Do not introduce new vocabulary when existing codebase terms cover the concept
|
|
10325
|
+
- Do not skip naming the alternative you rejected \u2014 the rejection is part of the design`;
|
|
10326
|
+
var ARCHITECTURE_EXPERT_BASE_PROMPT = AUDIT_PROMPT;
|
|
10139
10327
|
|
|
10140
10328
|
// src/agents/experts/expert-prompts/documentation-expert.ts
|
|
10141
10329
|
var DOCUMENTATION_EXPERT_BASE_PROMPT = `You are a technical documentation expert specializing in creating clear, comprehensive, and user-friendly documentation.
|
|
@@ -10200,12 +10388,25 @@ Respond with JSON matching this structure:
|
|
|
10200
10388
|
- All docs must be indexed in docs/README.md to be valid (canonical index)
|
|
10201
10389
|
- Use YAML frontmatter (title, description, tier, keywords) for tier 1/2 docs
|
|
10202
10390
|
|
|
10391
|
+
### Reference Implementation
|
|
10392
|
+
- **Canonical index**: \`docs/README.md\` \u2014 every new doc MUST be linked here. Unindexed docs are invalid.
|
|
10393
|
+
- **Exemplar architectural doc**: \`docs/architecture/SECURITY.md\` \u2014 threat model + sandbox + CVE mitigations in one coherent narrative. Use as the template for depth and structure.
|
|
10394
|
+
- **Exemplar compliance doc**: \`docs/architecture/UNTRUSTED_INPUT_HARDENING.md\` \u2014 trust tiers, invariants, typed actions. Shows how to document policy with enforcement hooks.
|
|
10395
|
+
- **Research index**: \`docs/research/RESEARCH_INDEX.md\` \u2014 the pattern for a registry-backed doc category.
|
|
10396
|
+
|
|
10203
10397
|
### Output Guidance
|
|
10204
10398
|
- Always include a confidence score (0-1) with reasoning for the score
|
|
10205
10399
|
- Reference specific files by absolute path when documenting code behavior
|
|
10206
10400
|
- If documentation analysis would exceed context, focus on critical gaps first
|
|
10207
10401
|
- Verify documented behavior against actual code before making claims
|
|
10208
10402
|
|
|
10403
|
+
### Anti-Pattern Prohibitions
|
|
10404
|
+
- Do NOT invent new doc types or categories \u2014 every new doc fits an existing tier (Architecture, Development, Research, Reference) and is linked from \`docs/README.md\`
|
|
10405
|
+
- Do NOT document undocumented config options without verifying they exist in code; missing-from-docs is OK, fabricating is not
|
|
10406
|
+
- Do NOT document speculative future features in current docs \u2014 if it's not implemented, it doesn't belong in user-facing docs
|
|
10407
|
+
- Do NOT use marketing voice ("powerful", "seamless", "revolutionary") \u2014 state what something does precisely
|
|
10408
|
+
- Do NOT create parallel indexes \u2014 \`docs/README.md\` is the only canonical one
|
|
10409
|
+
|
|
10209
10410
|
### Failure Patterns to Avoid
|
|
10210
10411
|
- Do not claim features that do not exist in the codebase
|
|
10211
10412
|
- Do not create parallel documentation indexes (only docs/README.md is canonical)
|
|
@@ -40633,7 +40834,7 @@ async function tryIssueTriage(task) {
|
|
|
40633
40834
|
try {
|
|
40634
40835
|
const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
|
|
40635
40836
|
if (issueMatch === null) return null;
|
|
40636
|
-
const { createIssueTriage } = await import("./issue-triage-
|
|
40837
|
+
const { createIssueTriage } = await import("./issue-triage-TIG3RKXF.js");
|
|
40637
40838
|
const triage = createIssueTriage();
|
|
40638
40839
|
const owner = issueMatch[1] ?? "";
|
|
40639
40840
|
const num = issueMatch[2] ?? "";
|
|
@@ -40661,7 +40862,7 @@ var VALID_TEMPLATES = /* @__PURE__ */ new Set([
|
|
|
40661
40862
|
]);
|
|
40662
40863
|
async function classifyWithLLM(task) {
|
|
40663
40864
|
try {
|
|
40664
|
-
const { executeExpert: executeExpert2 } = await import("./expert-bridge-
|
|
40865
|
+
const { executeExpert: executeExpert2 } = await import("./expert-bridge-J36C7VES.js");
|
|
40665
40866
|
const prompt = [
|
|
40666
40867
|
"Classify this task into exactly one pipeline template.",
|
|
40667
40868
|
"Templates: dev (implementation/bug fix/refactor), research (investigate/evaluate/compare),",
|
|
@@ -41442,7 +41643,7 @@ var memoryInitPromise = null;
|
|
|
41442
41643
|
async function initPipelineMemory() {
|
|
41443
41644
|
if (cachedMemory !== null) return cachedMemory;
|
|
41444
41645
|
try {
|
|
41445
|
-
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-
|
|
41646
|
+
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-E2OE2CYR.js");
|
|
41446
41647
|
const { LEARNING_DIR } = await import("./learning-persistence-WMWZJZ35.js");
|
|
41447
41648
|
const mem = createSessionMemory2(LEARNING_DIR);
|
|
41448
41649
|
mem.startSession(`pipeline-${String(Date.now())}`);
|
|
@@ -41495,7 +41696,7 @@ async function persistMobiMemState() {
|
|
|
41495
41696
|
if (!isPersistenceEnabled2()) return;
|
|
41496
41697
|
const os5 = await import("os");
|
|
41497
41698
|
const path19 = await import("path");
|
|
41498
|
-
const { createMobiMem } = await import("./mobimem-
|
|
41699
|
+
const { createMobiMem } = await import("./mobimem-5PAAMVFR.js");
|
|
41499
41700
|
const mobimem = createMobiMem();
|
|
41500
41701
|
const savePath = path19.join(os5.homedir(), ".nexus-agents", "memory", "mobimem-state.json");
|
|
41501
41702
|
await mobimem.save(savePath);
|
|
@@ -41512,7 +41713,7 @@ function recordRoutingExperience(category, success, durationMs) {
|
|
|
41512
41713
|
callRecord(routingMemoryCache);
|
|
41513
41714
|
return;
|
|
41514
41715
|
}
|
|
41515
|
-
void import("./routing-memory-
|
|
41716
|
+
void import("./routing-memory-3ES3OHLM.js").then(({ createRoutingMemory }) => {
|
|
41516
41717
|
routingMemoryCache = createRoutingMemory();
|
|
41517
41718
|
callRecord(routingMemoryCache);
|
|
41518
41719
|
}).catch(() => {
|
|
@@ -41539,7 +41740,7 @@ ${text}` : "";
|
|
|
41539
41740
|
}
|
|
41540
41741
|
async function getWeatherContext() {
|
|
41541
41742
|
try {
|
|
41542
|
-
const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-
|
|
41743
|
+
const { generateWeatherReport: generateWeatherReport2 } = await import("./weather-report-KUSVNXDZ.js");
|
|
41543
41744
|
const report = generateWeatherReport2({ includeAdaptive: true });
|
|
41544
41745
|
const mappings = "recommendedMappings" in report ? report.recommendedMappings : [];
|
|
41545
41746
|
if (!Array.isArray(mappings) || mappings.length === 0) return "";
|
|
@@ -41556,7 +41757,7 @@ ${lines}
|
|
|
41556
41757
|
}
|
|
41557
41758
|
async function getMemoryContext(task) {
|
|
41558
41759
|
try {
|
|
41559
|
-
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-
|
|
41760
|
+
const { createSessionMemory: createSessionMemory2 } = await import("./session-memory-E2OE2CYR.js");
|
|
41560
41761
|
const { LEARNING_DIR } = await import("./learning-persistence-WMWZJZ35.js");
|
|
41561
41762
|
const memory = createSessionMemory2(LEARNING_DIR, { maxLearningsInContext: 10 });
|
|
41562
41763
|
const learnings = memory.searchLearnings(task.slice(0, 200));
|
|
@@ -41649,7 +41850,7 @@ ${contextBlock}`;
|
|
|
41649
41850
|
const strategy = config.votingStrategy ?? "higher_order";
|
|
41650
41851
|
await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
|
|
41651
41852
|
try {
|
|
41652
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
41853
|
+
const { executeVoting } = await import("./consensus-vote-COW34Q2Y.js");
|
|
41653
41854
|
const votingResult = await executeVoting(
|
|
41654
41855
|
{
|
|
41655
41856
|
proposal: plan.slice(0, 4e3),
|
|
@@ -42481,7 +42682,7 @@ async function extractSymbolsForTask(task) {
|
|
|
42481
42682
|
}
|
|
42482
42683
|
async function retrieveAdaptiveMemory(task) {
|
|
42483
42684
|
try {
|
|
42484
|
-
const { AdaptiveMemoryBackend } = await import("./adaptive-memory-
|
|
42685
|
+
const { AdaptiveMemoryBackend } = await import("./adaptive-memory-5VP5WWTE.js");
|
|
42485
42686
|
const os5 = await import("os");
|
|
42486
42687
|
const path19 = await import("path");
|
|
42487
42688
|
const baseDir = path19.join(os5.homedir(), ".nexus-agents", "memory");
|
|
@@ -42500,7 +42701,7 @@ async function retrieveAdaptiveMemory(task) {
|
|
|
42500
42701
|
}
|
|
42501
42702
|
async function queryResearchRegistry(task) {
|
|
42502
42703
|
try {
|
|
42503
|
-
const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-
|
|
42704
|
+
const { synthesizeResearch: synthesizeResearch2 } = await import("./research-helpers-synthesize-ZMERZZ5B.js");
|
|
42504
42705
|
const topic = task.split(/[.!?\n]/).filter((s) => s.trim().length > 10)[0]?.trim();
|
|
42505
42706
|
if (topic === void 0) return null;
|
|
42506
42707
|
const result = await synthesizeResearch2(topic.slice(0, 50));
|
|
@@ -42585,7 +42786,7 @@ function createScanStageWrapper() {
|
|
|
42585
42786
|
try {
|
|
42586
42787
|
const slug = ctx.task.match(/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)/)?.[1];
|
|
42587
42788
|
if (slug !== void 0) {
|
|
42588
|
-
const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-
|
|
42789
|
+
const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-KQB3ZJTE.js");
|
|
42589
42790
|
const plan = await generateSecurityPlan2({ repo: slug, maxScanners: 10 });
|
|
42590
42791
|
const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
|
|
42591
42792
|
ctx.sharedMemory.write("scan", "decision", { recommendations: recs });
|
|
@@ -51972,7 +52173,7 @@ var GitHubTaskTracker = class {
|
|
|
51972
52173
|
cachedProvider = null;
|
|
51973
52174
|
async getProvider() {
|
|
51974
52175
|
if (this.cachedProvider !== null) return this.cachedProvider;
|
|
51975
|
-
const { createScmProvider } = await import("./factory-
|
|
52176
|
+
const { createScmProvider } = await import("./factory-4Z4RSUYE.js");
|
|
51976
52177
|
const result = await createScmProvider({ repo: this.config.repo ?? "" });
|
|
51977
52178
|
if (!result.ok) throw new Error(`SCM provider error: ${result.error.message}`);
|
|
51978
52179
|
this.cachedProvider = result.value;
|
|
@@ -52811,4 +53012,4 @@ export {
|
|
|
52811
53012
|
detectBackend,
|
|
52812
53013
|
createTaskTracker
|
|
52813
53014
|
};
|
|
52814
|
-
//# sourceMappingURL=chunk-
|
|
53015
|
+
//# sourceMappingURL=chunk-QSNAFOE6.js.map
|