Package Exports
- jido-kit/types
Readme
Jido-Kit
Helper library for building with Jido
What is Jido-Kit?
jido-kit provides essentials - Types and shared utilities (in future) - to improve the developer experience when working with Jido. It's especially useful when writing configs or plugins, offering IntelliSense and type safety in IDEs like VS Code.
Currently, jido-kit focuses on Types used across Jido's config and plugin system.
Installation
npm install --save-dev jido-kitTypes Provided
You can import individual types or all at once:
import { Hook, Plugin, Step, Flow, Config } from "jido-kit/types";🔹 Hook
Type for any lifecycle function in a step:
type Hook = () => void | Promise<void>;🔹 Plugin
Shape of a plugin object:
type Plugin = {
onStart?: Hook;
onSuccess?: Hook;
onFailure?: Hook;
};🔹 Step
Represents a step in a flow:
type Step = {
run: string;
onStart?: Hook;
onSuccess?: Hook;
onFailure?: Hook;
plugins: Plugin[];
};🔹 Flow
Structure of a flow definition:
type Flow = {
name: string;
description?: string;
steps: Step[];
};🔹 Config
The full structure passed to jido():
type Config = {
flows: Flow[];
};Usage Example
In your jido.config.js, use JSDoc annotations to enable type hints:
/** @type {import("jido-kit/types").Config} */
import { jido } from "jido";
export default jido({
flows: [
{
name: "build",
steps: [
{
run: "npm run build",
onSuccess: () => console.log("Build complete!")
}
]
}
]
});Or in a plugin file:
/** @type {import("jido-kit/types").Plugin} */
export const myPlugin = () => ({
onStart: () => console.log("Plugin: Flow step is starting...")
});[For complete guide and docs on usage of jido, visit the GitHub page for Jido.]
Why use Jido-Kit?
✅ Full IntelliSense support ✅ Prevents config mistakes ✅ Helps structure your custom plugins ✅ Zero runtime overhead (just types)
License
MIT