"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toolImproveContextOutputSchema = exports.toolImproveContextArgsSchema = exports.TOOL_IMPROVE_CONTEXT_DESCRIPTION = void 0;
const zod_1 = require("zod");
const outputMetadata_1 = require("../outputMetadata");
const toolSchemaBuilder_1 = require("../toolSchemaBuilder");
exports.TOOL_IMPROVE_CONTEXT_DESCRIPTION = `
Captures learnings from user corrections, clarifications, and guidance to improve future responses.

**Supported Learning Categories:**
- explore_selection: Which tables/explores to use for specific types of queries
- field_selection: Which fields to use for specific metrics or dimensions
- filter_logic: How to apply filters for calculations
- calculation: How to perform specific calculations or aggregations
- other: General preferences, formatting, or methodologies

**Technical Requirements:**
- Must provide original query context that led to the learning
- Must capture what was incorrect and what the correct approach is
- Must categorize the learning into one of the supported categories
- Must provide a confidence score (0-1) indicating if this is a learnable pattern
- Must generate a clear, actionable instruction to append to agent settings
- Instructions should be specific and context-aware (not overly generic)
`;
exports.toolImproveContextArgsSchema = (0, toolSchemaBuilder_1.createToolSchema)({
    description: exports.TOOL_IMPROVE_CONTEXT_DESCRIPTION,
})
    .extend({
    originalQuery: zod_1.z
        .string()
        .describe('The original user query that led to incorrect results'),
    incorrectResponse: zod_1.z
        .string()
        .describe('What the AI incorrectly suggested or returned'),
    correctResponse: zod_1.z
        .string()
        .describe('What the user corrected or clarified'),
    category: zod_1.z
        .enum([
        'explore_selection',
        'field_selection',
        'filter_logic',
        'calculation',
        'other',
    ])
        .describe('Category of the learning'),
    confidence: zod_1.z
        .number()
        .min(0)
        .max(1)
        .describe('Confidence score that this is a learnable learning or more context is needed'),
    suggestedInstruction: zod_1.z
        .string()
        .describe('The instruction to append to agent settings'),
})
    .build();
exports.toolImproveContextOutputSchema = zod_1.z.object({
    result: zod_1.z.string(),
    metadata: outputMetadata_1.baseOutputMetadataSchema,
});
//# sourceMappingURL=toolImproveContextArgs.js.map