"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetTestContextToolDefinition = exports.getTestContextResponseSchema = exports.getTestContextParamsSchema = void 0;
var zod_1 = require("zod");
var toolDefinition_js_1 = require("../toolDefinition.js");
var agentToolNames_js_1 = require("../shared/agentToolNames.js");
var schemas_js_1 = require("../testPlanning/schemas.js");
exports.getTestContextParamsSchema = zod_1.z.object({
    include_plan: zod_1.z.boolean().optional().meta({
        description: 'Whether to include the full test plan with all tasks and their details (implementation notes, validation criteria, suggested flows, suggested snippets). Default: true. Always include this on first call to read the plan built with the user during planning.',
    }),
    include_variables: zod_1.z.boolean().optional().meta({
        description: 'Whether to include the available variables and their values. Default: true',
    }),
    include_test_steps: zod_1.z.boolean().optional().meta({
        description: 'Whether to include the current test steps with cursor position. Default: true',
    }),
});
var taskDetailSchema = zod_1.z.object({
    task: zod_1.z.string().meta({
        description: 'The description of the task',
    }),
    implementation_notes: zod_1.z.string().optional().meta({
        description: 'Implementation notes for how to accomplish the task',
    }),
    suggested_validation: zod_1.z.string().optional().meta({
        description: 'What to verify when the task is complete',
    }),
    suggested_flow_options: zod_1.z.array(schemas_js_1.flowOptionSchema).optional().meta({
        description: 'Recommended reusable flow options for this task, with IDs and reasoning',
    }),
    suggested_snippet_options: zod_1.z.array(schemas_js_1.snippetOptionSchema).optional().meta({
        description: 'Recommended reusable code snippet options for this task, with IDs and reasoning',
    }),
});
exports.getTestContextResponseSchema = zod_1.z.object({
    current_task_index: zod_1.z.number().meta({
        description: 'The 0-based index of the current task',
    }),
    current_task: taskDetailSchema.optional().meta({
        description: 'Details about the current task being worked on',
    }),
    total_tasks: zod_1.z.number().meta({
        description: 'Total number of tasks in the test plan',
    }),
    plan: zod_1.z.string().optional().meta({
        description: 'The full test plan as a JSON string. Contains all tasks and their details. Only present when include_plan is true (default).',
    }),
    formatted_steps: zod_1.z.string().optional().meta({
        description: 'Formatted test steps with 1-based dot-notation indices, task group boundaries, and cursor position marker. Use these indices with execute_move_cursor and execute_play_steps. Only present when include_test_steps is true.',
    }),
    variables: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional().meta({
        description: 'Available variables and their current values (if include_variables is true)',
    }),
});
exports.GetTestContextToolDefinition = (0, toolDefinition_js_1.defineTool)({
    name: agentToolNames_js_1.AgentToolNames.GetTestContext,
    description: "Retrieves the current test context including task information, variables, and test steps.\n\nUse this tool when you need to:\n- Read the full test plan with all tasks, suggested flows, snippets, and implementation notes \u2014 do this FIRST at the start of test creation\n- Review the available variables and their values\n- See the current test steps and cursor position (formatted_steps shows dot-notation indices)\n- Get details about the current task's implementation notes or validation criteria\n\n**Before getting started:** If you don't already have the original test plan and planning conversation in your context from an earlier turn, call `get_original_test_plan` before (or alongside) this tool. That snapshot carries the user's original intent and the planning conversation that produced the plan \u2014 important grounding context. Skip it only if you've already fetched it in this session.\n\nBy default, all context is included. Set include_* parameters to false to exclude sections you don't need.",
    argumentsSchema: exports.getTestContextParamsSchema,
    responseSchema: exports.getTestContextResponseSchema,
});
//# sourceMappingURL=GetTestContextDefinition.js.map