pi-better-background-tasks 0.1.2 → 0.1.3
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 +22 -51
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,65 +1,36 @@
|
|
|
1
1
|
# pi-better-background-tasks
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
agent start long-running commands or command-based watchers without blocking the
|
|
5
|
-
foreground turn. Task metadata and logs are stored under the OS temp directory,
|
|
6
|
-
so status and logs remain available across `/reload` and ordinary session use.
|
|
3
|
+
Durable background processes and watchers for [Pi](https://pi.dev).
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
and similar integrations should be thin presets on top of the generic watcher,
|
|
10
|
-
not special cases in the runtime.
|
|
5
|
+
Use it when work should keep running while the foreground session stays free: dev servers, long scripts, queue watchers, deploy checks, log tails, and other command-driven tasks.
|
|
11
6
|
|
|
12
|
-
##
|
|
7
|
+
## Core Features
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
| `bg_task_list` | List known tasks. |
|
|
19
|
-
| `bg_task_status` | Inspect one task. Compact by default; pass `verbose:true` for full metadata JSON. |
|
|
20
|
-
| `bg_task_log` | Read a bounded task log tail by default, or a full log on request. |
|
|
21
|
-
| `bg_task_stop` | Cancel a watcher or terminate a process task. |
|
|
22
|
-
| `bg_task` | Action-based wrapper for `spawn`, `watch`, `list`, `status`, `log`, `stop`, `clear`. |
|
|
23
|
-
| `bg_status` | Small action wrapper for `list`, `status`, `log`, `stop`, `clear`. |
|
|
9
|
+
- Start long-running commands without blocking the current turn.
|
|
10
|
+
- Watch commands until success, failure, or timeout.
|
|
11
|
+
- Keep task metadata and logs available across reloads.
|
|
12
|
+
- Show active work in Pi's background-work navigator.
|
|
24
13
|
|
|
25
|
-
|
|
26
|
-
count as foreground attention. It keeps metadata and logs on disk for explicit
|
|
27
|
-
inspection.
|
|
14
|
+
## Install
|
|
28
15
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
16
|
+
```sh
|
|
17
|
+
pi install npm:pi-better-background-tasks
|
|
18
|
+
```
|
|
32
19
|
|
|
33
|
-
|
|
34
|
-
compact model-facing summary that omits large command bodies; use
|
|
35
|
-
`verbose:true` only when full metadata is required. `bg_task_log` defaults to a
|
|
36
|
-
20-line tail, and `tail_lines: 0` requests the full log explicitly.
|
|
20
|
+
Try it for one run:
|
|
37
21
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
22
|
+
```sh
|
|
23
|
+
pi -e npm:pi-better-background-tasks
|
|
24
|
+
```
|
|
41
25
|
|
|
42
|
-
##
|
|
26
|
+
## Update Or Remove
|
|
43
27
|
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"command": "npm run dev",
|
|
48
|
-
"cwd": "/path/to/app"
|
|
49
|
-
}
|
|
28
|
+
```sh
|
|
29
|
+
pi update npm:pi-better-background-tasks
|
|
30
|
+
pi remove npm:pi-better-background-tasks
|
|
50
31
|
```
|
|
51
32
|
|
|
52
|
-
|
|
53
|
-
{
|
|
54
|
-
"name": "wait for success",
|
|
55
|
-
"command": "node ./scripts/check-status.js --json",
|
|
56
|
-
"interval_seconds": 15,
|
|
57
|
-
"timeout_seconds": 600,
|
|
58
|
-
"success_when": { "type": "json_path_equals", "path": "$.status", "value": "done" },
|
|
59
|
-
"failure_when": { "type": "json_path_equals", "path": "$.status", "value": "failed" }
|
|
60
|
-
}
|
|
61
|
-
```
|
|
33
|
+
## More Detail
|
|
62
34
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
that shell, or pass `argv` and `shell:false` to avoid shell parsing.
|
|
35
|
+
- Repository: https://github.com/1aboveio/pi-better-harness
|
|
36
|
+
- Detailed notes: https://github.com/1aboveio/pi-better-harness/blob/main/packages/pi-better-background-tasks/docs/usage.md
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-better-background-tasks",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Generic durable background task and watcher tools for pi.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -50,4 +50,4 @@
|
|
|
50
50
|
"vitest": "^3.0.0",
|
|
51
51
|
"typebox": "^1.1.38"
|
|
52
52
|
}
|
|
53
|
-
}
|
|
53
|
+
}
|