component-komponent
workflowv1.0.0Auto-loading .komponent archives from the components/ directory
Install
Then run locally:
Configure LLM provider in ~/.kdeps/config.yaml (created automatically on first run).
README
Component with .komponent Auto-Loading
This example demonstrates how .komponent archives can be automatically loaded from the components/ directory.
Structure
component-komponent/
├── workflow.yaml
├── resources/
│ └── response.yaml # Final API response
└── components/
└── greeter.komponent # Pre-packaged component
How It Works
-
Component Package: The
greeter-1.0.0.komponentfile is a gzipped tar archive containing acomponent.yamland its resources. It is not unpacked; it stays as an archive in thecomponents/directory. -
Auto-Loading: When the workflow is parsed, the
loadComponents()function:- Scans the
components/directory - Detects
.komponentarchives - Extracts them to temporary directories
- Processes the component as if it were an unpacked directory
- Merges the component's resources into the workflow
- Scans the
-
Component Resources: The
greetercomponent provides asayHelloresource that:- Creates a greeting and sets the
greetingvariable
- Creates a greeting and sets the
-
Workflow Flow:
sayHello(from component) → setsgreeting = "Hello from .komponent!"finalResponse→ returnsgreetingas JSON
Running the Example
# Parse and execute the workflow (no external dependencies)
kdeps run examples/component-komponent/workflow.yaml
Expected output:
{
"success": true,
"message": "Hello from .komponent!"
}
Creating Your Own .komponent
-
Create a component directory with
component.yamland optionallyresources/:mkdir my-component cat > my-component/component.yaml << 'EOF' apiVersion: kdeps.io/v1 kind: Component metadata: name: my-component ... EOF -
Package it:
kdeps package my-component --output . # Creates my-component-1.0.0.komponent -
Copy the
.komponentfile to your workflow'scomponents/directory. -
Reference the component's
actionIds in your workflow's resources as needed.
Benefits of .komponent
- Distribution: Single file contains the complete component
- Versioning: Version number in filename makes updates explicit
- Encapsulation: Component internals are packaged, not scattered
- Reusability: Drop the same
.komponentinto any workflow'scomponents/folder
Versions
| Version | Published | Status |
|---|---|---|
| 1.0.0 | 4/11/2026 | active |
Details
- Author
- kdeps
- License
- Apache-2.0
- Latest Version
- 1.0.0
- Published
- 4/11/2026