UNPKG

@debugg-ai/debugg-ai-mcp

Version:

Zero-Config, Fully AI-Managed End-to-End Testing for all code gen platforms.

28 lines (27 loc) 1.32 kB
import { ensureConfirmed } from '../utils/confirmDestructive.js'; import { searchEnvironmentsHandler } from './searchEnvironmentsHandler.js'; import { createEnvironmentHandler } from './createEnvironmentHandler.js'; import { updateEnvironmentHandler } from './updateEnvironmentHandler.js'; import { deleteEnvironmentHandler } from './deleteEnvironmentHandler.js'; export async function environmentHandler(input, ctx) { switch (input.action) { case 'get': return searchEnvironmentsHandler({ uuid: input.uuid, projectUuid: input.projectUuid }, ctx); case 'list': return searchEnvironmentsHandler({ projectUuid: input.projectUuid, q: input.q, page: input.page, pageSize: input.pageSize }, ctx); case 'create': { const { action, ...rest } = input; return createEnvironmentHandler(rest, ctx); } case 'update': { const { action, ...rest } = input; return updateEnvironmentHandler(rest, ctx); } case 'delete': { const refusal = await ensureConfirmed('delete', `environment ${input.uuid}`, input, ctx); if (refusal) return refusal; return deleteEnvironmentHandler({ uuid: input.uuid, projectUuid: input.projectUuid }, ctx); } } }