Skip to content

Build AI methods with your coding agent, then run them anywhere: as an MCP for chatbots, as a webapp for people, or via API for your software.

Release/v0.18.2 (#719)

Thomas Hebrard3afa9e15dcdf
diff --git a/.badges/tests.json b/.badges/tests.json
index 6b3e92dbd..d15be8022 100644
--- a/.badges/tests.json
+++ b/.badges/tests.json
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"label": "tests",
- "message": "3901",
+ "message": "3908",
"color": "blue",
"cacheSeconds": 300
}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5fa782fc3..9ba48f866 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,22 @@
# Changelog
+## [v0.18.2] - 2026-02-27
+
+### Added
+
+- **Inputs path resolution** — Relative file paths (e.g., `"url": "data/invoice.pdf"`) inside `inputs.json` are now resolved relative to the inputs file's parent directory, making bundle directories self-contained and portable. Applies to both user and agent CLIs. Handles HTTP, data:, pipelex-storage://, and absolute paths by leaving them unchanged.
+
+### Changed
+
+- **`pipelex-agent init` defaults to local project** — The `init` command now targets the project-level `.pipelex/` directory by default (at detected project root) instead of auto-detecting. The `--local` flag has been removed. Use `--global`/`-g` to target `~/.pipelex/`. Errors out if no project root is found without `-g`.
+- **`pipelex-agent doctor` supports `--global`/`-g`** — The `doctor` command now accepts `--global`/`-g` to check the global `~/.pipelex/` directory. Without the flag, it auto-detects project `.pipelex/` if present, else falls back to `~/.pipelex/`.
+- **`pipelex-agent init --config` improved help** — The `--config` option help text now shows the JSON schema with field types upfront for better discoverability.
+
+### Fixed
+
+- **`pipelex-agent init -g` service agreement** — The `--global` flag now correctly writes the gateway service terms acceptance (`pipelex_service.toml`) to the target directory instead of always writing to the auto-detected config dir.
+- **Deterministic file discovery order** — `find_files_in_dir` now sorts `rglob`/`glob` results for consistent ordering across platforms and Python versions. On Linux with Python < 3.13, `rglob` returned filesystem-order results, which could cause `test_validate_all` to fail by picking up a test package's `METHODS.toml` before pipelex internal bundles.
+
## [v0.18.1] - 2026-02-25
### Fixed
diff --git a/docs/home/2-get-started/pipe-builder.md b/docs/home/2-get-started/pipe-builder.md
index 2d87be724..715bad6e4 100644
--- a/docs/home/2-get-started/pipe-builder.md
+++ b/docs/home/2-get-started/pipe-builder.md
@@ -43,7 +43,7 @@ The pipe builder generates three files in a numbered directory (e.g., `results/p
**Option 1: CLI**
```bash
-pipelex run results/cv_match.mthds --inputs inputs.json
+pipelex run bundle results/cv_match.mthds --inputs inputs.json
```
The `--inputs` file should be a JSON dictionary where keys are input variable names and values are the input data. Learn more on how to provide the inputs of a pipe: [Providing Inputs to Pipelines](../../home/6-build-reliable-ai-workflows/pipes/provide-inputs.md)
diff --git a/docs/home/6-build-reliable-ai-workflows/pipes/executing-pipelines.md b/docs/home/6-build-reliable-ai-workflows/pipes/executing-pipelines.md
index 7437a3071..faf8005ef 100644
--- a/docs/home/6-build-reliable-ai-workflows/pipes/executing-pipelines.md
+++ b/docs/home/6-build-reliable-ai-workflows/pipes/executing-pipelines.md
@@ -10,17 +10,17 @@ The easiest way to execute a pipeline is to point directly to your `.mthds` bund
```bash
# Run the bundle's main_pipe
-pipelex run path/to/my_bundle.mthds
+pipelex run bundle path/to/my_bundle.mthds
# Run a specific pipe from the bundle
-pipelex run path/to/my_bundle.mthds --pipe my_specific_pipe
+pipelex run bundle path/to/my_bundle.mthds --pipe my_specific_pipe
# Run with inputs
-pipelex run path/to/my_bundle.mthds --inputs inputs.json
+pipelex run bundle path/to/my_bundle.mthds --inputs inputs.json
```
!!! tip "Preparing Inputs"
- You can generate an input template with `pipelex build inputs path/to/my_bundle.mthds`, which creates a `results/inputs.json` file with the required input structure.
+ You can generate an input template with `pipelex build inputs bundle path/to/my_bundle.mthds`, which creates a `results/inputs.json` file with the required input structure.
### Using Python
diff --git a/docs/home/6-build-reliable-ai-workflows/pipes/provide-inputs.md b/docs/home/6-build-reliable-ai-workflows/pipes/provide-inputs.md
index 8ca6c3b9e..773349184 100644
--- a/docs/home/6-build-reliable-ai-workflows/pipes/provide-inputs.md
+++ b/docs/home/6-build-reliable-ai-workflows/pipes/provide-inputs.md
@@ -7,13 +7,13 @@ When running Pipelex pipelines, you need to provide input data that matches what
The Pipelex CLI can generate a template JSON file with all the required inputs for your pipeline:
```bash
-pipelex build inputs path/to/my_pipe.mthds
+pipelex build inputs bundle path/to/my_pipe.mthds
```
This creates a `results/inputs.json` file with the structure needed for your pipeline. You can then fill in the values and use it with:
```bash
-pipelex run path/to/my_pipe.mthds --inputs results/inputs.json
+pipelex run bundle path/to/my_pipe.mthds --inputs results/inputs.json
```
See more about the options of the CLI [here](../../9-tools/cli/index.md).
diff --git a/docs/home/7-configuration/config-technical/library-config.md b/docs/home/7-configuration/config-technical/library-config.md
index f46bc9ce8..2fa996bac 100644
--- a/docs/home/7-configuration/config-technical/library-config.md
+++ b/docs/home/7-configuration/config-technical/library-config.md
@@ -14,10 +14,10 @@ If you just want to run a pipe from a single `.mthds` file, **you don't need any
```bash
# CLI: run the bundle's main_pipe
-pipelex run path/to/my_bundle.mthds
+pipelex run bundle path/to/my_bundle.mthds
# CLI: run a specific pipe from the bundle
-pipelex run path/to/my_bundle.mthds --pipe my_pipe
+pipelex run bundle path/to/my_bundle.mthds --pipe my_pipe
```
```python
@@ -121,13 +121,13 @@ When running pipelines from the command line, use the `-L` or `--library-dir` op
```bash
# Single directory
-pipelex run my_pipe -L /path/to/pipelines
+pipelex run pipe my_pipe -L /path/to/pipelines
# Multiple directories
-pipelex run my_pipe -L /path/to/shared_pipes -L /path/to/project_pipes
+pipelex run pipe my_pipe -L /path/to/shared_pipes -L /path/to/project_pipes
# Combined with other options
-pipelex run my_bundle.mthds --inputs data.json -L /path/to/pipelines
+pipelex run bundle my_bundle.mthds --inputs data.json -L /path/to/pipelines
# Available on multiple commands
pipelex validate --all -L /path/to/pipelines/dir
@@ -459,7 +459,7 @@ After making changes to your pipelines, validate them:
pipelex validate --all
# Validate a specific pipe
-pipelex validate pipe YOUR_PIPE_CODE
+pipelex validate YOUR_PIPE_CODE
# Show all available pipes
pipelex show pipes
diff --git a/docs/home/9-tools/cli/agent-cli.md b/docs/home/9-tools/cli/agent-cli.md
new file mode 100644
index 000000000..528d42e06
--- /dev/null
+++ b/docs/home/9-tools/cli/agent-cli.md
@@ -0,0 +1,122 @@
+# Agent CLI (`pipelex-agent`)
+
+The `pipelex-agent` CLI is a machine-oriented companion to the main `pipelex` CLI. It is designed for programmatic consumption by AI agents, IDE extensions, and other automation tools. All output is structured JSON written to stdout (success) or stderr (error), with no Rich formatting or interactive prompts.
+
+Its structured JSON output makes it well-suited for piping into other tools (e.g., `jq`), scripting, and integration into larger workflows. It is consumed by the `mthds-agent` CLI (from the `mthds` npm package) which itself is used by Claude Code skills, the VS Code extension, and can be called directly from the command line.
+
+## Global Options
+
+| Option | Description |
+|--------|-------------|
+| `--log-level` | Set the logging level (e.g., `debug`, `info`, `warning`, `error`) |
+| `--runner` | Select the runner backend to use |
+| `--version` | Print the version and exit |
+
+## Commands Overview
+
+The agent CLI mirrors the main CLI's subcommand structure for `run`, `validate`, and `inputs`, each with `pipe`, `bundle`, and `method` subcommands.
+
+### Run
+
+Execute a pipeline and return results as JSON.
+
+```bash
+pipelex-agent run pipe <PIPE_CODE> [OPTIONS]
+pipelex-agent run bundle <PATH> [OPTIONS]
+pipelex-agent run method <NAME> [OPTIONS]
+```
+
+**Common options:**
+
+- `--inputs`, `-i` - Path to JSON input file
+- `--dry-run` - Dry-run without calling AI providers
+- `--mock-inputs` - Use mock inputs
+- `--graph` / `--no-graph` - Enable/disable execution graph (enabled by default)
+- `--library-dir`, `-L` - Additional library directory
+- `--with-memory` - Include full working memory in output
+
+For `bundle` and `method`, use `--pipe` to target a specific pipe.
+
+### Validate
+
+Validate pipes, bundles, or methods and return status as JSON.
+
+```bash
+pipelex-agent validate pipe <PIPE_CODE> [OPTIONS]
+pipelex-agent validate pipe --all [OPTIONS]
+pipelex-agent validate bundle <PATH> [OPTIONS]
+pipelex-agent validate method <NAME> [OPTIONS]
+```
+
+**Common options:**
+
+- `--library-dir`, `-L` - Additional library directory
+
+For `bundle`, additional options are available:
+
+- `--pipe` - Require a specific pipe in the bundle
+- `--graph`, `-g` - Generate an execution graph visualization
+- `--format`, `-f` - Graph output format
+- `--direction` - Graph layout direction
+
+### Inputs
+
+Generate example input JSON for a pipe, bundle, or method.
+
+```bash
+pipelex-agent inputs pipe <PIPE_CODE> [OPTIONS]
+pipelex-agent inputs bundle <PATH> [OPTIONS]
+pipelex-agent inputs method <NAME> [OPTIONS]
+```
+
+**Common options:**
+
+- `--library-dir`, `-L` - Additional library directory
+
+For `bundle` and `method`, use `--pipe` to target a specific pipe.
+
+### Flat Commands
+
+These commands do not have subcommands:
+
+| Command | Description |
+|---------|-------------|
+| `fmt` | Format a `.mthds`/`.toml`/`.plx` file in-place (delegates to `plxt`) |
+| `lint` | Lint a `.mthds`/`.toml`/`.plx` file for errors (delegates to `plxt`) |
+| `concept` | Convert a JSON concept spec into TOML |
+| `pipe` | Convert a JSON pipe spec into TOML |
+| `assemble` | Merge concept and pipe TOML sections into a complete `.mthds` file |
+| `models` | List available model presets, aliases, waterfalls, and talent mappings |
+| `doctor` | Check config, credentials, and model health |
+
+## Output Contract
+
+Every command (except `fmt` and `lint`) returns structured JSON via one of two functions:
+
+**Success** — written to stdout:
+
+```json
+{
+ "status": "success",
+ "data": { ... }
+}
+```
+
+**Error** — written to stderr:
+
+```json
+{
+ "status": "error",
+ "error_type": "specific_error_type",
+ "message": "Human-readable description",
+ "domain": "input | config | runtime",
+ "hint": "Suggested fix or next step",
+ "retryable": false
+}
+```
+
+`fmt` and `lint` are raw passthroughs to the `plxt` binary and bypass the JSON output contract, producing native `plxt` output instead.
+
+## Graph Visualization
+
+Graph visualization is available through the `validate bundle` subcommand with the `--graph` flag, and through `run` subcommands where it is enabled by default. Use `--no-graph` on `run` to disable it.
diff --git a/docs/home/9-tools/cli/build/inputs.md b/docs/home/9-tools/cli/build/inputs.md
index c80ccccfc..b0bed3163 100644
--- a/docs/home/9-tools/cli/build/inputs.md
+++ b/docs/home/9-tools/cli/build/inputs.md
@@ -4,44 +4,89 @@ Generate example input JSON for a pipe, showing the expected input structure bas
## Usage
+### By pipe code
+
+```bash
+pipelex build inputs pipe <PIPE_CODE> [OPTIONS]
+```
+
+**Arguments:**
+
+- `PIPE_CODE` - The pipe code (e.g. `my_domain.my_pipe`)
+
+**Options:**
+
+- `--library-dir`, `-L` - Directory to search for pipe definitions. Can be specified multiple times.
+- `--output`, `-o` - Path to save the generated JSON file (defaults to `results/`)
+
+### From a bundle
+
```bash
-pipelex build inputs <TARGET> [OPTIONS]
+pipelex build inputs bundle <PATH> [OPTIONS]
```
**Arguments:**
-- `TARGET` - Either a pipe code or a bundle file path (`.mthds`) - auto-detected
+- `PATH` - Path to a `.mthds` bundle file or a pipeline directory
**Options:**
-- `--pipe` - Pipe code to use (can be omitted if you specify a bundle that declares a `main_pipe`)
+- `--pipe` - Pipe code to use (can be omitted if the bundle declares a `main_pipe`)
- `--library-dir`, `-L` - Directory to search for pipe definitions. Can be specified multiple times.
-- `--output`, `-o` - Path to save the generated JSON file (defaults to bundle's directory if bundle provided, otherwise `results/`)
+- `--output`, `-o` - Path to save the generated JSON file (defaults to bundle's directory)
+
+### From an installed method
+
+```bash
+pipelex build inputs method <NAME> [OPTIONS]
+```
+
+**Arguments:**
+
+- `NAME` - Name of the installed method
+
+**Options:**
+
+- `--pipe` - Pipe code (overrides method's `main_pipe`)
+- `--library-dir`, `-L` - Directory to search for pipe definitions. Can be specified multiple times.
+- `--output`, `-o` - Path to save the generated JSON file
## Examples
+**Generate inputs for a pipe by code:**
+
+```bash
+pipelex build inputs pipe my_domain.my_pipe
+```
+
**Generate inputs from a bundle (uses main_pipe):**
```bash
-pipelex build inputs my_bundle.mthds
+pipelex build inputs bundle my_bundle.mthds
+```
+
+**Generate inputs from a pipeline directory:**
+
+```bash
+pipelex build inputs bundle pipeline_01/
```
**Specify which pipe to use from a bundle:**
```bash
-pipelex build inputs my_bundle.mthds --pipe my_pipe
+pipelex build inputs bundle my_bundle.mthds --pipe my_pipe
```
**Generate inputs for a pipe using a library directory:**
```bash
-pipelex build inputs my_domain.my_pipe -L ./my_library/
+pipelex build inputs pipe my_domain.my_pipe -L ./my_library/
```
**Custom output path:**
```bash
-pipelex build inputs my_bundle.mthds --output custom_inputs.json
+pipelex build inputs bundle my_bundle.mthds --output custom_inputs.json
```
## Output Format
diff --git a/docs/home/9-tools/cli/build/output.md b/docs/home/9-tools/cli/build/output.md
index 4945db535..44ae054af 100644
--- a/docs/home/9-tools/cli/build/output.md
+++ b/docs/home/9-tools/cli/build/output.md
@@ -4,54 +4,101 @@ Generate output representation for a pipe, showing the expected output structure
## Usage
+### By pipe code
+
```bash
-pipelex build output <TARGET> [OPTIONS]
+pipelex build output pipe <PIPE_CODE> [OPTIONS]
```
**Arguments:**
-- `TARGET` - Either a pipe code or a bundle file path (`.mthds`) - auto-detected
+- `PIPE_CODE` - The pipe code (e.g. `my_domain.my_pipe`)
**Options:**
-- `--pipe` - Pipe code to use (can be omitted if you specify a bundle that declares a `main_pipe`)
- `--library-dir`, `-L` - Directory to search for pipe definitions. Can be specified multiple times.
-- `--output`, `-o` - Path to save the generated file (defaults to bundle's directory if bundle provided, otherwise `results/`)
+- `--output`, `-o` - Path to save the generated file (defaults to `results/`)
- `--format`, `-f` - Output format (default: `json`):
- `json` - JSON object with example placeholder data
- `python` - Python class instantiation code
- `schema` - JSON Schema definition, ideal for generating TypeScript interfaces or Zod schemas
+### From a bundle
+
+```bash
+pipelex build output bundle <PATH> [OPTIONS]
+```
+
+**Arguments:**
+
+- `PATH` - Path to a `.mthds` bundle file or a pipeline directory
+
+**Options:**
+
+- `--pipe` - Pipe code to use (can be omitted if the bundle declares a `main_pipe`)
+- `--library-dir`, `-L` - Directory to search for pipe definitions. Can be specified multiple times.
+- `--output`, `-o` - Path to save the generated file (defaults to bundle's directory)
+- `--format`, `-f` - Output format (default: `json`): `json`, `python`, or `schema`
+
+### From an installed method
+
+```bash
+pipelex build output method <NAME> [OPTIONS]
+```
+
+**Arguments:**
+
+- `NAME` - Name of the installed method
+
+**Options:**
+
+- `--pipe` - Pipe code (overrides method's `main_pipe`)
+- `--library-dir`, `-L` - Directory to search for pipe definitions. Can be specified multiple times.
+- `--output`, `-o` - Path to save the generated file
+- `--format`, `-f` - Output format (default: `json`): `json`, `python`, or `schema`
+
## Examples
+**Generate output for a pipe by code:**
+
+```bash
+pipelex build output pipe my_domain.my_pipe
+```
+
**Generate output from a bundle (uses main_pipe):**
```bash
-pipelex build output my_bundle.mthds
+pipelex build output bundle my_bundle.mthds
+```
+
+**Generate JSON Schema from a bundle for TypeScript/Zod integration:**
+
+```bash
+pipelex build output bundle my_bundle.mthds --format schema
```
-**Generate JSON Schema for TypeScript/Zod integration:**
+**Generate output from a pipeline directory:**
```bash
-pipelex build output my_bundle.mthds --format schema
+pipelex build output bundle pipeline_01/
```
**Specify which pipe to use from a bundle:**
```bash
-pipelex build output my_bundle.mthds --pipe my_pipe
+pipelex build output bundle my_bundle.mthds --pipe my_pipe
```
**Generate output for a pipe using a library directory:**
```bash
-pipelex build output my_domain.my_pipe -L ./my_library/
+pipelex build output pipe my_domain.my_pipe -L ./my_library/
```
**Custom output path:**
```bash
-pipelex build output my_bundle.mthds --output expected_output.json
+pipelex build output bundle my_bundle.mthds --output expected_output.json
```
## Output Formats
diff --git a/docs/home/9-tools/cli/build/pipe.md b/docs/home/9-tools/cli/build/pipe.md
index 9fc2679e6..92f89294e 100644
--- a/docs/home/9-tools/cli/build/pipe.md
+++ b/docs/home/9-tools/cli/build/pipe.md
@@ -111,12 +111,12 @@ The Pipe Builder is in active development and currently:
After generating your pipeline:
-1. **Validate it**: `pipelex validate your_pipe.mthds` - See [Validate Commands](../validate.md)
-2. **Run it**: `pipelex run your_pipe.mthds` - See [Run Command](../run.md)
-3. **Generate a runner**: `pipelex build runner your_pipe.mthds` - See [Build Runner](runner.md)
+1. **Validate it**: `pipelex validate bundle your_pipe.mthds` - See [Validate Commands](../validate.md)
+2. **Run it**: `pipelex run bundle your_pipe.mthds` - See [Run Command](../run.md)
+3. **Generate a runner**: `pipelex build runner bundle your_pipe.mthds` - See [Build Runner](runner.md)
4. **Generate structures**: `pipelex build structures ./` - See [Build Structures](structures.md)
-5. **Generate input template**: `pipelex build inputs your_pipe.mthds` - See [Build Inputs](inputs.md)
-6. **View output structure**: `pipelex build output your_pipe.mthds` - See [Build Output](output.md)
+5. **Generate input template**: `pipelex build inputs bundle your_pipe.mthds` - See [Build Inputs](inputs.md)
+6. **View output structure**: `pipelex build output bundle your_pipe.mthds` - See [Build Output](output.md)
## Related Documentation
diff --git a/docs/home/9-tools/cli/build/runner.md b/docs/home/9-tools/cli/build/runner.md
index 0b99d2c03..fea7081bb 100644
--- a/docs/home/9-tools/cli/build/runner.md
+++ b/docs/home/9-tools/cli/build/runner.md
@@ -4,13 +4,15 @@ Generate Python code to run a pipe with all necessary imports and example inputs
## Usage
+### From a bundle
+
```bash
-pipelex build runner <TARGET> [OPTIONS]
+pipelex build runner bundle <PATH> [OPTIONS]
```
**Arguments:**
-- `TARGET` - Bundle file path (`.mthds`)
+- `PATH` - Path to a `.mthds` bundle file or a pipeline directory
**Options:**
@@ -18,30 +20,52 @@ pipelex build runner <TARGET> [OPTIONS]
- `--output`, `-o` - Path to save the generated Python file (defaults to target's directory)
- `--library-dirs`, `-L` - Directories to search for pipe definitions. Can be specified multiple times.
+### From an installed method
+
+```bash
+pipelex build runner method <NAME> [OPTIONS]
+```
+
+**Arguments:**
+
+- `NAME` - Name of the installed method
+
+**Options:**
+
+- `--pipe` - Pipe code (overrides method's `main_pipe`)
+- `--output`, `-o` - Path to save the generated Python file
+- `--library-dirs`, `-L` - Directories to search for pipe definitions. Can be specified multiple times.
+
## Examples
**Generate runner from a bundle (uses main_pipe):**
```bash
-pipelex build runner my_bundle.mthds
+pipelex build runner bundle my_bundle.mthds
+```
+
+**Generate runner from a pipeline directory:**
+
+```bash
+pipelex build runner bundle pipeline_01/
```
**Specify which pipe to use from a bundle:**
```bash
-pipelex build runner my_bundle.mthds --pipe my_pipe
+pipelex build runner bundle my_bundle.mthds --pipe my_pipe
```
**With additional library directories:**
```bash
-pipelex build runner my_bundle.mthds -L ./shared_pipes/ -L ./common/
+pipelex build runner bundle my_bundle.mthds -L ./shared_pipes/ -L ./common/
```
**Custom output path:**
```bash
-pipelex build runner my_bundle.mthds --output custom_runner.py
+pipelex build runner bundle my_bundle.mthds --output custom_runner.py
```
## What Gets Generated
@@ -77,4 +101,3 @@ After generating the runner file:
- [Build Inputs](inputs.md) - Generate example input JSON for a pipe
- [Build Output](output.md) - Generate example output JSON for a pipe
- [Run Command](../run.md) - Run pipes directly from CLI
-
diff --git a/docs/home/9-tools/cli/index.md b/docs/home/9-tools/cli/index.md
index de0a0bdcc..bf86bd5cf 100644
--- a/docs/home/9-tools/cli/index.md
+++ b/docs/home/9-tools/cli/index.md
@@ -25,14 +25,14 @@ The Pipelex CLI is organized into several command groups:
2. **Development Workflow**
- Write or generate pipelines in `.mthds` files
- - Validate with `pipelex validate your_pipe_code` or `pipelex validate your_bundle.mthds` during development
- - Run `pipelex validate --all` before committing changes
+ - Validate with `pipelex validate pipe your_pipe_code` or `pipelex validate bundle your_bundle.mthds` during development
+ - Run `pipelex validate pipe --all` before committing changes
3. **Running Pipelines**
- Use `pipelex show pipes` to see available pipes
- Use `pipelex show pipe pipe_code` to inspect pipe details
- - Run with `pipelex run pipe_code`, add the required inputs using `--inputs`
+ - Run with `pipelex run pipe pipe_code`, add the required inputs using `--inputs`
4. **Configuration Management**
diff --git a/docs/home/9-tools/cli/init.md b/docs/home/9-tools/cli/init.md
index 8f713e357..5c25b03ac 100644
--- a/docs/home/9-tools/cli/init.md
+++ b/docs/home/9-tools/cli/init.md
@@ -58,6 +58,49 @@ When you run `pipelex init`, you'll be guided through:
2. **Routing Configuration** - Set up how models are routed to backends
3. **Telemetry Setup** - Configure observability and analytics
+## Non-Interactive Init (`pipelex-agent init`)
+
+For automated or agent-driven setups, use the `pipelex-agent` CLI:
+
+```bash
+pipelex-agent init [--config/-c JSON] [--global/-g]
+```
+
+**Target directory:**
+
+- **Default:** project-level `.pipelex/` at the detected project root (looks for `.git`, `pyproject.toml`, etc.). Errors out if no project root is found.
+- **`--global`/`-g`:** forces `~/.pipelex/`.
+
+**Config JSON schema:**
+
+```json
+{
+ "backends": ["openai", "anthropic"],
+ "primary_backend": "openai",
+ "accept_gateway_terms": true,
+ "telemetry_mode": "off"
+}
+```
+
+All fields are optional:
+
+| Field | Type | Description |
+|-------|------|-------------|
+| `backends` | `list[str]` | Backend keys to enable (e.g. `openai`, `anthropic`, `pipelex_gateway`). Omit to keep template defaults. |
+| `primary_backend` | `str` | Required only when 2+ backends are selected and `pipelex_gateway` is not among them. |
+| `accept_gateway_terms` | `bool` | Required when `pipelex_gateway` is in backends. |
+| `telemetry_mode` | `str` | `off` (default), `anonymous`, or `identified`. |
+
+**Examples:**
+
+```bash
+# Initialize with OpenAI backend (project-level)
+pipelex-agent init --config '{"backends": ["openai"], "telemetry_mode": "off"}'
+
+# Initialize globally with gateway
+pipelex-agent init -g --config '{"backends": ["pipelex_gateway"], "accept_gateway_terms": true}'
+```
+
## Related Configuration
- [Configure AI Providers](../../5-setup/configure-ai-providers.md)
diff --git a/docs/home/9-tools/cli/run.md b/docs/home/9-tools/cli/run.md
index e15978c9b..a62e89969 100644
--- a/docs/home/9-tools/cli/run.md
+++ b/docs/home/9-tools/cli/run.md
@@ -1,52 +1,147 @@
-# Run Command
+# Run Commands
Execute a pipeline with optional inputs and outputs.
-## Run a Pipeline
+The `run` command has three subcommands depending on where your pipeline is defined:
```bash
-pipelex run [TARGET] [OPTIONS]
+pipelex run pipe ... # Run a pipe from your project's library
+pipelex run bundle ... # Run a pipeline from a bundle file or directory
+pipelex run method ... # Run an installed method package
```
-Executes a pipeline, either from a standalone bundle (.mthds) file or from your project's pipe library.
+## Run Pipe
+
+```bash
+pipelex run pipe <PIPE_CODE> [OPTIONS]
+```
+
+Runs a pipe by code from your project's pipe library.
**Arguments:**
-- `TARGET` - Either a pipe code or a bundle file path, auto-detected according to presence of the .mthds file extension
+- `PIPE_CODE` - The pipe code to run
**Options:**
-- `--pipe` - Pipe code to run (alternative to positional argument)
-- `--bundle` - Bundle file path (alternative to positional argument)
- `--inputs`, `-i` - Path to JSON file containing inputs
-- `--output`, `-o` - Path to save output JSON (defaults to `results/run_{pipe_code}.json`)
-- `--no-output` - Skip saving output to file
+- `--output-dir`, `-o` - Directory to save outputs (defaults to `results/`)
+- `--save-main-stuff` / `--no-save-main-stuff` - Whether to save the main output to a file
+- `--save-working-memory` / `--no-save-working-memory` - Whether to save the full working memory
+- `--working-memory-path` - Custom path for the working memory output file
- `--no-pretty-print` - Skip pretty printing the main output
-- `--library-dir`, `-L` - Directory to search for pipe definitions (.mthds files). Can be specified multiple times.
+- `--graph` / `--no-graph` - Enable/disable execution graph visualization
+- `--graph-full-data` / `--graph-no-data` - Include full data in the graph visualization
+- `--dry-run` - Dry-run the pipeline without calling AI providers
+- `--mock-inputs` - Use mock inputs for the pipeline (requires `--dry-run`)
+- `--library-dir`, `-L` - Directory to search for pipe definitions. Can be specified multiple times.
**Examples:**
```bash
# Run a pipe by code
-pipelex run hello_world
+pipelex run pipe hello_world
# Run with inputs from JSON file
-pipelex run write_weekly_report --inputs weekly_report_data.json
+pipelex run pipe write_weekly_report --inputs weekly_report_data.json
+
+# Run with custom output directory
+pipelex run pipe hello_world --output-dir my_output/
+
+# Run without saving or pretty printing
+pipelex run pipe my_pipe --no-save-main-stuff --no-pretty-print
+
+# Dry-run (no AI calls)
+pipelex run pipe my_pipe --dry-run
+
+# Run with custom library directories
+pipelex run pipe my_pipe -L ./pipelines -L ./shared_pipes
+```
+
+## Run Bundle
+
+```bash
+pipelex run bundle <PATH> [OPTIONS]
+```
+
+Runs a pipeline from a bundle file (`.mthds`) or a pipeline directory. When a directory is given, the bundle file is auto-detected inside it.
+
+**Arguments:**
+
+- `PATH` - Path to a `.mthds` bundle file or a directory containing one
+
+**Options:**
+
+- `--pipe PIPE_CODE` - Run a specific pipe from the bundle (defaults to the bundle's main pipe)
+- `--inputs`, `-i` - Path to JSON file containing inputs
+- `--output-dir`, `-o` - Directory to save outputs
+- `--save-main-stuff` / `--no-save-main-stuff` - Whether to save the main output
+- `--save-working-memory` / `--no-save-working-memory` - Whether to save the full working memory
+- `--working-memory-path` - Custom path for the working memory output file
+- `--no-pretty-print` - Skip pretty printing the main output
+- `--graph` / `--no-graph` - Enable/disable execution graph visualization
+- `--graph-full-data` / `--graph-no-data` - Include full data in the graph visualization
+- `--dry-run` - Dry-run the pipeline without calling AI providers
+- `--mock-inputs` - Use mock inputs for the pipeline (requires `--dry-run`)
+- `--library-dir`, `-L` - Directory to search for additional pipe definitions. Can be specified multiple times.
+
+**Examples:**
+```bash
# Run a bundle file (uses its main_pipe)
-pipelex run my_bundle.mthds
+pipelex run bundle my_bundle.mthds
+
+# Run a pipeline directory
+pipelex run bundle pipelines/invoice_processor/
# Run a specific pipe from a bundle
-pipelex run my_bundle.mthds --pipe extract_invoice
+pipelex run bundle my_bundle.mthds --pipe extract_invoice
-# Run with explicit options
-pipelex run --pipe hello_world --output my_output.json
+# Run with inputs
+pipelex run bundle my_bundle.mthds --inputs invoice_data.json
-# Run without saving or pretty printing
-pipelex run my_pipe --no-output --no-pretty-print
+# Run with execution graph
+pipelex run bundle my_bundle.mthds --graph
+```
-# Run with custom library directories
-pipelex run my_pipe -L ./pipelines -L ./shared_pipes
+## Run Method
+
+```bash
+pipelex run method <NAME> [OPTIONS]
+```
+
+Runs a pipeline from an installed method package.
+
+**Arguments:**
+
+- `NAME` - The name of the installed method to run
+
+**Options:**
+
+- `--pipe PIPE_CODE` - Run a specific pipe within the method (defaults to the method's main pipe)
+- `--inputs`, `-i` - Path to JSON file containing inputs
+- `--output-dir`, `-o` - Directory to save outputs
+- `--save-main-stuff` / `--no-save-main-stuff` - Whether to save the main output
+- `--save-working-memory` / `--no-save-working-memory` - Whether to save the full working memory
+- `--working-memory-path` - Custom path for the working memory output file
+- `--no-pretty-print` - Skip pretty printing the main output
+- `--graph` / `--no-graph` - Enable/disable execution graph visualization
+- `--graph-full-data` / `--graph-no-data` - Include full data in the graph visualization
+- `--dry-run` - Dry-run the pipeline without calling AI providers
+- `--mock-inputs` - Use mock inputs for the pipeline (requires `--dry-run`)
+- `--library-dir`, `-L` - Directory to search for additional pipe definitions. Can be specified multiple times.
+
+**Examples:**
+
+```bash
+# Run an installed method
+pipelex run method invoice_extractor
+
+# Run a specific pipe within a method
+pipelex run method invoice_extractor --pipe extract_amounts
+
+# Run with inputs
+pipelex run method invoice_extractor --inputs invoice_data.json
```
## Input JSON Format
@@ -72,4 +167,3 @@ The output JSON contains the complete working memory after pipeline execution, i
- [Executing Pipelines](../../6-build-reliable-ai-workflows/pipes/executing-pipelines.md)
- [Providing Inputs to Pipelines](../../6-build-reliable-ai-workflows/pipes/provide-inputs.md)
- [Design and Run Pipelines](../../6-build-reliable-ai-workflows/pipes/index.md)
-
diff --git a/docs/home/9-tools/cli/validate.md b/docs/home/9-tools/cli/validate.md
index 993131533..dd6b723db 100644
--- a/docs/home/9-tools/cli/validate.md
+++ b/docs/home/9-tools/cli/validate.md
@@ -2,124 +2,112 @@
Validate your pipeline definitions and configuration for correctness.
-## Validate All Pipes
+The `validate` command has three subcommands depending on what you want to validate:
```bash
-pipelex validate --all
+pipelex validate pipe ... # Validate a pipe from your project's library
+pipelex validate bundle ... # Validate a bundle file or directory
+pipelex validate method ... # Validate an installed method package
```
-Performs comprehensive validation:
-
-1. Validates all library configurations
-2. Runs static validation on all discovered pipes
-3. Performs dry-run execution to check pipeline logic
-
-This is the recommended validation to run before committing changes or deploying pipelines.
-
-**Options:**
-
-- `--library-dir`, `-L` - Directory to search for pipe definitions. Can be specified multiple times.
-
-**Examples:**
-
-```bash
-# Validate everything
-pipelex validate --all
-
-# Validate with custom library directories
-pipelex validate --all -L ./pipelines -L ./shared_pipes
-```
+!!! tip "Shorthand"
+ `pipelex validate --all` and `pipelex validate <pipe_code>` are shortcuts that default to the `pipe` subcommand. You can omit `pipe` for convenience.
-## Validate Single Pipe
+## Validate Pipe
```bash
-pipelex validate PIPE_CODE
-pipelex validate --pipe PIPE_CODE
+pipelex validate pipe <PIPE_CODE>
+pipelex validate pipe --all
```
-Validates and dry-runs a specific pipe from your imported packages, useful for iterative development.
+Validates and dry-runs a specific pipe from your imported packages, or all pipes at once.
**Arguments:**
-- `PIPE_CODE` - The pipe code to validate as a positional argument, or use `--pipe` option
+- `PIPE_CODE` - The pipe code to validate (omit when using `--all`)
**Options:**
-- `--pipe PIPE_CODE` - Explicitly specify the pipe code to validate (alternative to positional argument)
+- `--all`, `-a` - Validate all discovered pipes
- `--library-dir`, `-L` - Directory to search for pipe definitions. Can be specified multiple times.
**Examples:**
```bash
-# Validate a specific pipe (positional argument)
+# Validate a specific pipe
pipelex validate analyze_cv_matching
pipelex validate write_weekly_report
-# Validate a specific pipe (explicit option)
-pipelex validate --pipe analyze_cv_matching
+# Validate all pipes
+pipelex validate --all
+
+# Explicit subcommand form also works
+pipelex validate pipe --all
# Validate with custom library directories
pipelex validate my_pipe -L ./pipelines
+pipelex validate --all -L ./pipelines -L ./shared_pipes
```
## Validate Bundle
```bash
-pipelex validate BUNDLE_FILE.mthds
-pipelex validate --bundle BUNDLE_FILE.mthds
+pipelex validate bundle <PATH>
```
-Validates all pipes defined in a bundle file. The command automatically detects `.mthds` files as bundles.
+Validates all pipes defined in a bundle file (`.mthds`) or a pipeline directory. When a directory is given, the bundle file is auto-detected inside it.
**Arguments:**
-- `BUNDLE_FILE.mthds` - Path to the bundle file (auto-detected by `.mthds` extension)
+- `PATH` - Path to a `.mthds` bundle file or a directory containing one
**Options:**
-- `--bundle BUNDLE_FILE.mthds` - Explicitly specify the bundle file path
- `--library-dir`, `-L` - Directory to search for additional pipe definitions. Can be specified multiple times.
**Examples:**
```bash
-# Validate a bundle (auto-detected)
-pipelex validate my_pipeline.mthds
-pipelex validate pipelines/invoice_processor.mthds
+# Validate a bundle file
+pipelex validate bundle my_pipeline.mthds
+pipelex validate bundle pipelines/invoice_processor.mthds
-# Validate a bundle (explicit option)
-pipelex validate --bundle my_pipeline.mthds
+# Validate a pipeline directory (auto-detects the bundle file)
+pipelex validate bundle pipelines/invoice_processor/
-# Validate a bundle with additional library directories
-pipelex validate my_bundle.mthds -L ./shared_pipes
+# Validate with additional library directories
+pipelex validate bundle my_bundle.mthds -L ./shared_pipes
```
!!! note
When validating a bundle, ALL pipes in that bundle are validated, not just the main pipe.
-## Validate Specific Pipe in Bundle
+## Validate Method
```bash
-pipelex validate --bundle BUNDLE_FILE.mthds --pipe PIPE_CODE
+pipelex validate method <NAME>
```
-Validates all pipes in a bundle, while ensuring a specific pipe exists in that bundle. The entire bundle is validated, not just the specified pipe.
+Validates all pipes in an installed method package.
+
+**Arguments:**
+
+- `NAME` - The name of the installed method to validate
**Options:**
-- `--bundle BUNDLE_FILE.mthds` - Path to the bundle file
-- `--pipe PIPE_CODE` - Pipe code that must exist in the bundle
+- `--pipe PIPE_CODE` - Validate only a specific pipe within the method
+- `--library-dir`, `-L` - Directory to search for additional pipe definitions. Can be specified multiple times.
**Examples:**
```bash
-# Validate bundle and ensure specific pipe exists in it
-pipelex validate --bundle my_pipeline.mthds --pipe extract_invoice
-pipelex validate --bundle invoice_processor.mthds --pipe validate_amounts
-```
+# Validate an installed method
+pipelex validate method invoice_extractor
-!!! important "Bundle Validation Behavior"
- The specified pipe must be defined in the bundle. This is useful when you want to validate a bundle and confirm a specific pipe is present and valid within it. However, the entire bundle will be validated regardless.
+# Validate a specific pipe within a method
+pipelex validate method invoice_extractor --pipe extract_amounts
+```
## What Validation Checks
@@ -134,4 +122,3 @@ All validation commands check:
## Related Configuration
- [Dry Run Configuration](../../7-configuration/config-pipeline-validation/dry-run-config.md)
-
diff --git a/mkdocs.yml b/mkdocs.yml
index 68ff51638..a3e2fcc12 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -188,6 +188,7 @@ nav:
- Structures: home/9-tools/cli/build/structures.md
- Inputs: home/9-tools/cli/build/inputs.md
- Output: home/9-tools/cli/build/output.md
+ - Agent CLI: home/9-tools/cli/agent-cli.md
- Pipe Builder: home/9-tools/pipe-builder.md
- plxt (Formatter & Linter): home/9-tools/plxt.md
- Logging: home/9-tools/logging.md
diff --git a/pipelex/builder/CLAUDE.md b/pipelex/builder/CLAUDE.md
index 2e59176f1..c79070954 100644
--- a/pipelex/builder/CLAUDE.md
+++ b/pipelex/builder/CLAUDE.md
@@ -85,15 +85,6 @@ The loop applies these fixes automatically when validation fails:
After fixing, `_prune_unreachable_specs()` removes pipes unreachable from `main_pipe` and their unused concepts.
-## Integration with Agent CLI
-
-The `build` command in `pipelex/cli/agent_cli/commands/build_cmd.py` calls `build_pipe_core()` from `build_core.py`, which:
-
-1. Runs a "builder pipe" (itself a Pipelex pipeline) that generates a `PipelexBundleSpec`
-2. Passes it to `BuilderLoop.build_and_fix()`
-3. Converts the result to MTHDS via `MthdsFactory.make_mthds_content()`
-4. Saves to `pipelex-wip/` with incremental naming
-
## Talent System
Talents are abstract capability labels mapped to concrete model presets. Each talent enum (in `talents/`) maps to a `$preset` code used in MTHDS files. When modifying talents, update both the enum and its preset mapping dict.
diff --git a/pipelex/cli/agent_cli/CLAUDE.md b/pipelex/cli/agent_cli/CLAUDE.md
index 5ada4721f..b5df8a227 100644
--- a/pipelex/cli/agent_cli/CLAUDE.md
+++ b/pipelex/cli/agent_cli/CLAUDE.md
@@ -1,13 +1,13 @@
# Agent CLI (`pipelex-agent`)
-Machine-first CLI for building, running, and validating Pipelex method bundles (`.mthds` files). All output is structured JSON to stdout (success) or stderr (error). No Rich formatting, no interactive prompts.
+Machine-first CLI for running and validating Pipelex method bundles (`.mthds` files). All output is structured JSON to stdout (success) or stderr (error). No Rich formatting, no interactive prompts.
## Companion: Agent Skills
-The CLI is consumed by 7 Claude skills defined in a separate repo. Changes to the CLI often require corresponding skill updates, and vice versa.
+The CLI is consumed by 6 Claude skills defined in a separate repo. Changes to the CLI often require corresponding skill updates, and vice versa.
- Skills repo: `../agent-skills/skills/` (relative to project root)
-- Skills: `build`, `run`, `check`, `edit`, `fix`, `explain`, `synthesize-inputs`
+- Skills: `run`, `check`, `edit`, `fix`, `explain`, `synthesize-inputs`
- Each skill is a `SKILL.md` with optional `references/` dir
- Shared reference docs: `../agent-skills/skills/shared/` (`error-handling.md`, `pipelex-agent-guide.md`, `pipelex-reference.md`, `prerequisites.md`)
@@ -21,44 +21,59 @@ commands/
_agent_cli.py # PipelexAgentCLI(TyperGroup) — command registration, ordering
agent_output.py # agent_success(), agent_error(), error hints/domains
agent_cli_factory.py # make_pipelex_for_agent_cli() — init with JSON errors
- build_core.py # BuildPipeResult, BuildPipeError, build_pipe_core()
- build_cmd.py # build — generate pipeline from prompt
- run_cmd.py # run — execute pipeline
- validate_cmd.py # validate — verify pipes/bundles/libraries
+ run/ # run — execute pipeline (pipe|bundle|method subcommands)
+ app.py # run_app Typer, subcommand registration
+ pipe_cmd.py # run pipe — execute by pipe code
+ bundle_cmd.py # run bundle — execute from bundle file/directory
+ method_cmd.py # run method — execute installed method
+ _run_core.py # Shared async run logic (local runner)
+ _run_core_api.py # Shared async run logic (API runner)
+ _output_helpers.py # Output formatting helpers
+ stdin_resolver.py # Stdin input resolution
+ validate/ # validate — verify pipes/bundles/methods
+ app.py # validate_app Typer, subcommand registration
+ pipe_cmd.py # validate pipe — validate by code, or --all
+ bundle_cmd.py # validate bundle — validate bundle file/directory (+ --graph)
+ method_cmd.py # validate method — validate installed method
+ _validate_core.py # Shared validation logic
+ inputs/ # inputs — generate example input JSON
+ app.py # inputs_app Typer, subcommand registration
+ pipe_cmd.py # inputs pipe — inputs for a pipe by code
+ bundle_cmd.py # inputs bundle — inputs from bundle file/directory
+ method_cmd.py # inputs method — inputs for installed method
+ _inputs_core.py # Shared inputs logic
fmt_cmd.py # fmt — format file via plxt passthrough
lint_cmd.py # lint — lint file via plxt passthrough
plxt_passthrough.py # Shared helper for plxt subprocess delegation
- inputs_cmd.py # inputs — generate example input JSON
concept_cmd.py # concept — JSON spec → concept TOML
pipe_cmd.py # pipe — JSON spec → pipe TOML
assemble_cmd.py # assemble — combine TOML parts into .mthds
- graph_cmd.py # graph — render execution graph HTML
models_cmd.py # models — list presets, aliases, talent mappings
- doctor_cmd.py # doctor — config health check
+ init_cmd.py # init — non-interactive config setup (--global/-g, --config/-c)
+ doctor_cmd.py # doctor — config health check (--global/-g)
```
## Commands
| Command | Does |
|---------|------|
-| `build` | Runs BuilderLoop to generate a `.mthds` from a natural language prompt |
-| `run` | Executes a pipeline, returns JSON with main_stuff + working_memory. Supports directory mode (auto-detects bundle, inputs, library dir). Graph visualizations on by default (`--no-graph` to disable). |
-| `validate` | Dry-runs pipes/bundles, returns validation status per pipe |
+| `init` | Initializes Pipelex configuration (non-interactive). Defaults to project `.pipelex/` at detected project root. Use `--global`/`-g` to target `~/.pipelex/`. Accepts `--config`/`-c` with inline JSON or file path for backends, routing, telemetry, and gateway terms. |
+| `run` | Executes a pipeline (pipe\|bundle\|method subcommands), returns JSON with main_stuff + working_memory. Graph visualizations on by default (`--no-graph` to disable). |
+| `validate` | Dry-runs pipes/bundles/methods (pipe\|bundle\|method subcommands), returns validation status per pipe. Bundle subcommand supports `--graph` for graph visualization. |
| `fmt` | Formats a .mthds/.toml/.plx file in-place (delegates to plxt) |
| `lint` | Lints a .mthds/.toml/.plx file for errors (delegates to plxt) |
-| `inputs` | Generates example input JSON for a given pipe |
+| `inputs` | Generates example input JSON for a pipe/bundle/method (pipe\|bundle\|method subcommands) |
| `concept` | Converts a JSON concept spec into TOML |
| `pipe` | Converts a JSON pipe spec (typed) into TOML |
| `assemble` | Merges concept + pipe TOML sections into a complete `.mthds` file |
-| `graph` | Generates graph visualization (HTML) from a .mthds bundle via dry-run |
| `models` | Lists available model presets, aliases, waterfalls, and talent mappings |
-| `doctor` | Checks config, credentials, models health |
+| `doctor` | Checks config, credentials, models health. Use `--global`/`-g` to check `~/.pipelex/` instead of auto-detected config dir. |
## Key Patterns
- **Output contract**: Every command returns via `agent_success(dict)` or `agent_error(message, error_type, cause)`. Never print outside these. Exception: `fmt` and `lint` are raw passthrough to `plxt` — they bypass `agent_success()`/`agent_error()` intentionally so the calling tool can parse native output.
- **Error classification**: Each error type maps to a domain (`input`, `config`, `runtime`), a hint string, and a `retryable` flag. See `AGENT_ERROR_HINTS` dict in `agent_output.py`.
- **Init**: All commands that need Pipelex use `make_pipelex_for_agent_cli(library_dirs)`. It catches init errors and routes them through `agent_error()`.
-- **Async core**: Build, run, validate are async — commands use `asyncio.run()`.
+- **Async core**: Run and validate are async — commands use `asyncio.run()`.
- **File convention**: Generated outputs go to `pipelex-wip/` with incremental naming (`pipeline_01/`, `pipeline_02/`).
- **TOML handling**: Uses `tomlkit` (not `tomllib`) to preserve formatting and inline tables.
diff --git a/pipelex/cli/agent_cli/_agent_cli.py b/pipelex/cli/agent_cli/_agent_cli.py
index f022ee766..09213c23e 100644
--- a/pipelex/cli/agent_cli/_agent_cli.py
+++ b/pipelex/cli/agent_cli/_agent_cli.py
@@ -9,11 +9,10 @@ from typer.core import TyperGroup
from typing_extensions import override
from pipelex.cli.agent_cli.commands.assemble_cmd import assemble_cmd
-from pipelex.cli.agent_cli.commands.build_cmd import build_cmd
from pipelex.cli.agent_cli.commands.concept_cmd import concept_cmd
from pipelex.cli.agent_cli.commands.doctor_cmd import agent_doctor_cmd
from pipelex.cli.agent_cli.commands.fmt_cmd import fmt_cmd
-from pipelex.cli.agent_cli.commands.graph_cmd import graph_cmd
+from pipelex.cli.agent_cli.commands.init_cmd import agent_init_cmd
from pipelex.cli.agent_cli.commands.inputs.app import inputs_app
from pipelex.cli.agent_cli.commands.lint_cmd import lint_cmd
from pipelex.cli.agent_cli.commands.models_cmd import agent_models_cmd
@@ -30,7 +29,7 @@ class PipelexAgentCLI(TyperGroup):
def list_commands(self, ctx: Context) -> list[str]:
"""List commands in proper order."""
return [
- "build",
+ "init",
"run",
"validate",
"fmt",
@@ -39,7 +38,6 @@ class PipelexAgentCLI(TyperGroup):
"concept",
"pipe",
"assemble",
- "graph",
"models",
"doctor",
]
@@ -122,7 +120,7 @@ def app_callback(
)
-app.command(name="build", help="Build a pipeline from a prompt")(build_cmd)
+app.command(name="init", help="Initialize Pipelex configuration (non-interactive)")(agent_init_cmd)
app.add_typer(run_app, name="run", help="Execute a pipeline and output JSON results")
app.add_typer(validate_app, name="validate", help="Validate a pipe, bundle, or all pipes and output JSON results")
app.command(name="fmt", help="Format a .mthds, .toml, or .plx file in-place")(fmt_cmd)
@@ -131,6 +129,5 @@ app.add_typer(inputs_app, name="inputs", help="Generate example input JSON for a
app.command(name="concept", help="Structure a concept from JSON spec and output TOML")(concept_cmd)
app.command(name="pipe", help="Structure a pipe from JSON spec and output TOML")(pipe_cmd)
app.command(name="assemble", help="Assemble a complete .mthds bundle from TOML parts")(assemble_cmd)
-app.command(name="graph", help="Generate graph visualization from a .mthds bundle")(graph_cmd)
app.command(name="models", help="List available model presets, aliases, and talent mappings")(agent_models_cmd)
app.command(name="doctor", help="Check Pipelex configuration health and auto-fix issues")(agent_doctor_cmd)
diff --git a/pipelex/cli/agent_cli/commands/agent_output.py b/pipelex/cli/agent_cli/commands/agent_output.py
index 260bb7c20..535e43e13 100644
--- a/pipelex/cli/agent_cli/commands/agent_output.py
+++ b/pipelex/cli/agent_cli/commands/agent_output.py
@@ -23,7 +23,6 @@ AGENT_ERROR_HINTS: dict[str, str] = {
# Execution errors
"PipelineExecutionError": "Check 'pipe_stack' to identify which pipe failed and 'cause_type' for the root cause",
"PipeExecutionError": "A pipe input validation failed during pipeline execution. Check the error message for the failing model and field.",
- "BuildPipeError": "Check 'failure_memory_path' for builder loop failure diagnostics if present",
# File/input errors
"FileNotFoundError": "Verify the file path exists and is accessible from the current working directory",
"ArgumentError": "Check command usage with 'pipelex-agent <command> --help'",
@@ -54,6 +53,8 @@ AGENT_ERROR_HINTS: dict[str, str] = {
"BundleError": "Bundle must declare a 'main_pipe' or use the --pipe flag to specify which pipe to run",
"ValidationError": "Check that spec fields match the expected schema for the given type",
"ValueError": "Check that the provided value is valid for the parameter (e.g., --type must be a valid pipe type)",
+ # Init errors
+ "InitConfigError": "Check the --config JSON and ensure backend keys match available backends in the template",
# Unknown command
"UnknownCommandError": "Check 'valid_commands' in this error response for available commands",
}
@@ -93,10 +94,10 @@ AGENT_ERROR_DOMAINS: dict[str, str] = {
"RemoteConfigFetchError": "config",
"BinaryNotFoundError": "config",
"RemoteConfigValidationError": "config",
+ "InitConfigError": "config",
# runtime = execution failure
"PipelineExecutionError": "runtime",
"PipeExecutionError": "runtime",
- "BuildPipeError": "runtime",
}
diff --git a/pipelex/cli/agent_cli/commands/build_cmd.py b/pipelex/cli/agent_cli/commands/build_cmd.py
deleted file mode 100644
index ca9134411..000000000
--- a/pipelex/cli/agent_cli/commands/build_cmd.py
+++ /dev/null
@@ -1,106 +0,0 @@
-"""Agent CLI build command - simplified pipe building with JSON output."""
-
-import asyncio
-from typing import Annotated, Any
-
-import typer
-
-from pipelex.cli.agent_cli.commands.agent_cli_factory import make_pipelex_for_agent_cli
-from pipelex.cli.agent_cli.commands.agent_output import agent_error, agent_success, extract_validation_errors
-from pipelex.cli.agent_cli.commands.build_core import BuildPipeError, build_pipe_core
-from pipelex.core.pipes.exceptions import PipeOperatorModelChoiceError
-from pipelex.pipe_operators.exceptions import PipeOperatorModelAvailabilityError
-from pipelex.pipelex import Pipelex
-from pipelex.pipeline.validate_bundle import ValidateBundleError
-
-AGENT_OUTPUT_DIR = "pipelex-wip"
-AGENT_OUTPUT_NAME = "pipeline"
-
-# Example commands:
-#
-# pipelex-agent build "Given a theme, write a Haiku"
-# pipelex-agent build "Take a CV and a Job offer, analyze if they match"
-# pipelex-agent build "Given an expense report, apply company rules"
-# pipelex-agent build "Take a photo as input, and render the opposite of the photo"
-#
-# With a custom builder pipe:
-# pipelex-agent build "Generate image prompts from a brief" --builder-pipe custom_builder
-
-
-def build_cmd(
- ctx: typer.Context,
- prompt: Annotated[
- str,
- typer.Argument(help="Prompt describing what the pipeline should do"),
- ],
- builder_pipe: Annotated[
- str,
- typer.Option("--builder-pipe", help="Builder pipe to use for generating the pipeline"),
- ] = "pipe_builder",
-) -> None:
- """Build a pipeline from a prompt and output JSON with paths.
-
- Outputs to pipelex-wip/ directory with incremental naming (pipeline_01, pipeline_02, etc.).
- Generates MTHDS bundle only (no inputs.json or runner.py).
-
- Outputs JSON to stdout on success, JSON to stderr on error with exit code 1.
- """
- make_pipelex_for_agent_cli(log_level=ctx.obj["log_level"])
-
- async def run_build():
- return await build_pipe_core(
- prompt=prompt,
- builder_pipe=builder_pipe,
- output_dir=AGENT_OUTPUT_DIR,
- output_name=AGENT_OUTPUT_NAME,
- generate_inputs=False,
- )
-
- try:
- result = asyncio.run(run_build())
- agent_success(result.to_agent_json())
-
- except BuildPipeError as exc:
- build_extra: dict[str, Any] = {}
- if exc.failure_memory_path:
- build_extra["failure_memory_path"] = str(exc.failure_memory_path)
- if exc.__cause__:
- build_extra["cause_type"] = type(exc.__cause__).__name__
- build_extra["cause_message"] = str(exc.__cause__)
- agent_error(exc.message, "BuildPipeError", cause=exc, **build_extra)
-
- except ValidateBundleError as exc:
- validation_errors = extract_validation_errors(exc)
- validate_extra: dict[str, Any] = {"validation_errors": validation_errors}
- if exc.dry_run_error_message:
- validate_extra["dry_run_error"] = exc.dry_run_error_message
- if exc.failed_bundle_path:
- validate_extra["failed_bundle_path"] = exc.failed_bundle_path
- agent_error(exc.message, "ValidateBundleError", cause=exc, **validate_extra)
-
- except PipeOperatorModelChoiceError as exc:
- agent_error(
- exc.message,
- "PipeOperatorModelChoiceError",
- cause=exc,
- pipe_code=exc.pipe_code,
- model_type=str(exc.model_type),
- model_choice=str(exc.model_choice),
- )
-
- except PipeOperatorModelAvailabilityError as exc:
- availability_extra: dict[str, Any] = {
- "pipe_code": exc.pipe_code,
- "model_handle": exc.model_handle,
- }
- if exc.fallback_list:
- availability_extra["fallback_list"] = exc.fallback_list
- if exc.pipe_stack:
- availability_extra["pipe_stack"] = exc.pipe_stack
- agent_error(exc.message, "PipeOperatorModelAvailabilityError", cause=exc, **availability_extra)
-
- except Exception as exc:
- agent_error(f"Build failed: {exc}", type(exc).__name__, cause=exc)
-
- finally:
- Pipelex.teardown_if_needed()
diff --git a/pipelex/cli/agent_cli/commands/build_core.py b/pipelex/cli/agent_cli/commands/build_core.py
deleted file mode 100644
index 3edd1807f..000000000
--- a/pipelex/cli/agent_cli/commands/build_core.py
+++ /dev/null
@@ -1,186 +0,0 @@
-"""Core build logic for agent CLI."""
-
-from pathlib import Path
-from typing import Any
-
-from pydantic import BaseModel
-
-from pipelex import log
-from pipelex.builder.builder_errors import PipeBuilderError
-from pipelex.builder.builder_loop import BuilderLoop, maybe_generate_manifest_for_output
-from pipelex.builder.conventions import DEFAULT_INPUTS_FILE_NAME
-from pipelex.builder.exceptions import PipelexBundleSpecBlueprintError
-from pipelex.config import get_config
-from pipelex.core.interpreter.helpers import MTHDS_EXTENSION
-from pipelex.hub import get_required_pipe
-from pipelex.language.mthds_factory import MthdsFactory
-from pipelex.pipeline.exceptions import PipeExecutionError
-from pipelex.system.configuration.configs import PipelineExecutionConfig
-from pipelex.tools.misc.file_utils import (
- ensure_directory_for_file_path,
- get_incremental_directory_path,
- get_incremental_file_path,
- save_text_to_path,
-)
-from pipelex.tools.misc.json_utils import save_as_json_to_path
-
-
-class BuildPipeResult(BaseModel):
- """Result of building a pipe, containing output paths and metadata."""
-
- output_dir: Path
- mthds_file: Path
- inputs_file: Path | None = None
- main_pipe_code: str
- domain: str
- pipe_inputs: dict[str, str] | None = None
- pipe_output: str | None = None
-
- model_config = {"arbitrary_types_allowed": True}
-
- def to_agent_json(self) -> dict[str, Any]:
- """Return dict for JSON output to agent.
-
- Returns:
- Dictionary with string paths suitable for JSON serialization.
- """
- result: dict[str, Any] = {
- "output_dir": str(self.output_dir),
- "mthds_file": str(self.mthds_file),
- "main_pipe_code": self.main_pipe_code,
- "domain": self.domain,
- }
- if self.inputs_file:
- result["inputs_file"] = str(self.inputs_file)
- if self.pipe_inputs is not None:
- result["pipe_inputs"] = self.pipe_inputs
- if self.pipe_output is not None:
- result["pipe_output"] = self.pipe_output
- return result
-
-
-class BuildPipeError(Exception):
- """Error during pipe building."""
-
- def __init__(self, message: str, failure_memory_path: Path | None = None):
- super().__init__(message)
- self.message = message
- self.failure_memory_path = failure_memory_path
-
-
-async def build_pipe_core(
- prompt: str,
- builder_pipe: str = "pipe_builder",
- output_dir: str | None = None,
- output_name: str | None = None,
- generate_inputs: bool = True,
- execution_config: PipelineExecutionConfig | None = None,
-) -> BuildPipeResult:
- """Core pipe building logic for agent CLI.
-
- Args:
- prompt: The prompt describing what the pipeline should do.
- builder_pipe: The builder pipe to use for generating the pipeline.
- output_dir: Directory where files will be generated.
- output_name: Base name for the generated directory (without extension).
- generate_inputs: Whether to generate inputs.json file.
- execution_config: Configuration for pipeline execution.
-
- Returns:
- BuildPipeResult with output paths and metadata.
-
- Raises:
- BuildPipeError: If the build fails.
- """
- builder_config = get_config().pipelex.builder_config
-
- if execution_config is None:
- execution_config = get_config().pipelex.pipeline_execution_config
-
- # Build the pipeline
- builder_loop = BuilderLoop()
- try:
- pipelex_bundle_spec, _ = await builder_loop.build_and_fix(
- builder_pipe=builder_pipe,
- inputs={"brief": prompt},
- execution_config=execution_config,
- output_dir=output_dir,
- is_save_first_iteration_enabled=False,
- is_save_second_iteration_enabled=False,
- is_save_working_memory_enabled=False,
- )
- except (PipeBuilderError, PipeExecutionError) as exc:
- msg = f"Builder loop: Failed to execute pipeline: {exc}."
- failure_memory_path: Path | None = None
-
- if isinstance(exc, PipeBuilderError) and exc.working_memory:
- failure_memory_path = get_incremental_file_path(
- base_path=output_dir or builder_config.default_output_dir,
- base_name="failure_memory",
- extension="json",
- )
- save_as_json_to_path(
- object_to_save=exc.working_memory.smart_dump(),
- path=str(failure_memory_path),
- )
- log.error(f"Failure memory saved to: {failure_memory_path}")
-
- raise BuildPipeError(message=msg, failure_memory_path=failure_memory_path) from exc
-
- # Determine base output directory
- base_dir = output_dir or builder_config.default_output_dir
-
- # Determine output path - always generate directory with bundle.mthds
- dir_name = output_name or builder_config.default_directory_base_name
- bundle_file_name = Path(f"{builder_config.default_bundle_file_name}{MTHDS_EXTENSION}")
-
- extras_output_dir = get_incremental_directory_path(
- base_path=base_dir,
- base_name=dir_name,
- )
- mthds_file_path = Path(extras_output_dir) / bundle_file_name
-
- # Save the MTHDS file
- ensure_directory_for_file_path(file_path=str(mthds_file_path))
- try:
- mthds_content = MthdsFactory.make_mthds_content(blueprint=pipelex_bundle_spec.to_blueprint())
- except PipelexBundleSpecBlueprintError as exc:
- msg = f"Failed to convert bundle spec to blueprint: {exc}"
- raise BuildPipeError(message=msg) from exc
- save_text_to_path(text=mthds_content, path=str(mthds_file_path))
-
- # Generate METHODS.toml if multiple domains exist in output dir
- manifest_path = maybe_generate_manifest_for_output(output_dir=Path(extras_output_dir))
- if manifest_path:
- log.verbose(f"Package manifest generated: {manifest_path}")
-
- main_pipe_code = pipelex_bundle_spec.main_pipe or ""
- domain = pipelex_bundle_spec.domain or ""
-
- inputs_file_path: Path | None = None
- pipe_inputs: dict[str, str] | None = None
- pipe_output: str | None = None
-
- # Load pipe metadata (inputs/output) and optionally generate inputs.json
- if main_pipe_code:
- try:
- pipe = get_required_pipe(pipe_code=main_pipe_code)
- pipe_inputs = {name: stuff_spec.to_bundle_representation() for name, stuff_spec in pipe.inputs.items}
- pipe_output = pipe.output.to_bundle_representation()
-
- if generate_inputs:
- inputs_json_str = pipe.inputs.render_inputs(indent=2)
- inputs_file_path = Path(extras_output_dir) / DEFAULT_INPUTS_FILE_NAME
- save_text_to_path(text=inputs_json_str, path=str(inputs_file_path))
- except Exception as exc:
- log.warning(f"Could not load pipe metadata: {exc}")
-
- return BuildPipeResult(
- output_dir=Path(extras_output_dir),
- mthds_file=mthds_file_path,
- inputs_file=inputs_file_path,
- main_pipe_code=main_pipe_code,
- domain=domain,
- pipe_inputs=pipe_inputs,
- pipe_output=pipe_output,
- )
diff --git a/pipelex/cli/agent_cli/commands/doctor_cmd.py b/pipelex/cli/agent_cli/commands/doctor_cmd.py
index 4af93c996..2675d6635 100644
--- a/pipelex/cli/agent_cli/commands/doctor_cmd.py
+++ b/pipelex/cli/agent_cli/commands/doctor_cmd.py
@@ -1,6 +1,8 @@
"""Agent CLI doctor command -- JSON health report with no interactive prompts."""
-from typing import Any
+from typing import Annotated, Any
+
+import typer
from pipelex.cli.agent_cli.commands.agent_output import agent_error, agent_success
from pipelex.cli.commands.doctor_cmd import (
@@ -9,21 +11,36 @@ from pipelex.cli.commands.doctor_cmd import (
check_models,
check_telemetry_config,
)
+from pipelex.system.configuration.config_loader import config_manager
-def agent_doctor_cmd() -> None:
+def agent_doctor_cmd(
+ global_: Annotated[
+ bool,
+ typer.Option(
+ "--global",
+ "-g",
+ help="Force checking the global ~/.pipelex/ directory.",
+ ),
+ ] = False,
+) -> None:
"""Check Pipelex configuration health and output a JSON report.
Unlike the human CLI doctor, this command:
- Outputs structured JSON to stdout (never Rich panels or colors)
- Does not offer interactive fixes (diagnostic-only)
- Includes ``recommended_actions`` for programmatic remediation
+
+ Target directory: auto-detects project .pipelex/ if present, else ~/.pipelex/.
+ Use --global/-g to force checking the global ~/.pipelex/ directory.
"""
try:
- config_healthy, config_missing_count, config_message = check_config_files()
- telemetry_healthy, telemetry_message = check_telemetry_config()
- backends_healthy, backend_credential_reports, backends_message = check_backend_credentials()
- models_healthy, models_message, backend_file_reports = check_models()
+ config_dir = config_manager.global_config_dir if global_ else config_manager.pipelex_config_dir
+
+ config_healthy, config_missing_count, config_message = check_config_files(config_dir=config_dir)
+ telemetry_healthy, telemetry_message = check_telemetry_config(config_dir=config_dir)
+ backends_healthy, backend_credential_reports, backends_message = check_backend_credentials(config_dir=config_dir)
+ models_healthy, models_message, backend_file_reports = check_models(config_dir=config_dir)
except Exception as exc:
agent_error(f"Health check failed unexpectedly: {exc}", type(exc).__name__, cause=exc)
diff --git a/pipelex/cli/agent_cli/commands/graph_cmd.py b/pipelex/cli/agent_cli/commands/graph_cmd.py
deleted file mode 100644
index 97c8c164e..000000000
--- a/pipelex/cli/agent_cli/commands/graph_cmd.py
+++ /dev/null
@@ -1,125 +0,0 @@
-"""Agent CLI graph command - generate graph HTML from a .mthds bundle via dry-run."""
-
-import asyncio
-from pathlib import Path
-from typing import Annotated, Any
-
-import typer
-
-from pipelex.cli.agent_cli.commands.agent_cli_factory import make_pipelex_for_agent_cli
-from pipelex.cli.agent_cli.commands.agent_output import agent_error, agent_success
-from pipelex.core.interpreter.exceptions import MthdsDecodeError, PipelexInterpreterError
-from pipelex.core.interpreter.helpers import is_pipelex_file
-from pipelex.core.pipes.exceptions import PipeOperatorModelChoiceError
-from pipelex.graph.graph_rendering import GraphFormat, generate_graph_for_bundle
-from pipelex.pipe_operators.exceptions import PipeOperatorModelAvailabilityError
-from pipelex.pipelex import Pipelex
-from pipelex.pipeline.exceptions import PipelineExecutionError
-from pipelex.tools.misc.chart_utils import FlowchartDirection
-
-
-def graph_cmd(
- ctx: typer.Context,
- target: Annotated[
- str,
- typer.Argument(help="Path to a .mthds bundle file"),
- ],
- graph_format: Annotated[
- GraphFormat,
- typer.Option("--format", "-f", help="Graph format to generate: mermaidflow, reactflow, or both"),
- ] = GraphFormat.REACTFLOW,
- direction: Annotated[
- FlowchartDirection | None,
- typer.Option("--direction", help="Flowchart direction"),
- ] = None,
- library_dir: Annotated[
- list[str] | None,
- typer.Option("--library-dir", "-L", help="Directory to search for pipe definitions (.mthds files)"),
- ] = None,
-) -> None:
- """Generate graph visualization from a .mthds bundle.
-
- Performs a dry-run of the pipeline with mock inputs to produce the execution
- graph, then renders it as HTML.
-
- Outputs JSON to stdout on success, JSON to stderr on error with exit code 1.
-
- Examples:
- pipelex-agent graph bundle.mthds
- pipelex-agent graph bundle.mthds --format mermaidflow
- pipelex-agent graph bundle.mthds --direction left_to_right
- pipelex-agent graph bundle.mthds -L ./my_pipes/
- """
- input_path = Path(target)
-
- if not input_path.exists():
- agent_error(f"File not found: {target}", "FileNotFoundError")
-
- if not is_pipelex_file(input_path):
- agent_error(f"Expected a .mthds bundle file, got: {input_path.name}", "ArgumentError")
-
- # Initialize Pipelex
- make_pipelex_for_agent_cli(library_dirs=library_dir, log_level=ctx.obj["log_level"])
-
- try:
- graph_result = asyncio.run(
- generate_graph_for_bundle(
- bundle_path=input_path,
- graph_format=graph_format,
- library_dirs=library_dir,
- direction=direction,
- )
- )
-
- agent_success(
- {
- "success": True,
- "output_dir": graph_result["graph_output_dir"],
- "files": graph_result["graph_files"],
- "pipe_code": graph_result["pipe_code"],
- "direction": graph_result["direction"],
- }
- )
-
- except (PipelexInterpreterError, MthdsDecodeError) as exc:
- agent_error(f"Failed to parse bundle '{target}': {exc}", type(exc).__name__, cause=exc)
-
- except PipelineExecutionError as exc:
- extra_fields: dict[str, Any] = {
- "pipe_code": exc.pipe_code,
- "pipe_stack": exc.pipe_stack,
- }
- if exc.__cause__:
- extra_fields["cause_type"] = type(exc.__cause__).__name__
- extra_fields["cause_message"] = str(exc.__cause__)
- agent_error(exc.message, "PipelineExecutionError", cause=exc, **extra_fields)
-
- except PipeOperatorModelChoiceError as exc:
- agent_error(
- exc.message,
- "PipeOperatorModelChoiceError",
- cause=exc,
- pipe_code=exc.pipe_code,
- model_type=str(exc.model_type),
- model_choice=str(exc.model_choice),
- )
-
- except PipeOperatorModelAvailabilityError as exc:
- availability_extra: dict[str, Any] = {
- "pipe_code": exc.pipe_code,
- "model_handle": exc.model_handle,
- }
- if exc.fallback_list:
- availability_extra["fallback_list"] = exc.fallback_list
- if exc.pipe_stack:
- availability_extra["pipe_stack"] = exc.pipe_stack
- agent_error(exc.message, "PipeOperatorModelAvailabilityError", cause=exc, **availability_extra)
-
- except typer.Exit:
- raise
-
- except Exception as exc:
- agent_error(f"Failed to generate graph: {exc}", type(exc).__name__, cause=exc)
-
- finally:
- Pipelex.teardown_if_needed()
diff --git a/pipelex/cli/agent_cli/commands/init_cmd.py b/pipelex/cli/agent_cli/commands/init_cmd.py
new file mode 100644
index 000000000..07a2a897c
--- /dev/null
+++ b/pipelex/cli/agent_cli/commands/init_cmd.py
@@ -0,0 +1,347 @@
+"""Agent CLI init command -- non-interactive Pipelex initialization."""
+
+import json
+import os
+import shutil
+from typing import Annotated, Any, cast
+
+import typer
+from tomlkit import table
+
+from pipelex.cli.agent_cli.commands.agent_output import agent_error, agent_success
+from pipelex.cli.commands.init.backends import get_selected_backend_keys, update_backends_in_toml
+from pipelex.cli.commands.init.config_files import init_config
+from pipelex.cli.commands.init.ui.backends_ui import get_backend_options_from_toml
+from pipelex.cogt.model_backends.backend import PipelexBackend
+from pipelex.cogt.model_routing.routing_profile import PipelexRoutingProfile
+from pipelex.kit.paths import get_kit_configs_dir
+from pipelex.system.configuration.config_loader import config_manager
+from pipelex.system.pipelex_service.pipelex_service_agreement import update_service_terms_acceptance
+from pipelex.system.telemetry.telemetry_config import TELEMETRY_CONFIG_FILE_NAME, PostHogMode
+from pipelex.tools.misc.file_utils import path_exists
+from pipelex.tools.misc.toml_utils import load_toml_with_tomlkit, save_toml_to_path
+
+
+def _parse_config_arg(config_arg: str | None) -> dict[str, Any]:
+ """Parse the --config argument as inline JSON or file path.
+
+ Args:
+ config_arg: Inline JSON string or path to a JSON file, or None.
+
+ Returns:
+ Parsed config dict. Empty dict if config_arg is None.
+ """
+ if config_arg is None:
+ return {}
+
+ if config_arg.startswith("{"):
+ try:
+ result: dict[str, Any] = json.loads(config_arg)
+ return result
+ except json.JSONDecodeError as exc:
+ agent_error(f"Failed to parse inline JSON config: {exc}", "JSONDecodeError", cause=exc)
+ else:
+ try:
+ with open(config_arg, encoding="utf-8") as file:
+ loaded: Any = json.load(file)
+ if not isinstance(loaded, dict):
+ agent_error(f"Config file must contain a JSON object, got {type(loaded).__name__}", "JSONDecodeError")
+ return cast("dict[str, Any]", loaded)
+ except FileNotFoundError as exc:
+ agent_error(f"Config file not found: {config_arg}", "FileNotFoundError", cause=exc)
+ except json.JSONDecodeError as exc:
+ agent_error(f"Failed to parse config file JSON: {exc}", "JSONDecodeError", cause=exc)
+
+ return {}
+
+
+def _resolve_target_dir(global_: bool) -> str:
+ """Resolve the target directory for initialization.
+
+ Args:
+ global_: If True, force global ~/.pipelex/ directory.
+
+ Returns:
+ Absolute path to the target config directory.
+ """
+ if global_:
+ return config_manager.global_config_dir
+ # Default: project-level .pipelex/ at detected project root
+ project_root = config_manager.project_root
+ if project_root is None:
+ agent_error(
+ "No project root found (no .git, pyproject.toml, etc. in parent directories). "
+ "Use --global/-g to target the global ~/.pipelex/ directory.",
+ "ArgumentError",
+ )
+ return os.path.join(project_root, ".pipelex")
+
+
+def _configure_backends(
+ config: dict[str, Any],
+ backends_toml_path: str,
+ template_backends_path: str,
+ target_dir: str,
+) -> list[str]:
+ """Configure backends in backends.toml based on config input.
+
+ Args:
+ config: Parsed config dict with optional 'backends' key.
+ backends_toml_path: Path to the user's backends.toml.
+ template_backends_path: Path to the template backends.toml.
+ target_dir: Target config directory for writing service agreement.
+
+ Returns:
+ List of enabled backend keys.
+ """
+ if not path_exists(backends_toml_path):
+ agent_error("backends.toml not found after config initialization", "InitConfigError")
+
+ requested_backends: list[str] | None = config.get("backends")
+
+ if requested_backends is None:
+ # Keep template defaults — return what's currently enabled
+ return get_selected_backend_keys(backends_toml_path)
+
+ # Validate requested backend keys
+ backend_options = get_backend_options_from_toml(template_backends_path, backends_toml_path)
+ available_keys = [key for key, _ in backend_options]
+
+ for backend_key in requested_backends:
+ if backend_key not in available_keys:
+ agent_error(
+ f"Unknown backend: {backend_key}. Available: {', '.join(available_keys)}",
+ "ArgumentError",
+ )
+
+ # Build selected indices from requested backend keys
+ key_to_index = {key: idx for idx, (key, _) in enumerate(backend_options)}
+ selected_indices = [key_to_index[key] for key in requested_backends]
+
+ # Update backends.toml
+ toml_doc = load_toml_with_tomlkit(backends_toml_path)
+ update_backends_in_toml(toml_doc, selected_indices, backend_options)
+ save_toml_to_path(toml_doc, backends_toml_path)
+
+ # Handle pipelex_gateway terms acceptance
+ if PipelexBackend.GATEWAY in requested_backends:
+ accept_terms: bool = config.get("accept_gateway_terms", False)
+ update_service_terms_acceptance(accepted=accept_terms, config_dir=target_dir)
+
+ return requested_backends
+
+
+def _configure_routing(selected_backend_keys: list[str], config: dict[str, Any], target_dir: str) -> str:
+ """Configure routing profile based on selected backends and config.
+
+ Args:
+ selected_backend_keys: List of enabled backend keys.
+ config: Parsed config dict with optional 'primary_backend' key.
+ target_dir: Target config directory.
+
+ Returns:
+ Name of the active routing profile.
+ """
+ routing_profiles_toml_path = os.path.join(target_dir, "inference", "routing_profiles.toml")
+
+ if not path_exists(routing_profiles_toml_path):
+ agent_error("routing_profiles.toml not found after config initialization", "InitConfigError")
+
+ toml_doc = load_toml_with_tomlkit(routing_profiles_toml_path)
+
+ # Case 1: pipelex_gateway is enabled → use all_pipelex_gateway
+ if PipelexBackend.GATEWAY in selected_backend_keys:
+ toml_doc["active"] = PipelexRoutingProfile.ALL_PIPELEX_GATEWAY
+ save_toml_to_path(toml_doc, routing_profiles_toml_path)
+ return PipelexRoutingProfile.ALL_PIPELEX_GATEWAY
+
+ # Case 2: Only one backend → use all_{backend_key}
+ if len(selected_backend_keys) == 1:
+ backend_key = selected_backend_keys[0]
+ profile_name = f"all_{backend_key}"
+
+ # Create profile if it doesn't exist
+ profiles: dict[str, Any] = toml_doc.get("profiles") or {} # type: ignore[assignment]
+ if profile_name not in profiles:
+ if "profiles" not in toml_doc:
+ toml_doc["profiles"] = {}
+ profile_data = {
+ "description": f"Use {backend_key} backend for all its supported models",
+ "default": backend_key,
+ }
+ toml_doc["profiles"][profile_name] = profile_data # type: ignore[index]
+
+ toml_doc["active"] = profile_name
+ save_toml_to_path(toml_doc, routing_profiles_toml_path)
+ return profile_name
+
+ # Case 3: Multiple backends (no pipelex_gateway) → need primary_backend
+ primary_backend: str | None = config.get("primary_backend")
+
+ if primary_backend is None:
+ agent_error(
+ f"primary_backend is required when multiple backends are selected ({', '.join(selected_backend_keys)}) "
+ "and pipelex_gateway is not among them",
+ "ArgumentError",
+ )
+
+ if primary_backend not in selected_backend_keys:
+ agent_error(
+ f"primary_backend '{primary_backend}' is not in the selected backends: {', '.join(selected_backend_keys)}",
+ "ArgumentError",
+ )
+
+ # Build custom_routing profile
+ remaining_backends = [backend for backend in selected_backend_keys if backend != primary_backend]
+ fallback_order = [primary_backend, *remaining_backends]
+
+ if "profiles" not in toml_doc:
+ toml_doc["profiles"] = {}
+
+ new_profiles = table()
+
+ custom_routing_profile = table()
+ custom_routing_profile["description"] = "Custom routing"
+ custom_routing_profile["default"] = primary_backend
+ custom_routing_profile["fallback_order"] = fallback_order
+ custom_routing_profile["routes"] = table()
+ new_profiles["custom_routing"] = custom_routing_profile
+
+ # Preserve existing profiles after custom_routing
+ existing_profiles: dict[str, Any] = toml_doc.get("profiles") or {} # type: ignore[assignment]
+ for profile_key, profile_value in existing_profiles.items(): # type: ignore[union-attr]
+ if profile_key != "custom_routing":
+ new_profiles[profile_key] = profile_value
+
+ toml_doc["profiles"] = new_profiles # type: ignore[assignment]
+ toml_doc["active"] = "custom_routing"
+
+ save_toml_to_path(toml_doc, routing_profiles_toml_path)
+ return "custom_routing"
+
+
+def _configure_telemetry(target_dir: str, config: dict[str, Any]) -> str:
+ """Copy telemetry template to target directory and apply telemetry_mode if specified.
+
+ Args:
+ target_dir: Target config directory.
+ config: Parsed config dict with optional 'telemetry_mode' key.
+
+ Returns:
+ The telemetry mode that was set.
+ """
+ telemetry_config_path = os.path.join(target_dir, TELEMETRY_CONFIG_FILE_NAME)
+ template_path = os.path.join(str(get_kit_configs_dir()), TELEMETRY_CONFIG_FILE_NAME)
+
+ if not path_exists(str(template_path)):
+ agent_error("Telemetry template not found in kit configs", "InitConfigError")
+
+ os.makedirs(os.path.dirname(telemetry_config_path), exist_ok=True)
+ shutil.copy(template_path, telemetry_config_path)
+
+ # Apply telemetry_mode if specified
+ requested_mode: str | None = config.get("telemetry_mode")
+
+ if requested_mode is not None:
+ valid_modes = [mode.value for mode in PostHogMode]
+ if requested_mode not in valid_modes:
+ agent_error(
+ f"Invalid telemetry_mode: '{requested_mode}'. Valid values: {', '.join(valid_modes)}",
+ "ArgumentError",
+ )
+
+ toml_doc = load_toml_with_tomlkit(telemetry_config_path)
+ toml_doc["custom_posthog"]["mode"] = requested_mode # type: ignore[index]
+ save_toml_to_path(toml_doc, telemetry_config_path)
+ return requested_mode
+
+ return PostHogMode.OFF.value
+
+
+def agent_init_cmd(
+ config: Annotated[
+ str | None,
+ typer.Option(
+ "--config",
+ "-c",
+ help=(
+ "Inline JSON string or path to a JSON file. "
+ 'Schema: {"backends": list[str], "primary_backend": str, "accept_gateway_terms": bool, "telemetry_mode": str}. '
+ "All fields are optional. "
+ "backends: backend keys to enable (e.g. 'openai', 'anthropic', 'pipelex_gateway'). Omit to keep template defaults. "
+ "primary_backend: required only when 2+ backends are selected and pipelex_gateway is not among them. "
+ "accept_gateway_terms: true/false, required when pipelex_gateway is in backends. "
+ "telemetry_mode: 'off' (default), 'anonymous', or 'identified'."
+ ),
+ ),
+ ] = None,
+ global_: Annotated[
+ bool,
+ typer.Option(
+ "--global",
+ "-g",
+ help="Force global ~/.pipelex/ directory.",
+ ),
+ ] = False,
+) -> None:
+ """Initialize Pipelex configuration (non-interactive).
+
+ Sets up config files, inference backends, routing profile, and telemetry.
+ Credentials are NOT configured — use 'pipelex-agent doctor' to check credential
+ health, and 'pipelex init credentials' if needed.
+
+ Target directory: project .pipelex/ at detected project root by default.
+ Use --global/-g to force global ~/.pipelex/.
+
+ Config JSON schema::
+
+ {
+ "backends": ["pipelex_gateway", "openai"],
+ "accept_gateway_terms": true,
+ "primary_backend": "openai",
+ "telemetry_mode": "off"
+ }
+
+ - backends: list of backend keys to enable. Omit to keep all template defaults.
+ - accept_gateway_terms: sets gateway terms acceptance (true/false).
+ - primary_backend: required when 2+ backends are selected and pipelex_gateway
+ is not among them. Auto-derived when only 1 backend or pipelex_gateway is present.
+ - telemetry_mode: "off", "anonymous", or "identified". Defaults to "off".
+ """
+ try:
+ # Parse config
+ parsed_config = _parse_config_arg(config)
+
+ # Resolve target directory
+ target_dir = _resolve_target_dir(global_)
+
+ # Step 1: Copy config files
+ config_files_copied = init_config(reset=True, target_dir=target_dir)
+
+ # Step 2: Configure backends
+ template_backends_path = os.path.join(str(get_kit_configs_dir()), "inference", "backends.toml")
+ backends_toml_path = os.path.join(target_dir, "inference", "backends.toml")
+ backends_enabled = _configure_backends(parsed_config, backends_toml_path, template_backends_path, target_dir)
+
+ # Step 3: Configure routing
+ routing_profile = _configure_routing(backends_enabled, parsed_config, target_dir)
+
+ # Step 4: Configure telemetry
+ telemetry_mode = _configure_telemetry(target_dir, parsed_config)
+
+ # Output result
+ agent_success(
+ {
+ "success": True,
+ "target_dir": target_dir,
+ "config_files_copied": config_files_copied,
+ "backends_enabled": backends_enabled,
+ "routing_profile": routing_profile,
+ "telemetry_mode": telemetry_mode,
+ }
+ )
+
+ except typer.Exit:
+ raise
+ except Exception as exc:
+ agent_error(f"Initialization failed: {exc}", type(exc).__name__, cause=exc)
diff --git a/pipelex/cli/agent_cli/commands/inputs/app.py b/pipelex/cli/agent_cli/commands/inputs/app.py
index 1d15c4df3..7e1928468 100644
--- a/pipelex/cli/agent_cli/commands/inputs/app.py
+++ b/pipelex/cli/agent_cli/commands/inputs/app.py
@@ -4,6 +4,7 @@ from __future__ import annotations
import typer
+from pipelex.cli.agent_cli.commands.inputs.bundle_cmd import inputs_bundle_cmd
from pipelex.cli.agent_cli.commands.inputs.method_cmd import inputs_method_cmd
from pipelex.cli.agent_cli.commands.inputs.pipe_cmd import inputs_pipe_cmd
@@ -13,4 +14,5 @@ inputs_app = typer.Typer(
)
inputs_app.command(name="method", help="Generate example inputs for an installed method")(inputs_method_cmd)
-inputs_app.command(name="pipe", help="Generate example inputs for a pipe or bundle")(inputs_pipe_cmd)
+inputs_app.command(name="pipe", help="Generate example inputs for a pipe by code")(inputs_pipe_cmd)
+inputs_app.command(name="bundle", help="Generate example inputs from a bundle file (.mthds) or directory")(inputs_bundle_cmd)
diff --git a/pipelex/cli/agent_cli/commands/inputs/bundle_cmd.py b/pipelex/cli/agent_cli/commands/inputs/bundle_cmd.py
new file mode 100644
index 000000000..dd0f1c223
--- /dev/null
+++ b/pipelex/cli/agent_cli/commands/inputs/bundle_cmd.py
@@ -0,0 +1,141 @@
+"""Agent CLI inputs bundle command - generate example inputs from a bundle file or directory."""
+
+from __future__ import annotations
+
+import asyncio
+from pathlib import Path
+from typing import Annotated, Any
+
+import typer
+
+from pipelex.builder.conventions import DEFAULT_BUNDLE_FILE_NAME
+from pipelex.cli.agent_cli.commands.agent_cli_factory import make_pipelex_for_agent_cli
+from pipelex.cli.agent_cli.commands.agent_output import agent_error, agent_success, extract_validation_errors
+from pipelex.cli.agent_cli.commands.inputs._inputs_core import inputs_core
+from pipelex.core.interpreter.helpers import MTHDS_EXTENSION, is_pipelex_file
+from pipelex.core.pipes.exceptions import PipeOperatorModelChoiceError
+from pipelex.core.pipes.inputs.exceptions import NoInputsRequiredError
+from pipelex.pipe_operators.exceptions import PipeOperatorModelAvailabilityError
+from pipelex.pipelex import Pipelex
+from pipelex.pipeline.validate_bundle import ValidateBundleError
+
+
+def inputs_bundle_cmd(
+ ctx: typer.Context,
+ path: Annotated[
+ str,
+ typer.Argument(help="Path to a .mthds bundle file or a pipeline directory"),
+ ],
+ pipe: Annotated[
+ str | None,
+ typer.Option("--pipe", help="Pipe code to get inputs for (overrides bundle's main_pipe)"),
+ ] = None,
+ library_dir: Annotated[
+ list[str] | None,
+ typer.Option("--library-dir", "-L", help="Directory to search for pipe definitions (.mthds files)"),
+ ] = None,
+) -> None:
+ """Generate example input JSON from a bundle file (.mthds) or pipeline directory.
+
+ Outputs JSON to stdout on success, JSON to stderr on error with exit code 1.
+
+ Examples:
+ pipelex-agent inputs bundle my_bundle.mthds
+ pipelex-agent inputs bundle my_bundle.mthds --pipe my_pipe
+ pipelex-agent inputs bundle pipeline_01/
+ pipelex-agent inputs bundle pipeline_01/ --pipe my_pipe
+ """
+ bundle_path: str | None = None
+ target_path = Path(path)
+
+ if target_path.is_dir():
+ # Directory mode: auto-detect bundle file
+ bundle_file = target_path / DEFAULT_BUNDLE_FILE_NAME
+ if bundle_file.is_file():
+ bundle_path = str(bundle_file)
+ else:
+ mthds_files = list(target_path.glob(f"*{MTHDS_EXTENSION}"))
+ if len(mthds_files) == 0:
+ agent_error(f"No .mthds bundle file found in directory '{path}'", "FileNotFoundError")
+ if len(mthds_files) > 1:
+ mthds_names = ", ".join(mthds_file.name for mthds_file in mthds_files)
+ agent_error(
+ f"Multiple .mthds files found in '{path}' ({mthds_names}) and no '{DEFAULT_BUNDLE_FILE_NAME}'. "
+ f"Pass the .mthds file directly instead.",
+ "ArgumentError",
+ )
+ bundle_path = str(mthds_files[0])
+
+ # Add directory as library dir
+ target_dir_str = str(target_path)
+ if library_dir is None:
+ library_dir = [target_dir_str]
+ elif target_dir_str not in library_dir:
+ library_dir = [target_dir_str, *library_dir]
+
+ elif is_pipelex_file(target_path):
+ bundle_path = path
+ else:
+ agent_error(
+ f"'{path}' is not a .mthds file or directory. "
+ f"Use 'inputs pipe <code>' for pipe codes, or 'inputs bundle <path>' for .mthds files/directories.",
+ "ArgumentError",
+ )
+
+ pipe_code: str | None = pipe
+ library_dirs = [Path(lib_dir) for lib_dir in library_dir] if library_dir else None
+ make_pipelex_for_agent_cli(library_dirs=library_dirs, log_level=ctx.obj["log_level"])
+
+ try:
+ result = asyncio.run(inputs_core(pipe_code=pipe_code, bundle_path=Path(bundle_path), library_dirs=library_dirs)) # type: ignore[arg-type]
+ agent_success(result)
+
+ except FileNotFoundError as exc:
+ agent_error(f"Bundle file not found: {bundle_path}", "FileNotFoundError", cause=exc)
+
+ except ValidateBundleError as exc:
+ validation_errors = extract_validation_errors(exc)
+ extra: dict[str, Any] = {"validation_errors": validation_errors}
+ if exc.dry_run_error_message:
+ extra["dry_run_error"] = exc.dry_run_error_message
+ agent_error(exc.message, "ValidateBundleError", cause=exc, **extra)
+
+ except NoInputsRequiredError as exc:
+ agent_success(
+ {
+ "success": True,
+ "pipe_code": pipe_code,
+ "inputs": {},
+ "message": str(exc),
+ }
+ )
+
+ except PipeOperatorModelChoiceError as exc:
+ agent_error(
+ exc.message,
+ "PipeOperatorModelChoiceError",
+ cause=exc,
+ pipe_code=exc.pipe_code,
+ model_type=str(exc.model_type),
+ model_choice=str(exc.model_choice),
+ )
+
+ except PipeOperatorModelAvailabilityError as exc:
+ availability_extra: dict[str, Any] = {
+ "pipe_code": exc.pipe_code,
+ "model_handle": exc.model_handle,
+ }
+ if exc.fallback_list:
+ availability_extra["fallback_list"] = exc.fallback_list
+ if exc.pipe_stack:
+ availability_extra["pipe_stack"] = exc.pipe_stack
+ agent_error(exc.message, "PipeOperatorModelAvailabilityError", cause=exc, **availability_extra)
+
+ except typer.Exit:
+ raise
+
+ except Exception as exc:
+ agent_error(str(exc), type(exc).__name__, cause=exc)
+
+ finally:
+ Pipelex.teardown_if_needed()
diff --git a/pipelex/cli/agent_cli/commands/inputs/pipe_cmd.py b/pipelex/cli/agent_cli/commands/inputs/pipe_cmd.py
index 37dbd0667..9600bb687 100644
--- a/pipelex/cli/agent_cli/commands/inputs/pipe_cmd.py
+++ b/pipelex/cli/agent_cli/commands/inputs/pipe_cmd.py
@@ -1,4 +1,4 @@
-"""Agent CLI inputs pipe command - generate example inputs by pipe code or bundle path."""
+"""Agent CLI inputs pipe command - generate example inputs by pipe code."""
from __future__ import annotations
@@ -11,7 +11,8 @@ import typer
from pipelex.cli.agent_cli.commands.agent_cli_factory import make_pipelex_for_agent_cli
from pipelex.cli.agent_cli.commands.agent_output import agent_error, agent_success, extract_validation_errors
from pipelex.cli.agent_cli.commands.inputs._inputs_core import inputs_core
-from pipelex.core.interpreter.helpers import is_pipelex_file
+from pipelex.cli.method_resolver import resolve_pipe_from_exports
+from pipelex.core.interpreter.helpers import MTHDS_EXTENSION, is_pipelex_file
from pipelex.core.pipes.exceptions import PipeOperatorModelChoiceError
from pipelex.core.pipes.inputs.exceptions import NoInputsRequiredError
from pipelex.pipe_operators.exceptions import PipeOperatorModelAvailabilityError
@@ -21,67 +22,56 @@ from pipelex.pipeline.validate_bundle import ValidateBundleError
def inputs_pipe_cmd(
ctx: typer.Context,
- target: Annotated[
- str | None,
- typer.Argument(help="Pipe code or bundle file path (auto-detected)"),
- ] = None,
- pipe: Annotated[
- str | None,
- typer.Option("--pipe", help="Pipe code to get inputs for"),
- ] = None,
+ pipe_code: Annotated[
+ str,
+ typer.Argument(help="Pipe code to get inputs for"),
+ ],
library_dir: Annotated[
list[str] | None,
typer.Option("--library-dir", "-L", help="Directory to search for pipe definitions (.mthds files)"),
] = None,
) -> None:
- """Generate example input JSON for a pipe and output JSON results.
+ """Generate example input JSON for a pipe by code and output JSON results.
Outputs JSON to stdout on success, JSON to stderr on error with exit code 1.
Examples:
pipelex-agent inputs pipe my_pipe
- pipelex-agent inputs pipe my_bundle.mthds
- pipelex-agent inputs pipe my_bundle.mthds --pipe my_pipe
pipelex-agent inputs pipe my_pipe -L ./my_pipes
"""
- # Validate that at least one target is provided
- if target is None and pipe is None:
- agent_error("No pipe code or bundle file specified", "ArgumentError")
-
- # Determine pipe_code and bundle_path from arguments
- pipe_code: str | None = None
- bundle_path: Path | None = None
-
- if target:
- target_path = Path(target)
- if target_path.is_dir():
- agent_error(
- f"'{target}' is a directory. The inputs command requires a .mthds file or a pipe code.",
- "ArgumentError",
- )
-
- if is_pipelex_file(target_path):
- bundle_path = target_path
- else:
- pipe_code = target
- if pipe:
- agent_error("Cannot use --pipe if already passing a pipe code as positional argument", "ArgumentError")
-
- if pipe:
- pipe_code = pipe
+ # Helpful error if the user passes a path instead of a pipe code
+ target_path = Path(pipe_code)
+ if target_path.is_dir() or is_pipelex_file(target_path) or pipe_code.endswith(MTHDS_EXTENSION):
+ agent_error(
+ f"'{pipe_code}' looks like a file path or directory. "
+ f"Use 'inputs bundle {pipe_code}' for bundles/directories, or 'inputs pipe <code>' for pipe codes.",
+ "ArgumentError",
+ )
- if not pipe_code and not bundle_path:
- agent_error("No pipe code or bundle file specified", "ArgumentError")
+ # Check installed methods' exports for additional library dirs
+ try:
+ export_dirs = resolve_pipe_from_exports(pipe_code)
+ except ValueError as exc:
+ agent_error(
+ f"Ambiguous pipe code '{pipe_code}': {exc}",
+ "ArgumentError",
+ cause=exc,
+ )
+ if export_dirs:
+ if library_dir is None:
+ library_dir = export_dirs
+ else:
+ library_dir = [*export_dirs, *library_dir]
library_dirs = [Path(lib_dir) for lib_dir in library_dir] if library_dir else None
make_pipelex_for_agent_cli(library_dirs=library_dirs, log_level=ctx.obj["log_level"])
try:
- result = asyncio.run(inputs_core(pipe_code=pipe_code, bundle_path=bundle_path, library_dirs=library_dirs))
+ result = asyncio.run(inputs_core(pipe_code=pipe_code, bundle_path=None, library_dirs=library_dirs))
agent_success(result)
except FileNotFoundError as exc:
- agent_error(f"Bundle file not found: {bundle_path}", "FileNotFoundError", cause=exc)
+ agent_error(f"File not found: {exc}", "FileNotFoundError", cause=exc)
except ValidateBundleError as exc:
validation_errors = extract_validation_errors(exc)
@@ -122,6 +112,9 @@ def inputs_pipe_cmd(
availability_extra["pipe_stack"] = exc.pipe_stack
agent_error(exc.message, "PipeOperatorModelAvailabilityError", cause=exc, **availability_extra)
+ except typer.Exit:
+ raise
+
except Exception as exc:
agent_error(str(exc), type(exc).__name__, cause=exc)
diff --git a/pipelex/cli/agent_cli/commands/run/app.py b/pipelex/cli/agent_cli/commands/run/app.py
index 219c36536..64b2ecc02 100644
--- a/pipelex/cli/agent_cli/commands/run/app.py
+++ b/pipelex/cli/agent_cli/commands/run/app.py
@@ -4,6 +4,7 @@ from __future__ import annotations
import typer
+from pipelex.cli.agent_cli.commands.run.bundle_cmd import run_bundle_cmd
from pipelex.cli.agent_cli.commands.run.method_cmd import run_method_cmd
from pipelex.cli.agent_cli.commands.run.pipe_cmd import run_pipe_cmd
@@ -13,4 +14,5 @@ run_app = typer.Typer(
)
run_app.command(name="method", help="Execute a pipeline for an installed method")(run_method_cmd)
-run_app.command(name="pipe", help="Execute a pipeline by pipe code or bundle path")(run_pipe_cmd)
+run_app.command(name="pipe", help="Execute a pipeline by pipe code")(run_pipe_cmd)
+run_app.command(name="bundle", help="Execute a pipeline from a bundle file or directory")(run_bundle_cmd)
diff --git a/pipelex/cli/agent_cli/commands/run/bundle_cmd.py b/pipelex/cli/agent_cli/commands/run/bundle_cmd.py
new file mode 100644
index 000000000..e58dd08b1
--- /dev/null
+++ b/pipelex/cli/agent_cli/commands/run/bundle_cmd.py
@@ -0,0 +1,229 @@
+"""Agent CLI run bundle command - execute a pipeline from a bundle file or directory."""
+
+from __future__ import annotations
+
+import asyncio
+from pathlib import Path
+from typing import Annotated, Any
+
+import typer
+from mthds.runners.types import RunnerType
+
+from pipelex.builder.conventions import DEFAULT_BUNDLE_FILE_NAME, DEFAULT_INPUTS_FILE_NAME
+from pipelex.cli.agent_cli.commands.agent_cli_factory import make_pipelex_for_agent_cli
+from pipelex.cli.agent_cli.commands.agent_output import agent_error, agent_success
+from pipelex.cli.agent_cli.commands.run._run_core import run_pipeline_core
+from pipelex.cli.agent_cli.commands.run._run_core_api import run_pipeline_core_api
+from pipelex.cli.agent_cli.commands.run.stdin_resolver import parse_cli_inputs
+from pipelex.core.interpreter.exceptions import MthdsDecodeError, PipelexInterpreterError
+from pipelex.core.interpreter.helpers import MTHDS_EXTENSION, is_pipelex_file
+from pipelex.core.interpreter.interpreter import PipelexInterpreter
+from pipelex.core.pipes.exceptions import PipeOperatorModelChoiceError
+from pipelex.pipe_operators.exceptions import PipeOperatorModelAvailabilityError
+from pipelex.pipelex import Pipelex
+from pipelex.pipeline.exceptions import PipelineExecutionError
+
+
+def run_bundle_cmd(
+ ctx: typer.Context,
+ path: Annotated[
+ str,
+ typer.Argument(help="Path to a .mthds bundle file or a pipeline directory"),
+ ],
+ pipe: Annotated[
+ str | None,
+ typer.Option("--pipe", help="Pipe code to run (overrides bundle's main_pipe)"),
+ ] = None,
+ inputs: Annotated[
+ str | None,
+ typer.Option("--inputs", "-i", help="Path to JSON file with inputs or inline JSON"),
+ ] = None,
+ dry_run: Annotated[
+ bool,
+ typer.Option("--dry-run", help="Run pipeline in dry mode (no actual inference calls)"),
+ ] = False,
+ mock_inputs: Annotated[
+ bool,
+ typer.Option("--mock-inputs", help="Generate mock data for missing required inputs (requires --dry-run)"),
+ ] = False,
+ graph: Annotated[
+ bool,
+ typer.Option("--graph/--no-graph", help="Generate execution graph visualizations (saved alongside output)"),
+ ] = True,
+ library_dir: Annotated[
+ list[str] | None,
+ typer.Option("--library-dir", "-L", help="Directory to search for pipe definitions (.mthds files)"),
+ ] = None,
+ with_memory: Annotated[
+ bool,
+ typer.Option("--with-memory", help="Include full working memory in output (for piping to another method)"),
+ ] = False,
+) -> None:
+ """Execute a pipeline from a bundle file (.mthds) or pipeline directory.
+
+ Outputs JSON to stdout on success, JSON to stderr on error with exit code 1.
+ Graph visualizations are generated by default; use --no-graph to disable.
+
+ Examples:
+ pipelex-agent run bundle pipelex-wip/pipeline_01/
+ pipelex-agent run bundle my_bundle.mthds --pipe my_pipe
+ pipelex-agent run bundle pipeline_01/ --dry-run --mock-inputs
+ pipelex-agent run bundle pipeline_01/ --no-graph
+ """
+ # Validate --mock-inputs requires --dry-run
+ if mock_inputs and not dry_run:
+ agent_error("--mock-inputs requires --dry-run", "ArgumentError")
+
+ pipe_code: str | None = pipe
+ bundle_path: str | None = None
+ auto_inputs_path: str | None = None
+ target_path = Path(path)
+
+ if target_path.is_dir():
+ # Directory mode: auto-detect bundle, inputs, and library dir
+ bundle_file = target_path / DEFAULT_BUNDLE_FILE_NAME
+ if bundle_file.is_file():
+ bundle_path = str(bundle_file)
+ else:
+ mthds_files = list(target_path.glob(f"*{MTHDS_EXTENSION}"))
+ if len(mthds_files) == 0:
+ agent_error(f"No .mthds bundle file found in directory '{path}'", "FileNotFoundError")
+ if len(mthds_files) > 1:
+ mthds_names = ", ".join(mthds_file.name for mthds_file in mthds_files)
+ agent_error(
+ f"Multiple .mthds files found in '{path}' ({mthds_names}) and no '{DEFAULT_BUNDLE_FILE_NAME}'. "
+ f"Pass the .mthds file directly instead.",
+ "ArgumentError",
+ )
+ bundle_path = str(mthds_files[0])
+
+ # Auto-detect inputs file (used as low-priority fallback)
+ inputs_file = target_path / DEFAULT_INPUTS_FILE_NAME
+ auto_inputs_path = str(inputs_file) if inputs_file.is_file() else None
+
+ # Add directory as library dir (prepend to user-supplied list)
+ target_dir_str = str(target_path)
+ if library_dir is None:
+ library_dir = [target_dir_str]
+ elif target_dir_str not in library_dir:
+ library_dir = [target_dir_str, *library_dir]
+
+ elif is_pipelex_file(target_path):
+ bundle_path = path
+ else:
+ agent_error(
+ f"'{path}' is not a .mthds file or directory. Use 'run pipe <code>' for pipe codes, or 'run bundle <path>' for .mthds files/directories.",
+ "ArgumentError",
+ )
+
+ # Load MTHDS content from bundle
+ mthds_content: str | None = None
+ if bundle_path:
+ try:
+ mthds_content = Path(bundle_path).read_text(encoding="utf-8")
+ if not pipe_code:
+ bundle_blueprint = PipelexInterpreter.make_pipelex_bundle_blueprint(mthds_content=mthds_content)
+ main_pipe_code = bundle_blueprint.main_pipe
+ if not main_pipe_code:
+ agent_error(
+ f"Bundle '{bundle_path}' does not declare a main_pipe. Specify a pipe code with --pipe.",
+ "BundleError",
+ )
+ pipe_code = main_pipe_code
+ except FileNotFoundError as exc:
+ agent_error(f"Bundle file not found: {bundle_path}", "FileNotFoundError", cause=exc)
+ except (OSError, UnicodeDecodeError) as exc:
+ agent_error(f"Failed to read bundle file '{bundle_path}': {exc}", type(exc).__name__, cause=exc)
+ except (PipelexInterpreterError, MthdsDecodeError) as exc:
+ agent_error(f"Failed to parse bundle '{bundle_path}': {exc}", type(exc).__name__, cause=exc)
+
+ # Load inputs: --inputs flag takes priority, then stdin fallback, then auto-detected
+ pipeline_inputs: dict[str, Any] | None = parse_cli_inputs(inputs_arg=inputs, stdin_fallback=True, auto_inputs_path=auto_inputs_path)
+
+ runner_type: RunnerType = ctx.obj["runner"]
+
+ match runner_type:
+ case RunnerType.API:
+ # Validate unsupported flags for API runner
+ if dry_run:
+ agent_error("--dry-run is not supported with --runner api", "ArgumentError")
+ if mock_inputs:
+ agent_error("--mock-inputs is not supported with --runner api", "ArgumentError")
+
+ from mthds.client.exceptions import ClientAuthenticationError, PipelineRequestError # noqa: PLC0415
+
+ try:
+ result = asyncio.run(
+ run_pipeline_core_api(
+ pipe_code=pipe_code, # type: ignore[arg-type]
+ mthds_content=mthds_content,
+ inputs=pipeline_inputs,
+ with_memory=with_memory,
+ )
+ )
+ agent_success(result)
+
+ except ClientAuthenticationError as exc:
+ agent_error(str(exc), "ClientAuthenticationError", cause=exc)
+
+ except PipelineRequestError as exc:
+ agent_error(str(exc), "PipelineRequestError", cause=exc)
+
+ except Exception as exc:
+ agent_error(str(exc), type(exc).__name__, cause=exc)
+
+ case RunnerType.PIPELEX:
+ make_pipelex_for_agent_cli(log_level=ctx.obj["log_level"])
+
+ try:
+ result = asyncio.run(
+ run_pipeline_core(
+ pipe_code=pipe_code, # type: ignore[arg-type]
+ mthds_content=mthds_content,
+ bundle_uri=bundle_path,
+ inputs=pipeline_inputs,
+ dry_run=dry_run,
+ mock_inputs=mock_inputs,
+ library_dirs=library_dir,
+ graph=graph,
+ with_memory=with_memory,
+ )
+ )
+ agent_success(result)
+
+ except PipelineExecutionError as exc:
+ extra_fields: dict[str, Any] = {
+ "pipe_code": exc.pipe_code,
+ "pipe_stack": exc.pipe_stack,
+ }
+ if exc.__cause__:
+ extra_fields["cause_type"] = type(exc.__cause__).__name__
+ extra_fields["cause_message"] = str(exc.__cause__)
+ agent_error(exc.message, "PipelineExecutionError", cause=exc, **extra_fields)
+
+ except PipeOperatorModelChoiceError as exc:
+ agent_error(
+ exc.message,
+ "PipeOperatorModelChoiceError",
+ cause=exc,
+ pipe_code=exc.pipe_code,
+ model_type=str(exc.model_type),
+ model_choice=str(exc.model_choice),
+ )
+
+ except PipeOperatorModelAvailabilityError as exc:
+ availability_extra: dict[str, Any] = {
+ "pipe_code": exc.pipe_code,
+ "model_handle": exc.model_handle,
+ }
+ if exc.fallback_list:
+ availability_extra["fallback_list"] = exc.fallback_list
+ if exc.pipe_stack:
+ availability_extra["pipe_stack"] = exc.pipe_stack
+ agent_error(exc.message, "PipeOperatorModelAvailabilityError", cause=exc, **availability_extra)
+
+ except Exception as exc:
+ agent_error(str(exc), type(exc).__name__, cause=exc)
+
+ finally:
+ Pipelex.teardown_if_needed()
diff --git a/pipelex/cli/agent_cli/commands/run/pipe_cmd.py b/pipelex/cli/agent_cli/commands/run/pipe_cmd.py
index 656cb2a16..82808dce9 100644
--- a/pipelex/cli/agent_cli/commands/run/pipe_cmd.py
+++ b/pipelex/cli/agent_cli/commands/run/pipe_cmd.py
@@ -1,4 +1,4 @@
-"""Agent CLI run pipe command - execute a pipeline by pipe code or bundle path."""
+"""Agent CLI run pipe command - execute a pipeline by pipe code."""
from __future__ import annotations
@@ -9,16 +9,13 @@ from typing import Annotated, Any
import typer
from mthds.runners.types import RunnerType
-from pipelex.builder.conventions import DEFAULT_BUNDLE_FILE_NAME, DEFAULT_INPUTS_FILE_NAME
from pipelex.cli.agent_cli.commands.agent_cli_factory import make_pipelex_for_agent_cli
from pipelex.cli.agent_cli.commands.agent_output import agent_error, agent_success
from pipelex.cli.agent_cli.commands.run._run_core import run_pipeline_core
from pipelex.cli.agent_cli.commands.run._run_core_api import run_pipeline_core_api
from pipelex.cli.agent_cli.commands.run.stdin_resolver import parse_cli_inputs
from pipelex.cli.method_resolver import resolve_pipe_from_exports
-from pipelex.core.interpreter.exceptions import MthdsDecodeError, PipelexInterpreterError
from pipelex.core.interpreter.helpers import MTHDS_EXTENSION, is_pipelex_file
-from pipelex.core.interpreter.interpreter import PipelexInterpreter
from pipelex.core.pipes.exceptions import PipeOperatorModelChoiceError
from pipelex.pipe_operators.exceptions import PipeOperatorModelAvailabilityError
from pipelex.pipelex import Pipelex
@@ -27,18 +24,10 @@ from pipelex.pipeline.exceptions import PipelineExecutionError
def run_pipe_cmd(
ctx: typer.Context,
- target: Annotated[
- str | None,
- typer.Argument(help="Pipe code or bundle file path (auto-detected)"),
- ] = None,
- pipe: Annotated[
- str | None,
- typer.Option("--pipe", help="Pipe code to run"),
- ] = None,
- bundle: Annotated[
- str | None,
- typer.Option("--bundle", help="Bundle file path (.mthds)"),
- ] = None,
+ pipe_code: Annotated[
+ str,
+ typer.Argument(help="Pipe code to run"),
+ ],
inputs: Annotated[
str | None,
typer.Option("--inputs", "-i", help="Path to JSON file with inputs or inline JSON"),
@@ -64,121 +53,47 @@ def run_pipe_cmd(
typer.Option("--with-memory", help="Include full working memory in output (for piping to another method)"),
] = False,
) -> None:
- """Execute a pipeline by pipe code or bundle path and output JSON results.
+ """Execute a pipeline by pipe code and output JSON results.
Outputs JSON to stdout on success, JSON to stderr on error with exit code 1.
Graph visualizations are generated by default; use --no-graph to disable.
Examples:
- pipelex-agent run pipe pipelex-wip/pipeline_01/
- pipelex-agent run pipe my_bundle.mthds --pipe my_pipe
+ pipelex-agent run pipe my_pipe
+ pipelex-agent run pipe my_pipe --inputs data.json
pipelex-agent run pipe my_pipe --dry-run --mock-inputs
- pipelex-agent run pipe pipelex-wip/pipeline_01/ --no-graph
+ pipelex-agent run pipe my_pipe --no-graph
"""
- # Validate that at least one target is provided
- provided_options = sum([target is not None, pipe is not None, bundle is not None])
- if provided_options == 0:
- agent_error("No pipe code or bundle file specified", "ArgumentError")
+ # Helpful error if the user passes a path instead of a pipe code
+ target_path = Path(pipe_code)
+ if target_path.is_dir() or is_pipelex_file(target_path) or pipe_code.endswith(MTHDS_EXTENSION):
+ agent_error(
+ f"'{pipe_code}' looks like a file path or directory. "
+ f"Use 'run bundle {pipe_code}' for bundles/directories, or 'run pipe <code>' for pipe codes.",
+ "ArgumentError",
+ )
# Validate --mock-inputs requires --dry-run
if mock_inputs and not dry_run:
agent_error("--mock-inputs requires --dry-run", "ArgumentError")
- # Determine pipe_code and bundle_path from arguments
- pipe_code: str | None = None
- bundle_path: str | None = None
- auto_inputs_path: str | None = None
-
- if target:
- target_path = Path(target)
- if target_path.is_dir():
- # Directory mode: auto-detect bundle, inputs, and library dir
- if bundle:
- agent_error("Cannot use --bundle when passing a pipeline directory as target", "ArgumentError")
-
- # Find .mthds: try default name first, then fall back to single .mthds
- bundle_file = target_path / DEFAULT_BUNDLE_FILE_NAME
- if bundle_file.is_file():
- bundle_path = str(bundle_file)
- else:
- mthds_files = list(target_path.glob(f"*{MTHDS_EXTENSION}"))
- if len(mthds_files) == 0:
- agent_error(f"No .mthds bundle file found in directory '{target}'", "FileNotFoundError")
- if len(mthds_files) > 1:
- mthds_names = ", ".join(mthds_file.name for mthds_file in mthds_files)
- agent_error(
- f"Multiple .mthds files found in '{target}' ({mthds_names}) and no '{DEFAULT_BUNDLE_FILE_NAME}'. "
- f"Pass the .mthds file directly instead.",
- "ArgumentError",
- )
- bundle_path = str(mthds_files[0])
-
- # Auto-detect inputs file (used as low-priority fallback)
- inputs_file = target_path / DEFAULT_INPUTS_FILE_NAME
- auto_inputs_path = str(inputs_file) if inputs_file.is_file() else None
-
- # Add directory as library dir (prepend to user-supplied list)
- target_dir_str = str(target_path)
- if library_dir is None:
- library_dir = [target_dir_str]
- elif target_dir_str not in library_dir:
- library_dir = [target_dir_str, *library_dir]
-
- # Consume --pipe if provided
- if pipe:
- pipe_code = pipe
- pipe = None # prevent double-assignment below
-
- elif is_pipelex_file(target_path):
- bundle_path = target
- if bundle:
- agent_error("Cannot use --bundle if already passing a bundle file as positional argument", "ArgumentError")
- else:
- pipe_code = target
- if pipe:
- agent_error("Cannot use --pipe if already passing a pipe code as positional argument", "ArgumentError")
-
- if bundle:
- bundle_path = bundle
-
- if pipe:
- pipe_code = pipe
-
- if not pipe_code and not bundle_path:
- agent_error("No pipe code or bundle file specified", "ArgumentError")
-
# Check installed methods' exports for additional library dirs
- if pipe_code and not bundle_path:
+ try:
export_dirs = resolve_pipe_from_exports(pipe_code)
- if export_dirs:
- if library_dir is None:
- library_dir = export_dirs
- else:
- library_dir = [*export_dirs, *library_dir]
-
- # Load MTHDS content from bundle if provided
- mthds_content: str | None = None
- if bundle_path:
- try:
- mthds_content = Path(bundle_path).read_text(encoding="utf-8")
- if not pipe_code:
- bundle_blueprint = PipelexInterpreter.make_pipelex_bundle_blueprint(mthds_content=mthds_content)
- main_pipe_code = bundle_blueprint.main_pipe
- if not main_pipe_code:
- agent_error(
- f"Bundle '{bundle_path}' does not declare a main_pipe. Specify a pipe code with --pipe.",
- "BundleError",
- )
- pipe_code = main_pipe_code
- except FileNotFoundError as exc:
- agent_error(f"Bundle file not found: {bundle_path}", "FileNotFoundError", cause=exc)
- except (OSError, UnicodeDecodeError) as exc:
- agent_error(f"Failed to read bundle file '{bundle_path}': {exc}", type(exc).__name__, cause=exc)
- except (PipelexInterpreterError, MthdsDecodeError) as exc:
- agent_error(f"Failed to parse bundle '{bundle_path}': {exc}", type(exc).__name__, cause=exc)
+ except ValueError as exc:
+ agent_error(
+ f"Ambiguous pipe code '{pipe_code}': {exc}",
+ "ArgumentError",
+ cause=exc,
+ )
+ if export_dirs:
+ if library_dir is None:
+ library_dir = export_dirs
+ else:
+ library_dir = [*export_dirs, *library_dir]
# Load inputs: --inputs flag takes priority, then stdin fallback
- pipeline_inputs: dict[str, Any] | None = parse_cli_inputs(inputs_arg=inputs, stdin_fallback=True, auto_inputs_path=auto_inputs_path)
+ pipeline_inputs: dict[str, Any] | None = parse_cli_inputs(inputs_arg=inputs, stdin_fallback=True)
runner_type: RunnerType = ctx.obj["runner"]
@@ -195,8 +110,8 @@ def run_pipe_cmd(
try:
result = asyncio.run(
run_pipeline_core_api(
- pipe_code=pipe_code, # type: ignore[arg-type]
- mthds_content=mthds_content,
+ pipe_code=pipe_code,
+ mthds_content=None,
inputs=pipeline_inputs,
with_memory=with_memory,
)
@@ -218,9 +133,9 @@ def run_pipe_cmd(
try:
result = asyncio.run(
run_pipeline_core(
- pipe_code=pipe_code, # type: ignore[arg-type]
- mthds_content=mthds_content,
- bundle_uri=bundle_path,
+ pipe_code=pipe_code,
+ mthds_content=None,
+ bundle_uri=None,
inputs=pipeline_inputs,
dry_run=dry_run,
mock_inputs=mock_inputs,
diff --git a/pipelex/cli/agent_cli/commands/run/stdin_resolver.py b/pipelex/cli/agent_cli/commands/run/stdin_resolver.py
index 03ca59ce8..76e422bca 100644
--- a/pipelex/cli/agent_cli/commands/run/stdin_resolver.py
+++ b/pipelex/cli/agent_cli/commands/run/stdin_resolver.py
@@ -4,9 +4,11 @@ from __future__ import annotations
import json
import sys
+from pathlib import Path
from typing import Any, cast
from pipelex.cli.agent_cli.commands.agent_output import agent_error
+from pipelex.cli.commands.run._inputs_path_resolver import resolve_inputs_paths
from pipelex.tools.misc.json_utils import JsonTypeError, load_json_dict_from_path
WORKING_MEMORY_KEY = "working_memory"
@@ -165,7 +167,10 @@ def _parse_inputs_arg(inputs_arg: str) -> dict[str, Any] | None:
agent_error(f"Failed to parse inline JSON inputs: {exc}", "JSONDecodeError", cause=exc)
else:
try:
- return load_json_dict_from_path(inputs_arg)
+ loaded = load_json_dict_from_path(inputs_arg)
+ # Resolve relative url paths against the inputs file's parent directory
+ base_dir = Path(inputs_arg).parent.resolve()
+ return resolve_inputs_paths(loaded, base_dir)
except FileNotFoundError as exc:
agent_error(f"Input file not found: {inputs_arg}", "FileNotFoundError", cause=exc)
except JsonTypeError as exc:
diff --git a/pipelex/cli/agent_cli/commands/validate/app.py b/pipelex/cli/agent_cli/commands/validate/app.py
index 77a033411..d2d0ed192 100644
--- a/pipelex/cli/agent_cli/commands/validate/app.py
+++ b/pipelex/cli/agent_cli/commands/validate/app.py
@@ -4,6 +4,7 @@ from __future__ import annotations
import typer
+from pipelex.cli.agent_cli.commands.validate.bundle_cmd import validate_bundle_cmd
from pipelex.cli.agent_cli.commands.validate.method_cmd import validate_method_cmd
from pipelex.cli.agent_cli.commands.validate.pipe_cmd import validate_pipe_cmd
@@ -13,4 +14,5 @@ validate_app = typer.Typer(
)
validate_app.command(name="method", help="Validate an installed method")(validate_method_cmd)
-validate_app.command(name="pipe", help="Validate a pipe, bundle, or all pipes")(validate_pipe_cmd)
+validate_app.command(name="pipe", help="Validate a pipe by code, or all pipes")(validate_pipe_cmd)
+validate_app.command(name="bundle", help="Validate a bundle file (.mthds) or pipeline directory")(validate_bundle_cmd)
diff --git a/pipelex/cli/agent_cli/commands/validate/bundle_cmd.py b/pipelex/cli/agent_cli/commands/validate/bundle_cmd.py
new file mode 100644
index 000000000..8035ea788
--- /dev/null
+++ b/pipelex/cli/agent_cli/commands/validate/bundle_cmd.py
@@ -0,0 +1,189 @@
+"""Agent CLI validate bundle command - validate a bundle file or directory with JSON output."""
+
+import asyncio
+from pathlib import Path
+from typing import Annotated, Any
+
+import typer
+
+from pipelex.builder.conventions import DEFAULT_BUNDLE_FILE_NAME
+from pipelex.cli.agent_cli.commands.agent_cli_factory import make_pipelex_for_agent_cli
+from pipelex.cli.agent_cli.commands.agent_output import agent_error, agent_success, extract_validation_errors
+from pipelex.cli.agent_cli.commands.validate._validate_core import (
+ validate_bundle_core,
+ validate_pipe_in_bundle_core,
+)
+from pipelex.core.interpreter.exceptions import MthdsDecodeError, PipelexInterpreterError
+from pipelex.core.interpreter.helpers import MTHDS_EXTENSION, is_pipelex_file
+from pipelex.core.pipes.exceptions import PipeOperatorModelChoiceError
+from pipelex.graph.graph_rendering import GraphFormat, generate_graph_for_bundle
+from pipelex.libraries.pipe.exceptions import PipeNotFoundError
+from pipelex.pipe_operators.exceptions import PipeOperatorModelAvailabilityError
+from pipelex.pipelex import Pipelex
+from pipelex.pipeline.exceptions import PipelineExecutionError
+from pipelex.pipeline.validate_bundle import ValidateBundleError
+from pipelex.tools.misc.chart_utils import FlowchartDirection
+
+
+def validate_bundle_cmd(
+ ctx: typer.Context,
+ path: Annotated[
+ str,
+ typer.Argument(help="Path to a .mthds bundle file or a pipeline directory"),
+ ],
+ pipe: Annotated[
+ str | None,
+ typer.Option("--pipe", help="Pipe code to validate (overrides bundle's main_pipe)"),
+ ] = None,
+ graph: Annotated[
+ bool,
+ typer.Option("--graph", "-g", help="On successful bundle validation, save graph HTML files and include their paths in the JSON output"),
+ ] = False,
+ graph_format: Annotated[
+ GraphFormat,
+ typer.Option("--format", "-f", help="Graph format to generate: mermaidflow, reactflow, or both"),
+ ] = GraphFormat.REACTFLOW,
+ direction: Annotated[
+ FlowchartDirection | None,
+ typer.Option("--direction", help="Flowchart direction"),
+ ] = None,
+ library_dir: Annotated[
+ list[str] | None,
+ typer.Option("--library-dir", "-L", help="Directory to search for pipe definitions (.mthds files)"),
+ ] = None,
+) -> None:
+ """Validate a bundle file (.mthds) or pipeline directory and output JSON results.
+
+ Outputs JSON to stdout on success, JSON to stderr on error with exit code 1.
+
+ Examples:
+ pipelex-agent validate bundle my_bundle.mthds
+ pipelex-agent validate bundle my_bundle.mthds --pipe my_pipe
+ pipelex-agent validate bundle my_bundle.mthds --graph
+ pipelex-agent validate bundle pipeline_01/
+ pipelex-agent validate bundle pipeline_01/ --graph
+ """
+ bundle_path: str | None = None
+ target_path = Path(path)
+
+ if target_path.is_dir():
+ # Directory mode: auto-detect bundle file
+ bundle_file = target_path / DEFAULT_BUNDLE_FILE_NAME
+ if bundle_file.is_file():
+ bundle_path = str(bundle_file)
+ else:
+ mthds_files = list(target_path.glob(f"*{MTHDS_EXTENSION}"))
+ if len(mthds_files) == 0:
+ agent_error(f"No .mthds bundle file found in directory '{path}'", "FileNotFoundError")
+ if len(mthds_files) > 1:
+ mthds_names = ", ".join(mthds_file.name for mthds_file in mthds_files)
+ agent_error(
+ f"Multiple .mthds files found in '{path}' ({mthds_names}) and no '{DEFAULT_BUNDLE_FILE_NAME}'. "
+ f"Pass the .mthds file directly instead.",
+ "ArgumentError",
+ )
+ bundle_path = str(mthds_files[0])
+
+ # Add directory as library dir
+ target_dir_str = str(target_path)
+ if library_dir is None:
+ library_dir = [target_dir_str]
+ elif target_dir_str not in library_dir:
+ library_dir = [target_dir_str, *library_dir]
+
+ elif is_pipelex_file(target_path):
+ bundle_path = path
+ else:
+ agent_error(
+ f"'{path}' is not a .mthds file or directory. "
+ f"Use 'validate pipe <code>' for pipe codes, or 'validate bundle <path>' for .mthds files/directories.",
+ "ArgumentError",
+ )
+
+ library_dirs = [Path(lib_dir) for lib_dir in library_dir] if library_dir else None
+
+ # Convert library_dirs to list[str] for graph helper
+ library_dir_strings = [str(lib_dir) for lib_dir in library_dirs] if library_dirs else None
+
+ make_pipelex_for_agent_cli(library_dirs=library_dirs, log_level=ctx.obj["log_level"])
+
+ try:
+ if pipe:
+ # Validate a specific pipe within the bundle
+ result = asyncio.run(validate_pipe_in_bundle_core(bundle_path=Path(bundle_path), pipe_code=pipe, library_dirs=library_dirs)) # type: ignore[arg-type]
+ else:
+ # Validate the entire bundle
+ result = asyncio.run(validate_bundle_core(bundle_path=Path(bundle_path), library_dirs=library_dirs)) # type: ignore[arg-type]
+
+ # Generate graph if requested and validation succeeded
+ if graph:
+ try:
+ graph_result = asyncio.run(
+ generate_graph_for_bundle(
+ bundle_path=Path(bundle_path), # type: ignore[arg-type]
+ graph_format=graph_format,
+ library_dirs=library_dir_strings,
+ direction=direction,
+ )
+ )
+ result.update(graph_result)
+ except PipelineExecutionError as exc:
+ graph_extra: dict[str, Any] = {
+ "pipe_code": exc.pipe_code,
+ "pipe_stack": exc.pipe_stack,
+ }
+ if exc.__cause__:
+ graph_extra["cause_type"] = type(exc.__cause__).__name__
+ graph_extra["cause_message"] = str(exc.__cause__)
+ agent_error(f"Graph generation failed: {exc.message}", "PipelineExecutionError", cause=exc, **graph_extra)
+ except (PipelexInterpreterError, MthdsDecodeError) as exc:
+ agent_error(f"Graph generation failed: {exc}", type(exc).__name__, cause=exc)
+ except typer.Exit:
+ raise
+ except Exception as exc:
+ agent_error(f"Graph generation failed: {exc}", type(exc).__name__, cause=exc)
+
+ agent_success(result)
+
+ except PipeNotFoundError as exc:
+ agent_error(str(exc), "PipeNotFoundError", cause=exc)
+
+ except FileNotFoundError as exc:
+ agent_error(f"Bundle file not found: {bundle_path}", "FileNotFoundError", cause=exc)
+
+ except ValidateBundleError as exc:
+ validation_errors = extract_validation_errors(exc)
+ extra: dict[str, Any] = {"validation_errors": validation_errors}
+ if exc.dry_run_error_message:
+ extra["dry_run_error"] = exc.dry_run_error_message
+ agent_error(exc.message, "ValidateBundleError", cause=exc, **extra)
+
+ except PipeOperatorModelChoiceError as exc:
+ agent_error(
+ exc.message,
+ "PipeOperatorModelChoiceError",
+ cause=exc,
+ pipe_code=exc.pipe_code,
+ model_type=str(exc.model_type),
+ model_choice=str(exc.model_choice),
+ )
+
+ except PipeOperatorModelAvailabilityError as exc:
+ availability_extra: dict[str, Any] = {
+ "pipe_code": exc.pipe_code,
+ "model_handle": exc.model_handle,
+ }
+ if exc.fallback_list:
+ availability_extra["fallback_list"] = exc.fallback_list
+ if exc.pipe_stack:
+ availability_extra["pipe_stack"] = exc.pipe_stack
+ agent_error(exc.message, "PipeOperatorModelAvailabilityError", cause=exc, **availability_extra)
+
+ except typer.Exit:
+ raise
+
+ except Exception as exc:
+ agent_error(str(exc), type(exc).__name__, cause=exc)
+
+ finally:
+ Pipelex.teardown_if_needed()
diff --git a/pipelex/cli/agent_cli/commands/validate/pipe_cmd.py b/pipelex/cli/agent_cli/commands/validate/pipe_cmd.py
index e3b940f80..de43185c5 100644
--- a/pipelex/cli/agent_cli/commands/validate/pipe_cmd.py
+++ b/pipelex/cli/agent_cli/commands/validate/pipe_cmd.py
@@ -1,4 +1,4 @@
-"""Agent CLI validate pipe command - validate pipes/bundles with JSON output."""
+"""Agent CLI validate pipe command - validate a pipe by code or all pipes with JSON output."""
import asyncio
from pathlib import Path
@@ -10,74 +10,47 @@ from pipelex.cli.agent_cli.commands.agent_cli_factory import make_pipelex_for_ag
from pipelex.cli.agent_cli.commands.agent_output import agent_error, agent_success, extract_validation_errors
from pipelex.cli.agent_cli.commands.validate._validate_core import (
validate_all_core,
- validate_bundle_core,
validate_pipe_core,
- validate_pipe_in_bundle_core,
)
-from pipelex.core.interpreter.exceptions import MthdsDecodeError, PipelexInterpreterError
-from pipelex.core.interpreter.helpers import is_pipelex_file
+from pipelex.cli.method_resolver import resolve_pipe_from_exports
+from pipelex.core.interpreter.helpers import MTHDS_EXTENSION, is_pipelex_file
from pipelex.core.pipes.exceptions import PipeOperatorModelChoiceError
-from pipelex.graph.graph_rendering import GraphFormat, generate_graph_for_bundle
from pipelex.libraries.pipe.exceptions import PipeNotFoundError
from pipelex.pipe_operators.exceptions import PipeOperatorModelAvailabilityError
from pipelex.pipelex import Pipelex
-from pipelex.pipeline.exceptions import PipelineExecutionError
from pipelex.pipeline.validate_bundle import ValidateBundleError
-from pipelex.tools.misc.chart_utils import FlowchartDirection
def validate_pipe_cmd(
ctx: typer.Context,
- target: Annotated[
+ pipe_code: Annotated[
str | None,
- typer.Argument(help="Pipe code or bundle file path (auto-detected)"),
- ] = None,
- pipe: Annotated[
- str | None,
- typer.Option("--pipe", help="Pipe code to validate"),
- ] = None,
- bundle: Annotated[
- str | None,
- typer.Option("--bundle", help="Bundle file path (.mthds)"),
+ typer.Argument(help="Pipe code to validate"),
] = None,
validate_all: Annotated[
bool,
typer.Option("--all", "-a", help="Validate all pipes in all libraries"),
] = False,
- graph: Annotated[
- bool,
- typer.Option("--graph", "-g", help="On successful bundle validation, save graph HTML files and include their paths in the JSON output"),
- ] = False,
- graph_format: Annotated[
- GraphFormat,
- typer.Option("--format", "-f", help="Graph format to generate: mermaidflow, reactflow, or both"),
- ] = GraphFormat.REACTFLOW,
- direction: Annotated[
- FlowchartDirection | None,
- typer.Option("--direction", help="Flowchart direction"),
- ] = None,
library_dir: Annotated[
list[str] | None,
typer.Option("--library-dir", "-L", help="Directory to search for pipe definitions (.mthds files)"),
] = None,
) -> None:
- """Validate a pipe, bundle, or all pipes and output JSON results.
+ """Validate a pipe by code, or all pipes, and output JSON results.
Outputs JSON to stdout on success, JSON to stderr on error with exit code 1.
Examples:
pipelex-agent validate pipe my_pipe
- pipelex-agent validate pipe my_bundle.mthds
- pipelex-agent validate pipe my_bundle.mthds --graph
+ pipelex-agent validate pipe --all
pipelex-agent validate pipe --all -L ./my_pipes
"""
library_dirs = [Path(lib_dir) for lib_dir in library_dir] if library_dir else None
+
# Handle --all flag
if validate_all:
- if graph:
- agent_error("--graph requires a bundle target; it cannot be used with --all", "ArgumentError")
- if target or pipe or bundle:
- agent_error("--all cannot be used with a target, --pipe, or --bundle", "ArgumentError")
+ if pipe_code:
+ agent_error("--all cannot be used with a pipe code", "ArgumentError")
make_pipelex_for_agent_cli(library_dirs=library_dirs, log_level=ctx.obj["log_level"])
@@ -118,83 +91,41 @@ def validate_pipe_cmd(
Pipelex.teardown_if_needed()
return
- # Validate mutual exclusivity
- provided_options = sum([target is not None, pipe is not None, bundle is not None])
- if provided_options == 0:
- agent_error("No pipe code or bundle file specified. Use --all to validate all pipes.", "ArgumentError")
-
- # Determine pipe_code and bundle_path from arguments
- pipe_code: str | None = None
- bundle_path: Path | None = None
-
- if target:
- target_path = Path(target)
- if is_pipelex_file(target_path):
- bundle_path = target_path
- if bundle:
- agent_error("Cannot use --bundle if already passing a bundle file as positional argument", "ArgumentError")
- else:
- pipe_code = target
- if pipe:
- agent_error("Cannot use --pipe if already passing a pipe code as positional argument", "ArgumentError")
-
- if bundle:
- bundle_path = Path(bundle)
-
- if pipe:
- pipe_code = pipe
-
- if not pipe_code and not bundle_path:
- agent_error("No pipe code or bundle file specified", "ArgumentError")
-
- # --graph requires a bundle
- if graph and not bundle_path:
- agent_error("--graph requires a bundle target; it cannot be used with a standalone pipe", "ArgumentError")
-
- # Convert library_dirs to list[str] for graph helper (PipelexRunner expects list[str])
- library_dir_strings = [str(lib_dir) for lib_dir in library_dirs] if library_dirs else None
+ if not pipe_code:
+ agent_error(
+ "No pipe code specified. Use --all to validate all pipes, or use 'validate bundle <path>' for bundle files.",
+ "ArgumentError",
+ )
- make_pipelex_for_agent_cli(log_level=ctx.obj["log_level"])
+ # Helpful error if the user passes a path instead of a pipe code
+ target_path = Path(pipe_code)
+ if target_path.is_dir() or is_pipelex_file(target_path) or pipe_code.endswith(MTHDS_EXTENSION):
+ agent_error(
+ f"'{pipe_code}' looks like a file path or directory. "
+ f"Use 'validate bundle {pipe_code}' for bundles/directories, or 'validate pipe <code>' for pipe codes.",
+ "ArgumentError",
+ )
+ # Check installed methods' exports for additional library dirs
try:
- if bundle_path and pipe_code:
- # Validate a specific pipe within a bundle
- result = asyncio.run(validate_pipe_in_bundle_core(bundle_path=bundle_path, pipe_code=pipe_code, library_dirs=library_dirs))
- elif bundle_path:
- # Validate the entire bundle
- result = asyncio.run(validate_bundle_core(bundle_path=bundle_path, library_dirs=library_dirs))
+ export_dirs = resolve_pipe_from_exports(pipe_code)
+ except ValueError as exc:
+ agent_error(
+ f"Ambiguous pipe code '{pipe_code}': {exc}",
+ "ArgumentError",
+ cause=exc,
+ )
+ if export_dirs:
+ export_paths = [Path(export_dir) for export_dir in export_dirs]
+ if library_dirs is None:
+ library_dirs = export_paths
else:
- # Validate a standalone pipe
- result = asyncio.run(validate_pipe_core(pipe_code=pipe_code, library_dirs=library_dirs)) # type: ignore[arg-type]
-
- # Generate graph if requested and validation succeeded with a bundle
- if graph and bundle_path:
- try:
- graph_result = asyncio.run(
- generate_graph_for_bundle(
- bundle_path=bundle_path,
- graph_format=graph_format,
- library_dirs=library_dir_strings,
- direction=direction,
- )
- )
- result.update(graph_result)
- except PipelineExecutionError as exc:
- graph_extra: dict[str, Any] = {
- "pipe_code": exc.pipe_code,
- "pipe_stack": exc.pipe_stack,
- }
- if exc.__cause__:
- graph_extra["cause_type"] = type(exc.__cause__).__name__
- graph_extra["cause_message"] = str(exc.__cause__)
- agent_error(f"Graph generation failed: {exc.message}", "PipelineExecutionError", cause=exc, **graph_extra)
- except (PipelexInterpreterError, MthdsDecodeError) as exc:
- agent_error(f"Graph generation failed: {exc}", type(exc).__name__, cause=exc)
- except typer.Exit:
- raise
- except Exception as exc:
- agent_error(f"Graph generation failed: {exc}", type(exc).__name__, cause=exc)
+ library_dirs = [*export_paths, *library_dirs]
+ make_pipelex_for_agent_cli(library_dirs=library_dirs, log_level=ctx.obj["log_level"])
+
+ try:
+ result = asyncio.run(validate_pipe_core(pipe_code=pipe_code, library_dirs=library_dirs))
agent_success(result)
except PipeNotFoundError as exc:
@@ -203,9 +134,6 @@ def validate_pipe_cmd(
error_message += " Did you mean '--all'?"
agent_error(error_message, "PipeNotFoundError", cause=exc)
- except FileNotFoundError as exc:
- agent_error(f"Bundle file not found: {bundle_path}", "FileNotFoundError", cause=exc)
-
except ValidateBundleError as exc:
validation_errors = extract_validation_errors(exc)
extra: dict[str, Any] = {"validation_errors": validation_errors}
diff --git a/pipelex/cli/commands/build/inputs/app.py b/pipelex/cli/commands/build/inputs/app.py
index 06603fefe..2a7770c82 100644
--- a/pipelex/cli/commands/build/inputs/app.py
+++ b/pipelex/cli/commands/build/inputs/app.py
@@ -1,9 +1,11 @@
import typer
+from pipelex.cli.commands.build.inputs.bundle_cmd import build_inputs_bundle_cmd
from pipelex.cli.commands.build.inputs.method_cmd import build_inputs_method_cmd
from pipelex.cli.commands.build.inputs.pipe_cmd import build_inputs_pipe_cmd
build_inputs_app = typer.Typer(help="Generate example input JSON for a pipe", no_args_is_help=True)
+build_inputs_app.command("bundle", help="Generate inputs from a bundle file or directory")(build_inputs_bundle_cmd)
build_inputs_app.command("method", help="Generate inputs for an installed method")(build_inputs_method_cmd)
-build_inputs_app.command("pipe", help="Generate inputs for a pipe by code or bundle")(build_inputs_pipe_cmd)
+build_inputs_app.command("pipe", help="Generate inputs for a pipe by code")(build_inputs_pipe_cmd)
diff --git a/pipelex/cli/commands/build/inputs/bundle_cmd.py b/pipelex/cli/commands/build/inputs/bundle_cmd.py
new file mode 100644
index 000000000..7ebff8dd8
--- /dev/null
+++ b/pipelex/cli/commands/build/inputs/bundle_cmd.py
@@ -0,0 +1,98 @@
+from __future__ import annotations
+
+from pathlib import Path
+from typing import Annotated
+
+import typer
+
+from pipelex.builder.conventions import DEFAULT_BUNDLE_FILE_NAME
+from pipelex.cli.commands.build.inputs._inputs_core import execute_generate_inputs
+from pipelex.core.interpreter.helpers import MTHDS_EXTENSION, is_pipelex_file
+
+
+def build_inputs_bundle_cmd(
+ path: Annotated[
+ str,
+ typer.Argument(help="Path to a .mthds bundle file or a pipeline directory"),
+ ],
+ pipe: Annotated[
+ str | None,
+ typer.Option("--pipe", help="Pipe code (overrides bundle's main_pipe)"),
+ ] = None,
+ library_dir: Annotated[
+ list[str] | None,
+ typer.Option(
+ "--library-dir",
+ "-L",
+ help="Directory to search for pipe definitions (.mthds files). Can be specified multiple times.",
+ ),
+ ] = None,
+ output_path: Annotated[
+ str | None,
+ typer.Option("--output", "-o", help="Path to save the generated JSON file (defaults to bundle's directory)"),
+ ] = None,
+) -> None:
+ """Generate example input JSON from a bundle file or pipeline directory.
+
+ Examples:
+ pipelex build inputs bundle my_bundle.mthds
+ pipelex build inputs bundle pipeline_01/
+ pipelex build inputs bundle my_bundle.mthds --pipe my_pipe
+ pipelex build inputs bundle pipeline_01/ --output custom_inputs.json
+ """
+ target_path = Path(path)
+ bundle_path: Path
+ output_path_path = Path(output_path) if output_path else None
+
+ if target_path.is_dir():
+ bundle_file = target_path / DEFAULT_BUNDLE_FILE_NAME
+ if bundle_file.is_file():
+ bundle_path = bundle_file
+ else:
+ mthds_files = list(target_path.glob(f"*{MTHDS_EXTENSION}"))
+ if len(mthds_files) == 0:
+ typer.secho(
+ f"Failed to run: no .mthds bundle file found in directory '{path}'",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+ if len(mthds_files) > 1:
+ mthds_names = ", ".join(mthds_file.name for mthds_file in mthds_files)
+ typer.secho(
+ f"Failed to run: multiple .mthds files found in '{path}' ({mthds_names}) "
+ f"and no '{DEFAULT_BUNDLE_FILE_NAME}'. "
+ f"Pass the .mthds file directly, e.g.: pipelex build inputs bundle {target_path / mthds_files[0].name}",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+ bundle_path = mthds_files[0]
+
+ # Add directory as library dir
+ target_dir_str = str(target_path)
+ if library_dir is None:
+ library_dir = [target_dir_str]
+ elif target_dir_str not in library_dir:
+ library_dir = [target_dir_str, *library_dir]
+
+ typer.echo(f"Auto-detected bundle: {bundle_path}")
+
+ elif is_pipelex_file(target_path):
+ bundle_path = target_path
+ else:
+ typer.secho(
+ f"Failed to run: '{path}' is not a .mthds file or directory.\n"
+ f" To generate inputs for a pipe by code, use: pipelex build inputs pipe <code>\n"
+ f" To use a bundle, pass a .mthds file or directory: pipelex build inputs bundle <path>",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+
+ execute_generate_inputs(
+ pipe_code=pipe,
+ bundle_path=bundle_path,
+ output_path=output_path_path,
+ library_dir=library_dir,
+ )
diff --git a/pipelex/cli/commands/build/inputs/pipe_cmd.py b/pipelex/cli/commands/build/inputs/pipe_cmd.py
index e25caa6ff..f2a358478 100644
--- a/pipelex/cli/commands/build/inputs/pipe_cmd.py
+++ b/pipelex/cli/commands/build/inputs/pipe_cmd.py
@@ -3,22 +3,16 @@ from __future__ import annotations
from pathlib import Path
from typing import Annotated
-import click
import typer
from pipelex.cli.commands.build.inputs._inputs_core import execute_generate_inputs
-from pipelex.core.interpreter.helpers import is_pipelex_file
def build_inputs_pipe_cmd(
- target: Annotated[
- str | None,
- typer.Argument(help="Pipe code or bundle file path (auto-detected)"),
- ] = None,
- pipe: Annotated[
- str | None,
- typer.Option("--pipe", help="Pipe code, can be omitted if you specify a bundle (.mthds) that declares a main pipe"),
- ] = None,
+ pipe_code: Annotated[
+ str,
+ typer.Argument(help="Pipe code (e.g. my_domain.my_pipe)"),
+ ],
library_dir: Annotated[
list[str] | None,
typer.Option(
@@ -29,61 +23,21 @@ def build_inputs_pipe_cmd(
] = None,
output_path: Annotated[
str | None,
- typer.Option(
- "--output", "-o", help="Path to save the generated JSON file (defaults to bundle's directory if bundle provided, otherwise 'results/')"
- ),
+ typer.Option("--output", "-o", help="Path to save the generated JSON file (defaults to 'results/')"),
] = None,
) -> None:
- """Generate example input JSON for a pipe by code or bundle file.
+ """Generate example input JSON for a pipe by code.
Examples:
- pipelex build inputs pipe my_pipe
- pipelex build inputs pipe my_bundle.mthds
- pipelex build inputs pipe my_bundle.mthds --pipe my_pipe
+ pipelex build inputs pipe my_domain.my_pipe
+ pipelex build inputs pipe my_pipe -L ./my_library/
pipelex build inputs pipe my_pipe --output custom_inputs.json
"""
- if target is None and pipe is None:
- ctx: click.Context = click.get_current_context()
- typer.echo(ctx.get_help())
- raise typer.Exit(0)
-
- pipe_code: str | None = None
- bundle_path: Path | None = None
output_path_path = Path(output_path) if output_path else None
- if target:
- target_path = Path(target)
- if target_path.is_dir():
- typer.secho(
- f"Failed to run: '{target}' is a directory. The inputs command requires a .mthds file or a pipe code.",
- fg=typer.colors.RED,
- err=True,
- )
- raise typer.Exit(1)
-
- if is_pipelex_file(target_path):
- bundle_path = target_path
- else:
- pipe_code = target
- if pipe:
- typer.secho(
- "Failed to run: cannot use option --pipe if you're already passing a pipe code as positional argument",
- fg=typer.colors.RED,
- err=True,
- )
- raise typer.Exit(1)
-
- if pipe:
- assert not pipe_code, "pipe_code should be None at this stage if --pipe is provided"
- pipe_code = pipe
-
- if not pipe_code and not bundle_path:
- typer.secho("Failed to run: no pipe code or bundle file specified", fg=typer.colors.RED, err=True)
- raise typer.Exit(1)
-
execute_generate_inputs(
pipe_code=pipe_code,
- bundle_path=bundle_path,
+ bundle_path=None,
output_path=output_path_path,
library_dir=library_dir,
)
diff --git a/pipelex/cli/commands/build/output/app.py b/pipelex/cli/commands/build/output/app.py
index 574b3b455..67996650b 100644
--- a/pipelex/cli/commands/build/output/app.py
+++ b/pipelex/cli/commands/build/output/app.py
@@ -1,9 +1,11 @@
import typer
+from pipelex.cli.commands.build.output.bundle_cmd import build_output_bundle_cmd
from pipelex.cli.commands.build.output.method_cmd import build_output_method_cmd
from pipelex.cli.commands.build.output.pipe_cmd import build_output_pipe_cmd
build_output_app = typer.Typer(help="Generate example output representation for a pipe", no_args_is_help=True)
+build_output_app.command("bundle", help="Generate output from a bundle file or directory")(build_output_bundle_cmd)
build_output_app.command("method", help="Generate output for an installed method")(build_output_method_cmd)
-build_output_app.command("pipe", help="Generate output for a pipe by code or bundle")(build_output_pipe_cmd)
+build_output_app.command("pipe", help="Generate output for a pipe by code")(build_output_pipe_cmd)
diff --git a/pipelex/cli/commands/build/output/bundle_cmd.py b/pipelex/cli/commands/build/output/bundle_cmd.py
new file mode 100644
index 000000000..a4a04ce55
--- /dev/null
+++ b/pipelex/cli/commands/build/output/bundle_cmd.py
@@ -0,0 +1,125 @@
+from __future__ import annotations
+
+from pathlib import Path
+from typing import Annotated
+
+import typer
+
+from pipelex.builder.conventions import DEFAULT_BUNDLE_FILE_NAME
+from pipelex.cli.commands.build.output._output_core import execute_generate_output
+from pipelex.core.concepts.concept_representation_generator import ConceptRepresentationFormat
+from pipelex.core.interpreter.helpers import MTHDS_EXTENSION, is_pipelex_file
+
+
+def build_output_bundle_cmd(
+ path: Annotated[
+ str,
+ typer.Argument(help="Path to a .mthds bundle file or a pipeline directory"),
+ ],
+ pipe: Annotated[
+ str | None,
+ typer.Option("--pipe", help="Pipe code (overrides bundle's main_pipe)"),
+ ] = None,
+ library_dir: Annotated[
+ list[str] | None,
+ typer.Option(
+ "--library-dir",
+ "-L",
+ help="Directory to search for pipe definitions (.mthds files). Can be specified multiple times.",
+ ),
+ ] = None,
+ output_path: Annotated[
+ str | None,
+ typer.Option("--output", "-o", help="Path to save the generated file (defaults to bundle's directory)"),
+ ] = None,
+ output_format: Annotated[
+ str,
+ typer.Option(
+ "--format",
+ "-f",
+ help="Output format: 'json' for JSON example, 'python' for Python code, 'schema' for JSON Schema (useful for TypeScript/Zod generation)",
+ ),
+ ] = "json",
+) -> None:
+ """Generate example output representation from a bundle file or pipeline directory.
+
+ Examples:
+ pipelex build output bundle my_bundle.mthds
+ pipelex build output bundle pipeline_01/
+ pipelex build output bundle my_bundle.mthds --format schema
+ pipelex build output bundle my_bundle.mthds --pipe my_pipe
+ pipelex build output bundle pipeline_01/ --output expected_output.json
+ """
+ # Parse output format
+ format_lower = output_format.lower()
+ if format_lower == "json":
+ concept_format = ConceptRepresentationFormat.JSON
+ elif format_lower == "python":
+ concept_format = ConceptRepresentationFormat.PYTHON
+ elif format_lower == "schema":
+ concept_format = ConceptRepresentationFormat.SCHEMA
+ else:
+ typer.secho(
+ f"Invalid format '{output_format}'. Must be 'json', 'python', or 'schema'.",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+
+ target_path = Path(path)
+ bundle_path: Path
+ output_path_path = Path(output_path) if output_path else None
+
+ if target_path.is_dir():
+ bundle_file = target_path / DEFAULT_BUNDLE_FILE_NAME
+ if bundle_file.is_file():
+ bundle_path = bundle_file
+ else:
+ mthds_files = list(target_path.glob(f"*{MTHDS_EXTENSION}"))
+ if len(mthds_files) == 0:
+ typer.secho(
+ f"Failed to run: no .mthds bundle file found in directory '{path}'",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+ if len(mthds_files) > 1:
+ mthds_names = ", ".join(mthds_file.name for mthds_file in mthds_files)
+ typer.secho(
+ f"Failed to run: multiple .mthds files found in '{path}' ({mthds_names}) "
+ f"and no '{DEFAULT_BUNDLE_FILE_NAME}'. "
+ f"Pass the .mthds file directly, e.g.: pipelex build output bundle {target_path / mthds_files[0].name}",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+ bundle_path = mthds_files[0]
+
+ # Add directory as library dir
+ target_dir_str = str(target_path)
+ if library_dir is None:
+ library_dir = [target_dir_str]
+ elif target_dir_str not in library_dir:
+ library_dir = [target_dir_str, *library_dir]
+
+ typer.echo(f"Auto-detected bundle: {bundle_path}")
+
+ elif is_pipelex_file(target_path):
+ bundle_path = target_path
+ else:
+ typer.secho(
+ f"Failed to run: '{path}' is not a .mthds file or directory.\n"
+ f" To generate output for a pipe by code, use: pipelex build output pipe <code>\n"
+ f" To use a bundle, pass a .mthds file or directory: pipelex build output bundle <path>",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+
+ execute_generate_output(
+ pipe_code=pipe,
+ bundle_path=bundle_path,
+ output_path=output_path_path,
+ output_format=concept_format,
+ library_dir=library_dir,
+ )
diff --git a/pipelex/cli/commands/build/output/pipe_cmd.py b/pipelex/cli/commands/build/output/pipe_cmd.py
index 852bc4c1d..eb0db8279 100644
--- a/pipelex/cli/commands/build/output/pipe_cmd.py
+++ b/pipelex/cli/commands/build/output/pipe_cmd.py
@@ -3,23 +3,17 @@ from __future__ import annotations
from pathlib import Path
from typing import Annotated
-import click
import typer
from pipelex.cli.commands.build.output._output_core import execute_generate_output
from pipelex.core.concepts.concept_representation_generator import ConceptRepresentationFormat
-from pipelex.core.interpreter.helpers import is_pipelex_file
def build_output_pipe_cmd(
- target: Annotated[
- str | None,
- typer.Argument(help="Pipe code or bundle file path (auto-detected)"),
- ] = None,
- pipe: Annotated[
- str | None,
- typer.Option("--pipe", help="Pipe code, can be omitted if you specify a bundle (.mthds) that declares a main pipe"),
- ] = None,
+ pipe_code: Annotated[
+ str,
+ typer.Argument(help="Pipe code (e.g. my_domain.my_pipe)"),
+ ],
library_dir: Annotated[
list[str] | None,
typer.Option(
@@ -30,9 +24,7 @@ def build_output_pipe_cmd(
] = None,
output_path: Annotated[
str | None,
- typer.Option(
- "--output", "-o", help="Path to save the generated file (defaults to bundle's directory if bundle provided, otherwise 'results/')"
- ),
+ typer.Option("--output", "-o", help="Path to save the generated file (defaults to 'results/')"),
] = None,
output_format: Annotated[
str,
@@ -43,19 +35,14 @@ def build_output_pipe_cmd(
),
] = "json",
) -> None:
- """Generate example output representation for a pipe by code or bundle file.
+ """Generate example output representation for a pipe by code.
Examples:
- pipelex build output pipe my_pipe
+ pipelex build output pipe my_domain.my_pipe
pipelex build output pipe my_pipe --format schema
- pipelex build output pipe my_bundle.mthds
- pipelex build output pipe my_bundle.mthds --pipe my_pipe
+ pipelex build output pipe my_pipe -L ./my_library/
+ pipelex build output pipe my_pipe --output expected_output.json
"""
- if target is None and pipe is None:
- ctx: click.Context = click.get_current_context()
- typer.echo(ctx.get_help())
- raise typer.Exit(0)
-
# Parse output format
format_lower = output_format.lower()
if format_lower == "json":
@@ -72,43 +59,11 @@ def build_output_pipe_cmd(
)
raise typer.Exit(1)
- pipe_code: str | None = None
- bundle_path: Path | None = None
output_path_path = Path(output_path) if output_path else None
- if target:
- target_path = Path(target)
- if target_path.is_dir():
- typer.secho(
- f"Failed to run: '{target}' is a directory. The output command requires a .mthds file or a pipe code.",
- fg=typer.colors.RED,
- err=True,
- )
- raise typer.Exit(1)
-
- if is_pipelex_file(target_path):
- bundle_path = target_path
- else:
- pipe_code = target
- if pipe:
- typer.secho(
- "Failed to run: cannot use option --pipe if you're already passing a pipe code as positional argument",
- fg=typer.colors.RED,
- err=True,
- )
- raise typer.Exit(1)
-
- if pipe:
- assert not pipe_code, "pipe_code should be None at this stage if --pipe is provided"
- pipe_code = pipe
-
- if not pipe_code and not bundle_path:
- typer.secho("Failed to run: no pipe code or bundle file specified", fg=typer.colors.RED, err=True)
- raise typer.Exit(1)
-
execute_generate_output(
pipe_code=pipe_code,
- bundle_path=bundle_path,
+ bundle_path=None,
output_path=output_path_path,
output_format=concept_format,
library_dir=library_dir,
diff --git a/pipelex/cli/commands/build/runner/app.py b/pipelex/cli/commands/build/runner/app.py
index 8ea7299e3..b5aa321ed 100644
--- a/pipelex/cli/commands/build/runner/app.py
+++ b/pipelex/cli/commands/build/runner/app.py
@@ -1,9 +1,9 @@
import typer
+from pipelex.cli.commands.build.runner.bundle_cmd import build_runner_bundle_cmd
from pipelex.cli.commands.build.runner.method_cmd import build_runner_method_cmd
-from pipelex.cli.commands.build.runner.pipe_cmd import build_runner_pipe_cmd
build_runner_app = typer.Typer(help="Build Python code to run a pipe", no_args_is_help=True)
+build_runner_app.command("bundle", help="Build runner from a bundle file or directory")(build_runner_bundle_cmd)
build_runner_app.command("method", help="Build runner for an installed method")(build_runner_method_cmd)
-build_runner_app.command("pipe", help="Build runner for a pipe from a bundle file")(build_runner_pipe_cmd)
diff --git a/pipelex/cli/commands/build/runner/bundle_cmd.py b/pipelex/cli/commands/build/runner/bundle_cmd.py
new file mode 100644
index 000000000..d18b32232
--- /dev/null
+++ b/pipelex/cli/commands/build/runner/bundle_cmd.py
@@ -0,0 +1,95 @@
+from __future__ import annotations
+
+from pathlib import Path
+from typing import Annotated
+
+import typer
+
+from pipelex.builder.conventions import DEFAULT_BUNDLE_FILE_NAME
+from pipelex.cli.commands.build.runner._runner_core import execute_prepare_runner
+from pipelex.core.interpreter.helpers import MTHDS_EXTENSION, is_pipelex_file
+
+
+def build_runner_bundle_cmd(
+ path: Annotated[
+ str,
+ typer.Argument(help="Path to a .mthds bundle file or a pipeline directory"),
+ ],
+ pipe: Annotated[
+ str | None,
+ typer.Option("--pipe", help="Pipe code to use (optional if the .mthds declares a main_pipe)"),
+ ] = None,
+ output_path: Annotated[
+ str | None,
+ typer.Option("--output", "-o", help="Path to save the generated Python file (defaults to target's directory)"),
+ ] = None,
+ library_dirs: Annotated[
+ list[str] | None,
+ typer.Option("--library-dirs", "-L", help="Directories to search for pipe definitions (.mthds files). Can be specified multiple times."),
+ ] = None,
+) -> None:
+ """Build a Python runner file from a bundle file or pipeline directory.
+
+ Examples:
+ pipelex build runner bundle my_bundle.mthds
+ pipelex build runner bundle pipeline_01/
+ pipelex build runner bundle my_bundle.mthds --pipe my_pipe
+ pipelex build runner bundle my_bundle.mthds --output runner.py
+ """
+ target_path = Path(path)
+ bundle_path: Path
+ output_path_path = Path(output_path) if output_path else None
+
+ if target_path.is_dir():
+ bundle_file = target_path / DEFAULT_BUNDLE_FILE_NAME
+ if bundle_file.is_file():
+ bundle_path = bundle_file
+ else:
+ mthds_files = list(target_path.glob(f"*{MTHDS_EXTENSION}"))
+ if len(mthds_files) == 0:
+ typer.secho(
+ f"Failed to run: no .mthds bundle file found in directory '{path}'",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+ if len(mthds_files) > 1:
+ mthds_names = ", ".join(mthds_file.name for mthds_file in mthds_files)
+ typer.secho(
+ f"Failed to run: multiple .mthds files found in '{path}' ({mthds_names}) "
+ f"and no '{DEFAULT_BUNDLE_FILE_NAME}'. "
+ f"Pass the .mthds file directly, e.g.: pipelex build runner bundle {target_path / mthds_files[0].name}",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+ bundle_path = mthds_files[0]
+
+ # Add directory as library dir
+ target_dir_str = str(target_path)
+ if library_dirs is None:
+ library_dirs = [target_dir_str]
+ elif target_dir_str not in library_dirs:
+ library_dirs = [target_dir_str, *library_dirs]
+
+ typer.echo(f"Auto-detected bundle: {bundle_path}")
+
+ elif is_pipelex_file(target_path):
+ bundle_path = target_path
+ else:
+ typer.secho(
+ f"Failed to run: '{path}' is not a .mthds file or directory.\n"
+ f" To build a runner, pass a .mthds file or directory: pipelex build runner bundle <path>",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+
+ library_dirs_paths = [Path(lib_dir) for lib_dir in library_dirs] if library_dirs else None
+
+ execute_prepare_runner(
+ pipe_code=pipe,
+ bundle_path=bundle_path,
+ output_path=output_path_path,
+ library_dirs=library_dirs_paths,
+ )
diff --git a/pipelex/cli/commands/build/runner/pipe_cmd.py b/pipelex/cli/commands/build/runner/pipe_cmd.py
deleted file mode 100644
index 43aa0d89f..000000000
--- a/pipelex/cli/commands/build/runner/pipe_cmd.py
+++ /dev/null
@@ -1,60 +0,0 @@
-from __future__ import annotations
-
-from pathlib import Path
-from typing import Annotated
-
-import click
-import typer
-
-from pipelex.cli.commands.build.runner._runner_core import execute_prepare_runner
-from pipelex.core.interpreter.helpers import is_pipelex_file
-
-
-def build_runner_pipe_cmd(
- target: Annotated[
- str | None,
- typer.Argument(help="Bundle file path (.mthds)"),
- ] = None,
- pipe: Annotated[
- str | None,
- typer.Option("--pipe", help="Pipe code to use (optional if the .mthds declares a main_pipe)"),
- ] = None,
- output_path: Annotated[
- str | None,
- typer.Option("--output", "-o", help="Path to save the generated Python file (defaults to target's directory)"),
- ] = None,
- library_dirs: Annotated[
- list[str] | None,
- typer.Option("--library-dirs", "-L", help="Directories to search for pipe definitions (.mthds files). Can be specified multiple times."),
- ] = None,
-) -> None:
- """Build a Python runner file for a pipe from a bundle file.
-
- Examples:
- pipelex build runner pipe my_bundle.mthds
- pipelex build runner pipe my_bundle.mthds --pipe my_pipe
- pipelex build runner pipe my_bundle.mthds --output runner.py
- """
- if target is None:
- ctx: click.Context = click.get_current_context()
- typer.echo(ctx.get_help())
- raise typer.Exit(0)
-
- target_path = Path(target)
- output_path_path = Path(output_path) if output_path else None
- library_dirs_paths = [Path(lib_dir) for lib_dir in library_dirs] if library_dirs else None
-
- if not is_pipelex_file(target_path):
- typer.secho(
- f"Failed to run: '{target}' is not a .mthds file.",
- fg=typer.colors.RED,
- err=True,
- )
- raise typer.Exit(1)
-
- execute_prepare_runner(
- pipe_code=pipe,
- bundle_path=target_path,
- output_path=output_path_path,
- library_dirs=library_dirs_paths,
- )
diff --git a/pipelex/cli/commands/doctor_cmd.py b/pipelex/cli/commands/doctor_cmd.py
index 9f5fe48d7..859dd420c 100644
--- a/pipelex/cli/commands/doctor_cmd.py
+++ b/pipelex/cli/commands/doctor_cmd.py
@@ -4,6 +4,7 @@ from __future__ import annotations
import contextlib
import io
+import os
import sys
from pathlib import Path
from typing import TYPE_CHECKING, Any
@@ -56,20 +57,26 @@ class BackendFileReport(BaseModel):
has_kit_template: bool = False
-def check_config_files() -> tuple[bool, int, str]:
+def check_config_files(config_dir: str | None = None) -> tuple[bool, int, str]:
"""Check if configuration files are present and main config is valid.
+ Args:
+ config_dir: Explicit config directory path. If None, uses CWD-relative .pipelex/.
+
Returns:
Tuple of (is_healthy, missing_count, message)
"""
# Check for missing files
try:
- missing_count = init_config(reset=False, dry_run=True)
+ missing_count = init_config(reset=False, dry_run=True, target_dir=config_dir)
except Exception as exc:
return False, 0, f"Error checking config files: {exc}"
- # Check if main config can be loaded using the hub's setup
- pipelex_config_path = ".pipelex/pipelex.toml"
+ # Check if main config can be loaded using the hub's setup.
+ # Note: load_config() uses config_manager's own resolution chain (package → global → project)
+ # which may differ from config_dir when --global is used. This is acceptable for a diagnostic
+ # check — the existence check guards the path, while load_config() validates the merged config.
+ pipelex_config_path = os.path.join(config_dir, "pipelex.toml") if config_dir else ".pipelex/pipelex.toml"
if path_exists(pipelex_config_path):
try:
# Suppress stderr and stdout to prevent tracebacks from being printed
@@ -89,14 +96,16 @@ def check_config_files() -> tuple[bool, int, str]:
return False, missing_count, f"{missing_count} configuration file(s) missing"
-def check_telemetry_config() -> tuple[bool, str]:
+def check_telemetry_config(config_dir: str | None = None) -> tuple[bool, str]:
"""Check if telemetry configuration is valid.
+ Args:
+ config_dir: Explicit config directory path. If None, uses CWD-relative .pipelex/.
+
Returns:
Tuple of (is_healthy, message)
"""
- # Use hard-coded path to avoid needing Pipelex initialization
- telemetry_config_path = f".pipelex/{TELEMETRY_CONFIG_FILE_NAME}"
+ telemetry_config_path = os.path.join(config_dir, TELEMETRY_CONFIG_FILE_NAME) if config_dir else f".pipelex/{TELEMETRY_CONFIG_FILE_NAME}"
try:
toml_doc = load_toml_from_path(telemetry_config_path)
@@ -115,14 +124,16 @@ def check_telemetry_config() -> tuple[bool, str]:
return False, "Invalid configuration - run 'pipelex init telemetry --reset' to fix"
-def check_backend_credentials() -> tuple[bool, dict[str, BackendCredentialsReport], str]:
+def check_backend_credentials(config_dir: str | None = None) -> tuple[bool, dict[str, BackendCredentialsReport], str]:
"""Check if backend credentials are properly configured.
+ Args:
+ config_dir: Explicit config directory path. If None, uses CWD-relative .pipelex/.
+
Returns:
Tuple of (is_healthy, backend_reports_dict, summary_message)
"""
- # Use hard-coded path to avoid needing Pipelex initialization
- backends_toml_path = ".pipelex/inference/backends.toml"
+ backends_toml_path = os.path.join(config_dir, "inference", "backends.toml") if config_dir else ".pipelex/inference/backends.toml"
if not path_exists(backends_toml_path):
return False, {}, "Backend configuration file not found"
@@ -249,19 +260,22 @@ def replace_backend_file(backend_name: str, dry_run: bool = False) -> bool:
return False
-def check_backend_files() -> tuple[bool, dict[str, BackendFileReport], str]:
+def check_backend_files(config_dir: str | None = None) -> tuple[bool, dict[str, BackendFileReport], str]:
"""Check individual backend configuration files for validity.
+ Args:
+ config_dir: Explicit config directory path. If None, uses CWD-relative .pipelex/.
+
Returns:
Tuple of (is_healthy, backend_file_reports_dict, summary_message)
"""
- backends_dir_path = ".pipelex/inference/backends"
+ backends_dir_path = os.path.join(config_dir, "inference", "backends") if config_dir else ".pipelex/inference/backends"
if not path_exists(backends_dir_path):
return True, {}, "No backend files to check"
# Get list of enabled backends from backends.toml
- backends_toml_path = ".pipelex/inference/backends.toml"
+ backends_toml_path = os.path.join(config_dir, "inference", "backends.toml") if config_dir else ".pipelex/inference/backends.toml"
if not path_exists(backends_toml_path):
return True, {}, "No backends.toml to check"
@@ -568,14 +582,17 @@ def display_health_report(
console.print()
-def check_models() -> tuple[bool, str, dict[str, BackendFileReport]]:
+def check_models(config_dir: str | None = None) -> tuple[bool, str, dict[str, BackendFileReport]]:
"""Check if models are valid, including backend file validation.
+ Args:
+ config_dir: Explicit config directory path. If None, uses CWD-relative .pipelex/.
+
Returns:
Tuple of (is_healthy, message, backend_file_reports)
"""
# First check backend files individually
- backend_files_healthy, backend_file_reports, _ = check_backend_files()
+ backend_files_healthy, backend_file_reports, _ = check_backend_files(config_dir=config_dir)
# If backend files have issues, report that immediately
if not backend_files_healthy:
diff --git a/pipelex/cli/commands/run/_inputs_path_resolver.py b/pipelex/cli/commands/run/_inputs_path_resolver.py
new file mode 100644
index 000000000..6fee8c3dc
--- /dev/null
+++ b/pipelex/cli/commands/run/_inputs_path_resolver.py
@@ -0,0 +1,85 @@
+"""Resolve relative file paths inside pipeline inputs relative to a base directory.
+
+When inputs are loaded from a JSON file (e.g. ``inputs.json`` inside a bundle
+directory), any relative ``url`` values should be resolved relative to that
+file's parent directory — not relative to the process CWD. This module
+provides the logic to walk an inputs dict and prepend a base directory to
+relative local paths.
+"""
+
+from __future__ import annotations
+
+from pathlib import Path
+from typing import Any, cast
+
+from pipelex.tools.uri.resolved_uri import ResolvedLocalPath
+from pipelex.tools.uri.uri_resolver import resolve_uri
+
+
+def is_relative_local_path(uri: str) -> bool:
+ """Check whether *uri* is a relative local file path.
+
+ Uses :func:`resolve_uri` to classify the URI. Returns ``True`` only when
+ the URI resolves to a :class:`ResolvedLocalPath` **and** the path is not
+ absolute.
+
+ Args:
+ uri: The URI string to check.
+
+ Returns:
+ ``True`` if *uri* is a relative local path, ``False`` otherwise.
+ """
+ resolved = resolve_uri(uri)
+ if not isinstance(resolved, ResolvedLocalPath):
+ return False
+ return not Path(resolved.path).is_absolute()
+
+
+def resolve_url_in_value(value: Any, base_dir: Path) -> Any:
+ """Recursively walk a JSON-like value and resolve relative ``url`` fields.
+
+ When a ``dict`` contains a ``"url"`` key whose value is a relative local
+ path, the path is prepended with *base_dir* so that it becomes absolute.
+
+ Args:
+ value: An arbitrary JSON-decoded value (dict, list, str, etc.).
+ base_dir: The directory against which relative paths are resolved.
+
+ Returns:
+ The value with relative ``url`` entries resolved.
+ """
+ if isinstance(value, dict):
+ value_dict = cast("dict[str, Any]", value)
+ result: dict[str, Any] = {}
+ for key, val in value_dict.items():
+ if key == "url" and isinstance(val, str) and is_relative_local_path(val):
+ result[key] = str(base_dir / val)
+ else:
+ result[key] = resolve_url_in_value(val, base_dir)
+ return result
+
+ if isinstance(value, list):
+ value_list = cast("list[Any]", value)
+ return [resolve_url_in_value(item, base_dir) for item in value_list]
+
+ return value
+
+
+def resolve_inputs_paths(inputs_dict: dict[str, Any], base_dir: Path) -> dict[str, Any]:
+ """Resolve relative ``url`` paths in a pipeline inputs dict.
+
+ Entry point that applies :func:`resolve_url_in_value` to each top-level
+ value in *inputs_dict*.
+
+ Args:
+ inputs_dict: The parsed pipeline inputs dictionary.
+ base_dir: The directory to resolve relative paths against (typically
+ the parent directory of the ``inputs.json`` file).
+
+ Returns:
+ A new dict with all relative ``url`` values resolved to absolute paths.
+ """
+ resolved: dict[str, Any] = {}
+ for key, value in inputs_dict.items():
+ resolved[key] = resolve_url_in_value(value, base_dir)
+ return resolved
diff --git a/pipelex/cli/commands/run/_run_core.py b/pipelex/cli/commands/run/_run_core.py
index 05cfea31b..30e1f88f3 100644
--- a/pipelex/cli/commands/run/_run_core.py
+++ b/pipelex/cli/commands/run/_run_core.py
@@ -10,6 +10,7 @@ from posthog import tag
from pipelex import log
from pipelex.base_exceptions import PipelexError
from pipelex.cli.cli_factory import make_pipelex_for_cli
+from pipelex.cli.commands.run._inputs_path_resolver import resolve_inputs_paths
from pipelex.cli.error_handlers import (
ErrorContext,
handle_model_availability_error,
@@ -94,6 +95,9 @@ async def _execute_run(
else:
try:
pipeline_inputs = load_json_dict_from_path(inputs)
+ # Resolve relative url paths against the inputs file's parent directory
+ base_dir = Path(inputs).parent.resolve()
+ pipeline_inputs = resolve_inputs_paths(pipeline_inputs, base_dir)
typer.echo(f"Loaded inputs from: {inputs}")
except FileNotFoundError as file_not_found_exc:
typer.secho(f"Failed to load input file '{inputs}': file not found", fg=typer.colors.RED, err=True)
diff --git a/pipelex/cli/commands/run/app.py b/pipelex/cli/commands/run/app.py
index 94a99eced..a7090b0ff 100644
--- a/pipelex/cli/commands/run/app.py
+++ b/pipelex/cli/commands/run/app.py
@@ -1,9 +1,11 @@
import typer
+from pipelex.cli.commands.run.bundle_cmd import run_bundle_cmd
from pipelex.cli.commands.run.method_cmd import run_method_cmd
from pipelex.cli.commands.run.pipe_cmd import run_pipe_cmd
-run_app = typer.Typer(help="Run a method or pipe", no_args_is_help=True)
+run_app = typer.Typer(help="Run a method, pipe, or bundle", no_args_is_help=True)
run_app.command("method", help="Run an installed method by name")(run_method_cmd)
-run_app.command("pipe", help="Run a pipe by code, bundle file (.mthds), or pipeline directory")(run_pipe_cmd)
+run_app.command("pipe", help="Run a pipe by code")(run_pipe_cmd)
+run_app.command("bundle", help="Run a pipeline from a bundle file (.mthds) or directory")(run_bundle_cmd)
diff --git a/pipelex/cli/commands/run/bundle_cmd.py b/pipelex/cli/commands/run/bundle_cmd.py
new file mode 100644
index 000000000..33971145a
--- /dev/null
+++ b/pipelex/cli/commands/run/bundle_cmd.py
@@ -0,0 +1,163 @@
+from __future__ import annotations
+
+from pathlib import Path
+from typing import Annotated
+
+import typer
+
+from pipelex.builder.conventions import DEFAULT_BUNDLE_FILE_NAME, DEFAULT_INPUTS_FILE_NAME
+from pipelex.cli.commands.run._run_core import COMMAND, execute_run
+from pipelex.core.interpreter.helpers import MTHDS_EXTENSION, is_pipelex_file
+
+
+def run_bundle_cmd(
+ path: Annotated[
+ str,
+ typer.Argument(help="Path to a .mthds bundle file or a pipeline directory"),
+ ],
+ pipe: Annotated[
+ str | None,
+ typer.Option("--pipe", help="Pipe code to run (overrides bundle's main_pipe)"),
+ ] = None,
+ inputs: Annotated[
+ str | None,
+ typer.Option("--inputs", "-i", help="Path to JSON file with inputs"),
+ ] = None,
+ save_working_memory: Annotated[
+ bool,
+ typer.Option("--save-working-memory/--no-save-working-memory", help="Save working memory to JSON file"),
+ ] = True,
+ working_memory_path: Annotated[
+ str | None,
+ typer.Option("--working-memory-path", help="Custom path to save working memory JSON"),
+ ] = None,
+ save_main_stuff: Annotated[
+ bool,
+ typer.Option("--save-main-stuff/--no-save-main-stuff", help="Save main_stuff in JSON and Markdown formats"),
+ ] = True,
+ no_pretty_print: Annotated[
+ bool,
+ typer.Option("--no-pretty-print", help="Skip pretty printing the main_stuff"),
+ ] = False,
+ graph: Annotated[
+ bool | None,
+ typer.Option(
+ "--graph/--no-graph",
+ help="Override config: enable or disable execution graph outputs (JSON, Mermaid, HTML)",
+ ),
+ ] = None,
+ graph_full_data: Annotated[
+ bool | None,
+ typer.Option(
+ "--graph-full-data/--graph-no-data",
+ help="Override config: include or exclude full serialized data in graph",
+ ),
+ ] = None,
+ output_dir: Annotated[
+ str,
+ typer.Option("--output-dir", "-o", help="Base directory for all outputs (working memory, main_stuff, graphs)"),
+ ] = "results",
+ dry_run: Annotated[
+ bool,
+ typer.Option("--dry-run", help="Run pipeline in dry mode (no actual inference calls)"),
+ ] = False,
+ mock_inputs: Annotated[
+ bool,
+ typer.Option("--mock-inputs", help="Generate mock data for missing required inputs (requires --dry-run)"),
+ ] = False,
+ library_dir: Annotated[
+ list[str] | None,
+ typer.Option("--library-dir", "-L", help="Directory to search for pipe definitions (.mthds files). Can be specified multiple times."),
+ ] = None,
+) -> None:
+ """Run a pipeline from a bundle file (.mthds) or pipeline directory.
+
+ Examples:
+ pipelex run bundle pipeline_01/
+ pipelex run bundle pipeline_01/ --pipe my_pipe
+ pipelex run bundle my_bundle.mthds
+ pipelex run bundle my_bundle.mthds --pipe my_pipe --inputs data.json
+ pipelex run bundle pipeline_01/ --dry-run
+ """
+ # Validate --mock-inputs requires --dry-run
+ if mock_inputs and not dry_run:
+ typer.secho(
+ "Failed to run: --mock-inputs requires --dry-run",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+
+ pipe_code: str | None = pipe
+ bundle_path: str | None = None
+ target_path = Path(path)
+
+ if target_path.is_dir():
+ # Directory mode: auto-detect bundle and inputs
+ bundle_file = target_path / DEFAULT_BUNDLE_FILE_NAME
+ if bundle_file.is_file():
+ bundle_path = str(bundle_file)
+ else:
+ mthds_files = list(target_path.glob(f"*{MTHDS_EXTENSION}"))
+ if len(mthds_files) == 0:
+ typer.secho(
+ f"Failed to run: no .mthds bundle file found in directory '{path}'",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+ if len(mthds_files) > 1:
+ mthds_names = ", ".join(mthds_file.name for mthds_file in mthds_files)
+ typer.secho(
+ f"Failed to run: multiple .mthds files found in '{path}' ({mthds_names}) "
+ f"and no '{DEFAULT_BUNDLE_FILE_NAME}'. "
+ f"Pass the .mthds file directly, e.g.: pipelex run bundle {target_path / mthds_files[0].name}",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+ bundle_path = str(mthds_files[0])
+
+ # Auto-detect inputs if --inputs not explicitly provided
+ inputs_file = target_path / DEFAULT_INPUTS_FILE_NAME
+ if not inputs and inputs_file.is_file():
+ inputs = str(inputs_file)
+ typer.echo(f"Auto-detected inputs: {inputs}")
+
+ # Add directory as library dir
+ target_dir_str = str(target_path)
+ if library_dir is None:
+ library_dir = [target_dir_str]
+ elif target_dir_str not in library_dir:
+ library_dir = [target_dir_str, *library_dir]
+
+ typer.echo(f"Auto-detected bundle: {bundle_path}")
+
+ elif is_pipelex_file(target_path):
+ bundle_path = path
+ else:
+ typer.secho(
+ f"Failed to run: '{path}' is not a .mthds file or directory.\n"
+ f" To run a pipe by code, use: pipelex run pipe <code>\n"
+ f" To run a bundle, pass a .mthds file or directory: pipelex run bundle <path>",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+
+ execute_run(
+ pipe_code=pipe_code,
+ bundle_path=bundle_path,
+ inputs=inputs,
+ save_working_memory=save_working_memory,
+ working_memory_path=working_memory_path,
+ save_main_stuff=save_main_stuff,
+ no_pretty_print=no_pretty_print,
+ graph=graph,
+ graph_full_data=graph_full_data,
+ output_dir=output_dir,
+ dry_run=dry_run,
+ mock_inputs=mock_inputs,
+ library_dir=library_dir,
+ telemetry_command_label=f"{COMMAND} bundle",
+ )
diff --git a/pipelex/cli/commands/run/pipe_cmd.py b/pipelex/cli/commands/run/pipe_cmd.py
index 237d1af01..67c7926fb 100644
--- a/pipelex/cli/commands/run/pipe_cmd.py
+++ b/pipelex/cli/commands/run/pipe_cmd.py
@@ -3,28 +3,18 @@ from __future__ import annotations
from pathlib import Path
from typing import Annotated
-import click
import typer
-from pipelex.builder.conventions import DEFAULT_BUNDLE_FILE_NAME, DEFAULT_INPUTS_FILE_NAME
from pipelex.cli.commands.run._run_core import COMMAND, execute_run
from pipelex.cli.method_resolver import resolve_pipe_from_exports
from pipelex.core.interpreter.helpers import MTHDS_EXTENSION, is_pipelex_file
def run_pipe_cmd(
- target: Annotated[
- str | None,
- typer.Argument(help="Pipe code, bundle file path (.mthds), or pipeline directory (auto-detected)"),
- ] = None,
- pipe: Annotated[
- str | None,
- typer.Option("--pipe", help="Pipe code to run, can be omitted if you specify a bundle (.mthds) that declares a main pipe"),
- ] = None,
- bundle: Annotated[
- str | None,
- typer.Option("--bundle", help="Bundle file path (.mthds) - runs its main_pipe unless you specify a pipe code"),
- ] = None,
+ pipe_code: Annotated[
+ str,
+ typer.Argument(help="Pipe code to run"),
+ ],
inputs: Annotated[
str | None,
typer.Option("--inputs", "-i", help="Path to JSON file with inputs"),
@@ -76,25 +66,24 @@ def run_pipe_cmd(
typer.Option("--library-dir", "-L", help="Directory to search for pipe definitions (.mthds files). Can be specified multiple times."),
] = None,
) -> None:
- """Run a pipe by code, bundle file (.mthds), or pipeline directory.
+ """Run a pipe by code.
Examples:
pipelex run pipe my_pipe
- pipelex run pipe --bundle my_bundle.mthds
- pipelex run pipe --bundle my_bundle.mthds --pipe my_pipe
- pipelex run pipe --pipe my_pipe --inputs data.json
- pipelex run pipe my_bundle.mthds --inputs data.json
- pipelex run pipe pipeline_01/
- pipelex run pipe pipeline_01/ --pipe my_pipe
+ pipelex run pipe my_pipe --inputs data.json
pipelex run pipe my_pipe --dry-run
pipelex run pipe my_pipe --dry-run --mock-inputs
"""
- # Validate mutual exclusivity
- provided_options = sum([target is not None, pipe is not None, bundle is not None])
- if provided_options == 0:
- ctx: click.Context = click.get_current_context()
- typer.echo(ctx.get_help())
- raise typer.Exit(0)
+ # Helpful error if the user passes a path instead of a pipe code
+ target_path = Path(pipe_code)
+ if target_path.is_dir() or is_pipelex_file(target_path) or pipe_code.endswith(MTHDS_EXTENSION):
+ typer.secho(
+ f"Failed to run: '{pipe_code}' looks like a file path or directory.\n"
+ f" To run from a bundle or directory, use: pipelex run bundle {pipe_code}",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
# Validate --mock-inputs requires --dry-run
if mock_inputs and not dry_run:
@@ -105,108 +94,25 @@ def run_pipe_cmd(
)
raise typer.Exit(1)
- pipe_code: str | None = None
- bundle_path: str | None = None
-
- # Determine source
- if target:
- target_path = Path(target)
- if target_path.is_dir():
- # Directory mode: auto-detect bundle and inputs
- if bundle:
- typer.secho(
- "Failed to run: cannot use option --bundle when passing a pipeline directory as target",
- fg=typer.colors.RED,
- err=True,
- )
- raise typer.Exit(1)
-
- bundle_file = target_path / DEFAULT_BUNDLE_FILE_NAME
- if bundle_file.is_file():
- bundle_path = str(bundle_file)
- else:
- mthds_files = list(target_path.glob(f"*{MTHDS_EXTENSION}"))
- if len(mthds_files) == 0:
- typer.secho(
- f"Failed to run: no .mthds bundle file found in directory '{target}'",
- fg=typer.colors.RED,
- err=True,
- )
- raise typer.Exit(1)
- if len(mthds_files) > 1:
- mthds_names = ", ".join(mthds_file.name for mthds_file in mthds_files)
- typer.secho(
- f"Failed to run: multiple .mthds files found in '{target}' ({mthds_names}) "
- f"and no '{DEFAULT_BUNDLE_FILE_NAME}'. "
- f"Pass the .mthds file directly, e.g.: pipelex run pipe {target_path / mthds_files[0].name}",
- fg=typer.colors.RED,
- err=True,
- )
- raise typer.Exit(1)
- bundle_path = str(mthds_files[0])
-
- # Auto-detect inputs if --inputs not explicitly provided
- inputs_file = target_path / DEFAULT_INPUTS_FILE_NAME
- if not inputs and inputs_file.is_file():
- inputs = str(inputs_file)
- typer.echo(f"Auto-detected inputs: {inputs}")
-
- # Add directory as library dir
- target_dir_str = str(target_path)
- if library_dir is None:
- library_dir = [target_dir_str]
- elif target_dir_str not in library_dir:
- library_dir = [target_dir_str, *library_dir]
-
- if pipe:
- pipe_code = pipe
- pipe = None
-
- typer.echo(f"Auto-detected bundle: {bundle_path}")
-
- elif is_pipelex_file(target_path):
- bundle_path = target
- if bundle:
- typer.secho(
- "Failed to run: cannot use option --bundle if you're already passing a bundle file (.mthds) as positional argument",
- fg=typer.colors.RED,
- err=True,
- )
- raise typer.Exit(1)
- else:
- pipe_code = target
- if pipe:
- typer.secho(
- "Failed to run: cannot use option --pipe if you're already passing a pipe code as positional argument",
- fg=typer.colors.RED,
- err=True,
- )
- raise typer.Exit(1)
-
- if bundle:
- assert not bundle_path, "bundle_path should be None at this stage if --bundle is provided"
- bundle_path = bundle
-
- if pipe:
- assert not pipe_code, "pipe_code should be None at this stage if --pipe is provided"
- pipe_code = pipe
-
- if not pipe_code and not bundle_path:
- typer.secho("Failed to run: no pipe code or bundle file specified", fg=typer.colors.RED, err=True)
- raise typer.Exit(1)
-
- # If running a bare pipe code, check installed methods' exports for additional library dirs
- if pipe_code and not bundle_path:
+ # Check installed methods' exports for additional library dirs
+ try:
extra_dirs = resolve_pipe_from_exports(pipe_code)
- if extra_dirs:
- if library_dir is None:
- library_dir = extra_dirs
- else:
- library_dir = [*extra_dirs, *library_dir]
+ except ValueError as exc:
+ typer.secho(
+ f"Ambiguous pipe code '{pipe_code}': {exc}",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1) from exc
+ if extra_dirs:
+ if library_dir is None:
+ library_dir = extra_dirs
+ else:
+ library_dir = [*extra_dirs, *library_dir]
execute_run(
pipe_code=pipe_code,
- bundle_path=bundle_path,
+ bundle_path=None,
inputs=inputs,
save_working_memory=save_working_memory,
working_memory_path=working_memory_path,
diff --git a/pipelex/cli/commands/validate/app.py b/pipelex/cli/commands/validate/app.py
index c262ff113..309061423 100644
--- a/pipelex/cli/commands/validate/app.py
+++ b/pipelex/cli/commands/validate/app.py
@@ -1,9 +1,52 @@
+import click
import typer
+import typer.core
+from typing_extensions import override
+from pipelex.cli.commands.validate.bundle_cmd import validate_bundle_cmd
from pipelex.cli.commands.validate.method_cmd import validate_method_cmd
from pipelex.cli.commands.validate.pipe_cmd import validate_pipe_cmd
-validate_app = typer.Typer(help="Validate a method or pipe", no_args_is_help=True)
+
+class _ValidateGroup(typer.core.TyperGroup):
+ """Custom TyperGroup that defaults to the 'pipe' subcommand.
+
+ When no recognized subcommand is given but there are arguments (like --all
+ or a pipe code), prepends 'pipe' so that:
+ pipelex validate --all → pipelex validate pipe --all
+ pipelex validate my_pipe → pipelex validate pipe my_pipe
+ """
+
+ @override
+ def parse_args(self, ctx: click.Context, args: list[str]) -> list[str]:
+ if not args:
+ return super().parse_args(ctx, args)
+
+ # Don't intercept --help
+ if "--help" in args or "-h" in args:
+ return super().parse_args(ctx, args)
+
+ # Find the first non-option argument
+ first_positional: str | None = None
+ for arg in args:
+ if not arg.startswith("-"):
+ first_positional = arg
+ break
+
+ # If no positional arg (only flags like --all), or the first positional
+ # is not a known subcommand, default to 'pipe'
+ if first_positional is None or first_positional not in self.commands:
+ args = ["pipe", *args]
+
+ return super().parse_args(ctx, args)
+
+
+validate_app = typer.Typer(
+ help="Validate a method, pipe, or bundle",
+ cls=_ValidateGroup,
+ no_args_is_help=True,
+)
validate_app.command("method", help="Validate an installed method by name")(validate_method_cmd)
-validate_app.command("pipe", help="Validate a pipe by code, bundle file, or all pipes")(validate_pipe_cmd)
+validate_app.command("pipe", help="Validate a pipe by code, or all pipes")(validate_pipe_cmd)
+validate_app.command("bundle", help="Validate a bundle file (.mthds) or pipeline directory")(validate_bundle_cmd)
diff --git a/pipelex/cli/commands/validate/bundle_cmd.py b/pipelex/cli/commands/validate/bundle_cmd.py
new file mode 100644
index 000000000..58844454e
--- /dev/null
+++ b/pipelex/cli/commands/validate/bundle_cmd.py
@@ -0,0 +1,90 @@
+from __future__ import annotations
+
+from pathlib import Path
+from typing import Annotated
+
+import typer
+
+from pipelex.builder.conventions import DEFAULT_BUNDLE_FILE_NAME
+from pipelex.cli.commands.validate._validate_core import COMMAND, execute_validate
+from pipelex.core.interpreter.helpers import MTHDS_EXTENSION, is_pipelex_file
+
+
+def validate_bundle_cmd(
+ path: Annotated[
+ str,
+ typer.Argument(help="Path to a .mthds bundle file or a pipeline directory"),
+ ],
+ library_dir: Annotated[
+ list[str] | None,
+ typer.Option(
+ "--library-dir",
+ "-L",
+ help="Directory to search for pipe definitions (.mthds files). Can be specified multiple times.",
+ ),
+ ] = None,
+) -> None:
+ """Validate a bundle file (.mthds) or pipeline directory.
+
+ Examples:
+ pipelex validate bundle my_bundle.mthds
+ pipelex validate bundle pipeline_01/
+ """
+ bundle_path: str | None = None
+ target_path = Path(path)
+
+ if target_path.is_dir():
+ # Directory mode: auto-detect bundle file
+ bundle_file = target_path / DEFAULT_BUNDLE_FILE_NAME
+ if bundle_file.is_file():
+ bundle_path = str(bundle_file)
+ else:
+ mthds_files = list(target_path.glob(f"*{MTHDS_EXTENSION}"))
+ if len(mthds_files) == 0:
+ typer.secho(
+ f"Failed to validate: no .mthds bundle file found in directory '{path}'",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+ if len(mthds_files) > 1:
+ mthds_names = ", ".join(mthds_file.name for mthds_file in mthds_files)
+ typer.secho(
+ f"Failed to validate: multiple .mthds files found in '{path}' ({mthds_names}) "
+ f"and no '{DEFAULT_BUNDLE_FILE_NAME}'. "
+ f"Pass the .mthds file directly, e.g.: pipelex validate bundle {target_path / mthds_files[0].name}",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+ bundle_path = str(mthds_files[0])
+
+ # Add directory as library dir
+ target_dir_str = str(target_path)
+ if library_dir is None:
+ library_dir = [target_dir_str]
+ elif target_dir_str not in library_dir:
+ library_dir = [target_dir_str, *library_dir]
+
+ typer.echo(f"Auto-detected bundle: {bundle_path}")
+
+ elif is_pipelex_file(target_path):
+ bundle_path = path
+ else:
+ typer.secho(
+ f"Failed to validate: '{path}' is not a .mthds file or directory.\n"
+ f" To validate a pipe by code, use: pipelex validate pipe <code>\n"
+ f" To validate a bundle, pass a .mthds file or directory: pipelex validate bundle <path>",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
+
+ library_dirs_paths = [Path(lib_dir) for lib_dir in library_dir] if library_dir else None
+
+ execute_validate(
+ pipe_code=None,
+ bundle_path=Path(bundle_path) if bundle_path else None,
+ library_dirs=library_dirs_paths,
+ telemetry_command_label=f"{COMMAND} bundle",
+ )
diff --git a/pipelex/cli/commands/validate/pipe_cmd.py b/pipelex/cli/commands/validate/pipe_cmd.py
index d23594855..2328b38a4 100644
--- a/pipelex/cli/commands/validate/pipe_cmd.py
+++ b/pipelex/cli/commands/validate/pipe_cmd.py
@@ -3,7 +3,6 @@ from __future__ import annotations
from pathlib import Path
from typing import Annotated
-import click
import typer
from pipelex.cli.cli_factory import make_pipelex_for_cli
@@ -13,25 +12,15 @@ from pipelex.cli.commands.validate._validate_core import (
execute_validate,
)
from pipelex.cli.error_handlers import ErrorContext
-from pipelex.core.interpreter.helpers import is_pipelex_file
+from pipelex.cli.method_resolver import resolve_pipe_from_exports
+from pipelex.core.interpreter.helpers import MTHDS_EXTENSION, is_pipelex_file
from pipelex.pipelex import Pipelex
def validate_pipe_cmd(
- target: Annotated[
+ pipe_code: Annotated[
str | None,
- typer.Argument(help="Pipe code or bundle file path (auto-detected based on .mthds extension)"),
- ] = None,
- pipe: Annotated[
- str | None,
- typer.Option("--pipe", help="Pipe code to validate (optional when using --bundle)"),
- ] = None,
- bundle: Annotated[
- str | None,
- typer.Option(
- "--bundle",
- help="Bundle file path (.mthds) - validates all pipes in the bundle",
- ),
+ typer.Argument(help="Pipe code to validate"),
] = None,
validate_all: Annotated[
bool,
@@ -46,19 +35,17 @@ def validate_pipe_cmd(
),
] = None,
) -> None:
- """Validate and dry run a pipe or a bundle or all pipes.
+ """Validate and dry run a pipe by code, or all pipes.
Examples:
pipelex validate pipe my_pipe
- pipelex validate pipe my_bundle.mthds
- pipelex validate pipe --bundle my_bundle.mthds
- pipelex validate pipe --bundle my_bundle.mthds --pipe my_pipe
pipelex validate pipe --all
+ pipelex validate pipe my_pipe -L ./my_pipes
"""
if validate_all:
- if target or pipe or bundle:
+ if pipe_code:
typer.secho(
- "Failed to validate: --all cannot be used with a target, --pipe, or --bundle",
+ "Failed to validate: --all cannot be used with a pipe code",
fg=typer.colors.RED,
err=True,
)
@@ -74,58 +61,47 @@ def validate_pipe_cmd(
Pipelex.teardown_if_needed()
return
- # Validate mutual exclusivity
- provided_options = sum([target is not None, pipe is not None, bundle is not None])
- if provided_options == 0:
- ctx: click.Context = click.get_current_context()
- typer.echo(ctx.get_help())
- raise typer.Exit(0)
-
- pipe_code: str | None = None
- bundle_path: Path | None = None
- library_dirs = [Path(lib_dir) for lib_dir in library_dir] if library_dir else None
-
- # Determine source
- if target:
- target_path = Path(target)
- if is_pipelex_file(target_path):
- bundle_path = target_path
- if bundle:
- typer.secho(
- "Failed to validate: cannot use option --bundle if you're already passing a bundle file (.mthds) as positional argument",
- fg=typer.colors.RED,
- err=True,
- )
- raise typer.Exit(1)
- else:
- pipe_code = target
- if pipe:
- typer.secho(
- "Failed to validate: cannot use option --pipe if you're already passing a pipe code as positional argument",
- fg=typer.colors.RED,
- err=True,
- )
- raise typer.Exit(1)
-
- if bundle:
- assert not bundle_path, "bundle_path should be None at this stage if --bundle is provided"
- bundle_path = Path(bundle)
-
- if pipe:
- assert not pipe_code, "pipe_code should be None at this stage if --pipe is provided"
- pipe_code = pipe
+ if not pipe_code:
+ typer.secho(
+ "Failed to validate: no pipe code specified. Use --all to validate all pipes,\n"
+ "or use 'pipelex validate bundle <path>' to validate a bundle file.",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1)
- if not pipe_code and not bundle_path:
+ # Helpful error if the user passes a path instead of a pipe code
+ target_path = Path(pipe_code)
+ if target_path.is_dir() or is_pipelex_file(target_path) or pipe_code.endswith(MTHDS_EXTENSION):
typer.secho(
- "Failed to validate: no pipe code or bundle file specified",
+ f"Failed to validate: '{pipe_code}' looks like a file path or directory.\n"
+ f" To validate a bundle or directory, use: pipelex validate bundle {pipe_code}",
fg=typer.colors.RED,
err=True,
)
raise typer.Exit(1)
+ # Check installed methods' exports for additional library dirs
+ try:
+ extra_dirs = resolve_pipe_from_exports(pipe_code)
+ except ValueError as exc:
+ typer.secho(
+ f"Ambiguous pipe code '{pipe_code}': {exc}",
+ fg=typer.colors.RED,
+ err=True,
+ )
+ raise typer.Exit(1) from exc
+ if extra_dirs:
+ if library_dir is None:
+ library_dir = extra_dirs
+ else:
+ library_dir = [*extra_dirs, *library_dir]
+
+ library_dirs_paths = [Path(lib_dir) for lib_dir in library_dir] if library_dir else None
+
execute_validate(
pipe_code=pipe_code,
- bundle_path=bundle_path,
- library_dirs=library_dirs,
+ bundle_path=None,
+ library_dirs=library_dirs_paths,
telemetry_command_label=f"{COMMAND} pipe",
)
diff --git a/pipelex/cli/installed_methods.py b/pipelex/cli/installed_methods.py
index 6c78700af..2f36526ff 100644
--- a/pipelex/cli/installed_methods.py
+++ b/pipelex/cli/installed_methods.py
@@ -43,6 +43,7 @@ class InstalledMethod(BaseModel):
def discover_installed_methods(
include_global: bool = True,
include_project: bool = True,
+ extra_search_dirs: list[Path] | None = None,
) -> list[InstalledMethod]:
"""Scan ~/.mthds/methods/ and ./.mthds/methods/ for installed methods.
@@ -53,6 +54,7 @@ def discover_installed_methods(
Args:
include_global: Whether to scan the global methods directory
include_project: Whether to scan the project-local methods directory
+ extra_search_dirs: Additional .mthds/methods/ directories to scan
Returns:
A list of discovered installed methods
@@ -67,6 +69,13 @@ def discover_installed_methods(
dirs_to_scan.append(project_dir)
seen_dirs.add(project_dir)
+ if extra_search_dirs:
+ for extra_dir in extra_search_dirs:
+ resolved = extra_dir.resolve()
+ if resolved.is_dir() and resolved not in seen_dirs:
+ dirs_to_scan.append(resolved)
+ seen_dirs.add(resolved)
+
if include_global:
global_dir = GLOBAL_METHODS_DIR.resolve()
if global_dir.is_dir() and global_dir not in seen_dirs:
@@ -171,6 +180,37 @@ def discover_methods_from_library_dirs(
return methods
+def find_method_by_full_address(
+ full_address: str,
+ methods: list[InstalledMethod] | None = None,
+ extra_search_dirs: list[Path] | None = None,
+) -> InstalledMethod | None:
+ """Find an installed method by its full address (manifest address + "/" + name).
+
+ The full address is computed as ``manifest.address + "/" + name`` for each
+ discovered installed method. For example, a package with
+ ``address = "github.com/Pipelex/methods"`` and ``name = "documents"`` has
+ the full address ``"github.com/Pipelex/methods/documents"``.
+
+ Args:
+ full_address: The full package address to search for
+ methods: Pre-discovered methods list; if None, runs discovery
+ extra_search_dirs: Additional .mthds/methods/ directories to scan
+
+ Returns:
+ The matching InstalledMethod, or None if no match is found
+ """
+ if methods is None:
+ methods = discover_installed_methods(extra_search_dirs=extra_search_dirs)
+
+ for method in methods:
+ candidate_address = f"{method.manifest.address}/{method.name}"
+ if candidate_address == full_address:
+ return method
+
+ return None
+
+
def find_method_by_name(
method_name: str,
methods: list[InstalledMethod] | None = None,
diff --git a/pipelex/cli/method_resolver.py b/pipelex/cli/method_resolver.py
index 681721e80..059b91450 100644
--- a/pipelex/cli/method_resolver.py
+++ b/pipelex/cli/method_resolver.py
@@ -126,17 +126,10 @@ def resolve_pipe_from_exports(
Library dirs if the pipe code was found in an installed method, None otherwise.
Raises:
- typer.Exit: If the pipe code is found in multiple methods (ambiguous).
+ ValueError: If the pipe code is found in multiple methods (ambiguous).
"""
try:
method = _find_method_by_exported_pipe(pipe_code)
return [str(method.path)]
except LookupError:
return None
- except ValueError as exc:
- typer.secho(
- f"Ambiguous pipe code '{pipe_code}': {exc}",
- fg=typer.colors.RED,
- err=True,
- )
- raise typer.Exit(1) from exc
diff --git a/pipelex/core/qualified_ref.py b/pipelex/core/qualified_ref.py
index 746944f5d..ab6a3aa32 100644
--- a/pipelex/core/qualified_ref.py
+++ b/pipelex/core/qualified_ref.py
@@ -153,6 +153,21 @@ class QualifiedRef(BaseModel):
return False
return self.domain_path != domain
+ @staticmethod
+ def is_address_based_alias(alias: str) -> bool:
+ """True if alias looks like a package address (contains '/').
+
+ Regular aliases (e.g., "documents") never contain '/'.
+ Address-based aliases (e.g., "github.com/Pipelex/methods/documents") always do.
+
+ Args:
+ alias: The alias string to check
+
+ Returns:
+ True if the alias contains '/'
+ """
+ return "/" in alias
+
@staticmethod
def has_cross_package_prefix(raw: str) -> bool:
"""Check if a raw reference string contains the cross-package '->' prefix.
diff --git a/pipelex/kit/agent_rules/codex_commands.md b/pipelex/kit/agent_rules/codex_commands.md
index 92becc975..a3775d562 100644
--- a/pipelex/kit/agent_rules/codex_commands.md
+++ b/pipelex/kit/agent_rules/codex_commands.md
@@ -61,7 +61,7 @@
Key commands:
- - **`generate-mthds-schema`**: Regenerate the MTHDS JSON Schema (`.pipelex/mthds_schema.json`). Run this after modifying `mthds_schema_generator.py`.
+ - **`generate-mthds-schema`**: Regenerate the MTHDS JSON Schema (`derived/mthds_schema.json`). Run this after modifying `mthds_schema_generator.py`.
```bash
.venv/bin/pipelex-dev generate-mthds-schema
diff --git a/pipelex/kit/agent_rules/commands.md b/pipelex/kit/agent_rules/commands.md
index 3d5f4356a..b257c7d01 100644
--- a/pipelex/kit/agent_rules/commands.md
+++ b/pipelex/kit/agent_rules/commands.md
@@ -97,7 +97,7 @@
Key commands:
- - **`generate-mthds-schema`**: Regenerate the MTHDS JSON Schema (`.pipelex/mthds_schema.json`). Run this after modifying `mthds_schema_generator.py`.
+ - **`generate-mthds-schema`**: Regenerate the MTHDS JSON Schema (`derived/mthds_schema.json`). Run this after modifying `mthds_schema_generator.py`.
```bash
.venv/bin/pipelex-dev generate-mthds-schema
diff --git a/pipelex/libraries/library.py b/pipelex/libraries/library.py
index 8e75668fc..94b6852b7 100644
--- a/pipelex/libraries/library.py
+++ b/pipelex/libraries/library.py
@@ -93,7 +93,12 @@ class Library(BaseModel):
self.validate_pipe_library_with_libraries()
def validate_pipe_library_with_libraries(self) -> None:
- for pipe in self.pipe_library.get_pipes():
+ for pipe_key, pipe in self.pipe_library.root.items():
+ # Determine if this pipe comes from a dependency (aliased key like "alias->pipe_code")
+ dep_alias: str | None = None
+ if QualifiedRef.has_cross_package_prefix(pipe_key):
+ dep_alias, _remainder = QualifiedRef.split_cross_package_ref(pipe_key)
+
# Validate concept dependencies exist
# Note: This should NEVER fail as concepts are validated during pipe construction via get_required_concept()
# TODO: Make this non mandatory in production, or a test
@@ -115,6 +120,11 @@ class Library(BaseModel):
# Cross-package refs that aren't loaded are validated at package level, not library level
if QualifiedRef.has_cross_package_prefix(sub_pipe_code) and self.pipe_library.get_optional_pipe(sub_pipe_code) is None:
continue
+ # For dependency pipes, look up bare sub-pipe codes in the child library
+ if dep_alias is not None and not QualifiedRef.has_cross_package_prefix(sub_pipe_code):
+ child_library = self.dependency_libraries.get(dep_alias)
+ if child_library is not None and child_library.pipe_library.get_optional_pipe(sub_pipe_code) is not None:
+ continue
try:
self.pipe_library.get_required_pipe(pipe_code=sub_pipe_code)
except PipeLibraryError as pipe_error:
diff --git a/pipelex/libraries/library_manager.py b/pipelex/libraries/library_manager.py
index 5f320c8db..8f2bc217a 100644
--- a/pipelex/libraries/library_manager.py
+++ b/pipelex/libraries/library_manager.py
@@ -4,7 +4,7 @@ from pathlib import Path
from typing import TYPE_CHECKING
from kajson.kajson_manager import KajsonManager
-from mthds.package.dependency_resolver import ResolvedDependency, resolve_all_dependencies
+from mthds.package.dependency_resolver import ResolvedDependency, determine_exported_pipes, resolve_all_dependencies
from mthds.package.discovery import find_package_manifest
from mthds.package.exceptions import DependencyResolveError, ManifestError
from mthds.package.manifest.schema import MTHDS_STANDARD_VERSION, MethodsManifest
@@ -13,6 +13,7 @@ from typing_extensions import override
from pipelex import log
from pipelex.builder import builder
+from pipelex.cli.installed_methods import find_method_by_full_address
from pipelex.core.bundles.pipelex_bundle_blueprint import PipelexBundleBlueprint
from pipelex.core.concepts.concept_factory import ConceptFactory
from pipelex.core.concepts.native.concept_native import NativeConceptCode
@@ -23,6 +24,7 @@ from pipelex.core.interpreter.exceptions import PipelexInterpreterError
from pipelex.core.interpreter.interpreter import PipelexInterpreter
from pipelex.core.pipes.pipe_abstract import PipeAbstract
from pipelex.core.pipes.pipe_factory import PipeFactory
+from pipelex.core.qualified_ref import QualifiedRef
from pipelex.core.stuffs.structured_content import StructuredContent
from pipelex.core.validation import report_validation_error
from pipelex.hub import get_current_library
@@ -47,6 +49,43 @@ if TYPE_CHECKING:
from pipelex.core.concepts.concept_blueprint import ConceptBlueprint
from pipelex.core.domains.domain import Domain
+MTHDS_METHODS_DIRNAME = ".mthds/methods"
+
+
+def _find_methods_dirs_from_blueprints(blueprints: list[PipelexBundleBlueprint]) -> list[Path]:
+ """Find .mthds/methods/ directories by walking up from blueprint source paths.
+
+ When a bundle file is located outside the CWD (e.g. validating a
+ pipelex-cookbook bundle from the pipelex repo), the standard discovery
+ only checks CWD/.mthds/methods/ and ~/.mthds/methods/. This function
+ walks up ancestor directories of each bundle source path to find
+ additional .mthds/methods/ directories.
+
+ Args:
+ blueprints: The parsed bundle blueprints (their ``source`` field
+ holds the original file path)
+
+ Returns:
+ Deduplicated list of existing .mthds/methods/ directories found
+ """
+ result: list[Path] = []
+ seen: set[Path] = set()
+ for blueprint in blueprints:
+ if not blueprint.source:
+ continue
+ current = Path(blueprint.source).resolve().parent
+ while True:
+ candidate = current / MTHDS_METHODS_DIRNAME
+ resolved_candidate = candidate.resolve()
+ if resolved_candidate not in seen and candidate.is_dir():
+ result.append(resolved_candidate)
+ seen.add(resolved_candidate)
+ parent = current.parent
+ if parent == current:
+ break
+ current = parent
+ return result
+
class LibraryManager(LibraryManagerAbstract):
def __init__(self):
@@ -295,6 +334,12 @@ class LibraryManager(LibraryManagerAbstract):
Returns:
List of all pipes that were loaded
"""
+ # Discover and load address-based cross-package dependencies before loading pipes
+ self._load_address_based_dependencies(
+ library_id=library_id,
+ blueprints=blueprints,
+ )
+
library = self.get_library(library_id=library_id)
all_pipes: list[PipeAbstract] = []
@@ -826,6 +871,99 @@ class LibraryManager(LibraryManagerAbstract):
log.verbose(f"Loaded dependency '{alias}': {len(dep_concepts)} concepts, pipes from {len(dep_blueprints)} bundles")
+ def _load_address_based_dependencies(
+ self,
+ library_id: str,
+ blueprints: list[PipelexBundleBlueprint],
+ ) -> None:
+ """Scan blueprints for cross-package pipe refs with address-based aliases and load them.
+
+ Collects all cross-package pipe references from controller blueprints
+ (sequences, batches, conditions, parallels), identifies those whose
+ alias contains '/' (i.e. a full package address), and loads each
+ unique address-based dependency.
+
+ Also searches for .mthds/methods/ directories relative to the bundle
+ source path, walking up ancestor directories to find installed methods
+ even when the CWD differs from the bundle's project root.
+
+ Args:
+ library_id: The library to load into
+ blueprints: The parsed bundle blueprints to scan
+ """
+ library = self.get_library(library_id=library_id)
+
+ # Collect unique address-based aliases from all pipe references
+ address_aliases: set[str] = set()
+ for blueprint in blueprints:
+ for pipe_ref_str, _context in blueprint.collect_pipe_references():
+ if QualifiedRef.has_cross_package_prefix(pipe_ref_str):
+ alias, _remainder = QualifiedRef.split_cross_package_ref(pipe_ref_str)
+ if QualifiedRef.is_address_based_alias(alias):
+ address_aliases.add(alias)
+
+ if not address_aliases:
+ return
+
+ # Derive extra search dirs from bundle source paths
+ extra_search_dirs = _find_methods_dirs_from_blueprints(blueprints)
+
+ for full_address in sorted(address_aliases):
+ if full_address in library.dependency_libraries:
+ continue
+ self._load_address_based_dependency(
+ library=library,
+ full_address=full_address,
+ extra_search_dirs=extra_search_dirs,
+ )
+
+ # Wire concept resolver after all deps are loaded
+ if address_aliases:
+ library.concept_library.set_concept_resolver(library.resolve_concept)
+
+ def _load_address_based_dependency(
+ self,
+ library: "Library",
+ full_address: str,
+ extra_search_dirs: list[Path] | None = None,
+ ) -> bool:
+ """Load an installed method package on demand using its full address.
+
+ Discovers the matching installed method, builds a ResolvedDependency,
+ and delegates to _load_single_dependency() to load it as a child
+ library with the full address as alias.
+
+ Args:
+ library: The main library to load into
+ full_address: The full package address (e.g. "github.com/Pipelex/methods/documents")
+ extra_search_dirs: Additional .mthds/methods/ directories to scan
+
+ Returns:
+ True if the dependency was successfully loaded, False otherwise
+ """
+ installed = find_method_by_full_address(full_address=full_address, extra_search_dirs=extra_search_dirs)
+ if installed is None:
+ log.warning(f"No installed method found for address '{full_address}'")
+ return False
+
+ exported_pipe_codes = determine_exported_pipes(manifest=installed.manifest)
+
+ resolved_dep = ResolvedDependency(
+ alias=full_address,
+ address=installed.manifest.address,
+ manifest=installed.manifest,
+ package_root=installed.path,
+ mthds_files=installed.mthds_files,
+ exported_pipe_codes=exported_pipe_codes,
+ )
+
+ self._load_single_dependency(
+ library=library,
+ resolved_dep=resolved_dep,
+ )
+
+ return True
+
def _remove_pipes_from_blueprint(self, blueprint: PipelexBundleBlueprint) -> None:
library = self.get_current_library()
if blueprint.pipe is not None:
diff --git a/pipelex/libraries/library_utils.py b/pipelex/libraries/library_utils.py
index a3bc1a8af..e78129e5d 100644
--- a/pipelex/libraries/library_utils.py
+++ b/pipelex/libraries/library_utils.py
@@ -28,7 +28,7 @@ def get_pipelex_mthds_files_from_package() -> list[Path]:
if not traversable.is_dir():
return
- for child in traversable.iterdir():
+ for child in sorted(traversable.iterdir(), key=lambda entry: entry.name):
if child.is_file() and is_pipelex_file(Path(child.name)):
mthds_path_str = str(child)
collected.append(Path(mthds_path_str))
diff --git a/pipelex/system/pipelex_service/pipelex_service_agreement.py b/pipelex/system/pipelex_service/pipelex_service_agreement.py
index 94b7784a7..afc53c3ff 100644
--- a/pipelex/system/pipelex_service/pipelex_service_agreement.py
+++ b/pipelex/system/pipelex_service/pipelex_service_agreement.py
@@ -18,13 +18,15 @@ class PipelexServiceAgreement(ConfigModel):
)
-def update_service_terms_acceptance(accepted: bool) -> None:
+def update_service_terms_acceptance(accepted: bool, config_dir: str | None = None) -> None:
"""Update the service terms acceptance in pipelex_service.toml.
Args:
accepted: Whether the user accepted the terms.
+ config_dir: Explicit config directory path. If None, uses config_manager.pipelex_config_dir.
"""
- service_config_path = os.path.join(config_manager.pipelex_config_dir, PIPELEX_SERVICE_CONFIG_FILE_NAME)
+ resolved_config_dir = config_dir or config_manager.pipelex_config_dir
+ service_config_path = os.path.join(resolved_config_dir, PIPELEX_SERVICE_CONFIG_FILE_NAME)
if path_exists(service_config_path):
toml_doc = load_toml_with_tomlkit(service_config_path)
diff --git a/pipelex/tools/misc/file_utils.py b/pipelex/tools/misc/file_utils.py
index 8d1eb7684..351ac0c8c 100644
--- a/pipelex/tools/misc/file_utils.py
+++ b/pipelex/tools/misc/file_utils.py
@@ -383,10 +383,13 @@ def find_files_in_dir(
path = Path(dir_path)
files: list[Path] = []
filtered_files: list[Path] = []
+ # Sort results for consistent ordering across platforms and Python versions.
+ # Python < 3.13 returns rglob/glob results in filesystem order, which varies
+ # between macOS (APFS, always sorted) and Linux (ext4, inode order).
if is_recursive:
- files = list(path.rglob(pattern))
+ files = sorted(path.rglob(pattern))
else:
- files = list(path.glob(pattern))
+ files = sorted(path.glob(pattern))
for file in files:
# Check if file is under any excluded directory
is_excluded = False
diff --git a/pyproject.toml b/pyproject.toml
index da9b5706c..a6429a3aa 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "pipelex"
-version = "0.18.1"
+version = "0.18.2"
description = "Execute composable AI methods declared in the MTHDS open standard"
authors = [{ name = "Evotis S.A.S.", email = "[email protected]" }]
maintainers = [{ name = "Pipelex staff", email = "[email protected]" }]
diff --git a/tests/helpers/init_cmd_helpers.py b/tests/helpers/init_cmd_helpers.py
index d23af1c23..799b3554a 100644
--- a/tests/helpers/init_cmd_helpers.py
+++ b/tests/helpers/init_cmd_helpers.py
@@ -250,6 +250,9 @@ class MockedInitEnvironment:
# Mock typer.echo to suppress output
self.mocker.patch("typer.echo")
+ # Mock prompt_credentials to avoid env-dependent Prompt.ask calls for missing API keys
+ self.mocker.patch("pipelex.cli.commands.init.command.prompt_credentials")
+
def get_backend_indices(self, backend_names: list[str]) -> list[int]:
"""Get 1-based indices for backend names.
diff --git a/tests/unit/pipelex/cli/test_agent_graph_cmd.py b/tests/unit/pipelex/cli/test_agent_graph_cmd.py
deleted file mode 100644
index 21c7f40e2..000000000
--- a/tests/unit/pipelex/cli/test_agent_graph_cmd.py
+++ /dev/null
@@ -1,322 +0,0 @@
-"""Unit tests for the agent CLI graph command."""
-
-from __future__ import annotations
-
-import asyncio
-import inspect
-import json
-from pathlib import Path
-from typing import TYPE_CHECKING, Any
-
-import pytest
-import typer
-
-if TYPE_CHECKING:
- from pytest_mock import MockerFixture
-
-from pipelex.base_exceptions import PipelexError
-from pipelex.cli.agent_cli.commands.graph_cmd import graph_cmd
-from pipelex.core.interpreter.exceptions import MthdsDecodeError, PipelexInterpreterError
-from pipelex.graph.graph_rendering import GraphFormat, generate_graph_for_bundle
-from pipelex.tools.misc.chart_utils import FlowchartDirection
-
-GRAPH_CMD_MODULE = "pipelex.cli.agent_cli.commands.graph_cmd"
-GRAPH_RENDERING_MODULE = "pipelex.graph.graph_rendering"
-
-
-class TestGraphCmd:
- """Tests for the graph command that generates HTML from a .mthds bundle."""
-
- def _mock_generate_graph_for_bundle(
- self,
- mocker: MockerFixture,
- *,
- pipe_code: str = "my_pipe",
- output_dir: str = "mock_output",
- direction: str | None = None,
- ) -> Any:
- """Mock generate_graph_for_bundle to return a successful result dict."""
- mocker.patch(f"{GRAPH_CMD_MODULE}.make_pipelex_for_agent_cli")
- mocker.patch(f"{GRAPH_CMD_MODULE}.Pipelex.teardown_if_needed")
-
- result = {
- "graph_files": {"reactflow_html": "graph/reactflow.html"},
- "graph_output_dir": output_dir,
- "pipe_code": pipe_code,
- "direction": direction,
- }
- return mocker.patch(
- f"{GRAPH_CMD_MODULE}.generate_graph_for_bundle",
- new=mocker.AsyncMock(return_value=result),
- )
-
- def test_valid_mthds_file_produces_success_json(
- self,
- agent_ctx: Any,
- mocker: MockerFixture,
- capsys: pytest.CaptureFixture[str],
- tmp_path: Path,
- ) -> None:
- """Valid .mthds file should produce success JSON with pipe_code and output_dir."""
- mthds_file = tmp_path / "bundle.mthds"
- mthds_file.write_text('[bundle]\nmain_pipe = "my_pipe"\n[domain]\ncode = "test"')
-
- self._mock_generate_graph_for_bundle(mocker, output_dir=str(tmp_path))
-
- graph_cmd(ctx=agent_ctx, target=str(mthds_file))
-
- parsed = json.loads(capsys.readouterr().out)
- assert parsed["success"] is True
- assert parsed["pipe_code"] == "my_pipe"
- assert "output_dir" in parsed
- assert "files" in parsed
-
- def test_valid_mthds_file_calls_generate_graph_once(
- self,
- agent_ctx: Any,
- mocker: MockerFixture,
- tmp_path: Path,
- ) -> None:
- """Valid .mthds file should call generate_graph_for_bundle once."""
- mthds_file = tmp_path / "bundle.mthds"
- mthds_file.write_text('[bundle]\nmain_pipe = "my_pipe"\n[domain]\ncode = "test"')
-
- mock_generate = self._mock_generate_graph_for_bundle(mocker)
-
- graph_cmd(ctx=agent_ctx, target=str(mthds_file))
-
- assert mock_generate.call_count == 1
-
- def test_non_mthds_file_produces_error(
- self,
- agent_ctx: Any,
- capsys: pytest.CaptureFixture[str],
- tmp_path: Path,
- ) -> None:
- """Non-MTHDS file (e.g. .json, .txt) should produce an ArgumentError."""
- json_file = tmp_path / "graphspec.json"
- json_file.write_text("{}")
-
- with pytest.raises(typer.Exit) as exc_info:
- graph_cmd(ctx=agent_ctx, target=str(json_file))
-
- assert exc_info.value.exit_code == 1
- parsed = json.loads(capsys.readouterr().err)
- assert parsed["error"] is True
- assert parsed["error_type"] == "ArgumentError"
- assert ".mthds" in parsed["message"]
-
- def test_file_not_found_produces_error(
- self,
- agent_ctx: Any,
- capsys: pytest.CaptureFixture[str],
- tmp_path: Path,
- ) -> None:
- """Missing file should produce a FileNotFoundError."""
- missing = tmp_path / "nonexistent.mthds"
-
- with pytest.raises(typer.Exit) as exc_info:
- graph_cmd(ctx=agent_ctx, target=str(missing))
-
- assert exc_info.value.exit_code == 1
- parsed = json.loads(capsys.readouterr().err)
- assert parsed["error"] is True
- assert parsed["error_type"] == "FileNotFoundError"
-
- def test_bundle_without_main_pipe_produces_error(
- self,
- agent_ctx: Any,
- mocker: MockerFixture,
- capsys: pytest.CaptureFixture[str],
- tmp_path: Path,
- ) -> None:
- """Bundle that doesn't declare main_pipe should produce a PipelexInterpreterError."""
- mthds_file = tmp_path / "bundle.mthds"
- mthds_file.write_text('[domain]\ncode = "test"')
-
- mocker.patch(f"{GRAPH_CMD_MODULE}.make_pipelex_for_agent_cli")
- mocker.patch(f"{GRAPH_CMD_MODULE}.Pipelex.teardown_if_needed")
- mocker.patch(
- f"{GRAPH_CMD_MODULE}.generate_graph_for_bundle",
- new=mocker.AsyncMock(side_effect=PipelexInterpreterError("does not declare a main_pipe")),
- )
-
- with pytest.raises(typer.Exit) as exc_info:
- graph_cmd(ctx=agent_ctx, target=str(mthds_file))
-
- assert exc_info.value.exit_code == 1
- parsed = json.loads(capsys.readouterr().err)
- assert parsed["error"] is True
- assert parsed["error_type"] == "PipelexInterpreterError"
- assert "main_pipe" in parsed["message"]
-
- def test_no_graph_spec_produces_error(
- self,
- agent_ctx: Any,
- mocker: MockerFixture,
- capsys: pytest.CaptureFixture[str],
- tmp_path: Path,
- ) -> None:
- """If pipeline execution does not produce a graph spec, should produce an error."""
- mthds_file = tmp_path / "bundle.mthds"
- mthds_file.write_text('[bundle]\nmain_pipe = "my_pipe"\n[domain]\ncode = "test"')
-
- mocker.patch(f"{GRAPH_CMD_MODULE}.make_pipelex_for_agent_cli")
- mocker.patch(f"{GRAPH_CMD_MODULE}.Pipelex.teardown_if_needed")
- mocker.patch(
- f"{GRAPH_CMD_MODULE}.generate_graph_for_bundle",
- new=mocker.AsyncMock(side_effect=PipelexError("Pipeline execution did not produce a graph spec")),
- )
-
- with pytest.raises(typer.Exit) as exc_info:
- graph_cmd(ctx=agent_ctx, target=str(mthds_file))
-
- assert exc_info.value.exit_code == 1
- parsed = json.loads(capsys.readouterr().err)
- assert parsed["error"] is True
- assert "graph spec" in parsed["message"].lower()
-
- @pytest.mark.parametrize(
- "format_option",
- [
- GraphFormat.REACTFLOW,
- GraphFormat.MERMAIDFLOW,
- GraphFormat.BOTH,
- ],
- )
- def test_format_option_produces_success(
- self,
- agent_ctx: Any,
- mocker: MockerFixture,
- capsys: pytest.CaptureFixture[str],
- tmp_path: Path,
- format_option: GraphFormat,
- ) -> None:
- """Each format option should produce success JSON."""
- mthds_file = tmp_path / "bundle.mthds"
- mthds_file.write_text('[bundle]\nmain_pipe = "my_pipe"\n[domain]\ncode = "test"')
-
- self._mock_generate_graph_for_bundle(mocker)
-
- graph_cmd(ctx=agent_ctx, target=str(mthds_file), graph_format=format_option)
-
- parsed = json.loads(capsys.readouterr().out)
- assert parsed["success"] is True
-
- def test_default_format_is_reactflow(self) -> None:
- """Default graph format should be REACTFLOW."""
- sig = inspect.signature(graph_cmd)
- default = sig.parameters["graph_format"].default
- assert default == GraphFormat.REACTFLOW
-
- def test_direction_forwarded_to_generate_graph_for_bundle(
- self,
- agent_ctx: Any,
- mocker: MockerFixture,
- tmp_path: Path,
- ) -> None:
- """Direction option should be forwarded to generate_graph_for_bundle."""
- mthds_file = tmp_path / "bundle.mthds"
- mthds_file.write_text('[bundle]\nmain_pipe = "my_pipe"\n[domain]\ncode = "test"')
-
- mocker.patch(f"{GRAPH_CMD_MODULE}.make_pipelex_for_agent_cli")
- mocker.patch(f"{GRAPH_CMD_MODULE}.Pipelex.teardown_if_needed")
-
- result = {
- "graph_files": {"reactflow_html": "graph/reactflow.html"},
- "graph_output_dir": "mock_output",
- "pipe_code": "my_pipe",
- "direction": "left_to_right",
- }
- mock_generate = mocker.patch(
- f"{GRAPH_CMD_MODULE}.generate_graph_for_bundle",
- new=mocker.AsyncMock(return_value=result),
- )
-
- graph_cmd(ctx=agent_ctx, target=str(mthds_file), direction=FlowchartDirection.LEFT_TO_RIGHT)
-
- # Verify generate_graph_for_bundle was called with the correct direction
- mock_generate.assert_called_once()
- call_kwargs = mock_generate.call_args
- assert call_kwargs.kwargs.get("direction") == FlowchartDirection.LEFT_TO_RIGHT
-
- def test_mthds_parse_error_produces_error(
- self,
- agent_ctx: Any,
- mocker: MockerFixture,
- capsys: pytest.CaptureFixture[str],
- tmp_path: Path,
- ) -> None:
- """MTHDS parse error should produce a MthdsDecodeError."""
- mthds_file = tmp_path / "bundle.mthds"
- mthds_file.write_text("invalid toml {{{{")
-
- mocker.patch(f"{GRAPH_CMD_MODULE}.make_pipelex_for_agent_cli")
- mocker.patch(f"{GRAPH_CMD_MODULE}.Pipelex.teardown_if_needed")
- mocker.patch(
- f"{GRAPH_CMD_MODULE}.generate_graph_for_bundle",
- new=mocker.AsyncMock(side_effect=MthdsDecodeError(message="bad toml", doc="invalid toml {{{{", pos=0, lineno=1, colno=1)),
- )
-
- with pytest.raises(typer.Exit) as exc_info:
- graph_cmd(ctx=agent_ctx, target=str(mthds_file))
-
- assert exc_info.value.exit_code == 1
- parsed = json.loads(capsys.readouterr().err)
- assert parsed["error"] is True
- assert parsed["error_type"] == "MthdsDecodeError"
-
- def test_bundle_parent_dir_included_in_library_dirs(
- self,
- mocker: MockerFixture,
- tmp_path: Path,
- ) -> None:
- """generate_graph_for_bundle should include the bundle's parent dir in library_dirs.
-
- This verifies the bug fix: when no --library-dir is passed, the bundle's
- parent directory must still be included so PipelexRunner can resolve
- sibling dependencies.
- """
- mthds_file = tmp_path / "bundle.mthds"
- mthds_file.write_text('[bundle]\nmain_pipe = "my_pipe"\n[domain]\ncode = "test"')
-
- mock_blueprint = mocker.MagicMock()
- mock_blueprint.main_pipe = "my_pipe"
- mocker.patch(
- f"{GRAPH_RENDERING_MODULE}.PipelexInterpreter.make_pipelex_bundle_blueprint",
- return_value=mock_blueprint,
- )
-
- mock_config = mocker.MagicMock()
- mocker.patch(f"{GRAPH_RENDERING_MODULE}.get_config", return_value=mock_config)
-
- mock_runner_cls = mocker.patch(f"{GRAPH_RENDERING_MODULE}.PipelexRunner")
- mock_runner_instance = mocker.MagicMock()
- mock_pipe_output = mocker.MagicMock()
- mock_pipe_output.graph_spec = mocker.MagicMock()
- mock_response = mocker.MagicMock()
- mock_response.pipe_output = mock_pipe_output
- mock_runner_instance.execute_pipeline = mocker.AsyncMock(return_value=mock_response)
- mock_runner_cls.return_value = mock_runner_instance
-
- mocker.patch(
- f"{GRAPH_RENDERING_MODULE}.render_graph_from_spec",
- new=mocker.AsyncMock(return_value={"reactflow_html": Path("graph/reactflow.html")}),
- )
-
- asyncio.run(
- generate_graph_for_bundle(
- bundle_path=mthds_file,
- graph_format=GraphFormat.REACTFLOW,
- library_dirs=None,
- direction=None,
- )
- )
-
- # Verify PipelexRunner was constructed with library_dirs containing the bundle's parent dir
- mock_runner_cls.assert_called_once()
- call_kwargs = mock_runner_cls.call_args
- actual_library_dirs = call_kwargs.kwargs.get("library_dirs") or call_kwargs[1].get("library_dirs")
- bundle_parent = str(tmp_path.resolve())
- assert actual_library_dirs is not None, "library_dirs should not be None"
- assert bundle_parent in actual_library_dirs, f"Bundle parent dir '{bundle_parent}' should be in library_dirs, got: {actual_library_dirs}"
diff --git a/tests/unit/pipelex/cli/test_agent_validate_cmd.py b/tests/unit/pipelex/cli/test_agent_validate_cmd.py
index 80565b14d..6384838af 100644
--- a/tests/unit/pipelex/cli/test_agent_validate_cmd.py
+++ b/tests/unit/pipelex/cli/test_agent_validate_cmd.py
@@ -1,4 +1,4 @@
-"""Unit tests for the agent CLI validate command."""
+"""Unit tests for the agent CLI validate bundle command."""
from __future__ import annotations
@@ -8,7 +8,7 @@ from typing import TYPE_CHECKING, Any
import pytest
import typer
-from pipelex.cli.agent_cli.commands.validate.pipe_cmd import validate_pipe_cmd
+from pipelex.cli.agent_cli.commands.validate.bundle_cmd import validate_bundle_cmd
from pipelex.pipe_run.pipe_run_mode import PipeRunMode
from pipelex.pipeline.exceptions import PipelineExecutionError
@@ -17,11 +17,11 @@ if TYPE_CHECKING:
from pytest_mock import MockerFixture
-VALIDATE_CMD_MODULE = "pipelex.cli.agent_cli.commands.validate.pipe_cmd"
+VALIDATE_BUNDLE_CMD_MODULE = "pipelex.cli.agent_cli.commands.validate.bundle_cmd"
-class TestValidateCmd:
- """Tests for the validate command error handling."""
+class TestValidateBundleCmd:
+ """Tests for the validate bundle command error handling."""
def test_graph_generation_failure_emits_single_json_error(
self,
@@ -40,8 +40,8 @@ class TestValidateCmd:
mthds_file = tmp_path / "bundle.mthds"
mthds_file.write_text('[bundle]\nmain_pipe = "my_pipe"\n[domain]\ncode = "test"')
- mocker.patch(f"{VALIDATE_CMD_MODULE}.make_pipelex_for_agent_cli")
- mocker.patch(f"{VALIDATE_CMD_MODULE}.Pipelex.teardown_if_needed")
+ mocker.patch(f"{VALIDATE_BUNDLE_CMD_MODULE}.make_pipelex_for_agent_cli")
+ mocker.patch(f"{VALIDATE_BUNDLE_CMD_MODULE}.Pipelex.teardown_if_needed")
# Bundle validation succeeds
validation_result: dict[str, Any] = {
@@ -51,7 +51,7 @@ class TestValidateCmd:
"total_pipes": 1,
}
mocker.patch(
- f"{VALIDATE_CMD_MODULE}.validate_bundle_core",
+ f"{VALIDATE_BUNDLE_CMD_MODULE}.validate_bundle_core",
new=mocker.AsyncMock(return_value=validation_result),
)
@@ -64,14 +64,14 @@ class TestValidateCmd:
pipe_stack=["my_pipe"],
)
mocker.patch(
- f"{VALIDATE_CMD_MODULE}.generate_graph_for_bundle",
+ f"{VALIDATE_BUNDLE_CMD_MODULE}.generate_graph_for_bundle",
new=mocker.AsyncMock(side_effect=graph_error),
)
with pytest.raises(typer.Exit) as exc_info:
- validate_pipe_cmd(
+ validate_bundle_cmd(
ctx=agent_ctx,
- target=str(mthds_file),
+ path=str(mthds_file),
graph=True,
)
diff --git a/tests/unit/pipelex/cli/test_inputs_path_resolver.py b/tests/unit/pipelex/cli/test_inputs_path_resolver.py
new file mode 100644
index 000000000..1e87edaf6
--- /dev/null
+++ b/tests/unit/pipelex/cli/test_inputs_path_resolver.py
@@ -0,0 +1,248 @@
+"""Unit tests for _inputs_path_resolver: resolve relative url paths in pipeline inputs."""
+
+from __future__ import annotations
+
+from pathlib import Path
+from typing import Any, ClassVar
+
+import pytest
+
+from pipelex.cli.commands.run._inputs_path_resolver import is_relative_local_path, resolve_inputs_paths, resolve_url_in_value # noqa: PLC2701
+
+
+class _IsRelativeLocalPathCases:
+ RELATIVE_FILE = ("data/invoice.pdf", True)
+ RELATIVE_NESTED = ("subdir/another/file.txt", True)
+ BARE_FILENAME = ("invoice.pdf", True)
+ ABSOLUTE_PATH = ("/home/user/data/invoice.pdf", False)
+ HTTP_URL = ("https://example.com/file.pdf", False)
+ HTTPS_URL = ("https://cdn.example.com/doc.pdf", False)
+ DATA_URL = ("data:application/pdf;base64,AAAA", False)
+ PIPELEX_STORAGE = ("pipelex-storage://bucket/file.pdf", False)
+ FILE_URI = ("file:///home/user/file.pdf", False)
+
+
+class _ResolveInputsPathsCases:
+ """Parametrized test data for resolve_inputs_paths."""
+
+ BASE_DIR: ClassVar[Path] = Path("/bundles/my_pipeline")
+
+ RELATIVE_URL_IN_CONTENT: ClassVar[tuple[str, dict[str, Any], dict[str, Any]]] = (
+ "relative url in content dict is resolved",
+ {
+ "source_doc": {
+ "concept": "native.Document",
+ "content": {"url": "data/invoice.pdf"},
+ },
+ },
+ {
+ "source_doc": {
+ "concept": "native.Document",
+ "content": {"url": "/bundles/my_pipeline/data/invoice.pdf"},
+ },
+ },
+ )
+
+ RELATIVE_URLS_IN_LIST: ClassVar[tuple[str, dict[str, Any], dict[str, Any]]] = (
+ "relative urls in content list are resolved",
+ {
+ "docs": {
+ "concept": "native.Document",
+ "content": [
+ {"url": "data/f1.pdf"},
+ {"url": "data/f2.pdf"},
+ ],
+ },
+ },
+ {
+ "docs": {
+ "concept": "native.Document",
+ "content": [
+ {"url": "/bundles/my_pipeline/data/f1.pdf"},
+ {"url": "/bundles/my_pipeline/data/f2.pdf"},
+ ],
+ },
+ },
+ )
+
+ ABSOLUTE_PATH_UNCHANGED: ClassVar[tuple[str, dict[str, Any], dict[str, Any]]] = (
+ "absolute paths are left unchanged",
+ {
+ "source_doc": {
+ "concept": "native.Document",
+ "content": {"url": "/absolute/path/file.pdf"},
+ },
+ },
+ {
+ "source_doc": {
+ "concept": "native.Document",
+ "content": {"url": "/absolute/path/file.pdf"},
+ },
+ },
+ )
+
+ HTTP_URL_UNCHANGED: ClassVar[tuple[str, dict[str, Any], dict[str, Any]]] = (
+ "http urls are left unchanged",
+ {
+ "source_doc": {
+ "concept": "native.Document",
+ "content": {"url": "https://example.com/file.pdf"},
+ },
+ },
+ {
+ "source_doc": {
+ "concept": "native.Document",
+ "content": {"url": "https://example.com/file.pdf"},
+ },
+ },
+ )
+
+ DATA_URL_UNCHANGED: ClassVar[tuple[str, dict[str, Any], dict[str, Any]]] = (
+ "data: urls are left unchanged",
+ {
+ "source_doc": {
+ "concept": "native.Document",
+ "content": {"url": "data:application/pdf;base64,AAAA"},
+ },
+ },
+ {
+ "source_doc": {
+ "concept": "native.Document",
+ "content": {"url": "data:application/pdf;base64,AAAA"},
+ },
+ },
+ )
+
+ PIPELEX_STORAGE_UNCHANGED: ClassVar[tuple[str, dict[str, Any], dict[str, Any]]] = (
+ "pipelex-storage urls are left unchanged",
+ {
+ "source_doc": {
+ "concept": "native.Document",
+ "content": {"url": "pipelex-storage://bucket/file.pdf"},
+ },
+ },
+ {
+ "source_doc": {
+ "concept": "native.Document",
+ "content": {"url": "pipelex-storage://bucket/file.pdf"},
+ },
+ },
+ )
+
+ PLAIN_TEXT_UNCHANGED: ClassVar[tuple[str, dict[str, Any], dict[str, Any]]] = (
+ "plain text inputs are left unchanged",
+ {
+ "topic": {
+ "concept": "native.Text",
+ "content": {"body": "summarize this document"},
+ },
+ },
+ {
+ "topic": {
+ "concept": "native.Text",
+ "content": {"body": "summarize this document"},
+ },
+ },
+ )
+
+ NESTED_URL_RESOLVED: ClassVar[tuple[str, dict[str, Any], dict[str, Any]]] = (
+ "nested structured content urls are resolved",
+ {
+ "complex": {
+ "concept": "native.Document",
+ "content": {
+ "metadata": {"title": "Report"},
+ "attachments": [
+ {"url": "data/attachment.pdf", "label": "att1"},
+ ],
+ },
+ },
+ },
+ {
+ "complex": {
+ "concept": "native.Document",
+ "content": {
+ "metadata": {"title": "Report"},
+ "attachments": [
+ {"url": "/bundles/my_pipeline/data/attachment.pdf", "label": "att1"},
+ ],
+ },
+ },
+ },
+ )
+
+ EMPTY_DICT: ClassVar[tuple[str, dict[str, Any], dict[str, Any]]] = (
+ "empty dict returns empty dict",
+ {},
+ {},
+ )
+
+ NO_URL_KEYS: ClassVar[tuple[str, dict[str, Any], dict[str, Any]]] = (
+ "dict without url keys is unchanged",
+ {
+ "config": {
+ "key": "value",
+ "nested": {"a": 1, "b": 2},
+ },
+ },
+ {
+ "config": {
+ "key": "value",
+ "nested": {"a": 1, "b": 2},
+ },
+ },
+ )
+
+
+class TestInputsPathResolver:
+ """Tests for is_relative_local_path, resolve_url_in_value, and resolve_inputs_paths."""
+
+ # ---- is_relative_local_path ----
+
+ @pytest.mark.parametrize(
+ ("uri", "expected"),
+ [
+ _IsRelativeLocalPathCases.RELATIVE_FILE,
+ _IsRelativeLocalPathCases.RELATIVE_NESTED,
+ _IsRelativeLocalPathCases.BARE_FILENAME,
+ _IsRelativeLocalPathCases.ABSOLUTE_PATH,
+ _IsRelativeLocalPathCases.HTTP_URL,
+ _IsRelativeLocalPathCases.HTTPS_URL,
+ _IsRelativeLocalPathCases.DATA_URL,
+ _IsRelativeLocalPathCases.PIPELEX_STORAGE,
+ _IsRelativeLocalPathCases.FILE_URI,
+ ],
+ )
+ def test_is_relative_local_path(self, uri: str, expected: bool) -> None:
+ """Correctly classifies URIs as relative local paths or not."""
+ assert is_relative_local_path(uri) == expected
+
+ # ---- resolve_url_in_value ----
+
+ def test_resolve_url_in_value_string_passthrough(self) -> None:
+ """Non-dict, non-list values pass through unchanged."""
+ assert resolve_url_in_value("hello", Path("/base")) == "hello"
+ assert resolve_url_in_value(42, Path("/base")) == 42
+ assert resolve_url_in_value(None, Path("/base")) is None
+
+ # ---- resolve_inputs_paths ----
+
+ @pytest.mark.parametrize(
+ ("topic", "inputs_dict", "expected"),
+ [
+ _ResolveInputsPathsCases.RELATIVE_URL_IN_CONTENT,
+ _ResolveInputsPathsCases.RELATIVE_URLS_IN_LIST,
+ _ResolveInputsPathsCases.ABSOLUTE_PATH_UNCHANGED,
+ _ResolveInputsPathsCases.HTTP_URL_UNCHANGED,
+ _ResolveInputsPathsCases.DATA_URL_UNCHANGED,
+ _ResolveInputsPathsCases.PIPELEX_STORAGE_UNCHANGED,
+ _ResolveInputsPathsCases.PLAIN_TEXT_UNCHANGED,
+ _ResolveInputsPathsCases.NESTED_URL_RESOLVED,
+ _ResolveInputsPathsCases.EMPTY_DICT,
+ _ResolveInputsPathsCases.NO_URL_KEYS,
+ ],
+ )
+ def test_resolve_inputs_paths(self, topic: str, inputs_dict: dict[str, Any], expected: dict[str, Any]) -> None: # noqa: ARG002
+ """Resolves relative url paths in various input structures."""
+ result = resolve_inputs_paths(inputs_dict, _ResolveInputsPathsCases.BASE_DIR)
+ assert result == expected
diff --git a/uv.lock b/uv.lock
index 2437ceace..63ec74782 100644
--- a/uv.lock
+++ b/uv.lock
@@ -389,16 +389,16 @@ wheels = [
[[package]]
name = "boto3-stubs"
-version = "1.42.56"
+version = "1.42.58"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "botocore-stubs" },
{ name = "types-s3transfer" },
{ name = "typing-extensions", marker = "python_full_version < '3.12'" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/3d/a1/23cdd844dc940ef9c77ee1fc95cbf4c0a3f4ee53ecb3c2bbf7ba9932d2f7/boto3_stubs-1.42.56.tar.gz", hash = "sha256:95e4eab435b1b8e05e0d977c76f706efcded2b9a375cbc45b031c7458d100b25", size = 100972, upload-time = "2026-02-24T21:06:18.112Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/33/93/2b8bc07cd81e9cd70a1b5033e14387353bd4a74860e2c1c0dfaa893c205d/boto3_stubs-1.42.58.tar.gz", hash = "sha256:c42e0b0ab5435b9c0f8b9f4d9d11372a9d413443340fa5601e7750c6e3feae2a", size = 101013, upload-time = "2026-02-26T20:56:50.882Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/de/e2/a47ab38dbc20bf241af2d9dad7b6c517794df3a54a586abb00678a5eacff/boto3_stubs-1.42.56-py3-none-any.whl", hash = "sha256:824d229b2d87cac1a714472d88c13631df5cb4e1ef3bc3167cac635084ca5b57", size = 69824, upload-time = "2026-02-24T21:06:09.403Z" },
+ { url = "https://files.pythonhosted.org/packages/15/52/6de7f766b0e19fb3441de541b831f00f04c11aa9ce0d53062cbb78873f17/boto3_stubs-1.42.58-py3-none-any.whl", hash = "sha256:e9255ea0e43024789cb4f16414c76ad1890d260bcae3da44f1c9e8f0f9299a14", size = 69825, upload-time = "2026-02-26T20:56:41.313Z" },
]
[[package]]
@@ -846,10 +846,10 @@ wheels = [
[[package]]
name = "cuda-pathfinder"
-version = "1.3.5"
+version = "1.4.0"
source = { registry = "https://pypi.org/simple" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/ca/b5/e4056e4058fb56519fcddf1face6fe3ff2398953b41615fafe9fb1540bf2/cuda_pathfinder-1.3.5-py3-none-any.whl", hash = "sha256:6c88220f8637cb35d2a75c620d72efebf683b248b923713d8fbe235844c1a4b9", size = 33711, upload-time = "2026-02-23T18:34:27.253Z" },
+ { url = "https://files.pythonhosted.org/packages/ff/60/d8f1dbfb7f06b94c662e98c95189e6f39b817da638bc8fcea0d003f89e5d/cuda_pathfinder-1.4.0-py3-none-any.whl", hash = "sha256:437079ca59e7b61ae439ecc501d69ed87b3accc34d58153ef1e54815e2c2e118", size = 38406, upload-time = "2026-02-25T22:13:00.807Z" },
]
[[package]]
@@ -931,7 +931,7 @@ wheels = [
[[package]]
name = "docling-core"
-version = "2.65.2"
+version = "2.66.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "defusedxml" },
@@ -946,9 +946,9 @@ dependencies = [
{ name = "typer" },
{ name = "typing-extensions" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/9b/36/f8a7e212e601ff104906e3263d2306d67e372098ddc3d7a6ee3b7be35848/docling_core-2.65.2.tar.gz", hash = "sha256:4afc4c3ca8eaa8c0829aade53efe9692c1ad50763c6a64614fcb8c4b75bbcd7c", size = 254934, upload-time = "2026-02-23T15:17:43.276Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/00/ba/0b40f5bb2fff918bea79b0ea843ab3479a5f2c7a4be7009ddd713f0e8ab0/docling_core-2.66.0.tar.gz", hash = "sha256:3bbb85bf3e0106d20e7f3d2801ec40460347c95bcda55862b1fcb9effa4f78ea", size = 256592, upload-time = "2026-02-26T10:46:56.744Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/70/f6/28e1342d5a21c4de7a5339e6cb702751c75c815d58e318e4ba66db4d3be6/docling_core-2.65.2-py3-none-any.whl", hash = "sha256:24534577b4a94a4f7f3a41f622e0b883e897077cb2ffd4dabac06681767059b2", size = 240376, upload-time = "2026-02-23T15:17:41.809Z" },
+ { url = "https://files.pythonhosted.org/packages/2a/df/6983118cb33e5ce166592945bb473a2b7c60865a9ba661c1d462cfd2c356/docling_core-2.66.0-py3-none-any.whl", hash = "sha256:5f6cf447ca4f50c27531bd15ea1d16c3a811fbfe22e0107207711561520fb316", size = 241133, upload-time = "2026-02-26T10:46:55.021Z" },
]
[package.optional-dependencies]
@@ -1294,15 +1294,15 @@ requests = [
[[package]]
name = "google-auth-oauthlib"
-version = "1.2.4"
+version = "1.3.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "google-auth" },
{ name = "requests-oauthlib" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/90/dd/211f27c1e927e2292c2a71d5df1a2aaf261ce50ba7d50848c6ee24e20970/google_auth_oauthlib-1.2.4.tar.gz", hash = "sha256:3ca93859c6cc9003c8e12b2a0868915209d7953f05a70f4880ab57d57e56ee3e", size = 21185, upload-time = "2026-01-15T22:03:10.027Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/ac/b4/1b19567e4c567b796f5c593d89895f3cfae5a38e04f27c6af87618fd0942/google_auth_oauthlib-1.3.0.tar.gz", hash = "sha256:cd39e807ac7229d6b8b9c1e297321d36fcc8a9e4857dff4301870985df51a528", size = 21777, upload-time = "2026-02-27T14:13:01.489Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/84/21/fb96db432d187b07756e62971c4d89bdef70259e4cfa76ee32bcc0ac97d1/google_auth_oauthlib-1.2.4-py3-none-any.whl", hash = "sha256:0e922eea5f2baacaf8867febb782e46e7b153236c21592ed76ab3ddb77ffd772", size = 19193, upload-time = "2026-01-15T22:03:09.046Z" },
+ { url = "https://files.pythonhosted.org/packages/2f/56/909fd5632226d3fba31d7aeffd4754410735d49362f5809956fe3e9af344/google_auth_oauthlib-1.3.0-py3-none-any.whl", hash = "sha256:386b3fb85cf4a5b819c6ad23e3128d975216b4cac76324de1d90b128aaf38f29", size = 19308, upload-time = "2026-02-27T14:12:47.865Z" },
]
[[package]]
@@ -1372,10 +1372,9 @@ wheels = [
[[package]]
name = "google-genai"
-version = "1.64.0"
+version = "1.65.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
- { name = "aiohttp" },
{ name = "anyio" },
{ name = "distro" },
{ name = "google-auth", extra = ["requests"] },
@@ -1387,9 +1386,9 @@ dependencies = [
{ name = "typing-extensions" },
{ name = "websockets" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/bc/14/344b450d4387845fc5c8b7f168ffbe734b831b729ece3333fc0fe8556f04/google_genai-1.64.0.tar.gz", hash = "sha256:8db94ab031f745d08c45c69674d1892f7447c74ed21542abe599f7888e28b924", size = 496434, upload-time = "2026-02-19T02:06:13.95Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/79/f9/cc1191c2540d6a4e24609a586c4ed45d2db57cfef47931c139ee70e5874a/google_genai-1.65.0.tar.gz", hash = "sha256:d470eb600af802d58a79c7f13342d9ea0d05d965007cae8f76c7adff3d7a4750", size = 497206, upload-time = "2026-02-26T00:20:33.824Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/54/56/765eca90c781fedbe2a7e7dc873ef6045048e28ba5f2d4a5bcb13e13062b/google_genai-1.64.0-py3-none-any.whl", hash = "sha256:78a4d2deeb33b15ad78eaa419f6f431755e7f0e03771254f8000d70f717e940b", size = 728836, upload-time = "2026-02-19T02:06:11.655Z" },
+ { url = "https://files.pythonhosted.org/packages/68/3c/3fea4e7c91357c71782d7dcaad7a2577d636c90317e003386893c25bc62c/google_genai-1.65.0-py3-none-any.whl", hash = "sha256:68c025205856919bc03edb0155c11b4b833810b7ce17ad4b7a9eeba5158f6c44", size = 724429, upload-time = "2026-02-26T00:20:32.186Z" },
]
[[package]]
@@ -1427,34 +1426,34 @@ wheels = [
[[package]]
name = "hf-xet"
-version = "1.3.1"
-source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/a6/d0/73454ef7ca885598a3194d07d5c517d91a840753c5b35d272600d7907f64/hf_xet-1.3.1.tar.gz", hash = "sha256:513aa75f8dc39a63cc44dbc8d635ccf6b449e07cdbd8b2e2d006320d2e4be9bb", size = 641393, upload-time = "2026-02-25T00:57:56.701Z" }
-wheels = [
- { url = "https://files.pythonhosted.org/packages/56/79/9b6a5614230d7a871442d8d8e1c270496821638ba3a9baac16a5b9166200/hf_xet-1.3.1-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:08b231260c68172c866f7aa7257c165d0c87887491aafc5efeee782731725366", size = 3759716, upload-time = "2026-02-25T00:57:41.052Z" },
- { url = "https://files.pythonhosted.org/packages/d4/de/72acb8d7702b3cf9b36a68e8380f3114bf04f9f21cf9e25317457fe31f00/hf_xet-1.3.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:0810b69c64e96dee849036193848007f665dca2311879c9ea8693f4fc37f1795", size = 3518075, upload-time = "2026-02-25T00:57:39.605Z" },
- { url = "https://files.pythonhosted.org/packages/1d/5c/ed728d8530fec28da88ee882b522fccf00dc98e9d7bae4cdb0493070cb17/hf_xet-1.3.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ecd38f98e7f0f41108e30fd4a9a5553ec30cf726df7473dd3e75a1b6d56728c2", size = 4174369, upload-time = "2026-02-25T00:57:32.697Z" },
- { url = "https://files.pythonhosted.org/packages/3c/db/785a0e20aa3086948a26573f1d4ff5c090e63564bf0a52d32eb5b4d82e8d/hf_xet-1.3.1-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:65411867d46700765018b1990eb1604c3bf0bf576d9e65fc57fdcc10797a2eb9", size = 3953249, upload-time = "2026-02-25T00:57:30.096Z" },
- { url = "https://files.pythonhosted.org/packages/c4/6a/51b669c1e3dbd9374b61356f554e8726b9e1c1d6a7bee5d727d3913b10ad/hf_xet-1.3.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:1684c840c60da12d76c2a031ba40e4b154fdbf9593836fcf5ff090d95a033c61", size = 4152989, upload-time = "2026-02-25T00:57:48.308Z" },
- { url = "https://files.pythonhosted.org/packages/df/31/de07e26e396f46d13a09251df69df9444190e93e06a9d30d639e96c8a0ed/hf_xet-1.3.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:b3012c0f2ce1f0863338491a2bc0fd3f84aded0e147ab25f230da1f5249547fd", size = 4390709, upload-time = "2026-02-25T00:57:49.845Z" },
- { url = "https://files.pythonhosted.org/packages/e3/c1/fcb010b54488c2c112224f55b71f80e44d1706d9b764a0966310b283f86e/hf_xet-1.3.1-cp313-cp313t-win_amd64.whl", hash = "sha256:4eb432e1aa707a65a7e1f8455e40c5b47431d44fe0fb1b0c5d53848c27469398", size = 3634142, upload-time = "2026-02-25T00:57:59.063Z" },
- { url = "https://files.pythonhosted.org/packages/da/a6/9ef49cc601c68209979661b3e0b6659fc5a47bfb40f3ebf29eae9ee09e5c/hf_xet-1.3.1-cp313-cp313t-win_arm64.whl", hash = "sha256:e56104c84b2a88b9c7b23ba11a2d7ed0ccbe96886b3f985a50cedd2f0e99853f", size = 3494918, upload-time = "2026-02-25T00:57:57.654Z" },
- { url = "https://files.pythonhosted.org/packages/e7/f5/66adbb1f54a1b3c6da002fa36d4405901ddbcb7d927d780db17ce18ab99d/hf_xet-1.3.1-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:6517a245e41df3eae5adc5f9e8c86fa52abd548de798cbcd989f0082152860aa", size = 3759781, upload-time = "2026-02-25T00:57:47.017Z" },
- { url = "https://files.pythonhosted.org/packages/1e/75/189d91a90480c142cc710c1baa35ece20e8652d5fe5c9b2364a13573d827/hf_xet-1.3.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:4a322d506c513f98fdc1aa2aaa825daefd535b686e80ca789e6d33fcb146f524", size = 3517533, upload-time = "2026-02-25T00:57:45.812Z" },
- { url = "https://files.pythonhosted.org/packages/c6/52/52dd1ab6c29661e29585f3c10d14572e2535a3a472f27a0a46215b0f4659/hf_xet-1.3.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:8f16ec9d26badec46334a798e01b5d86af536924789c95b1a1ec6a05f26523e0", size = 4174082, upload-time = "2026-02-25T00:57:38.171Z" },
- { url = "https://files.pythonhosted.org/packages/14/03/460add181c79e2ea1527d2ad27788ecccaee1d5a82563f9402e25ee627e4/hf_xet-1.3.1-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:e1f5d72bd5b73e61530fff573bcff34bdb64af2bf4862cdd516e6c1dab4dc75b", size = 3952874, upload-time = "2026-02-25T00:57:36.942Z" },
- { url = "https://files.pythonhosted.org/packages/01/56/bf78f18890dfc8caa907830e95424dce0887d5c45efde13f23c9ebbaa8ef/hf_xet-1.3.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:4bc71afd853508b2ddf123b8fc9de71b0afa4c956ec730b69fb76103781e94cd", size = 4152325, upload-time = "2026-02-25T00:57:54.081Z" },
- { url = "https://files.pythonhosted.org/packages/3c/94/91685c6a4a7f513097a6a73b1e879024304cd0eae78080e3d737622f2fd9/hf_xet-1.3.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:541b4b00ed294ae6cfd9416de9506e58971013714d7316189c9638ed54e362d4", size = 4390499, upload-time = "2026-02-25T00:57:55.258Z" },
- { url = "https://files.pythonhosted.org/packages/79/1b/1e72c8ea1f31ef94640d1f265630d35b97b2ef31fe12696bbcc32dbcdc95/hf_xet-1.3.1-cp314-cp314t-win_amd64.whl", hash = "sha256:f85480b4fe3e8e4cdbc59ef1d235152b732fd57ca439cc983c291892945ae818", size = 3634352, upload-time = "2026-02-25T00:58:04.749Z" },
- { url = "https://files.pythonhosted.org/packages/cf/61/b59e87a7a10b95c4578a6ce555339b2f002035569dfd366662b9f59975a8/hf_xet-1.3.1-cp314-cp314t-win_arm64.whl", hash = "sha256:83a8830160392ef4bea78d443ea2cf1febe65783b3843a8f12c64b368981e7e2", size = 3494371, upload-time = "2026-02-25T00:58:03.422Z" },
- { url = "https://files.pythonhosted.org/packages/75/f8/c2da4352c0335df6ae41750cf5bab09fdbfc30d3b4deeed9d621811aa835/hf_xet-1.3.1-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:581d1809a016f7881069d86a072168a8199a46c839cf394ff53970a47e4f1ca1", size = 3761755, upload-time = "2026-02-25T00:57:43.621Z" },
- { url = "https://files.pythonhosted.org/packages/c0/e5/a2f3eaae09da57deceb16a96ebe9ae1f6f7b9b94145a9cd3c3f994e7782a/hf_xet-1.3.1-cp37-abi3-macosx_11_0_arm64.whl", hash = "sha256:329c80c86f2dda776bafd2e4813a46a3ee648dce3ac0c84625902c70d7a6ddba", size = 3523677, upload-time = "2026-02-25T00:57:42.3Z" },
- { url = "https://files.pythonhosted.org/packages/61/cd/acbbf9e51f17d8cef2630e61741228e12d4050716619353efc1ac119f902/hf_xet-1.3.1-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:2973c3ff594c3a8da890836308cae1444c8af113c6f10fe6824575ddbc37eca7", size = 4178557, upload-time = "2026-02-25T00:57:35.399Z" },
- { url = "https://files.pythonhosted.org/packages/df/4f/014c14c4ae3461d9919008d0bed2f6f35ba1741e28b31e095746e8dac66f/hf_xet-1.3.1-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:ed4bfd2e6d10cb86c9b0f3483df1d7dd2d0220f75f27166925253bacbc1c2dbe", size = 3958975, upload-time = "2026-02-25T00:57:34.004Z" },
- { url = "https://files.pythonhosted.org/packages/86/50/043f5c5a26f3831c3fa2509c17fcd468fd02f1f24d363adc7745fbe661cb/hf_xet-1.3.1-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:713913387cc76e300116030705d843a9f15aee86158337eeffb9eb8d26f47fcd", size = 4158298, upload-time = "2026-02-25T00:57:51.14Z" },
- { url = "https://files.pythonhosted.org/packages/08/9c/b667098a636a88358dbeb2caf90e3cb9e4b961f61f6c55bb312793424def/hf_xet-1.3.1-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:e5063789c9d21f51e9ed4edbee8539655d3486e9cad37e96b7af967da20e8b16", size = 4395743, upload-time = "2026-02-25T00:57:52.783Z" },
- { url = "https://files.pythonhosted.org/packages/70/37/4db0e4e1534270800cfffd5a7e0b338f2137f8ceb5768000147650d34ea9/hf_xet-1.3.1-cp37-abi3-win_amd64.whl", hash = "sha256:607d5bbc2730274516714e2e442a26e40e3330673ac0d0173004461409147dee", size = 3638145, upload-time = "2026-02-25T00:58:02.167Z" },
- { url = "https://files.pythonhosted.org/packages/4e/46/1ba8d36f8290a4b98f78898bdce2b0e8fe6d9a59df34a1399eb61a8d877f/hf_xet-1.3.1-cp37-abi3-win_arm64.whl", hash = "sha256:851b1be6597a87036fe7258ce7578d5df3c08176283b989c3b165f94125c5097", size = 3500490, upload-time = "2026-02-25T00:58:00.667Z" },
+version = "1.3.2"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/8b/cb/9bb543bd987ffa1ee48202cc96a756951b734b79a542335c566148ade36c/hf_xet-1.3.2.tar.gz", hash = "sha256:e130ee08984783d12717444e538587fa2119385e5bd8fc2bb9f930419b73a7af", size = 643646, upload-time = "2026-02-27T17:26:08.051Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/49/75/462285971954269432aad2e7938c5c7ff9ec7d60129cec542ab37121e3d6/hf_xet-1.3.2-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:335a8f36c55fd35a92d0062f4e9201b4015057e62747b7e7001ffb203c0ee1d2", size = 3761019, upload-time = "2026-02-27T17:25:49.441Z" },
+ { url = "https://files.pythonhosted.org/packages/35/56/987b0537ddaf88e17192ea09afa8eca853e55f39a4721578be436f8409df/hf_xet-1.3.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:c1ae4d3a716afc774e66922f3cac8206bfa707db13f6a7e62dfff74bfc95c9a8", size = 3521565, upload-time = "2026-02-27T17:25:47.469Z" },
+ { url = "https://files.pythonhosted.org/packages/a8/5c/7e4a33a3d689f77761156cc34558047569e54af92e4d15a8f493229f6767/hf_xet-1.3.2-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:d6dbdf231efac0b9b39adcf12a07f0c030498f9212a18e8c50224d0e84ab803d", size = 4176494, upload-time = "2026-02-27T17:25:40.247Z" },
+ { url = "https://files.pythonhosted.org/packages/6b/b3/71e856bf9d9a69b3931837e8bf22e095775f268c8edcd4a9e8c355f92484/hf_xet-1.3.2-cp313-cp313t-manylinux_2_28_aarch64.whl", hash = "sha256:c1980abfb68ecf6c1c7983379ed7b1e2b49a1aaf1a5aca9acc7d48e5e2e0a961", size = 3955601, upload-time = "2026-02-27T17:25:38.376Z" },
+ { url = "https://files.pythonhosted.org/packages/63/d7/aecf97b3f0a981600a67ff4db15e2d433389d698a284bb0ea5d8fcdd6f7f/hf_xet-1.3.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:1c88fbd90ad0d27c46b77a445f0a436ebaa94e14965c581123b68b1c52f5fd30", size = 4154770, upload-time = "2026-02-27T17:25:56.756Z" },
+ { url = "https://files.pythonhosted.org/packages/e2/e1/3af961f71a40e09bf5ee909842127b6b00f5ab4ee3817599dc0771b79893/hf_xet-1.3.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:35b855024ca37f2dd113ac1c08993e997fbe167b9d61f9ef66d3d4f84015e508", size = 4394161, upload-time = "2026-02-27T17:25:58.111Z" },
+ { url = "https://files.pythonhosted.org/packages/a1/c3/859509bade9178e21b8b1db867b8e10e9f817ab9ac1de77cb9f461ced765/hf_xet-1.3.2-cp313-cp313t-win_amd64.whl", hash = "sha256:31612ba0629046e425ba50375685a2586e11fb9144270ebabd75878c3eaf6378", size = 3637377, upload-time = "2026-02-27T17:26:10.611Z" },
+ { url = "https://files.pythonhosted.org/packages/05/7f/724cfbef4da92d577b71f68bf832961c8919f36c60d28d289a9fc9d024d4/hf_xet-1.3.2-cp313-cp313t-win_arm64.whl", hash = "sha256:433c77c9f4e132b562f37d66c9b22c05b5479f243a1f06a120c1c06ce8b1502a", size = 3497875, upload-time = "2026-02-27T17:26:09.034Z" },
+ { url = "https://files.pythonhosted.org/packages/ba/75/9d54c1ae1d05fb704f977eca1671747babf1957f19f38ae75c5933bc2dc1/hf_xet-1.3.2-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:c34e2c7aefad15792d57067c1c89b2b02c1bbaeabd7f8456ae3d07b4bbaf4094", size = 3761076, upload-time = "2026-02-27T17:25:55.42Z" },
+ { url = "https://files.pythonhosted.org/packages/f2/8a/08a24b6c6f52b5d26848c16e4b6d790bb810d1bf62c3505bed179f7032d3/hf_xet-1.3.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:4bc995d6c41992831f762096020dc14a65fdf3963f86ffed580b596d04de32e3", size = 3521745, upload-time = "2026-02-27T17:25:54.217Z" },
+ { url = "https://files.pythonhosted.org/packages/b5/db/a75cf400dd8a1a8acf226a12955ff6ee999f272dfc0505bafd8079a61267/hf_xet-1.3.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:959083c89dee30f7d6f890b36cdadda823386c4de63b1a30384a75bfd2ae995d", size = 4176301, upload-time = "2026-02-27T17:25:46.044Z" },
+ { url = "https://files.pythonhosted.org/packages/01/40/6c4c798ffdd83e740dd3925c4e47793b07442a9efa3bc3866ba141a82365/hf_xet-1.3.2-cp314-cp314t-manylinux_2_28_aarch64.whl", hash = "sha256:cfa760888633b08c01b398d212ce7e8c0d7adac6c86e4b20dfb2397d8acd78ee", size = 3955437, upload-time = "2026-02-27T17:25:44.703Z" },
+ { url = "https://files.pythonhosted.org/packages/0c/09/9a3aa7c5f07d3e5cc57bb750d12a124ffa72c273a87164bd848f9ac5cc14/hf_xet-1.3.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:3155a02e083aa21fd733a7485c7c36025e49d5975c8d6bda0453d224dd0b0ac4", size = 4154535, upload-time = "2026-02-27T17:26:05.207Z" },
+ { url = "https://files.pythonhosted.org/packages/ae/e0/831f7fa6d90cb47a230bc23284b502c700e1483bbe459437b3844cdc0776/hf_xet-1.3.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:91b1dc03c31cbf733d35dc03df7c5353686233d86af045e716f1e0ea4a2673cf", size = 4393891, upload-time = "2026-02-27T17:26:06.607Z" },
+ { url = "https://files.pythonhosted.org/packages/ab/96/6ed472fdce7f8b70f5da6e3f05be76816a610063003bfd6d9cea0bbb58a3/hf_xet-1.3.2-cp314-cp314t-win_amd64.whl", hash = "sha256:211f30098512d95e85ad03ae63bd7dd2c4df476558a5095d09f9e38e78cbf674", size = 3637583, upload-time = "2026-02-27T17:26:17.349Z" },
+ { url = "https://files.pythonhosted.org/packages/8b/e8/a069edc4570b3f8e123c0b80fadc94530f3d7b01394e1fc1bb223339366c/hf_xet-1.3.2-cp314-cp314t-win_arm64.whl", hash = "sha256:4a6817c41de7c48ed9270da0b02849347e089c5ece9a0e72ae4f4b3a57617f82", size = 3497977, upload-time = "2026-02-27T17:26:14.966Z" },
+ { url = "https://files.pythonhosted.org/packages/d8/28/dbb024e2e3907f6f3052847ca7d1a2f7a3972fafcd53ff79018977fcb3e4/hf_xet-1.3.2-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:f93b7595f1d8fefddfede775c18b5c9256757824f7f6832930b49858483cd56f", size = 3763961, upload-time = "2026-02-27T17:25:52.537Z" },
+ { url = "https://files.pythonhosted.org/packages/e4/71/b99aed3823c9d1795e4865cf437d651097356a3f38c7d5877e4ac544b8e4/hf_xet-1.3.2-cp37-abi3-macosx_11_0_arm64.whl", hash = "sha256:a85d3d43743174393afe27835bde0cd146e652b5fcfdbcd624602daef2ef3259", size = 3526171, upload-time = "2026-02-27T17:25:50.968Z" },
+ { url = "https://files.pythonhosted.org/packages/9d/ca/907890ce6ef5598b5920514f255ed0a65f558f820515b18db75a51b2f878/hf_xet-1.3.2-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:7c2a054a97c44e136b1f7f5a78f12b3efffdf2eed3abc6746fc5ea4b39511633", size = 4180750, upload-time = "2026-02-27T17:25:43.125Z" },
+ { url = "https://files.pythonhosted.org/packages/8c/ad/bc7f41f87173d51d0bce497b171c4ee0cbde1eed2d7b4216db5d0ada9f50/hf_xet-1.3.2-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:06b724a361f670ae557836e57801b82c75b534812e351a87a2c739f77d1e0635", size = 3961035, upload-time = "2026-02-27T17:25:41.837Z" },
+ { url = "https://files.pythonhosted.org/packages/73/38/600f4dda40c4a33133404d9fe644f1d35ff2d9babb4d0435c646c63dd107/hf_xet-1.3.2-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:305f5489d7241a47e0458ef49334be02411d1d0f480846363c1c8084ed9916f7", size = 4161378, upload-time = "2026-02-27T17:26:00.365Z" },
+ { url = "https://files.pythonhosted.org/packages/00/b3/7bc1ff91d1ac18420b7ad1e169b618b27c00001b96310a89f8a9294fe509/hf_xet-1.3.2-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:06cdbde243c85f39a63b28e9034321399c507bcd5e7befdd17ed2ccc06dfe14e", size = 4398020, upload-time = "2026-02-27T17:26:03.977Z" },
+ { url = "https://files.pythonhosted.org/packages/2b/0b/99bfd948a3ed3620ab709276df3ad3710dcea61976918cce8706502927af/hf_xet-1.3.2-cp37-abi3-win_amd64.whl", hash = "sha256:9298b47cce6037b7045ae41482e703c471ce36b52e73e49f71226d2e8e5685a1", size = 3641624, upload-time = "2026-02-27T17:26:13.542Z" },
+ { url = "https://files.pythonhosted.org/packages/cc/02/9a6e4ca1f3f73a164c0cd48e41b3cc56585dcc37e809250de443d673266f/hf_xet-1.3.2-cp37-abi3-win_arm64.whl", hash = "sha256:83d8ec273136171431833a6957e8f3af496bee227a0fe47c7b8b39c106d1749a", size = 3503976, upload-time = "2026-02-27T17:26:12.123Z" },
]
[[package]]
@@ -3301,7 +3300,7 @@ wheels = [
[[package]]
name = "pipelex"
-version = "0.18.1"
+version = "0.18.2"
source = { editable = "." }
dependencies = [
{ name = "aiofiles" },
@@ -5597,15 +5596,15 @@ bedrock-runtime = [
[[package]]
name = "types-aiobotocore"
-version = "3.1.3"
+version = "3.2.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "botocore-stubs" },
{ name = "typing-extensions", marker = "python_full_version < '3.12'" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/51/84/7bac4416719b7b45065495ffce1a6d3d6dec91be27fefc7d4b706b08d7bf/types_aiobotocore-3.1.3.tar.gz", hash = "sha256:e19b3b91d9da46cc5fb4c0ae9e51a6f02e168608db84cbbcbc26a3c419cf386a", size = 86437, upload-time = "2026-02-15T02:44:14.955Z" }
+sdist = { url = "https://files.pythonhosted.org/packages/d4/4c/8010f4d975a6c9ef05760619153d20c15e1ff4bd1c52f213d065cf5f676f/types_aiobotocore-3.2.0.tar.gz", hash = "sha256:79199e9cb564352dc9ef987fa1bff753a3757fdc1cc5439ab421e6db5ee90ea6", size = 86250, upload-time = "2026-02-26T02:18:27.408Z" }
wheels = [
- { url = "https://files.pythonhosted.org/packages/3b/63/f7dad2aff2c66efb7bd7e38b116ff0bc40c7223f54eef1cb50b8b265d287/types_aiobotocore-3.1.3-py3-none-any.whl", hash = "sha256:7cc70db11c568ca439f81473d711f16955a10d7289c519d7943f01a8e12ea727", size = 54208, upload-time = "2026-02-15T02:44:09.873Z" },
+ { url = "https://files.pythonhosted.org/packages/c3/61/dd7fc266b32dd5be864aee3e993442e0fde1149a4cd1618bce1878eccab6/types_aiobotocore-3.2.0-py3-none-any.whl", hash = "sha256:07bd9bb89655109856cf26a207e07fe9256521ac82d09656961c62594edfeee3", size = 54129, upload-time = "2026-02-26T02:18:20.829Z" },
]
[[package]]
@@ -5784,61 +5783,70 @@ wheels = [
[[package]]
name = "websockets"
-version = "15.0.1"
-source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/21/e6/26d09fab466b7ca9c7737474c52be4f76a40301b08362eb2dbc19dcc16c1/websockets-15.0.1.tar.gz", hash = "sha256:82544de02076bafba038ce055ee6412d68da13ab47f0c60cab827346de828dee", size = 177016, upload-time = "2025-03-05T20:03:41.606Z" }
-wheels = [
- { url = "https://files.pythonhosted.org/packages/1e/da/6462a9f510c0c49837bbc9345aca92d767a56c1fb2939e1579df1e1cdcf7/websockets-15.0.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d63efaa0cd96cf0c5fe4d581521d9fa87744540d4bc999ae6e08595a1014b45b", size = 175423, upload-time = "2025-03-05T20:01:35.363Z" },
- { url = "https://files.pythonhosted.org/packages/1c/9f/9d11c1a4eb046a9e106483b9ff69bce7ac880443f00e5ce64261b47b07e7/websockets-15.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ac60e3b188ec7574cb761b08d50fcedf9d77f1530352db4eef1707fe9dee7205", size = 173080, upload-time = "2025-03-05T20:01:37.304Z" },
- { url = "https://files.pythonhosted.org/packages/d5/4f/b462242432d93ea45f297b6179c7333dd0402b855a912a04e7fc61c0d71f/websockets-15.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5756779642579d902eed757b21b0164cd6fe338506a8083eb58af5c372e39d9a", size = 173329, upload-time = "2025-03-05T20:01:39.668Z" },
- { url = "https://files.pythonhosted.org/packages/6e/0c/6afa1f4644d7ed50284ac59cc70ef8abd44ccf7d45850d989ea7310538d0/websockets-15.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0fdfe3e2a29e4db3659dbd5bbf04560cea53dd9610273917799f1cde46aa725e", size = 182312, upload-time = "2025-03-05T20:01:41.815Z" },
- { url = "https://files.pythonhosted.org/packages/dd/d4/ffc8bd1350b229ca7a4db2a3e1c482cf87cea1baccd0ef3e72bc720caeec/websockets-15.0.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4c2529b320eb9e35af0fa3016c187dffb84a3ecc572bcee7c3ce302bfeba52bf", size = 181319, upload-time = "2025-03-05T20:01:43.967Z" },
- { url = "https://files.pythonhosted.org/packages/97/3a/5323a6bb94917af13bbb34009fac01e55c51dfde354f63692bf2533ffbc2/websockets-15.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac1e5c9054fe23226fb11e05a6e630837f074174c4c2f0fe442996112a6de4fb", size = 181631, upload-time = "2025-03-05T20:01:46.104Z" },
- { url = "https://files.pythonhosted.org/packages/a6/cc/1aeb0f7cee59ef065724041bb7ed667b6ab1eeffe5141696cccec2687b66/websockets-15.0.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5df592cd503496351d6dc14f7cdad49f268d8e618f80dce0cd5a36b93c3fc08d", size = 182016, upload-time = "2025-03-05T20:01:47.603Z" },
- { url = "https://files.pythonhosted.org/packages/79/f9/c86f8f7af208e4161a7f7e02774e9d0a81c632ae76db2ff22549e1718a51/websockets-15.0.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:0a34631031a8f05657e8e90903e656959234f3a04552259458aac0b0f9ae6fd9", size = 181426, upload-time = "2025-03-05T20:01:48.949Z" },
- { url = "https://files.pythonhosted.org/packages/c7/b9/828b0bc6753db905b91df6ae477c0b14a141090df64fb17f8a9d7e3516cf/websockets-15.0.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:3d00075aa65772e7ce9e990cab3ff1de702aa09be3940d1dc88d5abf1ab8a09c", size = 181360, upload-time = "2025-03-05T20:01:50.938Z" },
- { url = "https://files.pythonhosted.org/packages/89/fb/250f5533ec468ba6327055b7d98b9df056fb1ce623b8b6aaafb30b55d02e/websockets-15.0.1-cp310-cp310-win32.whl", hash = "sha256:1234d4ef35db82f5446dca8e35a7da7964d02c127b095e172e54397fb6a6c256", size = 176388, upload-time = "2025-03-05T20:01:52.213Z" },
- { url = "https://files.pythonhosted.org/packages/1c/46/aca7082012768bb98e5608f01658ff3ac8437e563eca41cf068bd5849a5e/websockets-15.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:39c1fec2c11dc8d89bba6b2bf1556af381611a173ac2b511cf7231622058af41", size = 176830, upload-time = "2025-03-05T20:01:53.922Z" },
- { url = "https://files.pythonhosted.org/packages/9f/32/18fcd5919c293a398db67443acd33fde142f283853076049824fc58e6f75/websockets-15.0.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:823c248b690b2fd9303ba00c4f66cd5e2d8c3ba4aa968b2779be9532a4dad431", size = 175423, upload-time = "2025-03-05T20:01:56.276Z" },
- { url = "https://files.pythonhosted.org/packages/76/70/ba1ad96b07869275ef42e2ce21f07a5b0148936688c2baf7e4a1f60d5058/websockets-15.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678999709e68425ae2593acf2e3ebcbcf2e69885a5ee78f9eb80e6e371f1bf57", size = 173082, upload-time = "2025-03-05T20:01:57.563Z" },
- { url = "https://files.pythonhosted.org/packages/86/f2/10b55821dd40eb696ce4704a87d57774696f9451108cff0d2824c97e0f97/websockets-15.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d50fd1ee42388dcfb2b3676132c78116490976f1300da28eb629272d5d93e905", size = 173330, upload-time = "2025-03-05T20:01:59.063Z" },
- { url = "https://files.pythonhosted.org/packages/a5/90/1c37ae8b8a113d3daf1065222b6af61cc44102da95388ac0018fcb7d93d9/websockets-15.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d99e5546bf73dbad5bf3547174cd6cb8ba7273062a23808ffea025ecb1cf8562", size = 182878, upload-time = "2025-03-05T20:02:00.305Z" },
- { url = "https://files.pythonhosted.org/packages/8e/8d/96e8e288b2a41dffafb78e8904ea7367ee4f891dafc2ab8d87e2124cb3d3/websockets-15.0.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:66dd88c918e3287efc22409d426c8f729688d89a0c587c88971a0faa2c2f3792", size = 181883, upload-time = "2025-03-05T20:02:03.148Z" },
- { url = "https://files.pythonhosted.org/packages/93/1f/5d6dbf551766308f6f50f8baf8e9860be6182911e8106da7a7f73785f4c4/websockets-15.0.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8dd8327c795b3e3f219760fa603dcae1dcc148172290a8ab15158cf85a953413", size = 182252, upload-time = "2025-03-05T20:02:05.29Z" },
- { url = "https://files.pythonhosted.org/packages/d4/78/2d4fed9123e6620cbf1706c0de8a1632e1a28e7774d94346d7de1bba2ca3/websockets-15.0.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8fdc51055e6ff4adeb88d58a11042ec9a5eae317a0a53d12c062c8a8865909e8", size = 182521, upload-time = "2025-03-05T20:02:07.458Z" },
- { url = "https://files.pythonhosted.org/packages/e7/3b/66d4c1b444dd1a9823c4a81f50231b921bab54eee2f69e70319b4e21f1ca/websockets-15.0.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:693f0192126df6c2327cce3baa7c06f2a117575e32ab2308f7f8216c29d9e2e3", size = 181958, upload-time = "2025-03-05T20:02:09.842Z" },
- { url = "https://files.pythonhosted.org/packages/08/ff/e9eed2ee5fed6f76fdd6032ca5cd38c57ca9661430bb3d5fb2872dc8703c/websockets-15.0.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:54479983bd5fb469c38f2f5c7e3a24f9a4e70594cd68cd1fa6b9340dadaff7cf", size = 181918, upload-time = "2025-03-05T20:02:11.968Z" },
- { url = "https://files.pythonhosted.org/packages/d8/75/994634a49b7e12532be6a42103597b71098fd25900f7437d6055ed39930a/websockets-15.0.1-cp311-cp311-win32.whl", hash = "sha256:16b6c1b3e57799b9d38427dda63edcbe4926352c47cf88588c0be4ace18dac85", size = 176388, upload-time = "2025-03-05T20:02:13.32Z" },
- { url = "https://files.pythonhosted.org/packages/98/93/e36c73f78400a65f5e236cd376713c34182e6663f6889cd45a4a04d8f203/websockets-15.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:27ccee0071a0e75d22cb35849b1db43f2ecd3e161041ac1ee9d2352ddf72f065", size = 176828, upload-time = "2025-03-05T20:02:14.585Z" },
- { url = "https://files.pythonhosted.org/packages/51/6b/4545a0d843594f5d0771e86463606a3988b5a09ca5123136f8a76580dd63/websockets-15.0.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:3e90baa811a5d73f3ca0bcbf32064d663ed81318ab225ee4f427ad4e26e5aff3", size = 175437, upload-time = "2025-03-05T20:02:16.706Z" },
- { url = "https://files.pythonhosted.org/packages/f4/71/809a0f5f6a06522af902e0f2ea2757f71ead94610010cf570ab5c98e99ed/websockets-15.0.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:592f1a9fe869c778694f0aa806ba0374e97648ab57936f092fd9d87f8bc03665", size = 173096, upload-time = "2025-03-05T20:02:18.832Z" },
- { url = "https://files.pythonhosted.org/packages/3d/69/1a681dd6f02180916f116894181eab8b2e25b31e484c5d0eae637ec01f7c/websockets-15.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0701bc3cfcb9164d04a14b149fd74be7347a530ad3bbf15ab2c678a2cd3dd9a2", size = 173332, upload-time = "2025-03-05T20:02:20.187Z" },
- { url = "https://files.pythonhosted.org/packages/a6/02/0073b3952f5bce97eafbb35757f8d0d54812b6174ed8dd952aa08429bcc3/websockets-15.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8b56bdcdb4505c8078cb6c7157d9811a85790f2f2b3632c7d1462ab5783d215", size = 183152, upload-time = "2025-03-05T20:02:22.286Z" },
- { url = "https://files.pythonhosted.org/packages/74/45/c205c8480eafd114b428284840da0b1be9ffd0e4f87338dc95dc6ff961a1/websockets-15.0.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0af68c55afbd5f07986df82831c7bff04846928ea8d1fd7f30052638788bc9b5", size = 182096, upload-time = "2025-03-05T20:02:24.368Z" },
- { url = "https://files.pythonhosted.org/packages/14/8f/aa61f528fba38578ec553c145857a181384c72b98156f858ca5c8e82d9d3/websockets-15.0.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:64dee438fed052b52e4f98f76c5790513235efaa1ef7f3f2192c392cd7c91b65", size = 182523, upload-time = "2025-03-05T20:02:25.669Z" },
- { url = "https://files.pythonhosted.org/packages/ec/6d/0267396610add5bc0d0d3e77f546d4cd287200804fe02323797de77dbce9/websockets-15.0.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:d5f6b181bb38171a8ad1d6aa58a67a6aa9d4b38d0f8c5f496b9e42561dfc62fe", size = 182790, upload-time = "2025-03-05T20:02:26.99Z" },
- { url = "https://files.pythonhosted.org/packages/02/05/c68c5adbf679cf610ae2f74a9b871ae84564462955d991178f95a1ddb7dd/websockets-15.0.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:5d54b09eba2bada6011aea5375542a157637b91029687eb4fdb2dab11059c1b4", size = 182165, upload-time = "2025-03-05T20:02:30.291Z" },
- { url = "https://files.pythonhosted.org/packages/29/93/bb672df7b2f5faac89761cb5fa34f5cec45a4026c383a4b5761c6cea5c16/websockets-15.0.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3be571a8b5afed347da347bfcf27ba12b069d9d7f42cb8c7028b5e98bbb12597", size = 182160, upload-time = "2025-03-05T20:02:31.634Z" },
- { url = "https://files.pythonhosted.org/packages/ff/83/de1f7709376dc3ca9b7eeb4b9a07b4526b14876b6d372a4dc62312bebee0/websockets-15.0.1-cp312-cp312-win32.whl", hash = "sha256:c338ffa0520bdb12fbc527265235639fb76e7bc7faafbb93f6ba80d9c06578a9", size = 176395, upload-time = "2025-03-05T20:02:33.017Z" },
- { url = "https://files.pythonhosted.org/packages/7d/71/abf2ebc3bbfa40f391ce1428c7168fb20582d0ff57019b69ea20fa698043/websockets-15.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:fcd5cf9e305d7b8338754470cf69cf81f420459dbae8a3b40cee57417f4614a7", size = 176841, upload-time = "2025-03-05T20:02:34.498Z" },
- { url = "https://files.pythonhosted.org/packages/cb/9f/51f0cf64471a9d2b4d0fc6c534f323b664e7095640c34562f5182e5a7195/websockets-15.0.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ee443ef070bb3b6ed74514f5efaa37a252af57c90eb33b956d35c8e9c10a1931", size = 175440, upload-time = "2025-03-05T20:02:36.695Z" },
- { url = "https://files.pythonhosted.org/packages/8a/05/aa116ec9943c718905997412c5989f7ed671bc0188ee2ba89520e8765d7b/websockets-15.0.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5a939de6b7b4e18ca683218320fc67ea886038265fd1ed30173f5ce3f8e85675", size = 173098, upload-time = "2025-03-05T20:02:37.985Z" },
- { url = "https://files.pythonhosted.org/packages/ff/0b/33cef55ff24f2d92924923c99926dcce78e7bd922d649467f0eda8368923/websockets-15.0.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:746ee8dba912cd6fc889a8147168991d50ed70447bf18bcda7039f7d2e3d9151", size = 173329, upload-time = "2025-03-05T20:02:39.298Z" },
- { url = "https://files.pythonhosted.org/packages/31/1d/063b25dcc01faa8fada1469bdf769de3768b7044eac9d41f734fd7b6ad6d/websockets-15.0.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:595b6c3969023ecf9041b2936ac3827e4623bfa3ccf007575f04c5a6aa318c22", size = 183111, upload-time = "2025-03-05T20:02:40.595Z" },
- { url = "https://files.pythonhosted.org/packages/93/53/9a87ee494a51bf63e4ec9241c1ccc4f7c2f45fff85d5bde2ff74fcb68b9e/websockets-15.0.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3c714d2fc58b5ca3e285461a4cc0c9a66bd0e24c5da9911e30158286c9b5be7f", size = 182054, upload-time = "2025-03-05T20:02:41.926Z" },
- { url = "https://files.pythonhosted.org/packages/ff/b2/83a6ddf56cdcbad4e3d841fcc55d6ba7d19aeb89c50f24dd7e859ec0805f/websockets-15.0.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f3c1e2ab208db911594ae5b4f79addeb3501604a165019dd221c0bdcabe4db8", size = 182496, upload-time = "2025-03-05T20:02:43.304Z" },
- { url = "https://files.pythonhosted.org/packages/98/41/e7038944ed0abf34c45aa4635ba28136f06052e08fc2168520bb8b25149f/websockets-15.0.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:229cf1d3ca6c1804400b0a9790dc66528e08a6a1feec0d5040e8b9eb14422375", size = 182829, upload-time = "2025-03-05T20:02:48.812Z" },
- { url = "https://files.pythonhosted.org/packages/e0/17/de15b6158680c7623c6ef0db361da965ab25d813ae54fcfeae2e5b9ef910/websockets-15.0.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:756c56e867a90fb00177d530dca4b097dd753cde348448a1012ed6c5131f8b7d", size = 182217, upload-time = "2025-03-05T20:02:50.14Z" },
- { url = "https://files.pythonhosted.org/packages/33/2b/1f168cb6041853eef0362fb9554c3824367c5560cbdaad89ac40f8c2edfc/websockets-15.0.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:558d023b3df0bffe50a04e710bc87742de35060580a293c2a984299ed83bc4e4", size = 182195, upload-time = "2025-03-05T20:02:51.561Z" },
- { url = "https://files.pythonhosted.org/packages/86/eb/20b6cdf273913d0ad05a6a14aed4b9a85591c18a987a3d47f20fa13dcc47/websockets-15.0.1-cp313-cp313-win32.whl", hash = "sha256:ba9e56e8ceeeedb2e080147ba85ffcd5cd0711b89576b83784d8605a7df455fa", size = 176393, upload-time = "2025-03-05T20:02:53.814Z" },
- { url = "https://files.pythonhosted.org/packages/1b/6c/c65773d6cab416a64d191d6ee8a8b1c68a09970ea6909d16965d26bfed1e/websockets-15.0.1-cp313-cp313-win_amd64.whl", hash = "sha256:e09473f095a819042ecb2ab9465aee615bd9c2028e4ef7d933600a8401c79561", size = 176837, upload-time = "2025-03-05T20:02:55.237Z" },
- { url = "https://files.pythonhosted.org/packages/02/9e/d40f779fa16f74d3468357197af8d6ad07e7c5a27ea1ca74ceb38986f77a/websockets-15.0.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:0c9e74d766f2818bb95f84c25be4dea09841ac0f734d1966f415e4edfc4ef1c3", size = 173109, upload-time = "2025-03-05T20:03:17.769Z" },
- { url = "https://files.pythonhosted.org/packages/bc/cd/5b887b8585a593073fd92f7c23ecd3985cd2c3175025a91b0d69b0551372/websockets-15.0.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:1009ee0c7739c08a0cd59de430d6de452a55e42d6b522de7aa15e6f67db0b8e1", size = 173343, upload-time = "2025-03-05T20:03:19.094Z" },
- { url = "https://files.pythonhosted.org/packages/fe/ae/d34f7556890341e900a95acf4886833646306269f899d58ad62f588bf410/websockets-15.0.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:76d1f20b1c7a2fa82367e04982e708723ba0e7b8d43aa643d3dcd404d74f1475", size = 174599, upload-time = "2025-03-05T20:03:21.1Z" },
- { url = "https://files.pythonhosted.org/packages/71/e6/5fd43993a87db364ec60fc1d608273a1a465c0caba69176dd160e197ce42/websockets-15.0.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f29d80eb9a9263b8d109135351caf568cc3f80b9928bccde535c235de55c22d9", size = 174207, upload-time = "2025-03-05T20:03:23.221Z" },
- { url = "https://files.pythonhosted.org/packages/2b/fb/c492d6daa5ec067c2988ac80c61359ace5c4c674c532985ac5a123436cec/websockets-15.0.1-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b359ed09954d7c18bbc1680f380c7301f92c60bf924171629c5db97febb12f04", size = 174155, upload-time = "2025-03-05T20:03:25.321Z" },
- { url = "https://files.pythonhosted.org/packages/68/a1/dcb68430b1d00b698ae7a7e0194433bce4f07ded185f0ee5fb21e2a2e91e/websockets-15.0.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:cad21560da69f4ce7658ca2cb83138fb4cf695a2ba3e475e0559e05991aa8122", size = 176884, upload-time = "2025-03-05T20:03:27.934Z" },
- { url = "https://files.pythonhosted.org/packages/fa/a8/5b41e0da817d64113292ab1f8247140aac61cbf6cfd085d6a0fa77f4984f/websockets-15.0.1-py3-none-any.whl", hash = "sha256:f7a866fbc1e97b5c617ee4116daaa09b722101d4a3c170c787450ba409f9736f", size = 169743, upload-time = "2025-03-05T20:03:39.41Z" },
+version = "16.0"
+source = { registry = "https://pypi.org/simple" }
+sdist = { url = "https://files.pythonhosted.org/packages/04/24/4b2031d72e840ce4c1ccb255f693b15c334757fc50023e4db9537080b8c4/websockets-16.0.tar.gz", hash = "sha256:5f6261a5e56e8d5c42a4497b364ea24d94d9563e8fbd44e78ac40879c60179b5", size = 179346, upload-time = "2026-01-10T09:23:47.181Z" }
+wheels = [
+ { url = "https://files.pythonhosted.org/packages/20/74/221f58decd852f4b59cc3354cccaf87e8ef695fede361d03dc9a7396573b/websockets-16.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:04cdd5d2d1dacbad0a7bf36ccbcd3ccd5a30ee188f2560b7a62a30d14107b31a", size = 177343, upload-time = "2026-01-10T09:22:21.28Z" },
+ { url = "https://files.pythonhosted.org/packages/19/0f/22ef6107ee52ab7f0b710d55d36f5a5d3ef19e8a205541a6d7ffa7994e5a/websockets-16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8ff32bb86522a9e5e31439a58addbb0166f0204d64066fb955265c4e214160f0", size = 175021, upload-time = "2026-01-10T09:22:22.696Z" },
+ { url = "https://files.pythonhosted.org/packages/10/40/904a4cb30d9b61c0e278899bf36342e9b0208eb3c470324a9ecbaac2a30f/websockets-16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:583b7c42688636f930688d712885cf1531326ee05effd982028212ccc13e5957", size = 175320, upload-time = "2026-01-10T09:22:23.94Z" },
+ { url = "https://files.pythonhosted.org/packages/9d/2f/4b3ca7e106bc608744b1cdae041e005e446124bebb037b18799c2d356864/websockets-16.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:7d837379b647c0c4c2355c2499723f82f1635fd2c26510e1f587d89bc2199e72", size = 183815, upload-time = "2026-01-10T09:22:25.469Z" },
+ { url = "https://files.pythonhosted.org/packages/86/26/d40eaa2a46d4302becec8d15b0fc5e45bdde05191e7628405a19cf491ccd/websockets-16.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:df57afc692e517a85e65b72e165356ed1df12386ecb879ad5693be08fac65dde", size = 185054, upload-time = "2026-01-10T09:22:27.101Z" },
+ { url = "https://files.pythonhosted.org/packages/b0/ba/6500a0efc94f7373ee8fefa8c271acdfd4dca8bd49a90d4be7ccabfc397e/websockets-16.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:2b9f1e0d69bc60a4a87349d50c09a037a2607918746f07de04df9e43252c77a3", size = 184565, upload-time = "2026-01-10T09:22:28.293Z" },
+ { url = "https://files.pythonhosted.org/packages/04/b4/96bf2cee7c8d8102389374a2616200574f5f01128d1082f44102140344cc/websockets-16.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:335c23addf3d5e6a8633f9f8eda77efad001671e80b95c491dd0924587ece0b3", size = 183848, upload-time = "2026-01-10T09:22:30.394Z" },
+ { url = "https://files.pythonhosted.org/packages/02/8e/81f40fb00fd125357814e8c3025738fc4ffc3da4b6b4a4472a82ba304b41/websockets-16.0-cp310-cp310-win32.whl", hash = "sha256:37b31c1623c6605e4c00d466c9d633f9b812ea430c11c8a278774a1fde1acfa9", size = 178249, upload-time = "2026-01-10T09:22:32.083Z" },
+ { url = "https://files.pythonhosted.org/packages/b4/5f/7e40efe8df57db9b91c88a43690ac66f7b7aa73a11aa6a66b927e44f26fa/websockets-16.0-cp310-cp310-win_amd64.whl", hash = "sha256:8e1dab317b6e77424356e11e99a432b7cb2f3ec8c5ab4dabbcee6add48f72b35", size = 178685, upload-time = "2026-01-10T09:22:33.345Z" },
+ { url = "https://files.pythonhosted.org/packages/f2/db/de907251b4ff46ae804ad0409809504153b3f30984daf82a1d84a9875830/websockets-16.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:31a52addea25187bde0797a97d6fc3d2f92b6f72a9370792d65a6e84615ac8a8", size = 177340, upload-time = "2026-01-10T09:22:34.539Z" },
+ { url = "https://files.pythonhosted.org/packages/f3/fa/abe89019d8d8815c8781e90d697dec52523fb8ebe308bf11664e8de1877e/websockets-16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:417b28978cdccab24f46400586d128366313e8a96312e4b9362a4af504f3bbad", size = 175022, upload-time = "2026-01-10T09:22:36.332Z" },
+ { url = "https://files.pythonhosted.org/packages/58/5d/88ea17ed1ded2079358b40d31d48abe90a73c9e5819dbcde1606e991e2ad/websockets-16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:af80d74d4edfa3cb9ed973a0a5ba2b2a549371f8a741e0800cb07becdd20f23d", size = 175319, upload-time = "2026-01-10T09:22:37.602Z" },
+ { url = "https://files.pythonhosted.org/packages/d2/ae/0ee92b33087a33632f37a635e11e1d99d429d3d323329675a6022312aac2/websockets-16.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:08d7af67b64d29823fed316505a89b86705f2b7981c07848fb5e3ea3020c1abe", size = 184631, upload-time = "2026-01-10T09:22:38.789Z" },
+ { url = "https://files.pythonhosted.org/packages/c8/c5/27178df583b6c5b31b29f526ba2da5e2f864ecc79c99dae630a85d68c304/websockets-16.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7be95cfb0a4dae143eaed2bcba8ac23f4892d8971311f1b06f3c6b78952ee70b", size = 185870, upload-time = "2026-01-10T09:22:39.893Z" },
+ { url = "https://files.pythonhosted.org/packages/87/05/536652aa84ddc1c018dbb7e2c4cbcd0db884580bf8e95aece7593fde526f/websockets-16.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d6297ce39ce5c2e6feb13c1a996a2ded3b6832155fcfc920265c76f24c7cceb5", size = 185361, upload-time = "2026-01-10T09:22:41.016Z" },
+ { url = "https://files.pythonhosted.org/packages/6d/e2/d5332c90da12b1e01f06fb1b85c50cfc489783076547415bf9f0a659ec19/websockets-16.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1c1b30e4f497b0b354057f3467f56244c603a79c0d1dafce1d16c283c25f6e64", size = 184615, upload-time = "2026-01-10T09:22:42.442Z" },
+ { url = "https://files.pythonhosted.org/packages/77/fb/d3f9576691cae9253b51555f841bc6600bf0a983a461c79500ace5a5b364/websockets-16.0-cp311-cp311-win32.whl", hash = "sha256:5f451484aeb5cafee1ccf789b1b66f535409d038c56966d6101740c1614b86c6", size = 178246, upload-time = "2026-01-10T09:22:43.654Z" },
+ { url = "https://files.pythonhosted.org/packages/54/67/eaff76b3dbaf18dcddabc3b8c1dba50b483761cccff67793897945b37408/websockets-16.0-cp311-cp311-win_amd64.whl", hash = "sha256:8d7f0659570eefb578dacde98e24fb60af35350193e4f56e11190787bee77dac", size = 178684, upload-time = "2026-01-10T09:22:44.941Z" },
+ { url = "https://files.pythonhosted.org/packages/84/7b/bac442e6b96c9d25092695578dda82403c77936104b5682307bd4deb1ad4/websockets-16.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:71c989cbf3254fbd5e84d3bff31e4da39c43f884e64f2551d14bb3c186230f00", size = 177365, upload-time = "2026-01-10T09:22:46.787Z" },
+ { url = "https://files.pythonhosted.org/packages/b0/fe/136ccece61bd690d9c1f715baaeefd953bb2360134de73519d5df19d29ca/websockets-16.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:8b6e209ffee39ff1b6d0fa7bfef6de950c60dfb91b8fcead17da4ee539121a79", size = 175038, upload-time = "2026-01-10T09:22:47.999Z" },
+ { url = "https://files.pythonhosted.org/packages/40/1e/9771421ac2286eaab95b8575b0cb701ae3663abf8b5e1f64f1fd90d0a673/websockets-16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:86890e837d61574c92a97496d590968b23c2ef0aeb8a9bc9421d174cd378ae39", size = 175328, upload-time = "2026-01-10T09:22:49.809Z" },
+ { url = "https://files.pythonhosted.org/packages/18/29/71729b4671f21e1eaa5d6573031ab810ad2936c8175f03f97f3ff164c802/websockets-16.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:9b5aca38b67492ef518a8ab76851862488a478602229112c4b0d58d63a7a4d5c", size = 184915, upload-time = "2026-01-10T09:22:51.071Z" },
+ { url = "https://files.pythonhosted.org/packages/97/bb/21c36b7dbbafc85d2d480cd65df02a1dc93bf76d97147605a8e27ff9409d/websockets-16.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e0334872c0a37b606418ac52f6ab9cfd17317ac26365f7f65e203e2d0d0d359f", size = 186152, upload-time = "2026-01-10T09:22:52.224Z" },
+ { url = "https://files.pythonhosted.org/packages/4a/34/9bf8df0c0cf88fa7bfe36678dc7b02970c9a7d5e065a3099292db87b1be2/websockets-16.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a0b31e0b424cc6b5a04b8838bbaec1688834b2383256688cf47eb97412531da1", size = 185583, upload-time = "2026-01-10T09:22:53.443Z" },
+ { url = "https://files.pythonhosted.org/packages/47/88/4dd516068e1a3d6ab3c7c183288404cd424a9a02d585efbac226cb61ff2d/websockets-16.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:485c49116d0af10ac698623c513c1cc01c9446c058a4e61e3bf6c19dff7335a2", size = 184880, upload-time = "2026-01-10T09:22:55.033Z" },
+ { url = "https://files.pythonhosted.org/packages/91/d6/7d4553ad4bf1c0421e1ebd4b18de5d9098383b5caa1d937b63df8d04b565/websockets-16.0-cp312-cp312-win32.whl", hash = "sha256:eaded469f5e5b7294e2bdca0ab06becb6756ea86894a47806456089298813c89", size = 178261, upload-time = "2026-01-10T09:22:56.251Z" },
+ { url = "https://files.pythonhosted.org/packages/c3/f0/f3a17365441ed1c27f850a80b2bc680a0fa9505d733fe152fdf5e98c1c0b/websockets-16.0-cp312-cp312-win_amd64.whl", hash = "sha256:5569417dc80977fc8c2d43a86f78e0a5a22fee17565d78621b6bb264a115d4ea", size = 178693, upload-time = "2026-01-10T09:22:57.478Z" },
+ { url = "https://files.pythonhosted.org/packages/cc/9c/baa8456050d1c1b08dd0ec7346026668cbc6f145ab4e314d707bb845bf0d/websockets-16.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:878b336ac47938b474c8f982ac2f7266a540adc3fa4ad74ae96fea9823a02cc9", size = 177364, upload-time = "2026-01-10T09:22:59.333Z" },
+ { url = "https://files.pythonhosted.org/packages/7e/0c/8811fc53e9bcff68fe7de2bcbe75116a8d959ac699a3200f4847a8925210/websockets-16.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:52a0fec0e6c8d9a784c2c78276a48a2bdf099e4ccc2a4cad53b27718dbfd0230", size = 175039, upload-time = "2026-01-10T09:23:01.171Z" },
+ { url = "https://files.pythonhosted.org/packages/aa/82/39a5f910cb99ec0b59e482971238c845af9220d3ab9fa76dd9162cda9d62/websockets-16.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:e6578ed5b6981005df1860a56e3617f14a6c307e6a71b4fff8c48fdc50f3ed2c", size = 175323, upload-time = "2026-01-10T09:23:02.341Z" },
+ { url = "https://files.pythonhosted.org/packages/bd/28/0a25ee5342eb5d5f297d992a77e56892ecb65e7854c7898fb7d35e9b33bd/websockets-16.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:95724e638f0f9c350bb1c2b0a7ad0e83d9cc0c9259f3ea94e40d7b02a2179ae5", size = 184975, upload-time = "2026-01-10T09:23:03.756Z" },
+ { url = "https://files.pythonhosted.org/packages/f9/66/27ea52741752f5107c2e41fda05e8395a682a1e11c4e592a809a90c6a506/websockets-16.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c0204dc62a89dc9d50d682412c10b3542d748260d743500a85c13cd1ee4bde82", size = 186203, upload-time = "2026-01-10T09:23:05.01Z" },
+ { url = "https://files.pythonhosted.org/packages/37/e5/8e32857371406a757816a2b471939d51c463509be73fa538216ea52b792a/websockets-16.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:52ac480f44d32970d66763115edea932f1c5b1312de36df06d6b219f6741eed8", size = 185653, upload-time = "2026-01-10T09:23:06.301Z" },
+ { url = "https://files.pythonhosted.org/packages/9b/67/f926bac29882894669368dc73f4da900fcdf47955d0a0185d60103df5737/websockets-16.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6e5a82b677f8f6f59e8dfc34ec06ca6b5b48bc4fcda346acd093694cc2c24d8f", size = 184920, upload-time = "2026-01-10T09:23:07.492Z" },
+ { url = "https://files.pythonhosted.org/packages/3c/a1/3d6ccdcd125b0a42a311bcd15a7f705d688f73b2a22d8cf1c0875d35d34a/websockets-16.0-cp313-cp313-win32.whl", hash = "sha256:abf050a199613f64c886ea10f38b47770a65154dc37181bfaff70c160f45315a", size = 178255, upload-time = "2026-01-10T09:23:09.245Z" },
+ { url = "https://files.pythonhosted.org/packages/6b/ae/90366304d7c2ce80f9b826096a9e9048b4bb760e44d3b873bb272cba696b/websockets-16.0-cp313-cp313-win_amd64.whl", hash = "sha256:3425ac5cf448801335d6fdc7ae1eb22072055417a96cc6b31b3861f455fbc156", size = 178689, upload-time = "2026-01-10T09:23:10.483Z" },
+ { url = "https://files.pythonhosted.org/packages/f3/1d/e88022630271f5bd349ed82417136281931e558d628dd52c4d8621b4a0b2/websockets-16.0-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:8cc451a50f2aee53042ac52d2d053d08bf89bcb31ae799cb4487587661c038a0", size = 177406, upload-time = "2026-01-10T09:23:12.178Z" },
+ { url = "https://files.pythonhosted.org/packages/f2/78/e63be1bf0724eeb4616efb1ae1c9044f7c3953b7957799abb5915bffd38e/websockets-16.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:daa3b6ff70a9241cf6c7fc9e949d41232d9d7d26fd3522b1ad2b4d62487e9904", size = 175085, upload-time = "2026-01-10T09:23:13.511Z" },
+ { url = "https://files.pythonhosted.org/packages/bb/f4/d3c9220d818ee955ae390cf319a7c7a467beceb24f05ee7aaaa2414345ba/websockets-16.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:fd3cb4adb94a2a6e2b7c0d8d05cb94e6f1c81a0cf9dc2694fb65c7e8d94c42e4", size = 175328, upload-time = "2026-01-10T09:23:14.727Z" },
+ { url = "https://files.pythonhosted.org/packages/63/bc/d3e208028de777087e6fb2b122051a6ff7bbcca0d6df9d9c2bf1dd869ae9/websockets-16.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:781caf5e8eee67f663126490c2f96f40906594cb86b408a703630f95550a8c3e", size = 185044, upload-time = "2026-01-10T09:23:15.939Z" },
+ { url = "https://files.pythonhosted.org/packages/ad/6e/9a0927ac24bd33a0a9af834d89e0abc7cfd8e13bed17a86407a66773cc0e/websockets-16.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:caab51a72c51973ca21fa8a18bd8165e1a0183f1ac7066a182ff27107b71e1a4", size = 186279, upload-time = "2026-01-10T09:23:17.148Z" },
+ { url = "https://files.pythonhosted.org/packages/b9/ca/bf1c68440d7a868180e11be653c85959502efd3a709323230314fda6e0b3/websockets-16.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:19c4dc84098e523fd63711e563077d39e90ec6702aff4b5d9e344a60cb3c0cb1", size = 185711, upload-time = "2026-01-10T09:23:18.372Z" },
+ { url = "https://files.pythonhosted.org/packages/c4/f8/fdc34643a989561f217bb477cbc47a3a07212cbda91c0e4389c43c296ebf/websockets-16.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:a5e18a238a2b2249c9a9235466b90e96ae4795672598a58772dd806edc7ac6d3", size = 184982, upload-time = "2026-01-10T09:23:19.652Z" },
+ { url = "https://files.pythonhosted.org/packages/dd/d1/574fa27e233764dbac9c52730d63fcf2823b16f0856b3329fc6268d6ae4f/websockets-16.0-cp314-cp314-win32.whl", hash = "sha256:a069d734c4a043182729edd3e9f247c3b2a4035415a9172fd0f1b71658a320a8", size = 177915, upload-time = "2026-01-10T09:23:21.458Z" },
+ { url = "https://files.pythonhosted.org/packages/8a/f1/ae6b937bf3126b5134ce1f482365fde31a357c784ac51852978768b5eff4/websockets-16.0-cp314-cp314-win_amd64.whl", hash = "sha256:c0ee0e63f23914732c6d7e0cce24915c48f3f1512ec1d079ed01fc629dab269d", size = 178381, upload-time = "2026-01-10T09:23:22.715Z" },
+ { url = "https://files.pythonhosted.org/packages/06/9b/f791d1db48403e1f0a27577a6beb37afae94254a8c6f08be4a23e4930bc0/websockets-16.0-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:a35539cacc3febb22b8f4d4a99cc79b104226a756aa7400adc722e83b0d03244", size = 177737, upload-time = "2026-01-10T09:23:24.523Z" },
+ { url = "https://files.pythonhosted.org/packages/bd/40/53ad02341fa33b3ce489023f635367a4ac98b73570102ad2cdd770dacc9a/websockets-16.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:b784ca5de850f4ce93ec85d3269d24d4c82f22b7212023c974c401d4980ebc5e", size = 175268, upload-time = "2026-01-10T09:23:25.781Z" },
+ { url = "https://files.pythonhosted.org/packages/74/9b/6158d4e459b984f949dcbbb0c5d270154c7618e11c01029b9bbd1bb4c4f9/websockets-16.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:569d01a4e7fba956c5ae4fc988f0d4e187900f5497ce46339c996dbf24f17641", size = 175486, upload-time = "2026-01-10T09:23:27.033Z" },
+ { url = "https://files.pythonhosted.org/packages/e5/2d/7583b30208b639c8090206f95073646c2c9ffd66f44df967981a64f849ad/websockets-16.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:50f23cdd8343b984957e4077839841146f67a3d31ab0d00e6b824e74c5b2f6e8", size = 185331, upload-time = "2026-01-10T09:23:28.259Z" },
+ { url = "https://files.pythonhosted.org/packages/45/b0/cce3784eb519b7b5ad680d14b9673a31ab8dcb7aad8b64d81709d2430aa8/websockets-16.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:152284a83a00c59b759697b7f9e9cddf4e3c7861dd0d964b472b70f78f89e80e", size = 186501, upload-time = "2026-01-10T09:23:29.449Z" },
+ { url = "https://files.pythonhosted.org/packages/19/60/b8ebe4c7e89fb5f6cdf080623c9d92789a53636950f7abacfc33fe2b3135/websockets-16.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:bc59589ab64b0022385f429b94697348a6a234e8ce22544e3681b2e9331b5944", size = 186062, upload-time = "2026-01-10T09:23:31.368Z" },
+ { url = "https://files.pythonhosted.org/packages/88/a8/a080593f89b0138b6cba1b28f8df5673b5506f72879322288b031337c0b8/websockets-16.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:32da954ffa2814258030e5a57bc73a3635463238e797c7375dc8091327434206", size = 185356, upload-time = "2026-01-10T09:23:32.627Z" },
+ { url = "https://files.pythonhosted.org/packages/c2/b6/b9afed2afadddaf5ebb2afa801abf4b0868f42f8539bfe4b071b5266c9fe/websockets-16.0-cp314-cp314t-win32.whl", hash = "sha256:5a4b4cc550cb665dd8a47f868c8d04c8230f857363ad3c9caf7a0c3bf8c61ca6", size = 178085, upload-time = "2026-01-10T09:23:33.816Z" },
+ { url = "https://files.pythonhosted.org/packages/9f/3e/28135a24e384493fa804216b79a6a6759a38cc4ff59118787b9fb693df93/websockets-16.0-cp314-cp314t-win_amd64.whl", hash = "sha256:b14dc141ed6d2dde437cddb216004bcac6a1df0935d79656387bd41632ba0bbd", size = 178531, upload-time = "2026-01-10T09:23:35.016Z" },
+ { url = "https://files.pythonhosted.org/packages/72/07/c98a68571dcf256e74f1f816b8cc5eae6eb2d3d5cfa44d37f801619d9166/websockets-16.0-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:349f83cd6c9a415428ee1005cadb5c2c56f4389bc06a9af16103c3bc3dcc8b7d", size = 174947, upload-time = "2026-01-10T09:23:36.166Z" },
+ { url = "https://files.pythonhosted.org/packages/7e/52/93e166a81e0305b33fe416338be92ae863563fe7bce446b0f687b9df5aea/websockets-16.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:4a1aba3340a8dca8db6eb5a7986157f52eb9e436b74813764241981ca4888f03", size = 175260, upload-time = "2026-01-10T09:23:37.409Z" },
+ { url = "https://files.pythonhosted.org/packages/56/0c/2dbf513bafd24889d33de2ff0368190a0e69f37bcfa19009ef819fe4d507/websockets-16.0-pp311-pypy311_pp73-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:f4a32d1bd841d4bcbffdcb3d2ce50c09c3909fbead375ab28d0181af89fd04da", size = 176071, upload-time = "2026-01-10T09:23:39.158Z" },
+ { url = "https://files.pythonhosted.org/packages/a5/8f/aea9c71cc92bf9b6cc0f7f70df8f0b420636b6c96ef4feee1e16f80f75dd/websockets-16.0-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0298d07ee155e2e9fda5be8a9042200dd2e3bb0b8a38482156576f863a9d457c", size = 176968, upload-time = "2026-01-10T09:23:41.031Z" },
+ { url = "https://files.pythonhosted.org/packages/9a/3f/f70e03f40ffc9a30d817eef7da1be72ee4956ba8d7255c399a01b135902a/websockets-16.0-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:a653aea902e0324b52f1613332ddf50b00c06fdaf7e92624fbf8c77c78fa5767", size = 178735, upload-time = "2026-01-10T09:23:42.259Z" },
+ { url = "https://files.pythonhosted.org/packages/6f/28/258ebab549c2bf3e64d2b0217b973467394a9cea8c42f70418ca2c5d0d2e/websockets-16.0-py3-none-any.whl", hash = "sha256:1637db62fad1dc833276dded54215f2c7fa46912301a24bd94d45d46a011ceec", size = 171598, upload-time = "2026-01-10T09:23:45.395Z" },
]
[[package]]