@aliou/pi-processes 0.10.8 → 0.10.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/package.json +2 -2
- package/src/utils/shell-utils.ts +44 -4
package/README.md
CHANGED
|
@@ -117,6 +117,46 @@ Available settings include:
|
|
|
117
117
|
- Linux: supported
|
|
118
118
|
- Windows: not supported
|
|
119
119
|
|
|
120
|
+
## Similar but different
|
|
121
|
+
|
|
122
|
+
Pi has several process, terminal, and background-task extensions. pi-processes focuses on explicit LLM-managed background processes, log inspection, watches that can wake the agent, and Pi UI surfaces for `/ps`, logs, dock, and status.
|
|
123
|
+
|
|
124
|
+
See [pi.dev/packages](https://pi.dev/packages) for the full registry of Pi extensions.
|
|
125
|
+
|
|
126
|
+
### Background command managers
|
|
127
|
+
|
|
128
|
+
These packages are closest when you want shell commands, dev servers, watchers, or logs to keep running while Pi continues the conversation.
|
|
129
|
+
|
|
130
|
+
- [pi-background-tasks](https://pi.dev/packages/pi-background-tasks): durable background shell tasks plus delegated child Pi workflows.
|
|
131
|
+
- [@99percentpeople/pi-background-tasks](https://pi.dev/packages/%4099percentpeople/pi-background-tasks): background commands and attachable PTY/TUI sessions, with SSH Remote integration.
|
|
132
|
+
- [@richardgill/pi-background-bash](https://github.com/richardgill/pi-extensions/tree/main/extensions/background-bash): replaces `bash` with session-owned local process groups and adds `bash_process` for list, peek, and kill.
|
|
133
|
+
- [pi-bash-bg](https://pi.dev/packages/pi-bash-bg): minimal `&` support for Pi's bash tool, detaching background processes and keeping output out of the context window.
|
|
134
|
+
- [pi-tian-background-terminals](https://pi.dev/packages/pi-tian-background-terminals): replaces Pi's built-in Bash with automatic background yielding, completion notifications, and a `/ps` viewer.
|
|
135
|
+
- [pi-better-background-tasks](https://pi.dev/packages/pi-better-background-tasks): durable background shell tasks, watchers, logs, and status inspection.
|
|
136
|
+
- [pi-patty-bg-tasks](https://pi.dev/packages/pi-patty-bg-tasks): Claude Code-style background tasks with auto-backgrounding, attach, file-backed output, and cooperative steering.
|
|
137
|
+
- [@mjakl/pi-processes](https://pi.dev/packages/%40mjakl/pi-processes): stripped-down pi-processes fork with the `process` tool, a single `/ps` overlay, a compact status line, and fewer commands/settings.
|
|
138
|
+
- [@haemmid/pi-processes](https://pi.dev/packages/%40haemmid/pi-processes): pi-web-focused pi-processes fork for dev-server automation, with `ensure`, `restart`, and `wait` actions for Astro/Vite-style workflows.
|
|
139
|
+
- [pi-processes-git-bash](https://pi.dev/packages/pi-processes-git-bash): pi-processes fork for Windows users through Git Bash.
|
|
140
|
+
|
|
141
|
+
### Terminal and shell replacements
|
|
142
|
+
|
|
143
|
+
These packages are a better fit when you want a different shell substrate, PTY behavior, or platform-specific terminal support.
|
|
144
|
+
|
|
145
|
+
- [pi-unified-exec](https://pi.dev/packages/pi-unified-exec): Codex-style long-lived shell sessions with stdin, PTY, REPL, SSH, dev-server, and disk-log support.
|
|
146
|
+
- [pi-live-terminal](https://pi.dev/packages/pi-live-terminal): tmux-backed command runner with a live terminal widget.
|
|
147
|
+
- [@aliaksei-raketski/pi-tmux-bash](https://pi.dev/packages/%40aliaksei-raketski/pi-tmux-bash): runs model-facing shell commands in managed tmux windows.
|
|
148
|
+
- [@4fu/pi-pwsh](https://pi.dev/packages/%404fu/pi-pwsh): persistent PowerShell tasks for Pi on Windows, with ConPTY sessions and user requests.
|
|
149
|
+
- [pi-pwsh-notify](https://pi.dev/packages/pi-pwsh-notify): PowerShell shell with background jobs and completion/server-ready notifications.
|
|
150
|
+
|
|
151
|
+
### Monitors, schedulers, and visibility
|
|
152
|
+
|
|
153
|
+
These packages are more about watching, waking, or surfacing process state than replacing pi-processes directly.
|
|
154
|
+
|
|
155
|
+
- [pi-event-monitor](https://pi.dev/packages/pi-event-monitor): event-driven shell-stream and file watchers that wake the session on process exit, matching output, or file writes.
|
|
156
|
+
- [pi-monitor-plugin](https://pi.dev/packages/pi-monitor-plugin): background jobs, monitors, loops, schedules, and idle-aware notifications.
|
|
157
|
+
- [pi-tripwire](https://pi.dev/packages/pi-tripwire): footer visibility for agent-spawned localhost servers; not a process runner itself.
|
|
158
|
+
- [@cortexkit/aft-pi](https://pi.dev/packages/%40cortexkit/aft-pi): broader Agent File Tools package that includes background bash tasks, PTY sessions, and output compression alongside code-analysis tools.
|
|
159
|
+
|
|
120
160
|
## Troubleshooting
|
|
121
161
|
|
|
122
162
|
### Pi started something and I want to see more output
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aliou/pi-processes",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@aliou/pi-utils-settings": "^0.19.1",
|
|
47
47
|
"@aliou/pi-utils-ui": "^0.5.0",
|
|
48
|
-
"@aliou/sh": "^0.
|
|
48
|
+
"@aliou/sh": "^0.2.2"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@earendil-works/pi-ai": "*",
|
package/src/utils/shell-utils.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import type {
|
|
4
4
|
Command,
|
|
5
|
+
ParamExp,
|
|
5
6
|
Program,
|
|
6
7
|
SimpleCommand,
|
|
7
8
|
Statement,
|
|
@@ -28,18 +29,57 @@ function partToString(part: WordPart): string {
|
|
|
28
29
|
case "DblQuoted":
|
|
29
30
|
return part.parts.map(partToString).join("");
|
|
30
31
|
case "ParamExp":
|
|
31
|
-
return part
|
|
32
|
-
? `$${part.param.value}`
|
|
33
|
-
: `\${${part.param.value}${part.op ?? ""}${part.value ? wordToString(part.value) : ""}}`;
|
|
32
|
+
return paramExpToString(part);
|
|
34
33
|
case "CmdSubst":
|
|
35
34
|
return "$(...)";
|
|
36
35
|
case "ArithExp":
|
|
37
|
-
return
|
|
36
|
+
return "$((...))";
|
|
38
37
|
case "ProcSubst":
|
|
39
38
|
return `${part.op}(...)`;
|
|
39
|
+
case "BraceExp":
|
|
40
|
+
return `{${part.elems.map(wordToString).join(",")}}`;
|
|
41
|
+
case "ExtGlob":
|
|
42
|
+
return `${part.op}${part.pattern})`;
|
|
40
43
|
}
|
|
41
44
|
}
|
|
42
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Render a raw text representation of a ParamExp node (e.g. `$VAR`,
|
|
48
|
+
* `${VAR:-default}`, `${#ARR[@]}`). Close to surface syntax, intended
|
|
49
|
+
* for display and command-name detection rather than exact round-trips.
|
|
50
|
+
*/
|
|
51
|
+
function paramExpToString(part: ParamExp): string {
|
|
52
|
+
const name = part.param.value;
|
|
53
|
+
if (part.short) return `$${name}`;
|
|
54
|
+
|
|
55
|
+
const prefix = part.excl ? "!" : part.length ? "#" : "";
|
|
56
|
+
const index = part.index ? `[${wordToString(part.index)}]` : "";
|
|
57
|
+
|
|
58
|
+
let suffix = "";
|
|
59
|
+
if (part.slice) {
|
|
60
|
+
const length = part.slice.length
|
|
61
|
+
? `:${wordToString(part.slice.length)}`
|
|
62
|
+
: "";
|
|
63
|
+
suffix = `:${wordToString(part.slice.offset)}${length}`;
|
|
64
|
+
} else if (part.replace) {
|
|
65
|
+
const delimiter = part.replace.all
|
|
66
|
+
? "//"
|
|
67
|
+
: part.replace.prefix
|
|
68
|
+
? "/#"
|
|
69
|
+
: part.replace.suffix
|
|
70
|
+
? "/%"
|
|
71
|
+
: "/";
|
|
72
|
+
const replacement = part.replace.with
|
|
73
|
+
? `/${wordToString(part.replace.with)}`
|
|
74
|
+
: "";
|
|
75
|
+
suffix = `${delimiter}${wordToString(part.replace.orig)}${replacement}`;
|
|
76
|
+
} else if (part.exp) {
|
|
77
|
+
suffix = `${part.exp.op}${part.exp.word ? wordToString(part.exp.word) : ""}`;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return `\${${prefix}${name}${index}${suffix}}`;
|
|
81
|
+
}
|
|
82
|
+
|
|
43
83
|
/**
|
|
44
84
|
* Walk the AST and call `callback` for every SimpleCommand found at any
|
|
45
85
|
* nesting depth. Returns early if callback returns `true`.
|