"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QueryWorkspaceDeploymentEventsToolDefinition = exports.queryWorkspaceDeploymentEventsResponseSchema = exports.queryWorkspaceDeploymentEventsParamsSchema = void 0;
var zod_1 = require("zod");
var toolDefinition_js_1 = require("../toolDefinition.js");
var agentToolNames_js_1 = require("../shared/agentToolNames.js");
var GetRelatedDeploymentEventsDefinition_js_1 = require("./GetRelatedDeploymentEventsDefinition.js");
/**
 * Lists deployment events in the workspace results session window (server-applied scope).
 */
exports.queryWorkspaceDeploymentEventsParamsSchema = zod_1.z.object({
    limit: zod_1.z.number().optional().meta({
        description: 'Maximum deployments to return after filters (newest first). Default: 20, max: 50.',
    }),
    filter_status: zod_1.z.enum(['all', 'passed', 'failed']).optional().meta({
        description: 'Filter by aggregate deployment status. Default: all',
    }),
});
exports.queryWorkspaceDeploymentEventsResponseSchema = zod_1.z.object({
    deployments: zod_1.z.array(GetRelatedDeploymentEventsDefinition_js_1.relatedDeploymentEventInfoSchema).meta({
        description: 'Deployment events in the session window matching scope (newest first)',
    }),
    returned_count: zod_1.z.number().meta({ description: 'Number of entries in deployments' }),
    truncated: zod_1.z.boolean().meta({
        description: 'True if more deployments matched filters than returned_count (limit applied).',
    }),
    scan_may_be_incomplete: zod_1.z.boolean().meta({
        description: 'True if the API returned a full page — older deployments may exist in the same window beyond this scan.',
    }),
    appliedFilters: zod_1.z
        .object({
        workspaceId: zod_1.z.string(),
        startTime: zod_1.z.string(),
        endTime: zod_1.z.string(),
        environmentId: zod_1.z.string().optional(),
        applicationId: zod_1.z.string().optional(),
    })
        .meta({ description: 'Session scope applied by the server (from workspace_results_context)' }),
});
exports.QueryWorkspaceDeploymentEventsToolDefinition = (0, toolDefinition_js_1.defineTool)({
    name: agentToolNames_js_1.AgentToolNames.QueryWorkspaceDeploymentEvents,
    description: "Deployment events in the **workspace results session** window (server applies workspace, time range, optional environment/application).\n\nUse when the user asks for **recent deployments** in this dashboard/workspace view or you need a **deployment_event_id** before **".concat(agentToolNames_js_1.AgentToolNames.GetDeploymentEventInfo, "**, **").concat(agentToolNames_js_1.AgentToolNames.GetDeploymentEventPlanRuns, "**, or **").concat(agentToolNames_js_1.AgentToolNames.GetRelatedDeploymentEvents, "**. Do not guess ids.\n\nNewest first; keep `limit` modest. If `scan_may_be_incomplete` is true, note that more events may exist in the window."),
    argumentsSchema: exports.queryWorkspaceDeploymentEventsParamsSchema,
    responseSchema: exports.queryWorkspaceDeploymentEventsResponseSchema,
});
//# sourceMappingURL=QueryWorkspaceDeploymentEventsDefinition.js.map