pi-landstrip 0.17.34 → 0.17.36

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 CHANGED
@@ -16,7 +16,7 @@ The extension includes a shared [sandbox policy](./sandbox.json) and separate
16
16
  [agent configuration](./subagents.json). Global and trusted-project files can
17
17
  override both.
18
18
 
19
- Process-backed subagents require Pi >= 0.80.6 and < 0.82.0, and Node.js >= 22.19.0.
19
+ Process-backed subagents require Pi >= 0.82.0, and Node.js >= 22.19.0.
20
20
 
21
21
  ## Installation
22
22
 
@@ -46,6 +46,16 @@ Alternatively, place the extension under `~/.pi/agent/extensions/` (global) or
46
46
 
47
47
  On unsupported platforms the extension loads but leaves sandboxing disabled.
48
48
 
49
+ On Windows, Pi's Git Bash/MSYS shell cannot run under LPAC. The packaged policy
50
+ therefore selects standard AppContainer explicitly. This is weaker than LPAC because
51
+ resources granted to `ALL APPLICATION PACKAGES` remain visible; `/sandbox` and the
52
+ status line report the active backend and mode. There is no silent
53
+ LPAC-to-standard fallback.
54
+
55
+ An optional restricted-user backend supports Git Bash without AppContainer. It
56
+ requires one-time elevated host setup and persistent local accounts and WFP rules;
57
+ see [Windows restricted-user setup](#windows-restricted-user-setup).
58
+
49
59
  ## Disabling
50
60
 
51
61
  Use the `--no-sandbox` flag, or set `enabled` to `false` in `sandbox.json`:
@@ -61,9 +71,10 @@ processes, but without the outer Landstrip OS sandbox. The extension warns once
61
71
  per session. Agent tool permissions still apply, but they are not an OS isolation
62
72
  boundary.
63
73
 
64
- Trusted project config overrides global config. `/sandbox` updates a trusted
65
- project sandbox file when present, otherwise the global file. Pi versions
66
- without a project-trust API use only global configuration.
74
+ Trusted project config overrides global config except for the Windows backend,
75
+ which can be selected only in the trusted global file. `/sandbox` updates a trusted
76
+ project sandbox file when present, otherwise the global file. Pi versions without a
77
+ project-trust API use only global configuration.
67
78
 
68
79
  ## Behavior
69
80
 
@@ -75,11 +86,12 @@ being approved.
75
86
  Project approvals are written to `.pi/sandbox.json`; global approvals are
76
87
  written to `~/.pi/agent/sandbox.json`.
77
88
 
78
- The main agent remains a normal Pi process. `pi-landstrip` replaces Bash
79
- execution, including AI `bash` calls and manually typed shell commands (`!` and
80
- `!!`), with a Landstrip-wrapped implementation. Network traffic uses an
81
- allowlist proxy when direct access is disabled. Pi's filesystem tools and plugin
82
- callbacks remain trusted code outside the Landstrip sandbox.
89
+ The main agent remains a normal Pi process. `pi-landstrip` replaces Bash execution,
90
+ including AI `bash` calls and manually typed shell commands (`!` and `!!`), with a
91
+ Landstrip-wrapped implementation. Network traffic uses an allowlist proxy when
92
+ direct access is disabled and the platform policy permits loopback; otherwise it is
93
+ blocked. Pi's filesystem tools and plugin callbacks remain trusted code outside the
94
+ Landstrip sandbox.
83
95
 
84
96
  By default, Bash and subagent processes have no direct network access. Reads are
85
97
  limited to the project, Git configuration, and `/dev/null`; writes are limited
@@ -132,9 +144,11 @@ The tool accepts the OpenCode task fields:
132
144
  Foreground tasks return the child result directly. Background tasks return a
133
145
  queued result and deliver completion automatically. Task rows show lifecycle
134
146
  state, current activity, tool-call count, elapsed time, and expandable output.
135
- Use `/subagents` or the task row's `/subagents <id>` command to inspect a child
136
- transcript. Completed and failed task metadata remains available after reload,
137
- and persisted sessions can be continued with `task_id`.
147
+ Use `/subagents` to open an inspector with **Agents** and **Sessions** tabs. The
148
+ Agents tab lists every available subagent type and its `built-in`, `global`, or
149
+ `local` source. The Sessions tab inspects child transcripts; task rows can open a
150
+ specific one with `/subagents <id>`. Completed and failed task metadata remains
151
+ available after reload, and persisted sessions can be continued with `task_id`.
138
152
 
139
153
  Session switching or shutdown stops live workers. After an unclean restart,
140
154
  unfinished work is marked interrupted; completed but undelivered background
@@ -162,11 +176,19 @@ Unsupported Pi versions still fail task startup.
162
176
  `sandbox.json`, then restart or continue the task in a fresh worker to apply
163
177
  additional filesystem access. Main-agent Bash can retry a command, but there
164
178
  is no live worker-policy update.
165
- - **Windows**: AppContainer cannot permit only the loopback proxy port, so
166
- domain-proxied worker networking is unavailable and the worker has no network.
167
- Setting `network.allowNetwork` to `true` is a degraded mode that permits model
168
- access but gives the entire worker unrestricted network access; domain lists
169
- are then not a boundary.
179
+ - **Windows AppContainer**: the packaged policy selects standard AppContainer for
180
+ Pi's Git Bash/MSYS runtime. With `windows.allowLoopback: false` (the default), the
181
+ extension does not start an unreachable proxy and the worker has no network.
182
+ Setting `windows.allowLoopback` to `true` enables the domain proxy, but also gives
183
+ the AppContainer access to every local loopback service, not only the proxy port.
184
+ Setting `network.allowNetwork` to `true` instead gives the entire worker
185
+ unrestricted network access; domain lists are then not a boundary. Both opt-ins
186
+ are explicit security downgrades and produce warnings.
187
+ - **Windows restricted user**: WFP blocks restricted accounts except for the
188
+ installed proxy port range, so domain-filtered proxying works without a broad
189
+ loopback exemption. `network.allowNetwork: true` leases a separately provisioned
190
+ unrestricted account. Filesystem grants are journaled and revoked after every
191
+ process tree exits.
170
192
 
171
193
  ### Credentials
172
194
 
@@ -182,13 +204,84 @@ first.
182
204
 
183
205
  Subagent configuration is read from `~/.pi/agent/subagents.json` and, for trusted
184
206
  projects, `.pi/subagents.json`. Project values override global values; both are
185
- merged over the packaged [defaults](./subagents.json). Sandbox policy remains in
186
- `~/.pi/agent/sandbox.json` and `.pi/sandbox.json`. Pi's `settings.json` contains
187
- only normal Pi settings, such as the `pi-landstrip` package entry.
207
+ merged over the packaged [defaults](./subagents.json). The packaged subagent types
208
+ are `explore`, `general`, and the OpenCode-compatible `scout` reconnaissance agent.
209
+
210
+ Sandbox policy remains in `~/.pi/agent/sandbox.json` and `.pi/sandbox.json`. Pi's
211
+ `settings.json` contains normal Pi settings, such as the `pi-landstrip` package
212
+ entry, plus optional `landstrip.opencode` import flags:
213
+
214
+ ```json
215
+ {
216
+ "packages": ["npm:pi-landstrip"],
217
+ "landstrip": {
218
+ "opencode": {
219
+ "showGlobalAgents": false,
220
+ "showLocalAgents": false
221
+ }
222
+ }
223
+ }
224
+ ```
225
+
226
+ Both flags default to `false`. When enabled:
227
+
228
+ - `showGlobalAgents` imports Markdown agents from the OpenCode global config
229
+ directory (`$OPENCODE_CONFIG_DIR`, or `$XDG_CONFIG_HOME/opencode`, or
230
+ `~/.config/opencode`) under `agent/` and `agents/`.
231
+ - `showLocalAgents` imports Markdown agents from the trusted project's
232
+ `.opencode/agent/` and `.opencode/agents/` directories.
233
+
234
+ OpenCode local agents override OpenCode global agents. Pi agent definitions
235
+ from `subagents.json` (built-in, global, and local) take precedence over OpenCode
236
+ imports with the same name; conflicts are silent. Local OpenCode agents are
237
+ skipped when the project is untrusted, regardless of the flag.
188
238
 
189
239
  `subagents.json` accepts only top-level `maxSubagents` and `subagents`; sandbox
190
240
  fields belong in `sandbox.json`.
191
241
 
242
+ The Windows sandbox fields are:
243
+
244
+ ```json
245
+ {
246
+ "windows": {
247
+ "backend": "appContainer",
248
+ "appContainerMode": "standard",
249
+ "allowLoopback": false
250
+ }
251
+ }
252
+ ```
253
+
254
+ `backend` is `"appContainer"` or `"restrictedUser"`. It is a trusted host setting:
255
+ only `~/.pi/agent/sandbox.json` can change it, and project configuration cannot
256
+ override it. `appContainerMode` is `"lpac"` or `"standard"`; core Landstrip defaults
257
+ to LPAC, while the Pi package defaults to standard mode for Git Bash compatibility.
258
+ `allowLoopback` is independently opt-in and applies only to AppContainer.
259
+
260
+ ### Windows restricted-user setup
261
+
262
+ Provision the backend once before selecting it in global configuration:
263
+
264
+ ```powershell
265
+ npx @landstrip/landstrip windows setup
266
+ npx @landstrip/landstrip windows status
267
+ ```
268
+
269
+ Setup requests UAC elevation and defaults to eight restricted-network accounts, two
270
+ unrestricted-network accounts, and proxy ports 60080-60111. Run
271
+ `npx @landstrip/landstrip windows setup --help` for pool and port options. Then set
272
+ `"backend": "restrictedUser"` in `~/.pi/agent/sandbox.json` and restart Pi.
273
+
274
+ The extension checks installation health and reads the configured proxy range before
275
+ launching a restricted worker. Restricted-user mode does not support
276
+ `windows.allowLoopback` or `network.allowLocalBinding`. Remove the persistent
277
+ accounts, WFP rules, runner, and recovered per-run ACL grants with:
278
+
279
+ ```powershell
280
+ npx @landstrip/landstrip windows uninstall
281
+ ```
282
+
283
+ A subagent configuration example follows:
284
+
192
285
  ```json
193
286
  {
194
287
  "maxSubagents": 2,