@allma/core-cdk
Version:
Core AWS CDK constructs for deploying the Allma serverless AI orchestration platform.
50 lines • 2.59 kB
JavaScript
import { StepType } from '@allma/core-types';
import { log_error } from '@allma/core-sdk';
// Import handlers for specific step types
import { handleLlmInvocation } from './llm-invocation-handler.js';
import { handleNoOp } from './noop-handler.js';
import { handleApiCall } from './api-call-handler.js';
import { handlePollExternalApi } from './poll-external-api-handler.js';
import { handleWaitForExternalEvent } from './wait-for-external-event-handler.js';
import { handleDataLoad } from './data-load-handler.js';
import { handleDataTransformation } from './data-transformation-handler.js';
import { handleDataSave } from './data-save-handler.js';
import { handleCustomLambdaInvoke } from './custom-lambda-invoke-handler.js';
import { handleMcpCall } from './mcp-call-handler.js';
import { handleFileDownload } from './file-download-handler.js';
// Import module executors for the new dispatcher handlers
import { executeSqsSender } from '../data-savers/sqs-sender.js';
import { executeSnsPublisher } from '../data-savers/sns-publisher.js';
import { executeStartFlowExecution } from '../data-savers/start-flow-execution.js';
import { executeSendEmail } from './email/send-email-handler.js';
const handlerRegistry = {
[]: handleLlmInvocation,
[]: handleNoOp,
[]: handleApiCall,
[]: handlePollExternalApi,
[]: handleWaitForExternalEvent,
[]: handleDataLoad,
[]: handleDataTransformation,
[]: handleDataSave,
[]: handleCustomLambdaInvoke,
[]: executeStartFlowExecution,
[]: handleMcpCall,
[]: handleFileDownload,
[]: executeSendEmail,
[]: executeSqsSender,
[]: executeSnsPublisher,
// Start point steps are entry points and perform no action during execution.
// They are treated as NO_OPs to simply pass control to the next step.
[]: handleNoOp,
[]: handleNoOp,
// Future handlers would be registered here
};
export function getStepHandler(stepType) {
const handler = handlerRegistry[stepType];
if (!handler) {
log_error(`No step handler registered for stepType: ${stepType}`);
throw new Error(`Unsupported stepType: ${stepType}`);
}
return handler;
}
//# sourceMappingURL=handler-registry.js.map