@adeildo/pi-harness 5.1.0 → 5.2.0

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 (3) hide show
  1. package/README.md +32 -22
  2. package/package.json +6 -6
  3. package/src/setup.ts +52 -0
package/README.md CHANGED
@@ -1,45 +1,55 @@
1
- # @adeildo/pi-harness
1
+ <h1 align="center">@adeildo/pi-harness</h1>
2
2
 
3
- [![npm](https://img.shields.io/npm/v/@adeildo/pi-harness)](https://www.npmjs.com/package/@adeildo/pi-harness)
3
+ <p align="center">
4
+ <a href="https://www.npmjs.com/package/@adeildo/pi-harness"><img src="https://img.shields.io/npm/v/@adeildo/pi-harness" alt="npm"></a>
5
+ <a href="https://pi.dev"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2Ffelipeadeildo%2Fpi-harness%2Fmain%2Fpackage.json&query=%24.devDependencies%5B%22%40earendil-works%2Fpi-coding-agent%22%5D&label=pi%20SDK&color=6E56CF" alt="pi SDK"></a>
6
+ </p>
4
7
 
5
- Every extension adeildo runs [Pi](https://pi.dev) with, in one install.
8
+ <p align="center">
9
+ <strong>Pi runs every command without asking. This makes it ask.</strong><br>
10
+ Every piece of this repository in one install: the permission, the questions, the screen and the Claude plan.
11
+ </p>
6
12
 
7
- ```bash
8
- pi install npm:@adeildo/pi-harness
9
- ```
13
+ <p align="center"><code>pi install npm:@adeildo/pi-harness</code></p>
14
+
15
+ <!-- docs:harness/conversation -->
16
+
17
+ <p align="center">
18
+ <img src="https://raw.githubusercontent.com/felipeadeildo/pi-harness/main/packages/harness/assets/conversation.png" alt="A session with the look: the start card, a request, the model running the tests, a commit you denied, then the stopwatch, the editor and the cost." width="860">
19
+ <br>
20
+ <em>A session: the start card, what you asked, what the model ran, and what it cost.</em>
21
+ </p>
22
+
23
+ <!-- /docs -->
10
24
 
11
25
  ## What comes in it
12
26
 
13
- | Piece | What it does |
14
- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
15
- | [Permission](../ask-permission) | Asks before a tool call runs, with a note the model reads. A judge model answers the routine calls for you |
16
- | [Questions](../ask-questions) | The model asks instead of guessing, with options, a preview of each, a note on any and your own answer |
17
- | [Look](../look) | The start card, a framed editor with the branch, model and context in its borders, and a screen that holds still |
18
- | [Providers](../providers) | Bills Anthropic OAuth requests to your Claude plan, and keeps several accounts per provider |
27
+ | Piece | What it does |
28
+ | ------------------------------- | -------------------------------------------------------------------------------------------------------- |
29
+ | [Permission](../ask-permission) | Asks before a command runs, with a note the model reads. A model answers the easy ones for you |
30
+ | [Questions](../ask-questions) | The model asks instead of guessing, with options, a preview of each, a note on any and your own answer |
31
+ | [Look](../look) | The start screen, the editor with the branch and the model on its borders, and a box around each command |
32
+ | [Providers](../providers) | Bills Anthropic OAuth requests to your Claude plan, and keeps several accounts per provider |
19
33
 
20
34
  All of them are on once the package is installed.
21
35
 
22
36
  > [!WARNING]
23
- > Providers makes Pi introduce itself to Anthropic as Claude Code whenever a request uses an Anthropic OAuth token. Using a subscription from anything other than Claude Code may break Anthropic's terms. Turn it off, as below, if you do not want that. Requests with an API key go out untouched.
24
-
25
- ## Turn a piece off
37
+ > Providers makes Pi introduce itself to Anthropic as Claude Code whenever a request uses an Anthropic OAuth token. Using a subscription from anything other than Claude Code may break Anthropic's terms. Turn it off, as below, if you do not want that. A request with an API key goes out untouched.
26
38
 
27
- Each piece is its own extension in this package. Run `pi config` and switch off the one you do not want, globally or for one project.
39
+ ## Turning a piece off
28
40
 
29
- The settings file has a switch per feature too, read on the next `/reload`:
41
+ Each piece is its own extension in this package, so `pi config` switches off the one you do not want, globally or for one project. The settings file has a switch per feature too, read on the next `/reload`, and the feature ids are `permission`, `look`, `subscription`, `accounts` and `questions`.
30
42
 
31
43
  ```json
32
44
  { "features": { "subscription": { "enabled": false } } }
33
45
  ```
34
46
 
35
- The feature ids are `permission`, `look`, `subscription`, `accounts` and `questions`.
36
-
37
47
  To have only one piece, install its own package instead. With both installed, the first copy that loads runs the feature and the other stays off.
38
48
 
39
49
  ## Settings
40
50
 
41
- `Alt+S` opens the settings of every piece. They live in `~/.pi/agent/extensions/pi-harness/settings.json`. A setting marked _project_ is also read from `.pi/extensions/pi-harness/settings.json` in a project Pi trusts, and the project value wins. Each piece's page lists its settings.
51
+ `Alt+S` opens the settings of every piece. They live in `~/.pi/agent/extensions/pi-harness/settings.json`, and each piece's page lists its own. A setting marked _project_ is also read from `.pi/extensions/pi-harness/settings.json` in a project Pi trusts, where the project value wins.
42
52
 
43
- ## License
53
+ The whole set, with the pictures and the settings of each piece, is in the [root README](https://github.com/felipeadeildo/pi-harness).
44
54
 
45
- [MIT](LICENSE)
55
+ Part of [pi-harness](https://github.com/felipeadeildo/pi-harness), which is this package. Every piece also ships on its own, for whoever wants only that one.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adeildo/pi-harness",
3
- "version": "5.1.0",
3
+ "version": "5.2.0",
4
4
  "description": "Every adeildo Pi extension in one install: the permission dialog, the look, the providers and the questions. Each is its own extension, so pi config turns one off.",
5
5
  "keywords": [
6
6
  "anthropic",
@@ -35,11 +35,11 @@
35
35
  "access": "public"
36
36
  },
37
37
  "dependencies": {
38
- "@adeildo/pi-ask-permission": "5.1.0",
39
- "@adeildo/pi-ask-questions": "5.1.0",
40
- "@adeildo/pi-kit": "5.1.0",
41
- "@adeildo/pi-look": "5.1.0",
42
- "@adeildo/pi-providers": "5.1.0"
38
+ "@adeildo/pi-ask-permission": "5.2.0",
39
+ "@adeildo/pi-ask-questions": "5.2.0",
40
+ "@adeildo/pi-kit": "5.2.0",
41
+ "@adeildo/pi-look": "5.2.0",
42
+ "@adeildo/pi-providers": "5.2.0"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "@earendil-works/pi-ai": "*",
package/src/setup.ts ADDED
@@ -0,0 +1,52 @@
1
+ // The pi settings the harness changes, for `/harness setup`. `bun run pi:defaults` fails when pi
2
+ // moves a default one of them was chosen against.
3
+ import type { SettingsManager } from "@earendil-works/pi-coding-agent";
4
+
5
+ type Value = string | number | boolean;
6
+
7
+ export interface PiSetting {
8
+ key: string;
9
+ value: Value;
10
+ /** Pi's default when the value was chosen. */
11
+ piDefault: Value;
12
+ why: string;
13
+ read(settings: SettingsManager): Value;
14
+ }
15
+
16
+ export const PI_SETTINGS: readonly PiSetting[] = [
17
+ {
18
+ key: "outputPad",
19
+ value: 0,
20
+ piDefault: 1,
21
+ why: "the look frames the editor and draws the strip, so pi's extra row is empty space",
22
+ read: (settings) => settings.getOutputPad(),
23
+ },
24
+ {
25
+ key: "warnings.anthropicExtraUsage",
26
+ value: false,
27
+ piDefault: true,
28
+ why: "the providers piece bills Anthropic to the Claude plan, so the extra usage warning is wrong",
29
+ read: (settings) => settings.getWarnings().anthropicExtraUsage ?? true,
30
+ },
31
+ {
32
+ key: "steeringMode",
33
+ value: "all",
34
+ piDefault: "one-at-a-time",
35
+ why: "every message typed while the agent works reaches it at the next step",
36
+ read: (settings) => settings.getSteeringMode(),
37
+ },
38
+ {
39
+ key: "followUpMode",
40
+ value: "all",
41
+ piDefault: "one-at-a-time",
42
+ why: "every follow-up queued while the agent works is sent together when it stops",
43
+ read: (settings) => settings.getFollowUpMode(),
44
+ },
45
+ {
46
+ key: "showCacheMissNotices",
47
+ value: true,
48
+ piDefault: false,
49
+ why: "a cache miss is money, and the look already shows how much of the prompt was cached",
50
+ read: (settings) => settings.getShowCacheMissNotices(),
51
+ },
52
+ ];