pi-better-harness 0.32.1 → 0.33.1
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 +44 -13
- package/extensions/minimal-output/hook.ts +6 -1
- package/{node_modules/pi-better-plan/src → extensions/task-context}/index.ts +193 -104
- package/extensions/task-context/legacy-plan-mask.ts +185 -0
- package/extensions/task-context/outcome-state.ts +62 -0
- package/{node_modules/pi-better-plan/src → extensions/task-context}/plan-presentation.ts +1 -1
- package/{node_modules/pi-better-plan/src → extensions/task-context}/plan-render.ts +9 -4
- package/{node_modules/pi-better-plan/src → extensions/task-context}/workflow-plan-update.ts +3 -3
- package/lib/cli.mjs +54 -4
- package/lib/install-settings.mjs +175 -0
- package/node_modules/pi-better-background-tasks/README.md +13 -2
- package/node_modules/pi-better-background-tasks/package.json +1 -1
- package/node_modules/pi-better-background-tasks/src/adapter-contract.ts +3 -2
- package/node_modules/pi-better-background-tasks/src/runtime.ts +111 -17
- package/node_modules/pi-better-background-tasks/src/sandbox.ts +214 -7
- package/node_modules/pi-better-background-tasks/src/shared-sandbox-core.ts +92 -0
- package/node_modules/pi-better-background-tasks/src/tools.ts +2 -2
- package/node_modules/pi-better-background-tasks/src/types.ts +7 -0
- package/node_modules/pi-better-goal/README.md +6 -0
- package/node_modules/pi-better-goal/src/index.ts +35 -5
- package/node_modules/pi-better-goal/src/task-context.ts +38 -0
- package/node_modules/pi-better-sandbox/README.md +39 -11
- package/node_modules/pi-better-sandbox/background-admission.ts +5 -4
- package/node_modules/pi-better-sandbox/index.ts +13 -2
- package/node_modules/pi-better-sandbox/package.json +1 -1
- package/node_modules/pi-better-sandbox/permissions-page.ts +32 -4
- package/node_modules/pi-better-sandbox/permissions.ts +25 -5
- package/node_modules/pi-better-sandbox/shared-sandbox-core.ts +92 -0
- package/node_modules/pi-better-sandbox/shared-task-application.ts +185 -0
- package/node_modules/pi-better-sandbox/shared-task-exec.ts +315 -0
- package/node_modules/pi-better-sandbox/shared-task-sandbox.ts +28 -94
- package/node_modules/pi-better-sandbox/shared-task-tools.ts +1 -1
- package/node_modules/pi-better-sandbox/status.ts +1 -1
- package/node_modules/pi-better-sandbox/subagent-admission.ts +60 -0
- package/node_modules/pi-better-subagents/README.md +4 -3
- package/node_modules/pi-better-subagents/catalog-schema.ts +2 -1
- package/node_modules/pi-better-subagents/config.json +1 -1
- package/node_modules/pi-better-subagents/config.ts +1 -1
- package/node_modules/pi-better-subagents/docs/agent-catalog-acceptance.md +2 -2
- package/node_modules/pi-better-subagents/docs/agent-catalog.md +4 -2
- package/node_modules/pi-better-subagents/docs/usage.md +32 -11
- package/node_modules/pi-better-subagents/index.ts +37 -9
- package/node_modules/pi-better-subagents/package.json +1 -1
- package/node_modules/pi-better-subagents/permission-policy.ts +132 -1
- package/node_modules/pi-better-subagents/roles/role.researcher.md +1 -1
- package/node_modules/pi-better-subagents/roles/role.writer.md +12 -0
- package/node_modules/pi-better-subagents/settings-page.ts +6 -2
- package/node_modules/pi-better-subagents/shared-sandbox-core.ts +92 -0
- package/node_modules/pi-better-subagents/shared-task-application.ts +185 -0
- package/node_modules/pi-better-subagents/shared-task-exec.ts +315 -0
- package/node_modules/pi-better-subagents/shared-task-sandbox.ts +28 -94
- package/node_modules/pi-better-subagents/shared-task-tools.ts +1 -1
- package/node_modules/pi-better-subagents/task-guard.ts +9 -3
- package/node_modules/pi-better-subagents/task-policy.ts +90 -7
- package/package.json +9 -11
- package/extensions/plan/index.ts +0 -1
- package/node_modules/pi-better-plan/LICENSE +0 -21
- package/node_modules/pi-better-plan/README.md +0 -66
- package/node_modules/pi-better-plan/REFERENCE.md +0 -125
- package/node_modules/pi-better-plan/package.json +0 -75
- /package/{node_modules/pi-better-plan/src → extensions/task-context}/cancelled-rows.ts +0 -0
- /package/{node_modules/pi-better-plan/src → extensions/task-context}/plan-state.ts +0 -0
- /package/{node_modules/pi-better-plan/src → extensions/task-context}/plan-widget.ts +0 -0
- /package/{node_modules/pi-better-plan/src → extensions/task-context}/shared-execution-policy.ts +0 -0
- /package/{node_modules/pi-better-plan/src → extensions/task-context}/types.ts +0 -0
- /package/{node_modules/pi-better-plan/src → extensions/task-context}/workflow-plan.ts +0 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<img src="https://raw.githubusercontent.com/1aboveio/pi-better-harness/main/docs/images/brand/logo.png" alt="Pi Better Harness logo" width="128" height="128" />
|
|
4
4
|
|
|
5
|
-
`pi-better-harness` is a Pi meta package that installs the core Pi Better Harness extensions: an opt-in foreground write sandbox, delegated subagents, durable background tasks, synchronous SSH commands, goal tracking, and
|
|
5
|
+
`pi-better-harness` is a Pi meta package that installs the core Pi Better Harness extensions: an opt-in foreground write sandbox, delegated subagents, durable background tasks, synchronous SSH commands, goal tracking, and Outcome & Todo.
|
|
6
6
|
|
|
7
7
|
## Quick Answer
|
|
8
8
|
|
|
@@ -12,11 +12,36 @@ Use `pi-better-harness` when you want the full working set for Pi. It manages:
|
|
|
12
12
|
- `pi-better-subagents` for detached, sandboxed subagent runs.
|
|
13
13
|
- `pi-better-background-tasks` for durable shell tasks and watchers.
|
|
14
14
|
- `pi-better-ssh` for short remote commands over reusable SSH connections.
|
|
15
|
-
- `pi-better-goal` for
|
|
16
|
-
-
|
|
15
|
+
- `pi-better-goal` for explicit triggers, pause/resume, and background-aware continuation.
|
|
16
|
+
- Harness-owned Outcome & Todo for session context and checklist progress. It starts off; enable **Outcome & Todo** in `/harness-settings`.
|
|
17
17
|
|
|
18
18
|
`pi-better-read-aloud` is intentionally not included yet.
|
|
19
19
|
|
|
20
|
+
## Outcome & Todo
|
|
21
|
+
|
|
22
|
+
In `/harness-settings`, **Outcome & Todo** starts **Off**. Turn it on to expose
|
|
23
|
+
`update_todo`, `get_todo`, and the native Todo widget. `/todo` opens the full view;
|
|
24
|
+
`/todo expand` and `/todo collapse` control the compact checklist.
|
|
25
|
+
|
|
26
|
+
An accepted outcome can be saved without a checklist. Completing or clearing its
|
|
27
|
+
Todo does not complete or remove the outcome. Write labels as short, plain actions,
|
|
28
|
+
usually 3-7 words: "Add Todo toggle", "Keep session state", or "Test keyboard controls".
|
|
29
|
+
Keep methods, file paths, and acceptance criteria in the outcome or supporting
|
|
30
|
+
records. This is writing guidance, not a hard limit or automatic truncation;
|
|
31
|
+
existing saved labels remain unchanged until deliberately updated.
|
|
32
|
+
|
|
33
|
+
Use `newTask: true` with a new
|
|
34
|
+
outcome for unrelated work; a correction to the current task keeps its binding.
|
|
35
|
+
Harness includes a short reminder before each model call while the outcome is
|
|
36
|
+
active. Disabling the feature hides its tools and display and stops reminders,
|
|
37
|
+
without deleting saved state or starting a turn. `/goal` and skills never enable it.
|
|
38
|
+
|
|
39
|
+
Existing Plan session histories restore as Todo. Workflow task-plan files and
|
|
40
|
+
revision checks stay unchanged; skills continue using their own records when the
|
|
41
|
+
optional interface is off. See the [usage guide](docs/usage.md#outcome--todo).
|
|
42
|
+
|
|
43
|
+
<p><img src="https://raw.githubusercontent.com/1aboveio/pi-better-harness/main/docs/images/package-gallery/todo-examples/middle.png" alt="Compact Harness Todo" width="49%" /><img src="https://raw.githubusercontent.com/1aboveio/pi-better-harness/main/docs/images/package-gallery/todo-examples/expanded.png" alt="Expanded Harness Todo" width="49%" /></p>
|
|
44
|
+
|
|
20
45
|
## Screenshots
|
|
21
46
|
|
|
22
47
|
<p><img src="https://raw.githubusercontent.com/1aboveio/pi-better-harness/main/docs/images/package-gallery/pi-better-harness.png" alt="pi-better-harness rendered in Pi" width="49%" /><img src="https://raw.githubusercontent.com/1aboveio/pi-better-harness/main/docs/images/package-gallery/overview/pi-better-harness.png" alt="pi-better-harness package overview" width="49%" /></p>
|
|
@@ -35,12 +60,21 @@ For project-local Pi settings:
|
|
|
35
60
|
npx pi-better-harness install --local
|
|
36
61
|
```
|
|
37
62
|
|
|
38
|
-
The
|
|
63
|
+
The installer also registers Harness with filters for its own settings, minimal output, and Outcome & Todo extensions. It removes an old `pi-better-plan` registration in the selected scope. The component packages keep their separate identities. Pi's normal installation prompts and errors still apply.
|
|
64
|
+
|
|
65
|
+
The single-bundle installation remains available:
|
|
39
66
|
|
|
40
67
|
```sh
|
|
41
68
|
pi install npm:pi-better-harness
|
|
42
69
|
```
|
|
43
70
|
|
|
71
|
+
After a normal bundle install or `pi update`, Harness masks any separately loaded
|
|
72
|
+
`pi-better-plan` package before Pi registers its tools, `/plan` command, widgets,
|
|
73
|
+
or prompt hooks. This applies in either load order, including when Outcome & Todo
|
|
74
|
+
is off. The old registration and cached files may remain, but are inactive while
|
|
75
|
+
Harness is loaded. Settings and session history are not rewritten. The explicit
|
|
76
|
+
installer above removes the old registration in its selected scope instead.
|
|
77
|
+
|
|
44
78
|
## Ordinary Startup
|
|
45
79
|
|
|
46
80
|
You keep launching Pi the way you always have:
|
|
@@ -100,11 +134,11 @@ all original tool details in both modes and folds them again on the next toggle.
|
|
|
100
134
|
`/tool-output normal` restores ordinary rendering. Error result bodies are also
|
|
101
135
|
hidden in minimal mode and remain available when expanded.
|
|
102
136
|
|
|
103
|
-
Minimal mode also covers Harness tools: Subagents, Background Tasks, Goal,
|
|
137
|
+
Minimal mode also covers Harness tools: Subagents, Background Tasks, Goal, Todo,
|
|
104
138
|
catalog inspection, and SSH. Compact calls retain the run or task ID, launch name
|
|
105
139
|
and task, background command, goal action, or plan summary without showing result
|
|
106
140
|
bodies. Finished calls fold into the same disclosure blocks as built-in tools;
|
|
107
|
-
expanding them restores their original package renderers. Goal and
|
|
141
|
+
expanding them restores their original package renderers. Goal and Todo widgets
|
|
108
142
|
and the background-work navigator are independent UI surfaces and remain visible.
|
|
109
143
|
|
|
110
144
|
Normal mode is the initial default. Changing tool output saves the choice in
|
|
@@ -115,8 +149,7 @@ tested with Pi 0.82.1, 0.99.1, and the bundled Pi 1.0.4 CLI; incompatible APIs
|
|
|
115
149
|
produce a warning and leave ordinary output enabled. Print/RPC output and
|
|
116
150
|
exported transcripts are unchanged.
|
|
117
151
|
|
|
118
|
-
The
|
|
119
|
-
Load the bundled harness or run it directly from a checkout:
|
|
152
|
+
The installer includes this Harness-owned extension. To run it directly from a checkout:
|
|
120
153
|
|
|
121
154
|
```sh
|
|
122
155
|
pi -e ./packages/pi-better-harness/extensions/minimal-output/index.ts
|
|
@@ -164,9 +197,7 @@ Pi's SDK. It is not loaded by the bundle, has no toggle or preference store in
|
|
|
164
197
|
this version, and makes no auxiliary model requests. The integration blocker is
|
|
165
198
|
[issue #426](https://github.com/1aboveio/pi-better-harness/issues/426).
|
|
166
199
|
|
|
167
|
-
The hub is TUI-only
|
|
168
|
-
Harness-only extensions; load the bundle or the settings extension from the
|
|
169
|
-
checkout to use the hub:
|
|
200
|
+
The hub is TUI-only and is included by the installer. To load the settings extension directly from the checkout:
|
|
170
201
|
|
|
171
202
|
```sh
|
|
172
203
|
pi -e ./packages/pi-better-harness/extensions/settings/index.ts
|
|
@@ -174,7 +205,7 @@ pi -e ./packages/pi-better-harness/extensions/settings/index.ts
|
|
|
174
205
|
|
|
175
206
|
## When To Use
|
|
176
207
|
|
|
177
|
-
Use the installer when you want every core extension with standalone package identities. Install an individual package instead when you only need the sandbox, subagents, shell task supervision, synchronous SSH, goal tracking
|
|
208
|
+
Use the installer when you want every core extension with standalone package identities. Install an individual package instead when you only need the sandbox, subagents, shell task supervision, synchronous SSH, or goal tracking. Outcome & Todo is available through Harness.
|
|
178
209
|
|
|
179
210
|
## Compatibility
|
|
180
211
|
|
|
@@ -194,7 +225,7 @@ Remove every standalone package:
|
|
|
194
225
|
npx pi-better-harness uninstall
|
|
195
226
|
```
|
|
196
227
|
|
|
197
|
-
Add `--local` to remove them from project-local settings.
|
|
228
|
+
Add `--local` to remove them from project-local settings. This also removes the filtered Harness registration in that scope.
|
|
198
229
|
|
|
199
230
|
## More Detail
|
|
200
231
|
|
|
@@ -93,6 +93,7 @@ const HOOK = Symbol.for("pi-better-harness.minimal-output-hook");
|
|
|
93
93
|
const emptyResult = () => ({ render: () => [] as string[], invalidate() {} });
|
|
94
94
|
const TOOL_ICONS: Record<string, string> = {
|
|
95
95
|
bash: "\u2318",
|
|
96
|
+
run_application: "\u2318",
|
|
96
97
|
read: "\u25a4",
|
|
97
98
|
write: "\u2710",
|
|
98
99
|
edit: "\u270e",
|
|
@@ -107,6 +108,8 @@ const TOOL_ICONS: Record<string, string> = {
|
|
|
107
108
|
update_goal: "\u25ce",
|
|
108
109
|
get_goal: "\u25ce",
|
|
109
110
|
goal_resume: "\u25ce",
|
|
111
|
+
update_todo: "\u2261",
|
|
112
|
+
get_todo: "\u2261",
|
|
110
113
|
update_plan: "\u2261",
|
|
111
114
|
get_plan: "\u2261",
|
|
112
115
|
remote_bash: "\u2318",
|
|
@@ -121,6 +124,8 @@ function harnessCallDetail(name: string, input: unknown): string | undefined {
|
|
|
121
124
|
return text(ssh.host) ? `${text(ssh.user) ? `${text(ssh.user)}@` : ""}${text(ssh.host)}` : "";
|
|
122
125
|
};
|
|
123
126
|
switch (name) {
|
|
127
|
+
case "run_application":
|
|
128
|
+
return joinDetails(args.executable, Array.isArray(args.args) ? args.args.map((arg) => JSON.stringify(arg)).join(" ") : undefined);
|
|
124
129
|
case "subagent_spawn":
|
|
125
130
|
return joinDetails(args.agent ?? args.role, args.alias ?? args.name, args.prompt);
|
|
126
131
|
case "subagent_spawn_batch":
|
|
@@ -140,7 +145,7 @@ function harnessCallDetail(name: string, input: unknown): string | undefined {
|
|
|
140
145
|
return text(args.status);
|
|
141
146
|
case "goal_resume":
|
|
142
147
|
return text(args.reason);
|
|
143
|
-
case "get_goal": case "get_background_activity": case "release_workflow": case "get_plan":
|
|
148
|
+
case "get_goal": case "get_background_activity": case "release_workflow": case "get_plan": case "get_todo":
|
|
144
149
|
return "";
|
|
145
150
|
case "remote_bash":
|
|
146
151
|
return joinDetails(host(), args.command);
|