@qulib/mcp 0.5.3 → 0.6.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.
@@ -0,0 +1,12 @@
1
+ import type { AnalyzeResult } from '@qulib/core';
2
+ export interface AnalyzeAppMcpPayloadOptions {
3
+ includeFullReport?: boolean;
4
+ /** When true, returns only `toAgentSummary(result)` JSON (QLIB-001). Ignores `includeFullReport`. */
5
+ agentSummary?: boolean;
6
+ }
7
+ /**
8
+ * Single place for analyze_app response shaping: default summary-first,
9
+ * optional full report, or compact agent gate summary.
10
+ */
11
+ export declare function buildAnalyzeAppMcpPayload(result: AnalyzeResult, input: AnalyzeAppMcpPayloadOptions): unknown;
12
+ //# sourceMappingURL=analyze-app-mcp-payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze-app-mcp-payload.d.ts","sourceRoot":"","sources":["../src/analyze-app-mcp-payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,MAAM,WAAW,2BAA2B;IAC1C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,qGAAqG;IACrG,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,2BAA2B,GACjC,OAAO,CAKT"}
@@ -0,0 +1,12 @@
1
+ import { toAgentSummary } from '@qulib/core';
2
+ import { summarizeAnalyzeResult } from './summarize-analyze-result.js';
3
+ /**
4
+ * Single place for analyze_app response shaping: default summary-first,
5
+ * optional full report, or compact agent gate summary.
6
+ */
7
+ export function buildAnalyzeAppMcpPayload(result, input) {
8
+ if (input.agentSummary === true) {
9
+ return toAgentSummary(result);
10
+ }
11
+ return summarizeAnalyzeResult(result, input.includeFullReport === true);
12
+ }
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ const requirePkg = createRequire(import.meta.url);
16
16
  const pkg = requirePkg('../package.json');
17
17
  import { analyzeApp, detectAuth, exploreAuth, scanRepo, computeAutomationMaturity, } from '@qulib/core';
18
18
  import { z } from 'zod';
19
- import { summarizeAnalyzeResult } from './summarize-analyze-result.js';
19
+ import { buildAnalyzeAppMcpPayload } from './analyze-app-mcp-payload.js';
20
20
  import { log } from './logger.js';
21
21
  function toolError(code, message, detail) {
22
22
  return {
@@ -68,6 +68,10 @@ const AnalyzeInputSchema = z.object({
68
68
  timeoutMs: z.number().int().positive().optional(),
69
69
  auth: z.discriminatedUnion('type', [FormLoginMcpAuthSchema, StorageStateMcpAuthSchema]).optional(),
70
70
  includeFullReport: z.boolean().optional(),
71
+ agentSummary: z
72
+ .boolean()
73
+ .optional()
74
+ .describe('When true, return only the versioned agent-summary JSON ({ schemaVersion: 1, gate, coverageStatus, topRisks, recommendedNextChecks, honestyNotes, costSummary, deterministicFollowUps }). Use this for CI gates and orchestrators that need a single small payload to decide pass/warn/fail. Overrides includeFullReport.'),
71
75
  llmTokenBudget: z.number().int().positive().optional(),
72
76
  llmMaxOutputTokensPerCall: z.number().int().positive().optional(),
73
77
  testGenerationLimit: z.number().int().positive().max(50).optional(),
@@ -153,7 +157,7 @@ mcpServer.registerTool('detect_auth', {
153
157
  }
154
158
  });
155
159
  mcpServer.registerTool('analyze_app', {
156
- description: 'Analyze a deployed web app for quality gaps. Default response is summary-first (top gaps, cost summary, next checks). Set includeFullReport for the full gapAnalysis. Optional llmMaxOutputTokensPerCall / llmTokenBudget (legacy), testGenerationLimit, enableLlmScenarios align with @qulib/core HarnessConfig.',
160
+ description: 'Analyze a deployed web app for quality gaps. Default response is summary-first (top gaps, cost summary, next checks). Set includeFullReport for the full gapAnalysis. Set agentSummary for the compact gate-decision payload (pass/warn/fail with honesty notes) — use this when calling from a CI gate or orchestrator. Optional llmMaxOutputTokensPerCall / llmTokenBudget (legacy), testGenerationLimit, enableLlmScenarios align with @qulib/core HarnessConfig.',
157
161
  inputSchema: AnalyzeInputSchema,
158
162
  }, async (input) => {
159
163
  try {
@@ -202,7 +206,10 @@ mcpServer.registerTool('analyze_app', {
202
206
  progressLog: mcpProgressLog,
203
207
  telemetry: telemetrySink,
204
208
  });
205
- const payload = summarizeAnalyzeResult(result, input.includeFullReport === true);
209
+ const payload = buildAnalyzeAppMcpPayload(result, {
210
+ includeFullReport: input.includeFullReport,
211
+ agentSummary: input.agentSummary,
212
+ });
206
213
  return {
207
214
  content: [
208
215
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qulib/mcp",
3
- "version": "0.5.3",
3
+ "version": "0.6.0",
4
4
  "description": "MCP server for Qulib — AI-callable QA gap analysis",
5
5
  "license": "MIT",
6
6
  "author": "Tapesh Nagarwal",
@@ -29,11 +29,11 @@
29
29
  "scripts": {
30
30
  "build": "npm --prefix ../.. run build -w @qulib/core && tsc && chmod +x dist/index.js",
31
31
  "dev": "tsx src/index.ts",
32
- "test": "node --import tsx/esm --test src/__tests__/summarize-analyze-result.test.ts"
32
+ "test": "node --import tsx/esm --test src/__tests__/summarize-analyze-result.test.ts src/__tests__/analyze-app-mcp-payload.test.ts"
33
33
  },
34
34
  "dependencies": {
35
35
  "@modelcontextprotocol/sdk": "^1.0.0",
36
- "@qulib/core": "0.5.3",
36
+ "@qulib/core": "0.6.0",
37
37
  "zod": "^3.23.0"
38
38
  },
39
39
  "devDependencies": {