pi-better-goal 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.
Files changed (2) hide show
  1. package/README.md +18 -87
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,105 +1,36 @@
1
1
  # pi-better-goal
2
2
 
3
- `pi-better-goal` is a Pi package that provides a `/goal` runtime with background-aware continuation for async subagents.
3
+ Goal tracking for [Pi](https://pi.dev), with background-aware continuation.
4
4
 
5
- It ships one extension that:
5
+ It keeps the active objective visible, tracks active versus elapsed time, and prevents Pi from treating foreground idleness as completion while background work is still running.
6
6
 
7
- - reads `pi-better-subagents` durable run metadata from the temp registry
8
- - treats current-parent `running` and `orphaned` subagents as active background work
9
- - owns `/goal` plus the `get_goal` and `update_goal` tools; only `/goal <objective>` can create a goal
10
- - shows the current goal with active and elapsed clocks in a right-aligned widget above custom footers such as `pi-observability`
11
- - publishes a typed activity snapshot on `pi.events`
12
- - adds goal-aware prompt context while background work is active, so foreground idleness is not confused with goal completion
13
- - sends a hidden follow-up when active background work drains to zero, including `callback:false` subagent runs
14
- - provides a `/better-activity` command and `get_background_activity` tool for inspection
7
+ ## Core Features
15
8
 
16
- Goal state is stored as `pi-better-goal` custom entries in the Pi session. Existing `pi-codex-goal` entries are read for compatibility, but new state is written by this package.
9
+ - `/goal` runtime for starting, pausing, resuming, completing, and clearing the current objective.
10
+ - A compact goal widget that does not replace Pi's footer.
11
+ - Background activity tracking for subagents and other registered providers.
12
+ - A follow-up wake when active background work drains to zero.
17
13
 
18
- ## Commands And Tools
19
-
20
- ```text
21
- /goal
22
- /goal <objective>
23
- /goal pause
24
- /goal resume
25
- /goal clear
26
- /goal complete
27
- /better-activity
28
- ```
29
-
30
- Model-callable tools:
31
-
32
- - `get_goal`
33
- - `update_goal`
34
- - `get_background_activity`
35
-
36
- ## Goal Clock
37
-
38
- Only `/goal <objective>` can create or replace a goal; there is no model-callable
39
- goal creation tool. The right-aligned widget below the editor shows the objective,
40
- status, active time, and total elapsed time. Active time stops while paused. Both
41
- clocks freeze when the goal is completed and remain visible until the goal is
42
- cleared or replaced.
43
-
44
- The widget does not replace Pi's footer, so custom footer extensions such as
45
- `pi-observability` retain ownership of their layout and lifecycle.
46
-
47
- Set `PI_BETTER_GOAL_DISABLE_WAKE=1` to disable hidden background-drain wakeups.
48
-
49
- ## Install Locally
50
-
51
- From this directory:
14
+ ## Install
52
15
 
53
16
  ```sh
54
- npm install
55
- pi install .
17
+ pi install npm:pi-better-goal
56
18
  ```
57
19
 
58
- For a one-off run:
20
+ Try it for one run:
59
21
 
60
22
  ```sh
61
- pi -e .
23
+ pi -e npm:pi-better-goal
62
24
  ```
63
25
 
64
- ## Event Contract
26
+ ## Update Or Remove
65
27
 
66
- The extension emits these events on `pi.events`:
67
-
68
- - `pi-better-goal:ready` with `{ version }`
69
- - `pi-better-goal:activity` with an `ActivitySnapshot`
70
- - `pi-better-goal:terminal-attention` when terminal or unhealthy background work needs attention
71
-
72
- Other extensions can register providers by emitting `pi-better-goal:register-provider` with:
73
-
74
- ```ts
75
- {
76
- id: "provider-id",
77
- label: "Provider label",
78
- getActivity(ctx) {
79
- return {
80
- providerId: "provider-id",
81
- label: "Provider label",
82
- items: [
83
- { id: "work-1", status: "running", active: true }
84
- ]
85
- };
86
- }
87
- }
28
+ ```sh
29
+ pi update npm:pi-better-goal
30
+ pi remove npm:pi-better-goal
88
31
  ```
89
32
 
90
- The built-in provider id is `subagents`.
91
-
92
- ## Status Semantics
33
+ ## More Detail
93
34
 
94
- For `pi-better-subagents`, active background work is:
95
-
96
- - `running`
97
- - `orphaned`
98
-
99
- `orphaned` is active but unhealthy. `completed`, `failed`, `killed`, `lost`, and `exited` are non-active terminal states. Batches are represented as normal per-run items; batch metadata is display-only.
100
-
101
- ## Validation
102
-
103
- ```sh
104
- npm run verify
105
- ```
35
+ - Repository: https://github.com/1aboveio/pi-better-harness
36
+ - Detailed notes: https://github.com/1aboveio/pi-better-harness/blob/main/packages/pi-better-goal/docs/usage.md
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-better-goal",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Background activity bridge for Pi goal continuations and async subagents.",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -65,4 +65,4 @@
65
65
  "engines": {
66
66
  "node": ">=22.0.0"
67
67
  }
68
- }
68
+ }