pi-landstrip 0.17.43 → 0.18.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 +140 -174
- package/dist/index.ts +682 -514
- package/dist/sandbox.json +0 -1
- package/package.json +6 -6
- package/sandbox.json +0 -1
- package/dist/subagents.json +0 -70
- package/subagents.json +0 -70
package/README.md
CHANGED
|
@@ -7,14 +7,13 @@ Subagents 3 active
|
|
|
7
7
|
└─ ● running @general Design bounded summaries
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
`pi-landstrip`
|
|
11
|
-
|
|
12
|
-
uses an Anthropic-compatible policy and delegates OS-level enforcement to
|
|
10
|
+
`pi-landstrip` adds sandboxed Bash, primary agents, and sandboxed subagents to
|
|
11
|
+
[Pi](https://pi.dev/). OS isolation is provided by
|
|
13
12
|
[`landstrip`](https://github.com/landstrip/landstrip).
|
|
14
13
|
|
|
15
|
-
The
|
|
16
|
-
|
|
17
|
-
override
|
|
14
|
+
The package includes a default [sandbox policy](./sandbox.json). Configure agents,
|
|
15
|
+
subagent limits, permissions, and OpenCode imports under `landstrip` in Pi
|
|
16
|
+
`settings.json`. Trusted project settings override global settings.
|
|
18
17
|
|
|
19
18
|
Process-backed subagents require Pi >= 0.82.0, and Node.js >= 22.19.0.
|
|
20
19
|
|
|
@@ -46,15 +45,12 @@ Alternatively, place the extension under `~/.pi/agent/extensions/` (global) or
|
|
|
46
45
|
|
|
47
46
|
On unsupported platforms the extension loads but leaves sandboxing disabled.
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
status line report the active backend and mode. There is no silent
|
|
53
|
-
LPAC-to-standard fallback.
|
|
48
|
+
Pi's Git Bash/MSYS shell cannot start in LPAC, so the default Windows policy uses
|
|
49
|
+
standard AppContainer. `/sandbox` and the status line show the active Windows
|
|
50
|
+
isolation. LPAC launch failures return an error.
|
|
54
51
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
see [Windows restricted-user setup](#windows-restricted-user-setup).
|
|
52
|
+
Restricted-user isolation supports Git Bash with restricted local accounts. See
|
|
53
|
+
[Windows restricted-user installation](#windows-restricted-user-installation).
|
|
58
54
|
|
|
59
55
|
## Disabling
|
|
60
56
|
|
|
@@ -71,20 +67,16 @@ processes, but without the outer Landstrip OS sandbox. The extension warns once
|
|
|
71
67
|
per session. Agent tool permissions still apply, but they are not an OS isolation
|
|
72
68
|
boundary.
|
|
73
69
|
|
|
74
|
-
Trusted project config overrides global config
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
project-trust API use only global configuration.
|
|
70
|
+
Trusted project config overrides global config. `/sandbox` updates a trusted
|
|
71
|
+
project sandbox file when present, otherwise the global file. Pi versions
|
|
72
|
+
without a project-trust API use only global configuration.
|
|
78
73
|
|
|
79
74
|
## Behavior
|
|
80
75
|
|
|
81
|
-
When
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
Project approvals are written to `.pi/sandbox.json`; global approvals are
|
|
87
|
-
written to `~/.pi/agent/sandbox.json`.
|
|
76
|
+
When a command requests additional access, the extension opens an approval dialog.
|
|
77
|
+
The user can allow once, allow for the session, save the approval globally or for the
|
|
78
|
+
project, or reject it. Project approvals go to `.pi/sandbox.json`; global approvals
|
|
79
|
+
go to `~/.pi/agent/sandbox.json`.
|
|
88
80
|
|
|
89
81
|
The main agent remains a normal Pi process. `pi-landstrip` replaces Bash execution,
|
|
90
82
|
including AI `bash` calls and manually typed shell commands (`!` and `!!`), with a
|
|
@@ -103,27 +95,39 @@ task's dedicated session directory. These paths are required to construct a
|
|
|
103
95
|
normal Pi worker and are not persisted into `sandbox.json`. The worker receives
|
|
104
96
|
write access only to its own session and temporary directories.
|
|
105
97
|
|
|
106
|
-
Use `/sandbox` to inspect
|
|
107
|
-
|
|
108
|
-
|
|
98
|
+
Use `/sandbox` to inspect or disable the sandbox. Use `/agents` to select a primary
|
|
99
|
+
agent, inspect primary agents, subagents, and tasks, and set subagent limits.
|
|
100
|
+
|
|
101
|
+
## Permission model
|
|
102
|
+
|
|
103
|
+
Agent and sandbox permissions apply at different stages:
|
|
104
|
+
|
|
105
|
+
| Layer | Checked before or during | Controls |
|
|
106
|
+
| ------------------ | ------------------------ | ------------------------------------------ |
|
|
107
|
+
| Agent permission | Before tool dispatch | Which tools an agent may call |
|
|
108
|
+
| Sandbox permission | During process execution | Filesystem and network access for commands |
|
|
109
|
+
|
|
110
|
+
```text
|
|
111
|
+
agent → agent permission → tool → sandbox → OS resource
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Each layer prompts independently. An agent approval allows tool dispatch; sandbox
|
|
115
|
+
restrictions still apply to the resulting process.
|
|
109
116
|
|
|
110
117
|
## Primary agents
|
|
111
118
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
with the session.
|
|
119
|
+
`/agents` lists all configured agents and their modes. Press Enter to activate a
|
|
120
|
+
visible primary agent. The built-in primary agents are `build` and `plan`. Build has
|
|
121
|
+
normal development access; plan asks before shell commands and file edits.
|
|
122
|
+
|
|
123
|
+
The selected prompt and permissions are stored in the session. Press `Ctrl+Shift+A`
|
|
124
|
+
while Pi is idle to cycle through visible primary agents.
|
|
119
125
|
|
|
120
126
|
## Subagents
|
|
121
127
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
root Pi process supervises RPC, permissions, nesting, persistence, and result
|
|
126
|
-
delivery.
|
|
128
|
+
The `task` tool runs each subagent in a separate `pi --mode rpc` process inside a
|
|
129
|
+
Landstrip sandbox. The root Pi process manages RPC, permissions, nesting, sessions,
|
|
130
|
+
and results.
|
|
127
131
|
|
|
128
132
|
Workers use normal Pi resource discovery and plugin loading, plus the
|
|
129
133
|
`pi-landstrip` worker extension. Requested tools are composed inside the worker,
|
|
@@ -131,7 +135,7 @@ so plugins can add or replace implementations. Each task starts a fresh Pi
|
|
|
131
135
|
process and plugin instances; continuing a `task_id` restores its persisted Pi
|
|
132
136
|
session in a new process.
|
|
133
137
|
|
|
134
|
-
The tool accepts
|
|
138
|
+
The tool accepts these fields:
|
|
135
139
|
|
|
136
140
|
```json
|
|
137
141
|
{
|
|
@@ -144,32 +148,18 @@ The tool accepts the OpenCode task fields:
|
|
|
144
148
|
}
|
|
145
149
|
```
|
|
146
150
|
|
|
147
|
-
Foreground tasks return
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
Use `/subagents` to open an inspector with **Agents** and **Sessions** tabs. The
|
|
151
|
-
Agents tab lists every available subagent type and its `built-in`, `global`, or
|
|
152
|
-
`local` source. The Sessions tab inspects child transcripts; task rows can open a
|
|
153
|
-
specific one with `/subagents <id>`. Completed and failed task metadata remains
|
|
154
|
-
available after reload, and persisted sessions can be continued with `task_id`.
|
|
151
|
+
Foreground tasks return their result directly. Background tasks return immediately
|
|
152
|
+
and report completion later. The **Tasks** tab in `/agents` shows task status and
|
|
153
|
+
output. Open a task with `/agents <id>`. Continue a saved session with `task_id`.
|
|
155
154
|
|
|
156
155
|
Session switching or shutdown stops live workers. After an unclean restart,
|
|
157
156
|
unfinished work is marked interrupted; completed but undelivered background
|
|
158
157
|
results are delivered when the root session resumes.
|
|
159
158
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
root session and its descendants.
|
|
165
|
-
|
|
166
|
-
Tool permissions cannot widen the outer Landstrip policy. Sandbox approvals
|
|
167
|
-
continue to use `.pi/sandbox.json` and `~/.pi/agent/sandbox.json`.
|
|
168
|
-
|
|
169
|
-
Subagents fail closed when sandboxing is expected but unavailable, unsupported,
|
|
170
|
-
or missing. An explicit `--no-sandbox` flag or `enabled: false` configuration is
|
|
171
|
-
treated as an intentional opt-out and uses the warned unsandboxed process path.
|
|
172
|
-
Unsupported Pi versions still fail task startup.
|
|
159
|
+
Workers check agent permissions before tool dispatch: `deny` blocks, `ask` prompts in
|
|
160
|
+
the root UI, and `allow` runs the tool. Required sandbox startup failures stop the
|
|
161
|
+
task. With `--no-sandbox` or `enabled: false`, workers run without OS isolation and
|
|
162
|
+
Pi shows a warning.
|
|
173
163
|
|
|
174
164
|
### Platform behavior
|
|
175
165
|
|
|
@@ -205,158 +195,134 @@ first.
|
|
|
205
195
|
|
|
206
196
|
## Configuration
|
|
207
197
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
198
|
+
Agent permissions are configured under `landstrip` in Pi `settings.json`. Sandbox
|
|
199
|
+
permissions are configured in `sandbox.json`. The files use different schemas and
|
|
200
|
+
control different stages.
|
|
201
|
+
|
|
202
|
+
### Agent policy (`settings.json`)
|
|
203
|
+
|
|
204
|
+
Agent settings are read from `~/.pi/agent/settings.json` and, for trusted projects,
|
|
205
|
+
`.pi/settings.json`. Built-in subagents are `explore`, `general`, and `scout`.
|
|
212
206
|
|
|
213
|
-
|
|
214
|
-
|
|
207
|
+
Pi Markdown agents are loaded from `~/.pi/agent/agents/*.md` and, for trusted
|
|
208
|
+
projects, `.pi/agents/*.md`. Nested directories are supported. Project Markdown
|
|
209
|
+
agents override global Markdown agents. Settings under `landstrip.agent` override
|
|
210
|
+
Markdown and OpenCode agents with the same name.
|
|
211
|
+
|
|
212
|
+
Add agent configuration under `landstrip` in Pi `settings.json`:
|
|
215
213
|
|
|
216
214
|
```json
|
|
217
215
|
{
|
|
218
|
-
"
|
|
216
|
+
"landstrip": {
|
|
217
|
+
"maxSubagents": 2,
|
|
218
|
+
"agent": {
|
|
219
|
+
"review": {
|
|
220
|
+
"description": "Review code without modifying it",
|
|
221
|
+
"mode": "subagent",
|
|
222
|
+
"prompt": "Review the requested code and report concrete findings.",
|
|
223
|
+
"permission": {
|
|
224
|
+
"edit": "deny",
|
|
225
|
+
"bash": "ask"
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
"permission": {
|
|
230
|
+
"task": {
|
|
231
|
+
"*": "deny",
|
|
232
|
+
"review": "allow"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
219
236
|
}
|
|
220
237
|
```
|
|
221
238
|
|
|
222
|
-
|
|
223
|
-
|
|
239
|
+
`landstrip.maxSubagents` sets the maximum number of concurrent subagents from 0 to 16. The default is 1; zero disables `task`. The `/agents` **Settings** tab provides
|
|
240
|
+
**Maximum subagents (global)** and **Maximum subagents (local)**.
|
|
241
|
+
|
|
242
|
+
`landstrip.permission` applies to every agent. Each
|
|
243
|
+
`landstrip.agent.<name>.permission` map adds agent-specific rules; later matching
|
|
244
|
+
rules win. Agent definitions support `mode`, `prompt`, `model`, `variant`, `steps`,
|
|
245
|
+
`color`, `disable`, and `allow`/`ask`/`deny` permissions. `{file:path}` prompt
|
|
246
|
+
references are resolved from the defining `settings.json`. Provider-specific fields
|
|
247
|
+
belong under `options`.
|
|
248
|
+
|
|
249
|
+
`hidden` removes an agent from `/agents`. A hidden, subagent-capable agent remains
|
|
250
|
+
available to `task`. Agent `mode` controls activation: only `primary` and `all` agents
|
|
251
|
+
can be selected as primary, while only `subagent` and `all` agents can be passed to
|
|
252
|
+
`task`. Missing, ambiguous, or unauthenticated primary-agent models produce an error
|
|
253
|
+
and leave the current agent active.
|
|
254
|
+
|
|
255
|
+
OpenCode integration flags also live in Pi `settings.json` under
|
|
256
|
+
`landstrip.opencode`; both default to `true`:
|
|
224
257
|
|
|
225
258
|
```json
|
|
226
259
|
{
|
|
227
|
-
"
|
|
228
|
-
"
|
|
229
|
-
"
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
"agent": {}
|
|
260
|
+
"packages": ["npm:pi-landstrip"],
|
|
261
|
+
"landstrip": {
|
|
262
|
+
"opencode": {
|
|
263
|
+
"showGlobalAgents": true,
|
|
264
|
+
"showLocalAgents": true
|
|
265
|
+
}
|
|
234
266
|
}
|
|
235
267
|
}
|
|
236
268
|
```
|
|
237
269
|
|
|
238
|
-
- `showGlobalAgents` imports
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
270
|
+
- `showGlobalAgents` imports `agent` definitions from `opencode.json` and
|
|
271
|
+
`opencode.jsonc`, plus Markdown agents under `agent/` and `agents/`, in the
|
|
272
|
+
OpenCode global config directory (`$OPENCODE_CONFIG_DIR`,
|
|
273
|
+
`$XDG_CONFIG_HOME/opencode`, or `~/.config/opencode`).
|
|
274
|
+
- `showLocalAgents` imports `agent` definitions from project `opencode.json` and
|
|
275
|
+
`opencode.jsonc`, `.opencode/opencode.json` and `.opencode/opencode.jsonc`, and
|
|
276
|
+
Markdown agents under `.opencode/agent/` and `.opencode/agents/`.
|
|
277
|
+
|
|
278
|
+
Set either flag to `false` to disable that OpenCode source. Project OpenCode agents
|
|
279
|
+
override global OpenCode agents. Pi Markdown agents and `landstrip.agent` settings
|
|
280
|
+
take precedence over OpenCode imports. Project sources require a trusted project.
|
|
281
|
+
OpenCode config files support JSONC comments, trailing commas, and `{file:path}`
|
|
282
|
+
prompt references.
|
|
243
283
|
|
|
244
|
-
|
|
245
|
-
OpenCode global agents. Pi agent definitions from `subagents.json` (built-in,
|
|
246
|
-
global, and local) take precedence over OpenCode imports with the same name;
|
|
247
|
-
conflicts are silent. Local OpenCode agents are skipped when the project is
|
|
248
|
-
untrusted, regardless of the flag.
|
|
284
|
+
### Sandbox policy (`sandbox.json`)
|
|
249
285
|
|
|
250
|
-
|
|
251
|
-
sandbox
|
|
286
|
+
Sandbox settings are read from `~/.pi/agent/sandbox.json` and, for trusted projects,
|
|
287
|
+
`.pi/sandbox.json`. They control runtime filesystem and network access.
|
|
252
288
|
|
|
253
|
-
|
|
289
|
+
Configure Windows sandbox fields in `sandbox.json`:
|
|
254
290
|
|
|
255
291
|
```json
|
|
256
292
|
{
|
|
257
293
|
"windows": {
|
|
258
|
-
"backend": "appContainer",
|
|
259
294
|
"appContainerMode": "standard",
|
|
260
295
|
"allowLoopback": false
|
|
261
296
|
}
|
|
262
297
|
}
|
|
263
298
|
```
|
|
264
299
|
|
|
265
|
-
`
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
to LPAC, while the Pi package defaults to standard mode for Git Bash compatibility.
|
|
269
|
-
`allowLoopback` is independently opt-in and applies only to AppContainer.
|
|
300
|
+
`appContainerMode` accepts `"lpac"` or `"standard"`. The Pi package defaults to
|
|
301
|
+
standard mode for Git Bash. `allowLoopback` applies only to AppContainer. Landstrip
|
|
302
|
+
selects Windows isolation automatically.
|
|
270
303
|
|
|
271
|
-
|
|
304
|
+
#### Windows restricted-user installation
|
|
272
305
|
|
|
273
|
-
Provision
|
|
306
|
+
Provision restricted-user execution once to activate it:
|
|
274
307
|
|
|
275
308
|
```powershell
|
|
276
|
-
npx @landstrip/landstrip windows
|
|
309
|
+
npx @landstrip/landstrip windows install
|
|
277
310
|
npx @landstrip/landstrip windows status
|
|
278
311
|
```
|
|
279
312
|
|
|
280
|
-
|
|
281
|
-
unrestricted-network accounts, and proxy ports 60080
|
|
282
|
-
`
|
|
283
|
-
`"backend": "restrictedUser"` in `~/.pi/agent/sandbox.json` and restart Pi.
|
|
313
|
+
Installation requests elevation and creates eight restricted-network accounts, two
|
|
314
|
+
unrestricted-network accounts, and proxy ports 60080–60111 by default. Use
|
|
315
|
+
`windows install --help` to change these values. Restart Pi after installation.
|
|
284
316
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
317
|
+
Before each launch, the extension checks the installation. A failed health check
|
|
318
|
+
stops the task. Restricted-user isolation does not support `windows.allowLoopback`
|
|
319
|
+
or `network.allowLocalBinding`. Remove the accounts, WFP rules, runner, and ACL
|
|
320
|
+
grants with:
|
|
289
321
|
|
|
290
322
|
```powershell
|
|
291
323
|
npx @landstrip/landstrip windows uninstall
|
|
292
324
|
```
|
|
293
325
|
|
|
294
|
-
A subagent configuration example follows:
|
|
295
|
-
|
|
296
|
-
```json
|
|
297
|
-
{
|
|
298
|
-
"maxSubagents": 2,
|
|
299
|
-
"subagents": {
|
|
300
|
-
"agent": {
|
|
301
|
-
"review": {
|
|
302
|
-
"description": "Review code without modifying it",
|
|
303
|
-
"mode": "subagent",
|
|
304
|
-
"prompt": "Review the requested code and report concrete findings.",
|
|
305
|
-
"permission": {
|
|
306
|
-
"edit": "deny",
|
|
307
|
-
"bash": "ask"
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
},
|
|
311
|
-
"permission": {
|
|
312
|
-
"task": {
|
|
313
|
-
"*": "deny",
|
|
314
|
-
"review": "allow"
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
`maxSubagents` is an integer from 0 through 16 controlling concurrent workers.
|
|
322
|
-
The packaged default is 0, which removes the `task` tool while retaining primary
|
|
323
|
-
roles. There is no separate subagent enable switch. The Settings tab in
|
|
324
|
-
`/agents` edits this limit for global and trusted-project configuration.
|
|
325
|
-
|
|
326
|
-
Agent modes, hidden/disabled agents, prompts, colors, and ordered
|
|
327
|
-
`allow`/`ask`/`deny` permissions apply to primary agents and subagents. Prompt
|
|
328
|
-
strings may include OpenCode-style `{file:path}` tokens; relative paths resolve
|
|
329
|
-
against the `subagents.json` file that defines them. `color` accepts `#RRGGBB`
|
|
330
|
-
or OpenCode theme names (`primary`, `secondary`, `accent`, `success`, `warning`,
|
|
331
|
-
`error`, `info`). `hidden` only hides an agent from user-facing primary pickers;
|
|
332
|
-
the model can still invoke a hidden subagent via `task`. Subagent workers also
|
|
333
|
-
honor model selection, supported Pi thinking-level variants, and step limits.
|
|
334
|
-
Primary agent activation currently changes the prompt and permissions only.
|
|
335
|
-
Later matching permission rules win. Put provider-specific values under
|
|
336
|
-
`options`; unknown agent fields are rejected. Agent permissions cannot weaken an
|
|
337
|
-
enabled OS sandbox, grant filesystem access, or grant network access.
|
|
338
|
-
|
|
339
|
-
## Configuration migration
|
|
340
|
-
|
|
341
|
-
There is no compatibility loader for previous subagent configuration sources.
|
|
342
|
-
Legacy keys in `settings.json` produce a migration warning. Move configuration as
|
|
343
|
-
follows, then remove the old fields:
|
|
344
|
-
|
|
345
|
-
- Move `agent` and `permission` from Pi `settings.json` or OpenCode JSON under
|
|
346
|
-
`subagents.agent` and `subagents.permission`.
|
|
347
|
-
- Convert legacy `tools` booleans to explicit `permission` rules.
|
|
348
|
-
- Move Markdown agent prompts into each `subagents.agent.<name>.prompt` string.
|
|
349
|
-
- Put the worker limit in top-level `maxSubagents`; zero disables delegation.
|
|
350
|
-
- Move `landstrip.opencode` flags from Pi `settings.json` to top-level
|
|
351
|
-
`opencode` in `subagents.json`.
|
|
352
|
-
- Use `~/.pi/agent/subagents.json` for global configuration and
|
|
353
|
-
`.pi/subagents.json` for trusted project configuration.
|
|
354
|
-
- Leave sandbox policy in `~/.pi/agent/sandbox.json` and `.pi/sandbox.json`;
|
|
355
|
-
those files are unchanged.
|
|
356
|
-
|
|
357
|
-
Do not put these fields in Pi's `settings.json`; `pi-landstrip` does not read
|
|
358
|
-
them there.
|
|
359
|
-
|
|
360
326
|
## Plugin API
|
|
361
327
|
|
|
362
328
|
Pi extensions can discover the active Landstrip runtime through the versioned
|