pi-herdsman 0.4.0 → 0.5.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.
@@ -2,125 +2,77 @@
2
2
 
3
3
  [Documentation index](../README.md)
4
4
 
5
- Pi Herdsman intentionally has very little settings state.
6
-
7
- Agent behavior lives in Markdown definitions. The extension settings currently
8
- own agent placement.
9
-
10
- ## Agent placement
11
-
12
- Settings shape:
13
-
14
- ```json
15
- {
16
- "piHerdsman": {
17
- "spawnPlacement": "subtree"
18
- }
19
- }
20
- ```
21
-
22
- Supported values:
5
+ Pi Herdsman keeps its configuration in one flat, user-wide file:
23
6
 
24
7
  ```text
25
- tab
26
- subtree
27
- split
8
+ <Pi agent directory>/pi-herdsman/config.json
28
9
  ```
29
10
 
30
- Default:
31
-
32
- ```text
33
- subtree
34
- ```
35
-
36
- When no `spawnPlacement` value is configured, it resolves to `subtree`.
37
- Unrecognized values remain invalid and resolve to `tab`.
38
-
39
- `tab` places future direct agents owned by a lead in one dedicated agents tab.
40
-
41
- `subtree` gives each future lead-direct agent its own tab. Descendants always
42
- split inside their owner's current tab.
11
+ The default location is `~/.pi/agent/pi-herdsman/config.json`. Pi's native
12
+ `getAgentDir()` determines the agent directory, so setting
13
+ `PI_CODING_AGENT_DIR` relocates the file to
14
+ `$PI_CODING_AGENT_DIR/pi-herdsman/config.json`.
43
15
 
44
- `split` places future lead-direct agents by splitting from the caller's current
45
- pane. Descendants always split inside their owner's current tab.
16
+ Project trust and project settings do not affect Herdsman configuration.
17
+ Agent definitions remain a separate feature and continue to use the bundled,
18
+ project-local, and user agent-definition locations described in the
19
+ [agent-definition guide](../guides/agent-definitions.md).
46
20
 
47
- This affects future starts, not existing agents.
21
+ ## Schema and defaults
48
22
 
49
- ## Message limits
50
-
51
- Pi Herdsman uses two independent byte settings:
23
+ The file contains only explicitly configured overrides. The accepted flat
24
+ schema is:
52
25
 
53
26
  ```json
54
27
  {
55
- "piHerdsman": {
56
- "inlineAttachmentLimitBytes": 131072,
57
- "mailboxPayloadLimitBytes": 131072
58
- }
28
+ "spawnPlacement": "subtree",
29
+ "inlineAttachmentLimitBytes": 131072,
30
+ "mailboxPayloadLimitBytes": 131072
59
31
  }
60
32
  ```
61
33
 
62
- Each accepts an integer from 1024 bytes (1 KiB) through 1048576 bytes (1 MiB)
63
- and defaults to 131072 bytes (128 KiB). The inline limit applies per file;
64
- eligible complete strict UTF-8 files are embedded in caller order only when
65
- the exact serialized mailbox record fits. Other files remain canonical
66
- references. The mailbox limit is the exact serialized `RequestRecord`,
67
- `AskRecord`, or text-only chief supervision record admission size. Chief
68
- supervision also has an existing fixed 8 KiB record ceiling, so its effective
69
- admission limit is the smaller of the configured mailbox limit and 8 KiB.
34
+ An absent file means these defaults:
35
+
36
+ | Field | Default | Allowed values |
37
+ | ---------------------------- | -----------------: | ------------------------------------------------- |
38
+ | `spawnPlacement` | `subtree` | `tab`, `subtree`, `split` |
39
+ | `inlineAttachmentLimitBytes` | `131072` (128 KiB) | integer from 1024 (1 KiB) through 1048576 (1 MiB) |
40
+ | `mailboxPayloadLimitBytes` | `131072` (128 KiB) | integer from 1024 (1 KiB) through 1048576 (1 MiB) |
70
41
 
71
- Only valid global values affect runtime behavior. Invalid global values are
72
- ignored rather than clamped, and project-local values for these two keys are
73
- inert. Configure the global values through `/agents` → `Message limits`; the
74
- fixed 1 MiB protocol safety ceiling remains in force for reading existing
75
- mailbox records.
42
+ Malformed JSON, a non-object root, unknown fields, and invalid known values
43
+ are errors. Reads do not create the directory or file. Configuration changes
44
+ through `/agents` update this single file atomically.
76
45
 
77
- ## Settings scope
46
+ `inlineAttachmentLimitBytes` applies per file. Eligible complete strict UTF-8
47
+ files are embedded only when the exact serialized mailbox record fits; other
48
+ files remain canonical references. `mailboxPayloadLimitBytes` limits the exact
49
+ serialized request, ask, or chief message record. Chief messages also retain
50
+ their fixed 8 KiB protocol ceiling.
78
51
 
79
- Pi Herdsman reads Pi settings through Pi's settings manager.
52
+ Placement affects future starts, not existing agents. `tab` uses one lead-owned
53
+ agents tab, `subtree` gives each lead-direct agent its own tab, and `split`
54
+ splits from the caller's pane. Nested delegation always splits in its owner's
55
+ current tab.
80
56
 
81
- Global settings are stored in the Pi agent directory's `settings.json`
82
- (default `~/.pi/agent/settings.json`).
57
+ ## Reset
83
58
 
84
- Project settings are stored in:
59
+ Stop active Pi and Herdsman processes first; running processes may recreate
60
+ runtime state. Then delete the complete Herdsman directory at this canonical
61
+ location:
85
62
 
86
63
  ```text
87
- <project>/.pi/settings.json
64
+ <resolved Pi agent directory>/pi-herdsman/
88
65
  ```
89
66
 
90
- A project placement value is effective only when:
91
-
92
- - the project is trusted by Pi; and
93
- - the project setting is `tab`, `subtree`, or `split`.
94
-
95
- If no valid trusted project placement is active, the global value is used.
96
-
97
- `/agents placement` opens a native selector showing the effective value and
98
- offering `tab`, `subtree`, or `split`. Selecting a value writes to the current effective
99
- scope and verifies the value after writing; the confirmation reports whether
100
- that scope is `project` or `global`.
101
-
102
- ## Agent definitions are not extension settings
103
-
104
- Do not put per-agent model, thinking, tool, skill, extension, body, or
105
- delegation policy in `piHerdsman`.
67
+ `<resolved Pi agent directory>` means the result of Pi's native
68
+ `getAgentDir()`. With a custom `PI_CODING_AGENT_DIR`, Pi resolves that value
69
+ (including values such as `~`) before appending `pi-herdsman`; do not construct
70
+ the path by concatenating the raw environment variable yourself. Use the
71
+ native file-management operation for the current platform to delete that
72
+ directory.
106
73
 
107
- Those belong in Markdown agent definitions.
108
-
109
- Trusted project-local definitions are discovered from `<cwd>/.pi/agents/`.
110
-
111
- See:
112
-
113
- - [Agent definitions](../guides/agent-definitions.md)
114
- - [Agent-definition schema](agent-definition-schema.md)
115
-
116
- ## herdr integration
117
-
118
- The required Pi integration is installed separately:
119
-
120
- ```sh
121
- herdr integration install pi
122
- herdr integration status
123
- ```
74
+ The next process starts with the defaults and recreates only the runtime state
75
+ it needs.
124
76
 
125
77
  ## See also
126
78
 
@@ -38,7 +38,7 @@ must not be presented as exhausted cleanup.
38
38
  | Category | Meaning |
39
39
  | -------------------------- | ----------------------------------------------------------------------------------- |
40
40
  | `not_running_inside_herdr` | Required herdr environment is missing. |
41
- | `agent_label_exists` | Requested/generated live label conflicts with an existing agent. |
41
+ | `agent_label_exists` | Requested, inherited, or generated live label conflicts with an existing agent. |
42
42
  | `pane_not_ready` | Agent pane/startup did not reach the required readiness boundary. |
43
43
  | `target_not_found` | Exact requested identity or ownership evidence was not found. |
44
44
  | `target_ambiguous` | More than one live candidate matched an identity that must be exact. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-herdsman",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "description": "Asynchronous Pi agent orchestration with nested delegation, parallel execution, and supervision in herdr.",
6
6
  "license": "Apache-2.0",
@@ -41,7 +41,7 @@
41
41
  "image": "https://raw.githubusercontent.com/boadij/pi-herdsman/main/docs/assets/thumbnail.webp"
42
42
  },
43
43
  "scripts": {
44
- "test": "node --experimental-test-module-mocks --test --test-timeout=10000",
44
+ "test": "node --experimental-test-module-mocks --import=./scripts/test-env.mjs --test --test-timeout=10000",
45
45
  "check": "node scripts/check.mjs",
46
46
  "build": "node scripts/build.mjs",
47
47
  "package:audit": "node scripts/package-audit.mjs",