import { z } from 'zod';
import { defineTool, } from '../toolDefinition.js';
import { AgentToolNames } from '../shared/agentToolNames.js';
import { relatedDeploymentEventInfoSchema } from './GetRelatedDeploymentEventsDefinition.js';
/**
 * Lists deployment events in the workspace results session window (server-applied scope).
 */
export const queryWorkspaceDeploymentEventsParamsSchema = z.object({
    limit: z.number().optional().meta({
        description: 'Maximum deployments to return after filters (newest first). Default: 20, max: 50.',
    }),
    filter_status: z.enum(['all', 'passed', 'failed']).optional().meta({
        description: 'Filter by aggregate deployment status. Default: all',
    }),
});
export const queryWorkspaceDeploymentEventsResponseSchema = z.object({
    deployments: z.array(relatedDeploymentEventInfoSchema).meta({
        description: 'Deployment events in the session window matching scope (newest first)',
    }),
    returned_count: z.number().meta({ description: 'Number of entries in deployments' }),
    truncated: z.boolean().meta({
        description: 'True if more deployments matched filters than returned_count (limit applied).',
    }),
    scan_may_be_incomplete: z.boolean().meta({
        description: 'True if the API returned a full page — older deployments may exist in the same window beyond this scan.',
    }),
    appliedFilters: z
        .object({
        workspaceId: z.string(),
        startTime: z.string(),
        endTime: z.string(),
        environmentId: z.string().optional(),
        applicationId: z.string().optional(),
    })
        .meta({ description: 'Session scope applied by the server (from workspace_results_context)' }),
});
export const QueryWorkspaceDeploymentEventsToolDefinition = defineTool({
    name: AgentToolNames.QueryWorkspaceDeploymentEvents,
    description: `Deployment events in the **workspace results session** window (server applies workspace, time range, optional environment/application).

Use when the user asks for **recent deployments** in this dashboard/workspace view or you need a **deployment_event_id** before **${AgentToolNames.GetDeploymentEventInfo}**, **${AgentToolNames.GetDeploymentEventPlanRuns}**, or **${AgentToolNames.GetRelatedDeploymentEvents}**. Do not guess ids.

Newest first; keep \`limit\` modest. If \`scan_may_be_incomplete\` is true, note that more events may exist in the window.`,
    argumentsSchema: queryWorkspaceDeploymentEventsParamsSchema,
    responseSchema: queryWorkspaceDeploymentEventsResponseSchema,
});
//# sourceMappingURL=QueryWorkspaceDeploymentEventsDefinition.js.map