nexus-agents 2.77.1 → 2.77.3

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.
@@ -190,7 +190,10 @@ function analyzeRepo(metadata, topLevelEntries, workflowEntries) {
190
190
  packageManager: detectPackageManager(topLevelEntries),
191
191
  ciProvider,
192
192
  securityTooling: secTooling,
193
- hasDockerfile: topLevelEntries.includes("Dockerfile") || topLevelEntries.includes("docker-compose.yml") || topLevelEntries.includes("docker-compose.yaml"),
193
+ // Match `Dockerfile`, `Dockerfile.<purpose>` (e.g. `Dockerfile.sandbox`),
194
+ // and docker-compose variants. Pre-#2730 the check was exact-match only,
195
+ // so a repo with three legitimate `Dockerfile.*` files reported false.
196
+ hasDockerfile: topLevelEntries.some((e) => e === "Dockerfile" || e.startsWith("Dockerfile.")) || topLevelEntries.includes("docker-compose.yml") || topLevelEntries.includes("docker-compose.yaml"),
194
197
  hasHelmCharts: topLevelEntries.includes("Chart.yaml") || topLevelEntries.includes("charts") || topLevelEntries.includes("helm"),
195
198
  hasMakefile: topLevelEntries.includes("Makefile"),
196
199
  hasTests,
@@ -356,4 +359,4 @@ export {
356
359
  analyzeRepo,
357
360
  analyzeGitHubRepo
358
361
  };
359
- //# sourceMappingURL=chunk-BC3M4VLP.js.map
362
+ //# sourceMappingURL=chunk-BMOPMCFZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/mcp/tools/repo-analyze.ts"],"sourcesContent":["/* eslint-disable max-lines -- cohesive module, governance allows 400-600 */\n/**\n * nexus-agents/mcp - Repository Analyze Logic\n *\n * Inspects a GitHub repository and returns structured analysis\n * including language, tooling, CI, security, and gap identification.\n *\n * @module mcp/tools/repo-analyze\n * (Source: Issue #1074)\n */\n\nimport type { RepoAnalyzeInput, RepoAnalysis } from './repo-analyze-types.js';\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\n/** Normalize \"owner/repo\" from either \"owner/repo\" or full GitHub URL. */\nexport function normalizeRepoId(input: string): string {\n const urlMatch = /github\\.com\\/([^/]+\\/[^/]+?)(?:\\.git)?(?:\\/|$)/.exec(input);\n const matched = urlMatch?.[1] ?? '';\n if (matched.length > 0) return matched;\n if (/^[^/]+\\/[^/]+$/.test(input)) return input;\n throw new Error(`Invalid repo format: \"${input}\". Use \"owner/name\" or a GitHub URL.`);\n}\n\n/** Package manager detection rules: [files, manager]. First match wins. */\nconst PACKAGE_MANAGER_RULES: ReadonlyArray<readonly [readonly string[], string]> = [\n [['pnpm-lock.yaml'], 'pnpm'],\n [['yarn.lock'], 'yarn'],\n [['package-lock.json', 'package.json'], 'npm'],\n [['Cargo.toml'], 'cargo'],\n [['go.mod'], 'go'],\n [['requirements.txt', 'pyproject.toml'], 'pip'],\n [['Gemfile'], 'bundler'],\n [['pom.xml'], 'maven'],\n [['build.gradle', 'build.gradle.kts'], 'gradle'],\n];\n\n/** Detect package manager from top-level files. */\nexport function detectPackageManager(entries: readonly string[]): string | null {\n for (const [files, manager] of PACKAGE_MANAGER_RULES) {\n if (files.some((f) => entries.includes(f))) return manager;\n }\n return null;\n}\n\n/** Detect CI provider from directory structure. */\nexport function detectCiProvider(entries: readonly string[]): string | null {\n if (entries.includes('.github')) return 'github-actions';\n if (entries.includes('.gitlab-ci.yml')) return 'gitlab-ci';\n if (entries.includes('Jenkinsfile')) return 'jenkins';\n if (entries.includes('.circleci')) return 'circleci';\n if (entries.includes('.travis.yml')) return 'travis';\n if (entries.includes('azure-pipelines.yml')) return 'azure-devops';\n if (entries.includes('concourse')) return 'concourse';\n return null;\n}\n\n/** Tool names detectable from CI workflow filenames (#1674). */\nconst WORKFLOW_SECURITY_PATTERNS: ReadonlyArray<readonly [string, string]> = [\n ['semgrep', 'semgrep'],\n ['codeql', 'codeql'],\n ['grype', 'grype'],\n ['snyk', 'snyk'],\n];\n\n/** Detect security tools from .github/workflows/ filenames. */\nfunction detectWorkflowSecurity(\n workflowEntries: readonly string[],\n existing: readonly string[]\n): readonly string[] {\n const wfLower = workflowEntries.map((w) => w.toLowerCase());\n const found: string[] = [];\n for (const [pattern, tool] of WORKFLOW_SECURITY_PATTERNS) {\n if (!existing.includes(tool) && wfLower.some((w) => w.includes(pattern))) {\n found.push(tool);\n }\n }\n return found;\n}\n\n/** Detect security tooling from root files and CI workflow filenames (#1674). */\nexport function detectSecurityTooling(\n entries: readonly string[],\n workflowEntries?: readonly string[]\n): readonly string[] {\n const tools: string[] = [];\n if (entries.includes('.semgrep.yml') || entries.includes('.semgrep')) tools.push('semgrep');\n if (entries.includes('.snyk')) tools.push('snyk');\n if (entries.includes('SECURITY.md')) tools.push('security-policy');\n if (entries.includes('.grype.yaml')) tools.push('grype');\n if (entries.includes('CODEOWNERS')) tools.push('codeowners');\n if (workflowEntries !== undefined) {\n tools.push(...detectWorkflowSecurity(workflowEntries, tools));\n }\n return tools;\n}\n\n/** Detect framework from package manager config. */\nexport function detectFramework(entries: readonly string[]): string | null {\n if (entries.includes('helmfile.yaml') || entries.includes('helmfile.yaml.gotmpl'))\n return 'helmfile';\n if (entries.includes('next.config.js') || entries.includes('next.config.ts')) return 'nextjs';\n if (entries.includes('angular.json')) return 'angular';\n if (entries.includes('vite.config.ts') || entries.includes('vite.config.js')) return 'vite';\n if (entries.includes('tsconfig.json') && entries.includes('package.json')) return 'typescript';\n return null;\n}\n\n/** Gap detection rules: [files-any-present, gap message]. */\nconst GAP_RULES: ReadonlyArray<readonly [readonly string[], string]> = [\n [['SECURITY.md'], 'No SECURITY.md policy'],\n [['CODEOWNERS'], 'No CODEOWNERS file'],\n [['LICENSE', 'LICENSE.md'], 'No LICENSE file'],\n [\n ['.semgrep.yml', '.semgrep', '.grype.yaml', '.snyk'],\n 'No SAST/SCA security scanning configured',\n ],\n // Test detection handled separately via detectTestInfra (supports monorepo + co-located patterns)\n [['.gitignore'], 'No .gitignore file'],\n];\n\n/** Scanner recommendation per language. Canonical source: secure-language-stacks. */\ninterface LanguageScanners {\n readonly sast: readonly string[];\n readonly sca: readonly string[];\n}\n\nconst LANGUAGE_SCANNER_MATRIX: Readonly<Record<string, LanguageScanners>> = {\n TypeScript: {\n sast: ['semgrep (p/typescript, p/nodejs)', 'eslint-plugin-security'],\n sca: ['osv-scanner', 'npm audit'],\n },\n JavaScript: {\n sast: ['semgrep (p/javascript, p/nodejs)', 'eslint-plugin-security'],\n sca: ['osv-scanner', 'npm audit'],\n },\n Python: {\n sast: ['semgrep (p/python)', 'bandit'],\n sca: ['osv-scanner', 'pip-audit'],\n },\n Java: {\n sast: ['semgrep (p/java)', 'spotbugs + find-sec-bugs'],\n sca: ['osv-scanner', 'OWASP dependency-check'],\n },\n Go: {\n sast: ['semgrep (p/golang)', 'gosec'],\n sca: ['osv-scanner', 'govulncheck'],\n },\n Rust: {\n sast: ['semgrep (p/rust)'],\n sca: ['osv-scanner', 'cargo-audit'],\n },\n 'C++': {\n sast: ['semgrep (p/c)', 'cppcheck'],\n sca: ['osv-scanner'],\n },\n C: {\n sast: ['semgrep (p/c)', 'cppcheck'],\n sca: ['osv-scanner'],\n },\n Kotlin: {\n sast: ['semgrep (p/kotlin)', 'detekt'],\n sca: ['osv-scanner', 'OWASP dependency-check'],\n },\n Swift: {\n sast: ['semgrep (p/swift)'],\n sca: ['osv-scanner'],\n },\n Ruby: {\n sast: ['semgrep (p/ruby)', 'brakeman'],\n sca: ['osv-scanner', 'bundler-audit'],\n },\n PHP: {\n sast: ['semgrep (p/php)', 'phpstan'],\n sca: ['osv-scanner', 'composer audit'],\n },\n Shell: {\n sast: ['semgrep (p/bash)', 'shellcheck'],\n sca: [],\n },\n HCL: {\n sast: ['semgrep (p/terraform)', 'tfsec'],\n sca: ['osv-scanner'],\n },\n};\n\n/** Generate language-specific scanner recommendations when SAST/SCA is missing. */\nexport function getLanguageRecommendations(\n language: string | null,\n securityTooling: readonly string[]\n): readonly string[] {\n if (language === null) return [];\n const scanners = LANGUAGE_SCANNER_MATRIX[language];\n if (scanners === undefined) return [];\n\n const hasSast = securityTooling.includes('semgrep') || securityTooling.includes('snyk');\n const hasSca =\n securityTooling.includes('osv-scanner') ||\n securityTooling.includes('grype') ||\n securityTooling.includes('snyk');\n\n const recs: string[] = [];\n if (!hasSast && scanners.sast.length > 0) {\n const tools = scanners.sast.join(', ');\n recs.push(`${language} project missing SAST: ${tools}`);\n }\n if (!hasSca && scanners.sca.length > 0) {\n const tools = scanners.sca.join(', ');\n recs.push(`${language} project missing SCA: ${tools}`);\n }\n return recs;\n}\n\n/** SAST tool names that suppress the generic gap message. */\nconst SAST_TOOLS = new Set(['semgrep', 'codeql', 'snyk']);\nconst SAST_GAP_MSG = 'No SAST/SCA security scanning configured';\n\n/** Remove the SAST/SCA gap if any SAST tool was detected (#1674). */\nfunction removeSastGapIfToolDetected(gaps: string[], secTools: readonly string[]): void {\n if (secTools.some((t) => SAST_TOOLS.has(t))) {\n const idx = gaps.indexOf(SAST_GAP_MSG);\n if (idx !== -1) gaps.splice(idx, 1);\n }\n}\n\n/** Identify gaps in repository best practices. */\nexport function identifyGaps(\n entries: readonly string[],\n ciProvider: string | null,\n language?: string | null,\n securityTooling?: readonly string[]\n): readonly string[] {\n const gaps: string[] = [];\n if (ciProvider === null) gaps.push('No CI/CD configuration detected');\n for (const [files, message] of GAP_RULES) {\n if (!files.some((f) => entries.includes(f))) gaps.push(message);\n }\n // Test detection: uses detectTestInfra for monorepo + co-located pattern support (#1130)\n if (!detectTestInfra(entries)) gaps.push('No test directory detected');\n\n // Remove SAST/SCA gap if workflow-level security was detected (#1674)\n removeSastGapIfToolDetected(gaps, securityTooling ?? []);\n\n // Language-specific recommendations when generic SAST/SCA gap detected\n const hasGenericSecGap = gaps.includes('No SAST/SCA security scanning configured');\n if (\n hasGenericSecGap &&\n language !== null &&\n language !== undefined &&\n securityTooling !== undefined\n ) {\n const langRecs = getLanguageRecommendations(language, securityTooling);\n gaps.push(...langRecs);\n }\n\n return gaps;\n}\n\n// ============================================================================\n// Core\n// ============================================================================\n\n/** GitHub repo metadata from the API. */\nexport interface GhRepoMetadata {\n readonly name: string;\n readonly full_name: string;\n readonly description: string | null;\n readonly language: string | null;\n readonly default_branch: string;\n readonly stargazers_count: number;\n readonly license: { readonly spdx_id: string } | null;\n}\n\n/** Analyze a GitHub repository given its metadata and file tree. */\nexport function analyzeRepo(\n metadata: GhRepoMetadata,\n topLevelEntries: readonly string[],\n workflowEntries?: readonly string[]\n): RepoAnalysis {\n const ciProvider = detectCiProvider(topLevelEntries);\n const secTooling = detectSecurityTooling(topLevelEntries, workflowEntries);\n const hasTests = detectTestInfra(topLevelEntries);\n\n return {\n name: metadata.full_name,\n language: metadata.language,\n framework: detectFramework(topLevelEntries),\n packageManager: detectPackageManager(topLevelEntries),\n ciProvider,\n securityTooling: secTooling,\n // Match `Dockerfile`, `Dockerfile.<purpose>` (e.g. `Dockerfile.sandbox`),\n // and docker-compose variants. Pre-#2730 the check was exact-match only,\n // so a repo with three legitimate `Dockerfile.*` files reported false.\n hasDockerfile:\n topLevelEntries.some((e) => e === 'Dockerfile' || e.startsWith('Dockerfile.')) ||\n topLevelEntries.includes('docker-compose.yml') ||\n topLevelEntries.includes('docker-compose.yaml'),\n hasHelmCharts:\n topLevelEntries.includes('Chart.yaml') ||\n topLevelEntries.includes('charts') ||\n topLevelEntries.includes('helm'),\n hasMakefile: topLevelEntries.includes('Makefile'),\n hasTests,\n license: metadata.license?.spdx_id ?? null,\n description: metadata.description,\n defaultBranch: metadata.default_branch,\n stars: metadata.stargazers_count,\n topLevelEntries: [...topLevelEntries],\n gaps: identifyGaps(topLevelEntries, ciProvider, metadata.language, secTooling),\n };\n}\n\n/** Non-code languages to exclude when detecting primary language. */\nconst MARKUP_LANGUAGES = new Set([\n 'HTML',\n 'CSS',\n 'SCSS',\n 'Less',\n 'Markdown',\n 'Roff',\n 'SVG',\n 'XML',\n 'XSLT',\n 'Mustache',\n 'Handlebars',\n 'EJS',\n]);\n\n/** Detect primary language from GitHub languages API (byte counts). */\nfunction detectPrimaryLanguage(\n languages: Record<string, number>,\n fallback: string | null\n): string | null {\n const sorted = Object.entries(languages)\n .filter(([lang]) => !MARKUP_LANGUAGES.has(lang))\n .sort((a, b) => b[1] - a[1]);\n const top = sorted[0];\n return top !== undefined ? top[0] : fallback;\n}\n\n/** Check for test infrastructure beyond top-level directories. */\nfunction detectTestInfra(entries: readonly string[]): boolean {\n const testDirs = ['tests', 'test', '__tests__', 'spec'];\n if (testDirs.some((d) => entries.includes(d))) return true;\n // Check for test config files (co-located test pattern, monorepos)\n const testConfigs = [\n 'vitest.config.ts',\n 'vitest.config.js',\n 'vitest.config.mts',\n 'vitest.workspace.ts',\n 'vitest.workspace.js',\n 'jest.config.ts',\n 'jest.config.js',\n 'jest.config.mjs',\n 'cypress.config.ts',\n 'cypress.config.js',\n 'playwright.config.ts',\n '.mocharc.yml',\n '.mocharc.json',\n ];\n if (testConfigs.some((c) => entries.includes(c))) return true;\n // Monorepo: packages/ dir + package.json implies co-located tests\n return entries.includes('packages') && entries.includes('package.json');\n}\n\n/** Infer code language from project files when GitHub reports markup. */\nfunction inferLanguageFromEntries(\n entries: readonly string[],\n fallback: string | null\n): string | null {\n if (entries.includes('tsconfig.json')) return 'TypeScript';\n if (entries.includes('Cargo.toml')) return 'Rust';\n if (entries.includes('go.mod')) return 'Go';\n if (entries.includes('pyproject.toml') || entries.includes('setup.py')) return 'Python';\n if (entries.includes('pom.xml') || entries.includes('build.gradle')) return 'Java';\n if (entries.includes('Gemfile')) return 'Ruby';\n if (entries.includes('package.json')) return 'JavaScript';\n return fallback;\n}\n\ntype ExecFileFn = (\n cmd: string,\n args: string[],\n options?: { timeout?: number }\n) => Promise<{ stdout: string }>;\n\n/** Lazy-load promisified execFile. */\nasync function getExecFile(): Promise<ExecFileFn> {\n const { execFile } = await import('node:child_process');\n const { promisify } = await import('node:util');\n return promisify(execFile);\n}\n\n/** Fetch repo metadata and languages via GitHub API. */\nasync function fetchRepoData(\n repoId: string,\n exec: ExecFileFn\n): Promise<{ metadata: GhRepoMetadata; entries: string[] }> {\n const { stdout: metaJson } = await exec(\n 'gh',\n [\n 'api',\n `repos/${repoId}`,\n '--jq',\n '{name: .name, full_name: .full_name, description: .description, language: .language, default_branch: .default_branch, stargazers_count: .stargazers_count, license: .license}',\n ],\n { timeout: 30_000 }\n );\n let metadata: GhRepoMetadata;\n try {\n metadata = JSON.parse(metaJson.trim()) as GhRepoMetadata;\n } catch {\n throw new Error(`Failed to parse repo metadata for ${repoId}: ${metaJson.slice(0, 200)}`);\n }\n const { stdout: contentsJson } = await exec(\n 'gh',\n ['api', `repos/${repoId}/contents`, '--jq', '[.[].name]'],\n { timeout: 30_000 }\n );\n let entries: string[];\n try {\n const parsed: unknown = JSON.parse(contentsJson.trim());\n entries = Array.isArray(parsed) ? parsed.filter((e): e is string => typeof e === 'string') : [];\n } catch {\n throw new Error(`Failed to parse repo contents for ${repoId}: ${contentsJson.slice(0, 200)}`);\n }\n return { metadata, entries };\n}\n\n/** Resolve NOASSERTION license via the GitHub license API. */\nasync function resolveLicense(repoId: string, exec: ExecFileFn): Promise<string | null> {\n try {\n const { stdout } = await exec(\n 'gh',\n ['api', `repos/${repoId}/license`, '--jq', '.license.spdx_id'],\n { timeout: 15_000 }\n );\n const spdxId = stdout.trim();\n if (spdxId !== '' && spdxId !== 'null' && spdxId !== 'NOASSERTION') {\n return spdxId;\n }\n } catch {\n // Keep NOASSERTION if license API also fails\n }\n return null;\n}\n\n/** Resolve primary language, falling back to entry inference for markup repos. */\nasync function resolveLanguage(\n repoId: string,\n entries: readonly string[],\n metadata: GhRepoMetadata,\n exec: ExecFileFn\n): Promise<string | null> {\n let languages: Record<string, number> = {};\n try {\n const { stdout } = await exec('gh', ['api', `repos/${repoId}/languages`], { timeout: 15_000 });\n languages = JSON.parse(stdout.trim()) as Record<string, number>;\n } catch {\n /* fall back to metadata.language */\n }\n const primary = detectPrimaryLanguage(languages, metadata.language);\n if (primary === null || MARKUP_LANGUAGES.has(primary)) {\n return inferLanguageFromEntries(entries, primary);\n }\n return primary;\n}\n\n/** Fetch workflow filenames from .github/workflows/ (#1674). Best-effort. */\nasync function fetchWorkflowEntries(repoId: string, exec: ExecFileFn): Promise<readonly string[]> {\n try {\n const { stdout } = await exec(\n 'gh',\n ['api', `repos/${repoId}/contents/.github/workflows`, '--jq', '[.[].name]'],\n { timeout: 15_000 }\n );\n const parsed: unknown = JSON.parse(stdout.trim());\n return Array.isArray(parsed) ? parsed.filter((e): e is string => typeof e === 'string') : [];\n } catch {\n return []; // No workflows directory or API error — graceful fallback\n }\n}\n\n/** Fetch repo data from GitHub and produce analysis. */\nexport async function analyzeGitHubRepo(input: RepoAnalyzeInput): Promise<RepoAnalysis> {\n const repoId = normalizeRepoId(input.repo);\n const exec = await getExecFile();\n const { metadata, entries } = await fetchRepoData(repoId, exec);\n\n const primaryLang = await resolveLanguage(repoId, entries, metadata, exec);\n const enhanced = { ...metadata, language: primaryLang };\n\n // Resolve null or NOASSERTION license when LICENSE file exists\n const hasLicenseFile = entries.includes('LICENSE') || entries.includes('LICENSE.md');\n const licenseUnresolved = enhanced.license === null || enhanced.license.spdx_id === 'NOASSERTION';\n if (licenseUnresolved && hasLicenseFile) {\n const resolved = await resolveLicense(repoId, exec);\n if (resolved !== null) enhanced.license = { spdx_id: resolved };\n }\n\n // Fetch workflow filenames for CI-level security detection (#1674)\n const workflowEntries = entries.includes('.github')\n ? await fetchWorkflowEntries(repoId, exec)\n : [];\n\n return analyzeRepo(enhanced, entries, workflowEntries);\n}\n"],"mappings":";AAkBO,SAAS,gBAAgB,OAAuB;AACrD,QAAM,WAAW,iDAAiD,KAAK,KAAK;AAC5E,QAAM,UAAU,WAAW,CAAC,KAAK;AACjC,MAAI,QAAQ,SAAS,EAAG,QAAO;AAC/B,MAAI,iBAAiB,KAAK,KAAK,EAAG,QAAO;AACzC,QAAM,IAAI,MAAM,yBAAyB,KAAK,sCAAsC;AACtF;AAGA,IAAM,wBAA6E;AAAA,EACjF,CAAC,CAAC,gBAAgB,GAAG,MAAM;AAAA,EAC3B,CAAC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,IAAI;AAE9D,QAAM,cAAc,MAAM,gBAAgB,QAAQ,SAAS,UAAU,IAAI;AACzE,QAAM,WAAW,EAAE,GAAG,UAAU,UAAU,YAAY;AAGtD,QAAM,iBAAiB,QAAQ,SAAS,SAAS,KAAK,QAAQ,SAAS,YAAY;AACnF,QAAM,oBAAoB,SAAS,YAAY,QAAQ,SAAS,QAAQ,YAAY;AACpF,MAAI,qBAAqB,gBAAgB;AACvC,UAAM,WAAW,MAAM,eAAe,QAAQ,IAAI;AAClD,QAAI,aAAa,KAAM,UAAS,UAAU,EAAE,SAAS,SAAS;AAAA,EAChE;AAGA,QAAM,kBAAkB,QAAQ,SAAS,SAAS,IAC9C,MAAM,qBAAqB,QAAQ,IAAI,IACvC,CAAC;AAEL,SAAO,YAAY,UAAU,SAAS,eAAe;AACvD;","names":[]}
@@ -53,10 +53,10 @@ import {
53
53
  } from "./chunk-ERWXGXV2.js";
54
54
  import {
55
55
  generateSecurityPlan
56
- } from "./chunk-ZKOBXAPK.js";
56
+ } from "./chunk-WXVN4K3D.js";
57
57
  import {
58
58
  analyzeGitHubRepo
59
- } from "./chunk-BC3M4VLP.js";
59
+ } from "./chunk-BMOPMCFZ.js";
60
60
  import {
61
61
  CodebaseIndex
62
62
  } from "./chunk-AP2FD37C.js";
@@ -70,7 +70,7 @@ import {
70
70
  clampTaskTtl,
71
71
  getAvailabilityCache,
72
72
  resolveFallback
73
- } from "./chunk-EVI46ZGG.js";
73
+ } from "./chunk-LTUUW3FN.js";
74
74
  import {
75
75
  DEFAULTS
76
76
  } from "./chunk-YQMQSJQK.js";
@@ -1521,6 +1521,10 @@ var BaseAgentOptionsSchema = z4.object({
1521
1521
  "pm_expert",
1522
1522
  "ux_expert",
1523
1523
  "infrastructure_expert",
1524
+ "qa_expert",
1525
+ // #2715 — was missing from this Zod copy; canonical AgentRole has it
1526
+ "data_visualization_expert",
1527
+ // #2715 — same
1524
1528
  "thinker",
1525
1529
  "worker",
1526
1530
  "verifier",
@@ -10603,17 +10607,7 @@ function createManyExperts(configs, options) {
10603
10607
  return ok(experts);
10604
10608
  }
10605
10609
  function createAllBuiltInExperts(options) {
10606
- const types = [
10607
- "code",
10608
- "architecture",
10609
- "security",
10610
- "documentation",
10611
- "testing",
10612
- "devops",
10613
- "research",
10614
- "pm",
10615
- "ux"
10616
- ];
10610
+ const types = Object.keys(BUILT_IN_EXPERTS);
10617
10611
  const experts = [];
10618
10612
  for (const type of types) {
10619
10613
  const result = createBuiltInExpert(type, options);
@@ -28397,9 +28391,6 @@ function delegateInputToTaskContract(input) {
28397
28391
  if (input.billing_mode !== void 0) {
28398
28392
  metadata["billingMode"] = input.billing_mode;
28399
28393
  }
28400
- if (input.estimate_tokens === true) {
28401
- metadata["estimateTokens"] = true;
28402
- }
28403
28394
  return buildBaseTaskContract({
28404
28395
  idPrefix: "delegate",
28405
28396
  task: input.task,
@@ -33599,7 +33590,12 @@ var DelegateInputSchema = z56.object({
33599
33590
  task: z56.string().min(1).max(5e4).describe("Task to execute or analyze"),
33600
33591
  preferred_capability: z56.enum(["reasoning", "context", "speed", "code"]).optional().describe("Preferred capability for routing: reasoning, context, speed, or code"),
33601
33592
  model_hint: z56.string().max(100).optional().describe("Explicit model preference (e.g., claude-opus, gemini-pro)"),
33602
- estimate_tokens: z56.boolean().optional().default(false).describe("If true, return token estimate only without execution"),
33593
+ // estimate_tokens flag removed (#2723). The field was declared in two schemas
33594
+ // (here and in TOOL_SCHEMA below) but never read by any consumer — calling
33595
+ // `delegate_to_model { estimate_tokens: true }` returned the full routing
33596
+ // decision identical to omitting the flag. The output already carries
33597
+ // `estimated_tokens` so the use case the flag advertised is satisfied
33598
+ // without the flag.
33603
33599
  billing_mode: z56.enum(["plan", "api"]).optional().describe("Billing mode: plan (monthly subscription, ignore cost) or api (pay-per-token)")
33604
33600
  });
33605
33601
  var DelegateOutputSchema = z56.object({
@@ -33696,7 +33692,7 @@ var TOOL_SCHEMA = {
33696
33692
  task: z56.string().min(1).max(5e4).describe("Task to execute or analyze"),
33697
33693
  preferred_capability: z56.enum(["reasoning", "context", "speed", "code"]).optional().describe("Preferred capability for routing"),
33698
33694
  model_hint: z56.string().max(100).optional().describe("Explicit model preference"),
33699
- estimate_tokens: z56.boolean().optional().describe("Return token estimate only"),
33695
+ // estimate_tokens removed (#2723) see comment above on DelegateInputSchema.
33700
33696
  billing_mode: z56.enum(["plan", "api"]).optional().describe("Billing mode for cost handling")
33701
33697
  };
33702
33698
 
@@ -40556,11 +40552,18 @@ function classifyTraceError(err2) {
40556
40552
  }
40557
40553
  return "unknown";
40558
40554
  }
40559
- function sanitizeErrorMessage(err2) {
40560
- if (err2 instanceof Error) {
40561
- return err2.message.replace(/\/[^\s:]+/g, "<path>");
40555
+ function userFacingTraceError(err2, runId) {
40556
+ const category = classifyTraceError(err2);
40557
+ switch (category) {
40558
+ case "not_found":
40559
+ return `No trace file for runId '${runId}'`;
40560
+ case "permission_error":
40561
+ return `Permission denied reading trace for runId '${runId}'`;
40562
+ case "parse_error":
40563
+ return `Trace file for runId '${runId}' is malformed (invalid JSONL)`;
40564
+ default:
40565
+ return "Failed to read trace";
40562
40566
  }
40563
- return "An unexpected error occurred";
40564
40567
  }
40565
40568
  function parseJsonlLines(content) {
40566
40569
  return content.trim().split("\n").filter(Boolean).flatMap((line) => {
@@ -40605,7 +40608,7 @@ async function queryTraceFromDisk(input, runsDir) {
40605
40608
  };
40606
40609
  } catch (err2) {
40607
40610
  const category = classifyTraceError(err2);
40608
- const message = sanitizeErrorMessage(err2);
40611
+ const message = userFacingTraceError(err2, input.runId);
40609
40612
  if (category === "not_found") {
40610
40613
  traceLogger.debug("Trace file not found", { runId: input.runId });
40611
40614
  } else {
@@ -43749,7 +43752,7 @@ function createAnalyzeStageWrapper() {
43749
43752
  true
43750
43753
  );
43751
43754
  }
43752
- const { analyzeGitHubRepo: analyzeGitHubRepo2 } = await import("./repo-analyze-HWMXSK5C.js");
43755
+ const { analyzeGitHubRepo: analyzeGitHubRepo2 } = await import("./repo-analyze-QGLXEFVJ.js");
43753
43756
  const analysis = await analyzeGitHubRepo2({ repo: slug, depth: "deep" });
43754
43757
  const summary = `Language: ${String(analysis.language)}, Framework: ${String(analysis.framework)}, CI: ${String(analysis.ciProvider)}, Security: ${analysis.securityTooling.join(", ") || "none"}`;
43755
43758
  ctx.sharedMemory.write("analyze", "discovery", { slug, analysis: summary });
@@ -43769,7 +43772,7 @@ function createScanStageWrapper() {
43769
43772
  try {
43770
43773
  const slug = ctx.task.match(/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+)/)?.[1];
43771
43774
  if (slug !== void 0) {
43772
- const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-EIL2BV3S.js");
43775
+ const { generateSecurityPlan: generateSecurityPlan2 } = await import("./repo-security-plan-X5CRZ2YY.js");
43773
43776
  const plan = await generateSecurityPlan2({ repo: slug, maxScanners: 10 });
43774
43777
  const recs = plan.recommendations.slice(0, 5).map((r) => `${r.priority}: ${r.displayName} (${r.category})`).join("; ");
43775
43778
  ctx.sharedMemory.write("scan", "decision", { recommendations: recs });
@@ -45668,7 +45671,7 @@ var PipelineInputSchema = z97.object({
45668
45671
  task: z97.string().min(5).max(1e4).describe("Task description \u2014 pipeline template auto-selected based on content"),
45669
45672
  /** Path to a spec file (.md, .yaml) to use as task input. */
45670
45673
  specFile: z97.string().max(500).optional().describe("Path to a spec file \u2014 content prepended to task for greenfield projects"),
45671
- /** Override template (dev, research, audit, greenfield). Auto-detected if omitted. */
45674
+ /** Override template — see `listTemplateIds()` for the canonical list (#2728). Auto-detected if omitted. */
45672
45675
  template: z97.string().max(50).optional().describe(`Pipeline template override. Available: ${listTemplateIds().join(", ")}`),
45673
45676
  /** Voting strategy for consensus stages. */
45674
45677
  votingStrategy: z97.enum([
@@ -45734,7 +45737,7 @@ function selectStageRegistry(template, task, agentStages) {
45734
45737
  }
45735
45738
  return createDevStageRegistry(agentStages);
45736
45739
  }
45737
- var RUN_PIPELINE_DESCRIPTION = "Single unified entry point for all pipeline templates (dev/research/audit/greenfield). Auto-detects template from task content or accepts an explicit override.";
45740
+ var RUN_PIPELINE_DESCRIPTION = `Single unified entry point for all pipeline templates (${listTemplateIds().join("/")}). Auto-detects template from task content or accepts an explicit override.`;
45738
45741
  function registerPipelineTool(server, _deps) {
45739
45742
  server.registerTool(
45740
45743
  "run_pipeline",
@@ -50007,4 +50010,4 @@ export {
50007
50010
  detectBackend,
50008
50011
  createTaskTracker
50009
50012
  };
50010
- //# sourceMappingURL=chunk-FGQOGLHQ.js.map
50013
+ //# sourceMappingURL=chunk-K446R3BC.js.map