Skip to content

feat(task-runner): run a project's own scripts from a sidebar panel - #176

Merged
sleeyax merged 11 commits into
mainfrom
feat/task-runner
Nov 10, 2026
Merged

sleeyax merged 11 commits into
mainfrom
feat/task-runner

Conversation

@sleeyax

@sleeyax sleeyax commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Summary

A Tasks panel in the Explorer lists what a project already defines and runs it in one step.

server/
├── discovery/                # reads files as text, never runs repo code unasked
│   ├── sources/              # package-scripts, makefile, nx, vscode-tasks: one file per ecosystem
│   └── inferred-targets.ts   # runs the repo's nx, only after "Load inferred targets"
└── runs/
    ├── shell-wrapper.ts      # sh wrapper and exit marker
    └── task-runs.ts          # run, stop, force kill, status
client/tasks-panel.tsx        # search, groups, rows

The daemon removes a terminal when its process exits and reports no exit code, so status comes from a wrapper:

sh -c
  trap : INT                      # C-c reaches the task, wrapper survives
  $SHELL -lic "<task>\nexit"      # trailing exit stops zsh exec-ing the task
  print ::task-exit=<code>::      # first marker wins, later lines came from the leftover shell
  exec $SHELL                     # terminal stays open, output stays readable

Monorepo tasks are named task: <group>: <label> rather than task: <label>, so two packages with a build keep separate terminals.

Closes #124

Evidence

  • Before: in the spike on real daemon terminals, a single-command task under zsh killed the wrapper on C-c: no marker, and the terminal disappeared.
    After: with the trailing exit, zsh and bash both print the marker, keep the terminal, and stay usable after someone types a fake marker into the leftover shell.
  • Before: jsonc-parser passed typecheck and tests but failed plugin load with Cannot find module './impl/format'.
    After: the plugin reaches running on Paseo 0.15.0.
  • pnpm test in plugins/task-runner: 78 pass, 0 fail, covering discoverTasks over real temp directories and TaskRuns over a fake terminal port.
  • The real terminal adapter was run end to end on a throwaway daemon: success, failure with exit code, stop, re-run replacing the terminal, and force kill after 5 seconds.
  • The { graph: { nodes } } shape and the naming of unnamed projects were checked against a real nx graph.

Not verified: the panel has not been looked at in the Paseo app, so layout and interaction are untested.

Merge Danger

Door: two-way

A new plugin that can be removed or disabled.

Blast Radius: isolated

Outside plugins/task-runner this only adds a README row, release-please entries and lockfile lines. Once installed, starting a task runs that project's own script on the daemon host, as the user asked for.

sleeyax and others added 11 commits November 10, 2026 00:09
Add a Tasks panel in the Explorer that lists package.json scripts, Makefile targets, Nx targets and .vscode/tasks.json tasks.
Discovery reads files as text, and only runs the repo's own nx after the user asks for inferred targets.
Tasks run in plugin-owned terminals inside an sh wrapper that prints an exit marker, since the SDK cannot report a terminal's status.
A trailing exit keeps zsh from exec-ing a single-command task, which lost the terminal and the marker on real daemons.
JSONC is read by hand because jsonc-parser's UMD build fails to load in the daemon's bundle.

Refs #124

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A group's rows now sit inset under a line dropping from its chevron, so it is clear which package a task belongs to.
A workspace with one group stays flat.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Read the packages list of pnpm-workspace.yaml by hand, so the plugin has no runtime dependency and no build step, and installing it no longer needs pnpm on the daemon's PATH.
Running a task never needed pnpm, since each task uses its project's own package manager.
The README now leaves rationale to the ADRs and drops what the panel already shows, and it names monorepo terminals correctly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The panel shows how to use it, so the README now only lists what the plugin supports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… for

Keep only what the panel does not show: where to open it, inferred Nx targets, and the tasks.json fields that are read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Run Task... now focuses the search box, where the arrow keys pick a task and Enter runs it.
Recently run tasks are listed first, under Recent, and a Rerun Last Task Command Center item runs the last one again.
Recent tasks are kept per workspace in the Paseo home's plugin data, because the plugin's server can read its settings but not write them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collapsed sections are keyed by section, so a package named Recent keeps its own state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It now matches the package names listed below it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The icon sits after the chevron, so the section still collapses and its guide line still drops from the chevron.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	.release-please-manifest.json
@sleeyax
sleeyax merged commit 4ca288b into main Nov 10, 2026
1 check passed
@sleeyax
sleeyax deleted the feat/task-runner branch November 10, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

task-runner: run a project's own scripts from a sidebar panel

1 participant