[PR #14] feat(workflows): add pipeline step type for in-process command execution #14

Open
opened 2026-02-15 18:15:41 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/openclaw/lobster/pull/14
Author: @sfo2001
Created: 2/15/2026
Status: 🔄 Open

Base: mainHead: feat/pipeline-step-type


📝 Commits (2)

  • 671dcd6 fix(stdlib): remove unused Transport type and transport variable
  • 91754c0 feat(workflows): add pipeline step type for in-process command execution

📊 Changes

5 files changed (+366 additions, -12 deletions)

View changed files

📝 src/cli.ts (+2 -0)
📝 src/commands/registry.ts (+7 -1)
📝 src/commands/stdlib/llm_task_invoke.ts (+0 -3)
📝 src/workflows/file.ts (+89 -8)
test/workflow_pipeline_step.test.ts (+268 -0)

📄 Description

Motivation

Workflow steps currently execute via /bin/sh, so using lobster's stdlib commands (map, sort, jq-filter, each) from a workflow requires spawning a separate lobster process. The pipeline step type runs commands in-process through the existing registry, avoiding the shell round-trip and making stdlib commands first-class citizens in workflow definitions.

Summary

  • Workflow steps can now use pipeline: "command | chain" instead of command: "shell string"
  • Pipeline steps run in-process via the command registry (no shell spawn), enabling use of stdlib commands like map, sort, each directly in workflow YAML
  • Exactly one of command or pipeline is required per step; validation rejects both or neither
  • cwd is not supported for pipeline steps (raises clear error)
  • Passes registry through RunContext from CLI to workflow runner

Changes

Category Files
Workflow runner src/workflows/file.ts (+runPipelineStep, stdinToStream, validation)
CLI src/cli.ts (pass registry into workflow run context)
Registry src/commands/registry.ts (export Registry interface)
Tests test/workflow_pipeline_step.test.ts (268 lines)

+366 / -9 lines across 4 files.

Test plan

  • pnpm build passes
  • pnpm lint passes
  • node --test dist/test/workflow_pipeline_step.test.js
  • Existing workflow tests still pass (backward-compatible, command steps unchanged)

Use of AI


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/openclaw/lobster/pull/14 **Author:** [@sfo2001](https://github.com/sfo2001) **Created:** 2/15/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/pipeline-step-type` --- ### 📝 Commits (2) - [`671dcd6`](https://github.com/openclaw/lobster/commit/671dcd66b39ddfb8ba690e0d8571ca140efbcc75) fix(stdlib): remove unused Transport type and transport variable - [`91754c0`](https://github.com/openclaw/lobster/commit/91754c05bddd6e03c151d20d950ab457a50f08bf) feat(workflows): add pipeline step type for in-process command execution ### 📊 Changes **5 files changed** (+366 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `src/cli.ts` (+2 -0) 📝 `src/commands/registry.ts` (+7 -1) 📝 `src/commands/stdlib/llm_task_invoke.ts` (+0 -3) 📝 `src/workflows/file.ts` (+89 -8) ➕ `test/workflow_pipeline_step.test.ts` (+268 -0) </details> ### 📄 Description ## Motivation Workflow steps currently execute via `/bin/sh`, so using lobster's stdlib commands (map, sort, jq-filter, each) from a workflow requires spawning a separate lobster process. The `pipeline` step type runs commands in-process through the existing registry, avoiding the shell round-trip and making stdlib commands first-class citizens in workflow definitions. ## Summary - Workflow steps can now use `pipeline: "command | chain"` instead of `command: "shell string"` - Pipeline steps run in-process via the command registry (no shell spawn), enabling use of stdlib commands like `map`, `sort`, `each` directly in workflow YAML - Exactly one of `command` or `pipeline` is required per step; validation rejects both or neither - `cwd` is not supported for pipeline steps (raises clear error) - Passes `registry` through `RunContext` from CLI to workflow runner ## Changes | Category | Files | |---|---| | Workflow runner | `src/workflows/file.ts` (+`runPipelineStep`, `stdinToStream`, validation) | | CLI | `src/cli.ts` (pass `registry` into workflow run context) | | Registry | `src/commands/registry.ts` (export `Registry` interface) | | Tests | `test/workflow_pipeline_step.test.ts` (268 lines) | +366 / -9 lines across 4 files. ## Test plan - [x] `pnpm build` passes - [x] `pnpm lint` passes - [x] `node --test dist/test/workflow_pipeline_step.test.js` - [x] Existing workflow tests still pass (backward-compatible, `command` steps unchanged) ## Use of AI - my idea, code and test generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 18:15:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/lobster#14