JSPM

jido-kit

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q26958F
  • License MIT

Helper library for the Jido CLI. Includes types and utilities to write workflows, steps, and plugins with better developer experience.

Package Exports

  • jido-kit/types

Readme

Jido-Kit

jido-logo

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-kit

Types 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