@allma/core-types
v1.1.0
Published
Shared TypeScript types, interfaces, and Zod schemas for the Allma serverless AI orchestration platform.
Maintainers
Readme
@allma/core-types
This package is the single source of truth for data contracts within the Allma ecosystem. It provides shared TypeScript types, interfaces, enums, constants, and Zod schemas used across all Allma packages and integration modules.
What is Allma?
Allma is a serverless, event-driven platform designed to build, execute, and manage complex, AI-powered automated workflows, known as Flows. It acts as a "digital factory" for orchestrating sophisticated business processes, combining data integration, conditional logic, and advanced AI capabilities in a robust, scalable, and observable environment built on AWS.
Installation
npm install @allma/core-typesCore Usage
Use this package to ensure type safety and runtime validation when interacting with Allma's data structures, such as when building custom step modules or plugins.
Example: Using a Flow Definition Type and a Zod Schema
import { FlowDefinition, FlowDefinitionSchema, StepType } from '@allma/core-types';
import { z } from 'zod';
// Use interfaces for function signatures to ensure type safety
function analyzeFlow(flow: FlowDefinition): number {
console.log(`Analyzing flow: ${flow.name}`);
return flow.steps.length;
}
// Use Zod schemas for runtime validation of raw input
function validateAndProcessFlow(rawInput: unknown): void {
const validationResult = FlowDefinitionSchema.safeParse(rawInput);
if (!validationResult.success) {
console.error('Invalid flow definition:', validationResult.error.flatten());
throw new Error('Validation failed');
}
// `validationResult.data` is now fully typed as `FlowDefinition`
const stepCount = analyzeFlow(validationResult.data);
console.log(`The flow has ${stepCount} steps.`);
}Contributing
This package is part of the allma-core monorepo. We welcome contributions! Please see our main repository and contribution guide for more details.
License
This project is licensed under the Apache-2.0 License.
