@aliou/pi-processes 0.4.4 → 0.4.6
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 +2 -17
- package/package.json +28 -13
- package/src/test/test-exit-crash.sh +19 -0
- package/src/test/test-exit-failure.sh +17 -0
- package/src/test/test-exit-success.sh +16 -0
- package/src/test/test-output.sh +28 -0
- /package/{commands → src/commands}/index.ts +0 -0
- /package/{commands → src/commands}/settings-command.ts +0 -0
- /package/{components → src/components}/log-stream-component.ts +0 -0
- /package/{components → src/components}/process-picker-component.ts +0 -0
- /package/{components → src/components}/processes-component.ts +0 -0
- /package/{components → src/components}/status-format.ts +0 -0
- /package/{config.ts → src/config.ts} +0 -0
- /package/{constants → src/constants}/index.ts +0 -0
- /package/{constants → src/constants}/types.ts +0 -0
- /package/{hooks → src/hooks}/cleanup.ts +0 -0
- /package/{hooks → src/hooks}/index.ts +0 -0
- /package/{hooks → src/hooks}/message-renderer.ts +0 -0
- /package/{hooks → src/hooks}/process-end.ts +0 -0
- /package/{hooks → src/hooks}/widget.ts +0 -0
- /package/{index.ts → src/index.ts} +0 -0
- /package/{manager.ts → src/manager.ts} +0 -0
- /package/{tools → src/tools}/actions/clear.ts +0 -0
- /package/{tools → src/tools}/actions/index.ts +0 -0
- /package/{tools → src/tools}/actions/kill.ts +0 -0
- /package/{tools → src/tools}/actions/list.ts +0 -0
- /package/{tools → src/tools}/actions/logs.ts +0 -0
- /package/{tools → src/tools}/actions/output.ts +0 -0
- /package/{tools → src/tools}/actions/start.ts +0 -0
- /package/{tools → src/tools}/index.ts +0 -0
- /package/{utils → src/utils}/ansi.ts +0 -0
- /package/{utils → src/utils}/command-executor.test.ts +0 -0
- /package/{utils → src/utils}/command-executor.ts +0 -0
- /package/{utils → src/utils}/format.ts +0 -0
- /package/{utils → src/utils}/index.ts +0 -0
- /package/{utils → src/utils}/process-group.ts +0 -0
package/README.md
CHANGED
|
@@ -8,29 +8,14 @@ Manage background processes from Pi. Start long-running commands (dev servers, b
|
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
|
-
Install via npm:
|
|
12
|
-
|
|
13
11
|
```bash
|
|
14
12
|
pi install npm:@aliou/pi-processes
|
|
15
13
|
```
|
|
16
14
|
|
|
17
|
-
Or
|
|
15
|
+
Or from git:
|
|
18
16
|
|
|
19
17
|
```bash
|
|
20
|
-
pi install git:github.com/aliou/pi-
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Or selectively in your `settings.json`:
|
|
24
|
-
|
|
25
|
-
```json
|
|
26
|
-
{
|
|
27
|
-
"packages": [
|
|
28
|
-
{
|
|
29
|
-
"source": "git:github.com/aliou/pi-extensions",
|
|
30
|
-
"extensions": ["extensions/processes"]
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
}
|
|
18
|
+
pi install git:github.com/aliou/pi-processes
|
|
34
19
|
```
|
|
35
20
|
|
|
36
21
|
## Features
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aliou/pi-processes",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
|
+
"license": "MIT",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"private": false,
|
|
6
7
|
"keywords": [
|
|
@@ -11,11 +12,11 @@
|
|
|
11
12
|
],
|
|
12
13
|
"repository": {
|
|
13
14
|
"type": "git",
|
|
14
|
-
"url": "https://github.com/aliou/pi-
|
|
15
|
+
"url": "https://github.com/aliou/pi-processes"
|
|
15
16
|
},
|
|
16
17
|
"pi": {
|
|
17
18
|
"extensions": [
|
|
18
|
-
"./index.ts"
|
|
19
|
+
"./src/index.ts"
|
|
19
20
|
],
|
|
20
21
|
"video": "https://assets.aliou.me/pi-extensions/demos/pi-processes.mp4"
|
|
21
22
|
},
|
|
@@ -23,21 +24,35 @@
|
|
|
23
24
|
"access": "public"
|
|
24
25
|
},
|
|
25
26
|
"files": [
|
|
26
|
-
"
|
|
27
|
-
"commands",
|
|
28
|
-
"components",
|
|
29
|
-
"constants",
|
|
30
|
-
"hooks",
|
|
31
|
-
"tools",
|
|
32
|
-
"utils",
|
|
27
|
+
"src",
|
|
33
28
|
"README.md"
|
|
34
29
|
],
|
|
35
30
|
"dependencies": {
|
|
36
|
-
"@
|
|
37
|
-
"@aliou/pi-utils-
|
|
38
|
-
"@
|
|
31
|
+
"@aliou/pi-utils-settings": "^0.4.0",
|
|
32
|
+
"@aliou/pi-utils-ui": "^0.1.0",
|
|
33
|
+
"@sinclair/typebox": "^0.34.41"
|
|
39
34
|
},
|
|
40
35
|
"peerDependencies": {
|
|
41
36
|
"@mariozechner/pi-coding-agent": ">=0.51.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@aliou/pi-evals": "^0.3.0",
|
|
40
|
+
"@biomejs/biome": "^2.3.13",
|
|
41
|
+
"@changesets/cli": "^2.27.11",
|
|
42
|
+
"@mariozechner/pi-ai": "0.52.7",
|
|
43
|
+
"@mariozechner/pi-coding-agent": "0.52.7",
|
|
44
|
+
"@mariozechner/pi-tui": "0.52.7",
|
|
45
|
+
"@types/node": "^25.0.10",
|
|
46
|
+
"husky": "^9.1.7",
|
|
47
|
+
"typescript": "^5.9.3",
|
|
48
|
+
"vitest": "^4.0.18"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"typecheck": "tsc --noEmit",
|
|
52
|
+
"lint": "biome check",
|
|
53
|
+
"format": "biome check --write",
|
|
54
|
+
"changeset": "changeset",
|
|
55
|
+
"version": "changeset version",
|
|
56
|
+
"release": "pnpm changeset publish"
|
|
42
57
|
}
|
|
43
58
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Test script that simulates a crash (exit code 137 - like SIGKILL)
|
|
3
|
+
# Usage: ./test-exit-crash.sh [seconds]
|
|
4
|
+
|
|
5
|
+
WAIT_SECONDS=${1:-17}
|
|
6
|
+
|
|
7
|
+
echo "Starting unstable task..."
|
|
8
|
+
echo "Will crash in ${WAIT_SECONDS} seconds"
|
|
9
|
+
|
|
10
|
+
for i in $(seq 1 $WAIT_SECONDS); do
|
|
11
|
+
echo "[$(date '+%H:%M:%S')] Running... ($i/$WAIT_SECONDS)"
|
|
12
|
+
if [ $i -eq $((WAIT_SECONDS - 1)) ]; then
|
|
13
|
+
echo "[WARN] Memory pressure detected" >&2
|
|
14
|
+
fi
|
|
15
|
+
sleep 1
|
|
16
|
+
done
|
|
17
|
+
|
|
18
|
+
echo "FATAL: Segmentation fault (core dumped)" >&2
|
|
19
|
+
exit 137
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Test script that exits with failure (exit code 1)
|
|
3
|
+
# Usage: ./test-exit-failure.sh [seconds]
|
|
4
|
+
|
|
5
|
+
WAIT_SECONDS=${1:-15}
|
|
6
|
+
|
|
7
|
+
echo "Starting failing task..."
|
|
8
|
+
echo "Will fail in ${WAIT_SECONDS} seconds"
|
|
9
|
+
|
|
10
|
+
for i in $(seq 1 $WAIT_SECONDS); do
|
|
11
|
+
echo "[$(date '+%H:%M:%S')] Processing... ($i/$WAIT_SECONDS)"
|
|
12
|
+
sleep 1
|
|
13
|
+
done
|
|
14
|
+
|
|
15
|
+
echo "ERROR: Task failed!" >&2
|
|
16
|
+
echo "Something went wrong!" >&2
|
|
17
|
+
exit 1
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Test script that exits successfully (exit code 0)
|
|
3
|
+
# Usage: ./test-exit-success.sh [seconds]
|
|
4
|
+
|
|
5
|
+
WAIT_SECONDS=${1:-13}
|
|
6
|
+
|
|
7
|
+
echo "Starting successful task..."
|
|
8
|
+
echo "Will complete in ${WAIT_SECONDS} seconds"
|
|
9
|
+
|
|
10
|
+
for i in $(seq 1 $WAIT_SECONDS); do
|
|
11
|
+
echo "[$(date '+%H:%M:%S')] Working... ($i/$WAIT_SECONDS)"
|
|
12
|
+
sleep 1
|
|
13
|
+
done
|
|
14
|
+
|
|
15
|
+
echo "Task completed successfully!"
|
|
16
|
+
exit 0
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Test script for processes extension
|
|
3
|
+
# Writes 80 characters every second, empty line every 10 seconds
|
|
4
|
+
|
|
5
|
+
counter=0
|
|
6
|
+
while true; do
|
|
7
|
+
counter=$((counter + 1))
|
|
8
|
+
|
|
9
|
+
# Generate 80 characters: timestamp + padding
|
|
10
|
+
timestamp=$(date '+%H:%M:%S')
|
|
11
|
+
line=$(printf "[%s] Line %05d: " "$timestamp" "$counter")
|
|
12
|
+
# Pad to 80 chars with random chars
|
|
13
|
+
padding_len=$((80 - ${#line}))
|
|
14
|
+
padding=$(head -c $padding_len /dev/urandom | LC_ALL=C tr -dc 'a-zA-Z0-9' 2>/dev/null || printf '%*s' "$padding_len" '' | tr ' ' 'x')
|
|
15
|
+
echo "${line}${padding}"
|
|
16
|
+
|
|
17
|
+
# Every 10 seconds, print an empty line
|
|
18
|
+
if [ $((counter % 10)) -eq 0 ]; then
|
|
19
|
+
echo ""
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# Every 5 lines, write something to stderr
|
|
23
|
+
if [ $((counter % 5)) -eq 0 ]; then
|
|
24
|
+
echo "[WARN] Counter reached $counter" >&2
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
sleep 1
|
|
28
|
+
done
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|