@kirrosh/zond 0.8.0 → 0.9.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kirrosh/zond",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "API testing platform — define tests in YAML, run from CLI or WebUI, generate from OpenAPI specs",
5
5
  "license": "MIT",
6
6
  "module": "index.ts",
@@ -26,11 +26,13 @@
26
26
  "scripts": {
27
27
  "zond": "bun run src/cli/index.ts",
28
28
  "test": "bun run test:unit && bun run test:mocked",
29
- "test:unit": "bun test tests/db/ tests/parser/ tests/runner/ tests/generator/ tests/core/ tests/cli/args.test.ts tests/cli/chat.test.ts tests/cli/ci-init.test.ts tests/cli/commands.test.ts tests/cli/doctor.test.ts tests/cli/init.test.ts tests/cli/runs.test.ts tests/cli/safe-run.test.ts tests/cli/update.test.ts tests/integration/ tests/web/ tests/mcp/tools.test.ts tests/mcp/save-test-suite.test.ts tests/agent/agent-loop.test.ts tests/agent/context-manager.test.ts tests/agent/system-prompt.test.ts tests/reporter/",
29
+ "test:unit": "bun test tests/db/ tests/parser/ tests/runner/ tests/generator/ tests/core/ tests/cli/args.test.ts tests/cli/chat.test.ts tests/cli/ci-init.test.ts tests/cli/commands.test.ts tests/cli/doctor.test.ts tests/cli/init.test.ts tests/cli/runs.test.ts tests/cli/safe-run.test.ts tests/cli/update.test.ts tests/integration/ tests/web/ tests/mcp/tools.test.ts tests/mcp/save-test-suite.test.ts tests/agent/agent-loop.test.ts tests/agent/context-manager.test.ts tests/agent/system-prompt.test.ts tests/reporter/ tests/version-sync.test.ts",
30
30
  "test:mocked": "bun run scripts/run-mocked-tests.ts",
31
31
  "test:ai": "bun test tests/ai/",
32
32
  "check": "tsc --noEmit --project tsconfig.json",
33
- "build": "bun build --compile src/cli/index.ts --outfile zond"
33
+ "build": "bun build --compile src/cli/index.ts --outfile zond",
34
+ "version:sync": "bun run scripts/sync-version.ts",
35
+ "postversion": "bun run scripts/sync-version.ts && git add .claude-plugin/plugin.json .claude-plugin/marketplace.json"
34
36
  },
35
37
  "devDependencies": {
36
38
  "@types/bun": "latest"
@@ -44,6 +44,16 @@ export function envCategory(hint: string | undefined): string | null {
44
44
  return null;
45
45
  }
46
46
 
47
+ export function schemaHint(
48
+ failureType: string,
49
+ responseStatus: number | null | undefined,
50
+ ): string | null {
51
+ if (failureType === "assertion_failed" || responseStatus === 400 || responseStatus === 422) {
52
+ return "Use describe_endpoint(specPath, method, path) to verify expected request/response schema";
53
+ }
54
+ return null;
55
+ }
56
+
47
57
  export function computeSharedEnvIssue(
48
58
  failures: Array<{ hint?: string }>,
49
59
  envFilePath?: string,
@@ -67,11 +67,30 @@ export interface GuideOptions {
67
67
  securitySchemes: SecuritySchemeInfo[];
68
68
  endpointCount: number;
69
69
  coverageHeader?: string;
70
+ compact?: boolean;
70
71
  }
71
72
 
72
73
  export function buildGenerationGuide(opts: GuideOptions): string {
73
74
  const hasAuth = opts.securitySchemes.length > 0;
74
75
 
76
+ if (opts.compact) {
77
+ const securitySummary = hasAuth
78
+ ? `Security: ${opts.securitySchemes.map(s => `${s.name} (${s.type}${s.scheme ? `/${s.scheme}` : ""})`).join(", ")}`
79
+ : "Security: none";
80
+
81
+ return `# Test Generation Guide for ${opts.title}
82
+ ${opts.coverageHeader ? `\n${opts.coverageHeader}\n` : ""}
83
+ ## API Specification (${opts.endpointCount} endpoints)
84
+ ${opts.baseUrl ? `Base URL: ${opts.baseUrl}` : "Base URL: use {{base_url}} environment variable"}
85
+ ${securitySummary}
86
+
87
+ ${opts.apiContext}
88
+
89
+ ---
90
+
91
+ > **Note:** Refer to the full YAML format reference, generation algorithm, tag conventions, and practical tips from the initial \`generate_and_save\` call (without \`tag\`). Only the API endpoints above are unique to this chunk.`;
92
+ }
93
+
75
94
  return `# Test Generation Guide for ${opts.title}
76
95
  ${opts.coverageHeader ? `\n${opts.coverageHeader}\n` : ""}
77
96
  ## API Specification (${opts.endpointCount} endpoints)
@@ -106,6 +106,7 @@ export function registerGenerateAndSaveTool(server: McpServer) {
106
106
  securitySchemes,
107
107
  endpointCount: endpoints.length,
108
108
  coverageHeader,
109
+ compact: !!tag,
109
110
  });
110
111
 
111
112
  const saveInstructions = `
@@ -4,7 +4,7 @@ import { getDb } from "../../db/schema.ts";
4
4
  import { listCollections, listRuns, getRunById, getResultsByRunId, getCollectionById } from "../../db/queries.ts";
5
5
  import { join } from "node:path";
6
6
  import { TOOL_DESCRIPTIONS } from "../descriptions.js";
7
- import { statusHint, classifyFailure, envHint, envCategory } from "../../core/diagnostics/failure-hints.ts";
7
+ import { statusHint, classifyFailure, envHint, envCategory, schemaHint } from "../../core/diagnostics/failure-hints.ts";
8
8
 
9
9
  function parseBodySafe(raw: string | null | undefined): unknown {
10
10
  if (!raw) return undefined;
@@ -124,6 +124,7 @@ export function registerQueryDbTool(server: McpServer, dbPath?: string) {
124
124
  // env issues take priority over generic status hints
125
125
  const hint = envHint(r.request_url, r.error_message, envFilePath) ?? statusHint(r.response_status);
126
126
  const failure_type = classifyFailure(r.status, r.response_status);
127
+ const sHint = schemaHint(failure_type, r.response_status);
127
128
  return {
128
129
  suite_name: r.suite_name,
129
130
  test_name: r.test_name,
@@ -134,6 +135,7 @@ export function registerQueryDbTool(server: McpServer, dbPath?: string) {
134
135
  request_url: r.request_url,
135
136
  response_status: r.response_status,
136
137
  ...(hint ? { hint } : {}),
138
+ ...(sHint ? { schema_hint: sHint } : {}),
137
139
  response_body: parseBodySafe(r.response_body),
138
140
  response_headers: r.response_headers
139
141
  ? JSON.parse(r.response_headers)
@@ -48,6 +48,12 @@ export function registerRunTestsTool(server: McpServer, dbPath?: string) {
48
48
  const hints: string[] = [];
49
49
  if (failedSteps.length > 0) {
50
50
  hints.push("Use query_db(action: 'diagnose_failure', runId: " + runId + ") for detailed failure analysis");
51
+ const hasAssertionFailures = failedSteps.some(s => s.assertions.length > 0);
52
+ if (hasAssertionFailures) {
53
+ hints.push(
54
+ "Some tests have assertion failures — use describe_endpoint(specPath, method, path) to verify expected schemas"
55
+ );
56
+ }
51
57
  }
52
58
  hints.push("Use manage_server(action: 'start') to launch the Web UI and view results visually in a browser at http://localhost:8080");
53
59
  hints.push("Ask the user if they want to set up CI/CD to run these tests automatically on push. If yes, use ci_init to generate a workflow and help them push to GitHub/GitLab.");