Package Exports
- helmstack-core
- helmstack-core/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (helmstack-core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@helmstack/core
Core orchestrator engine for HelmStack: task management, AI logic, state/memory, command handlers with contract-first validation.
๐ฏ Overview
HelmStack Core is the orchestration engine that powers all HelmStack commands. It implements:
- Command orchestration via the
Heckclass - Runtime policies (timeout, retry, lock, validation)
- Service interfaces for external integrations
- Handler framework for command business logic
- Contract-first validation using
@helmstack/schemas
๐๏ธ Architecture
helmstack-core/
โโโ src/
โ โโโ orchestrator/ # Main Heck class and handler registry
โ โโโ runtime/ # Lock, Retry, Timeout, Validation, Logger
โ โโโ services/ # Interface definitions for external services
โ โโโ usecases/ # Command handlers (business logic)
โ โโโ policies/ # Reusable policies and rules
โ โโโ bootstrap/ # Context setup and dependency injection๐ Usage
import { Heck, CoreContext } from '@helmstack/core';
// Create context with service implementations
const context = new CoreContext({
services: {
Git: new GitAdapter(),
GitHub: new GitHubAdapter(),
ML: new MLAdapter(),
// ... other services
}
});
// Create orchestrator
const heck = new Heck(registry, context);
// Execute command
const result = await heck.run('plan', {
ai: true,
charter: true
});
console.log(result.payload);๐ Command Handlers
All command handlers implement the Handler<TInput, TOutput> interface:
export class PlanHandler implements Handler<PlanInput, PlanOutput> {
async run(input: PlanInput, context: CoreContext): Promise<PlanOutput> {
// Business logic here
return {
strategy: 'ai',
tasks: [...],
risks: [...]
};
}
}๐ง Runtime Features
- Envelope: Standard response format for all commands
- Validation: AJV-based schema validation
- Lock: Workspace-level file locking for mutating operations
- Retry: Exponential backoff with jitter
- Timeout: Configurable timeouts with abort support
- Logger: Structured logging with redaction
๐ค Service Integration
Core defines interfaces for external services but doesn't implement them. Implementations come from @helmstack/addons:
Git- Local git operationsGitHub- GitHub API integrationML- AI/ML service integrationSecrets- Secret managementFS- File system operationsHttp- HTTP client with retry/backoff
๐ Contract Validation
All command inputs and outputs are validated against schemas from @helmstack/schemas. This ensures:
- Type safety across the entire ecosystem
- Consistent API contracts
- Breaking change detection
๐งช Testing
# Run all tests
npm test
# Run contract tests (against schemas)
npm run test:contract
# Run unit tests
npm run test:unit
# Run integration tests
npm run test:integrationPart of the HelmStack ecosystem.