How testcraft-app/api-automation-agent works
API Automation Agent turns an OpenAPI/Swagger definition or Postman collection into a generated TypeScript automation framework. The main workflow is CLI configuration, source-specific parsing and endpoint modeling, then staged model/test generation with an LLM, file creation, and final checks. The README also documents endpoint selection, reuse of existing frameworks, incremental state, and Postman migration. The graph reflects sampled code and indexed references; some wiring is dependency-injected or unsampled, so uncertain links are omitted.
Main entry points: framework_generator.py Generation orchestrator · api_processor.py API processing · main.py Application entry · postman_processor.py Postman migration
Components 19
Entry and configuration
- CLI and configuration
src/configuration/cli.py - Runtime configuration
src/configuration/config.py - Application entry
main.py
Definition processing
- Swagger processor
src/processors/swagger_processor.py - Spec preparation
src/processors/swagger - Postman migration
src/processors/postman_processor.py - Collection utilities
src/processors/postman/postman_utils.py - API processing
src/processors/api_processor.py - Endpoint model
src/models/api_verb.py
Generation and state
- Generation orchestrator
src/framework_generator.py - LLM generation
src/services/llm_service.py - File-generation tools
src/ai_tools/file_creation_tool.py - Generated file specs
src/ai_tools/models/file_spec.py - Incremental state
src/services/framework_state_manager.py
Framework output
- TypeScript framework
api-framework-template/src/base/ServiceBase.ts - File operations
src/services/file_service.py - Quality and test commands
src/services/command_service.py
Other components
- API developer
- Model providers
Connections 21
- API developer → Application entry: runs agent
README.md - Application entry → CLI and configuration: parses options
main.py - Application entry → Runtime configuration: sets options
main.py - Application entry → Generation orchestrator: starts generation
main.py - Generation orchestrator → API processing: processes definition
src/framework_generator.py - API processing → Swagger processor: dispatches input
src/processors/swagger_processor.py - API processing → Postman migration: dispatches input
src/processors/postman_processor.py - Swagger processor → Spec preparation: uses spec handlers
src/processors/swagger_processor.py - Postman migration → Collection utilities: uses utilities
src/processors/postman_processor.py - Postman migration → API processing: converts collection
src/processors/postman_processor.py - Generation orchestrator → LLM generation: requests generation
src/framework_generator.py - LLM generation → Model providers: calls model
src/services/llm_service.py - LLM generation → File-generation tools: registers tools
src/services/llm_service.py - File-generation tools → File operations: creates files
src/ai_tools/file_creation_tool.py - File-generation tools → Generated file specs: accepts specifications
src/ai_tools/file_creation_tool.py - Generation orchestrator → File operations: writes output
src/framework_generator.py - File operations → TypeScript framework: copies template
src/services/file_service.py - Generation orchestrator → Incremental state: persists progress
src/framework_generator.py - Generation orchestrator → Quality and test commands: runs final checks
src/framework_generator.py - Quality and test commands → TypeScript framework: checks generated code
README.md - API processing → Endpoint model: builds endpoint models
src/processors/api_processor.py