"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SearchTestsBySemanticToolDefinition = exports.searchTestsBySemanticToolResponseSchema = exports.searchTestsBySemanticToolParamsSchema = void 0;
var zod_1 = require("zod");
var toolDefinition_js_1 = require("../toolDefinition.js");
var agentToolNames_js_1 = require("./agentToolNames.js");
var searchTestsSchemas_js_1 = require("./searchTestsSchemas.js");
exports.searchTestsBySemanticToolParamsSchema = zod_1.z.object({
    query: zod_1.z.string().meta({
        description: 'Natural-language description of the test behavior or intent to find. Embeddings reward full ' +
            'sentences and conceptual phrasing — write more than just keywords. ' +
            'Example: "tests that exercise the user signup flow including email verification and password requirements". ' +
            'Typically called ONCE per agent invocation; a second call with a different framing is fine but each call ' +
            'runs an embedding + KNN, so be deliberate.',
    }),
    // No structural-filter arguments: test_type / mobile_platform / labels / updated_after are
    // request-level filters enforced server-side from tool context (never chosen by the model).
    // See SearchTestsBySemanticTool for where they're applied (post-filter, since queryTestsByChunk
    // only supports mobile_platform at the query level).
    limit: zod_1.z.number().int().min(1).max(200).default(20).meta({
        description: 'Per-call hard limit on candidates returned. Capped at 200 server-side.',
    }),
});
exports.searchTestsBySemanticToolResponseSchema = zod_1.z.object({
    total_candidates: zod_1.z.number().int().meta({
        description: 'Number of unique tests returned by this tool call.',
    }),
    truncated: zod_1.z.boolean().meta({
        description: 'True if any match had its annotated_step_summary budget-truncated. Per-match `truncated` flags indicate which.',
    }),
    matches: zod_1.z.array(searchTestsSchemas_js_1.testSearchMatchSchema),
});
exports.SearchTestsBySemanticToolDefinition = (0, toolDefinition_js_1.defineTool)({
    name: agentToolNames_js_1.AgentToolNames.SearchTestsBySemantic,
    description: 'Embedding-based vector search over indexed test step chunks. Best for conceptual or natural-language ' +
        'queries describing what a test should do. Typically called once; a second call with different framing is allowed.',
    argumentsSchema: exports.searchTestsBySemanticToolParamsSchema,
    responseSchema: exports.searchTestsBySemanticToolResponseSchema,
});
//# sourceMappingURL=SearchTestsBySemanticDefinition.js.map