wspkit
wspkit is a Python library and command-line client for the Workflow Server
Protocol (WSP) — a small JSON-RPC 2.0 protocol that lets workflow tools
(environment managers, task runners, test runners) expose their capabilities to
consuming tools through a uniform interface.
WSP is to workflow tools roughly what the Language Server Protocol is to editors: a stable, machine-readable surface that decouples the tool from the client.
Why use wspkit
- Two integration paths. Take a runtime dependency on the library and register Python callables, or stay completely decoupled by writing a TOML or JSON config file that points at imports or external commands.
- A complete CLI client. The bundled
wspcommand performs the per-invocation lifecycle (initialize→ method →shutdown→exit), translates JSON-RPC error responses into well-defined exit codes, and prints results as JSON. - A useful out-of-the-box experience. When no target is configured,
wspserves a built-in workflow tool backed by Python's standardvenvmodule with on-disk persistence, so you get workingenvironment/*calls before installing anything else. - Conformance you can rely on. The protocol implementation is verified against property-based tests covering the JSON-RPC codec, the Content-Length framing, the lifecycle finite-state machine, and the error model. See Testing for the property catalogue.
Where to start
- New to WSP? Begin with Getting started, then read the Protocol overview for the data model.
- Already have a workflow tool? Jump to Embed wspkit in a workflow tool to wire it up in a few lines, or to Ship a Config_File if you'd prefer no runtime dependency.
- Have an existing CLI you'd like to expose over WSP? Read Adapt an existing CLI for a worked example.
- Just want to run commands? Skip to Use the wsp CLI.
Project status
wspkit is a young library. The first iteration ships:
- The
WSP_Serverruntime over stdio withContent-Lengthframing. - Programmatic and Config_File handler registration.
- The lifecycle methods (
initialize,shutdown,exit) and theenvironment/*family (list,create,get,delete,execute). - The
wspCLI client and the bundled fallback workflow tool.
Future iterations will add Python interpreter installation endpoints, test endpoints, and task endpoints. See the WSP method reference for the current surface.