import type { AppConfigDeleteEnvironmentParams, AppConfigDeleteResourceResponse, } from '@/tools/appconfig/types' import type { ToolConfig } from '@/tools/types' export const deleteEnvironmentTool: ToolConfig< AppConfigDeleteEnvironmentParams, AppConfigDeleteResourceResponse > = { id: 'appconfig_delete_environment', name: 'AppConfig Delete Environment', description: 'Delete an AWS AppConfig environment', version: '1.0', params: { region: { type: 'string', required: true, visibility: 'user-only', description: 'AWS region (e.g., us-east-1)', }, accessKeyId: { type: 'string', required: true, visibility: 'user-only', description: 'AWS access key ID', }, secretAccessKey: { type: 'string', required: true, visibility: 'user-only', description: 'AWS secret access key', }, applicationId: { type: 'string', required: true, visibility: 'user-or-llm', description: 'The application ID that owns the environment', }, environmentId: { type: 'string', required: true, visibility: 'user-or-llm', description: 'The environment ID to delete', }, }, request: { url: '/api/tools/appconfig/delete-environment', method: 'POST', headers: () => ({ 'Content-Type': 'application/json' }), body: (params) => ({ region: params.region, accessKeyId: params.accessKeyId, secretAccessKey: params.secretAccessKey, applicationId: params.applicationId, environmentId: params.environmentId, }), }, transformResponse: async (response: Response) => { const data = await response.json() if (!response.ok) { throw new Error(data.error || 'Failed to delete AppConfig environment') } return { success: true, output: { message: data.message ?? '', applicationId: data.applicationId ?? '', id: data.id ?? '', }, } }, outputs: { message: { type: 'string', description: 'Operation status message' }, applicationId: { type: 'string', description: 'Owning application ID' }, id: { type: 'string', description: 'ID of the deleted environment' }, }, }