npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@felan-ai/ext-background-bash

v0.7.2

Published

Runtime-portable detached Bash processes for Felan

Readme

@felan-ai/ext-background-bash

Provider-neutral project-local Bash execution for Felan sessions. The extension augments bash with explicit backgrounding, bounded foreground waiting, optional PTY input, and adds tools to list, read, wait for, write to, and stop processes. Output and process metadata live under <session-storage>/background-bash/<workspace-key>/jobs. Local Felan maps <session-storage> to $FELAN_AGENT_DIR/storage/sessions/<encoded-root-session-id>, while cloud adapters map it to their root-session state path.

The implementation routes filesystem and process operations through the active AgentRuntime. Background launch uses a detached POSIX shell runner. Host, Docker, and Daytona runtimes need nohup, ps, sleep, and either setsid or shell job control so each process receives an isolated process group. The extension captures runtime.storage('session') once; that handle must be durable and visible in the same filesystem namespace as runtime.shell. It requests the explicit POSIX shell flavor for probing and execution, then leaves its tools inactive when the runtime is incompatible. On native Windows, HostAgentRuntime discovers a same-host Git Bash installation through FELAN_POSIX_SHELL, PATH, or standard Git-for-Windows locations. WSL is not selected automatically because its path and process namespace does not match the host runtime. Git Bash's process tools use its ps -l format when GNU ps -o is unavailable. The local TUI can persistently disable the extension through dependency onboarding; Felan does not install operating-system utilities.

The same process surface is available to every selected model. Model-specific policy belongs to the model-facing prompt/tool composition, not to process ownership or runtime capability checks.

This release requires a compatible @felan-ai/agent-core release because it uses the runtime's explicit POSIX shell flavor.

Tools and controls

  • bash({ command, background: true }) starts a detached process.
  • bash({ command, timeout: 120 }) waits in the tool, then promotes the same process without restarting it.
  • bash({ command, timeout: 0, tty: true }) starts an interactive PTY immediately.
  • write_background_bash({ id, chars }) sends exact stdin/control bytes to a PTY job.
  • list_background_bash lists workspace processes and statuses.
  • read_background_bash reads trailing process output, capped at 128 KiB of log content. Larger files use POSIX tail without loading the whole log.
  • wait_background_bash waits for terminal status without returning log output.
  • stop_background_bash sends SIGTERM or SIGKILL.
  • /processes and Ctrl+Shift+J open the interactive process/log view inline in the TUI.

The process/log view uses an inline frame. Automatic completion messages use a compact one-line summary; Alt+A reveals bounded details.

The default foreground promotion window is 120 seconds and can be changed with extensionConfig.backgroundBash.foregroundTimeoutSeconds. Cancelling a foreground wait terminates its process tree; cancelling a wait for an already-backgrounded job does not terminate that job. Detached jobs remain discoverable after restart when their runtime storage persists. PTY handles are root-session-scoped and are not reattachable after shutdown. The footer status shows the number of running processes. Live PTY status comes from its root-session handle, not detached-runner PID probes. Status reads and input remain available while another caller waits in the foreground. Terminal outcomes and completion timestamps are recorded once. An orphaned PTY is reported as unknown; its stored PID is not used to reattach or signal a process. Processes started by the active session deliver a completion message automatically. The message steers an active run at its next model-call boundary or triggers a turn when the agent is idle. A terminal result returned directly by list_background_bash, read_background_bash, wait_background_bash, or stop_background_bash suppresses the duplicate completion message.

Development

Source: packages/ext-background-bash in https://github.com/felan-ai/felan.

corepack enable
pnpm install --frozen-lockfile
pnpm --filter @felan-ai/ext-background-bash build
pnpm --filter @felan-ai/ext-background-bash type-check
pnpm --filter @felan-ai/ext-background-bash test

Attribution

This package adapts the MIT-licensed pi-background-bash implementation. See NOTICE and LICENSE for source details.

Composition and requirements

import backgroundBashExtension from '@felan-ai/ext-background-bash';

const extension = backgroundBashExtension;

Hosts provide the AgentRuntime; the local TUI owns the process view, shortcut, status polling, and dependency onboarding. Compatible runtimes need the POSIX shell/process facilities listed in runtime dependencies. Felan does not install operating-system utilities, and the feature remains inactive when they are unavailable.

The extension owns detached job records, logs, lifecycle, PTY controls, and the six model-facing process controls. It does not provide a sandbox.

Related documentation