imports: block at the top of a .toon file lets you bring in external TypeScript types, Effect services, TOON components, and plugins. Import arrays use TOON’s tabular format for compact, readable declarations.
Importing Schemas
ImportSchema.Class or Model.Class definitions for use as input or output types:
Importing Services
Import Effect services to make them available inhandler: functions and run: blocks:
Importing Components
Import reusable components from other.toon files:
Importing Other TOON Files
Import an entire.toon file as a sub-workflow:
Plugin Setup
Plugins extend TOON with custom node kinds, model providers, or services. Plugins have per-entry config, so they use expanded list items:- Add custom node kinds (e.g.,
kind: linear-ticket) - Provide default model configuration
- Register services automatically into the Layer stack
- Add custom interpolation functions
Import Resolution
Imports are resolved relative to the.toon file’s directory:
./) resolve from node_modules:
Multiple Import Sources
Combine different import types freely:Next Steps
- Schemas — Define and import type definitions.
- Components — Create and use reusable components.
- Overview — How TOON fits into the three-layer architecture.