You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-7Lines changed: 10 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,9 @@ First-class [Sprites](https://sprites.dev) environments for the [Pi coding agent
9
9
10
10
## Install
11
11
12
-
Until the first npm release, install directly from GitHub:
12
+
`pi-sprites` is not published to npm. Until the first npm release, install it
13
+
directly from GitHub (the repository must be public or your Git client must
14
+
already have access):
13
15
14
16
```bash
15
17
pi install git:github.com/superfly/pi-sprites
@@ -24,6 +26,7 @@ pi install npm:pi-sprites
24
26
For development from this checkout:
25
27
26
28
```bash
29
+
npm ci
27
30
pi -e ./extensions/core.ts \
28
31
-e ./extensions/checkpoints.ts \
29
32
-e ./extensions/services.ts \
@@ -85,7 +88,7 @@ See the [extension guide](./docs/README.md) for prerequisites, configuration, co
85
88
86
89
## Project configuration
87
90
88
-
Copy [`templates/sprites.json`](./templates/sprites.json) to `.pi/sprites.json` and adjust it for the project. Project configuration overrides `~/.pi/agent/sprites.json`; ignored `.pi/sprites.local.json` overrides both.
91
+
Copy [`templates/sprites.json`](./templates/sprites.json) to `.pi/sprites.json` and adjust it for the project. Project configuration overrides `~/.pi/agent/sprites.json`; a machine-local `.pi/sprites.local.json` overrides both. Add the local file to the project's `.gitignore` before putting machine-specific or sensitive values in it.
89
92
90
93
The major sections are:
91
94
@@ -104,11 +107,11 @@ With the default `toolActivation: "auto"`, commands remain available but the eig
104
107
105
108
## Checkpoints
106
109
107
-
The default `risky` mode creates one safety checkpoint before the first write, edit, destructive shell command, or mutating Sprite management tool in a Pi turn. `turn` applies the same once-per-turn checkpoint to any mutation; `off` disables automatic checkpoints.
110
+
The default `risky` mode creates one safety checkpoint before the first write, edit, recognized destructive shell command, or service, policy, or RPC-host model tool in a Pi turn. Those three model tools are conservatively treated as risky even for read-only actions. `turn` applies the same once-per-turn checkpoint before any tool call; `off` disables automatic checkpoints.
108
111
109
112
Restore remains command-only and requires confirmation. Checkpoints contain the filesystem, installed packages, configuration, and on-disk databases. They do not contain running processes, memory, or open connections.
110
113
111
-
Checkpoint deletion and filesystem diffs are intentionally not implemented until the public Sprites SDK exposes stable APIs for them. The package does not reach through SDK internals or assume a private checkpoint mount layout.
114
+
Checkpoint deletion and filesystem diffs are intentionally not implemented because the installed public JavaScript SDK does not expose stable APIs for them. The package does not reach through SDK internals or assume a private checkpoint mount layout.
112
115
113
116
## Services and networking
114
117
@@ -153,17 +156,17 @@ This installs Pi as a Sprite service and exposes it locally through a TCP proxy.
153
156
-`POST /rpc`
154
157
-`GET /events` as server-sent events
155
158
156
-
The service has no public HTTP port by default. When `rpcHost.httpPort` is configured, the secret named by `rpcHost.secretEnv` must be present; requests must send it as `Authorization: Bearer ...`.
159
+
The service is not routed through the Sprite URL by default. When `rpcHost.httpPort` is configured, the secret named by `rpcHost.secretEnv` must be present and requests must send it as `Authorization: Bearer ...`. Configuring the service port does not change the Sprite URL's own `sprite` (authenticated) or `public` access setting.
157
160
158
161
## Safety defaults
159
162
160
163
- Sprite destruction and checkpoint restore are command-only and confirmed.
161
164
- CI and workers are retained unless cleanup is explicitly configured.
162
165
- The RPC host is local-proxy-only unless configured otherwise.
163
166
- Public URL access is never enabled automatically.
164
-
-Provider credentials are not copied into Sprites.
167
+
-Local provider credentials are not copied into Sprites automatically.
165
168
- Project setup commands run only from a trusted project's configuration.
166
-
- New, resumed, and forked Pi sessions reset selection, proxies, and last-checkpoint state.
169
+
- New, resumed, and forked Pi sessions reset transient selection to configured defaults and clear proxies and last-checkpoint state.
167
170
168
171
Pi packages execute with the user's full permissions. Review package source before installation, just as you would any other Pi extension.
Copy file name to clipboardExpand all lines: docs/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Testing guides:
21
21
22
22
## How Pi treats these files
23
23
24
-
Pi packages have runtime resource types for extensions, skills, prompts, and themes. There is no separate documentation resource type. These Markdown files are shipped in the npm package and linked from the top-level README, but are deliberately absent from the `pi` manifest. Pi therefore does not load them as prompts or place them in model context.
24
+
Pi packages have runtime resource types for extensions, skills, prompts, and themes. There is no separate documentation resource type. These Markdown files are shipped with the package and linked from the top-level README, but are deliberately absent from the `pi` manifest. Pi therefore does not load them as prompts or place them in model context. See Pi's [package documentation](https://pi.dev/docs/latest/packages) for the resource and filtering model.
25
25
26
26
Commands beginning with `/sprite-` are always available when their extension is loaded and are initiated by the user. Tools named `sprite_*` are callable by the model. With the default `toolActivation: "auto"`, those model tools become active only after a Sprite is selected or when Pi itself is running inside a Sprite. See [Core remote environment](./core.md#model-tool-activation) for the other activation modes.
27
27
@@ -30,19 +30,19 @@ Commands beginning with `/sprite-` are always available when their extension is
30
30
- Node.js 24 or later.
31
31
- A Sprites token in `SPRITES_TOKEN`, `SPRITE_TOKEN`, or the variable named by `tokenEnv`.
32
32
- A selected or configured Sprite for extensions that operate on the current environment. Checkpoints can also use `sprite-env` when Pi itself runs inside a Sprite. Bootstrap, CI, and workers can provision explicitly named Sprites without changing the user's selection.
33
-
- Project trust before `.pi/sprites.json` or `.pi/sprites.local.json` is honored. Global `~/.pi/agent/sprites.json` remains available outside a trusted project.
33
+
- Project trust before `.pi/sprites.json` or `.pi/sprites.local.json` is honored. Global `~/.pi/agent/sprites.json` remains available outside a trusted project. Add `.pi/sprites.local.json` to the consuming project's `.gitignore` before using it for local-only values.
34
34
35
35
Start with the configuration template at [`templates/sprites.json`](../templates/sprites.json).
36
36
37
37
## Filtering extensions
38
38
39
-
Pi package filters can narrow the extension list. For example, this project setting keeps only core routing and checkpoints:
39
+
Pi package filters can narrow the extension list. For example, this entry in the project's `.pi/settings.json` keeps only core routing and checkpoints for the current Git installation:
Copy file name to clipboardExpand all lines: docs/checkpoints.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,8 +31,8 @@ A selected Sprite is required unless Pi itself is running inside a Sprite, where
31
31
Modes are:
32
32
33
33
-`off`: no automatic checkpoints.
34
-
-`risky` (default): once per turn, before the first write, edit, recognized destructive shell command, or mutating service, policy, or RPC-host tool call.
35
-
-`turn`: once per turn before the first mutating tool call.
34
+
-`risky` (default): once per turn, before the first write, edit, recognized destructive shell command, or service, policy, or RPC-host model-tool call. Those three model tools are conservatively treated as risky for every action, including inspection.
35
+
-`turn`: once per turn before the first tool call, whether or not that tool is expected to mutate state.
36
36
37
37
If a required automatic checkpoint fails, the mutation is blocked rather than allowed to continue without a recovery point.
38
38
@@ -44,6 +44,6 @@ Bootstrap, CI, and worker tool calls do not checkpoint the user's selected Sprit
44
44
45
45
## Limitations
46
46
47
-
Checkpoint deletion and filesystem diff are not implemented. Those operations currently require SDK internals or an unstable on-disk layout;`pi-sprites`waits for stable public SDK APIs instead.
47
+
Checkpoint deletion and filesystem diff are not implemented. The installed public JavaScript SDK does not expose those operations, and implementing them would require a hand-written API call or an unstable on-disk layout.`pi-sprites`avoids both.
48
48
49
49
Restoring may terminate active processes and sessions. Services should restart according to the Sprite service manager, but arbitrary foreground processes will not be recreated.
Copy file name to clipboardExpand all lines: docs/core.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ After `/sprite-use` or `/sprite-new`, these normal Pi operations target `remoteC
10
10
- interactive `!` shell commands
11
11
- the working-directory line added to the agent's system prompt
12
12
13
-
`/sprite-local` returns those operations to the machine running Pi. Selection and open proxies reset when a Pi session starts, ends, resumes, forks, or is replaced.
13
+
`/sprite-local` returns those operations to the machine running Pi. When a Pi session starts, resumes, forks, or is replaced, transient selection resets and configuration is reapplied; a configured `sprite` may therefore become selected again. Open proxies and last-checkpoint state are cleared between sessions.
14
14
15
15
## Commands
16
16
@@ -74,7 +74,7 @@ The setting does not disable Pi's normal filesystem tools; it only changes wheth
74
74
}
75
75
```
76
76
77
-
-`mode`: `auto`, `local`, or `remote`. `auto` uses remote routing when a Sprite is selected.
77
+
-`mode`: `local` always keeps native tools on the Pi host; `remote` routes them when a Sprite is selected, including when Pi itself runs inside a Sprite; `auto` routes to a selected Sprite only when Pi is running outside one.
78
78
-`sprite`: initial configured Sprite name.
79
79
-`remoteCwd`: workspace directory inside the Sprite; otherwise `/workspace/<local-project-name>`.
80
80
-`baseURL`: optional Sprites API endpoint override.
| 1.3 |`/sprite new pi-sprites-test`| Creates and selects the Sprite. |
51
-
| 1.4 |`!pwd`| Runs in the **remote** Sprite, prints `remoteCwd` (`/workspace/pi-sprites-test`). |
52
-
| 1.5 |`write` a file `hello.txt` with some text | File is created remotely. |
53
-
| 1.6 |`read hello.txt` / `ls`| Shows the remote file. Confirms `read`/`write`/`ls` are routed. |
54
-
| 1.7 |`/sprite-local` then `!pwd`| Returns to your **local** machine's cwd. |
55
-
| 1.8 |`/sprite-use pi-sprites-test` then `ls`| Back on the remote workspace, file still present. |
54
+
| 1.3 |`/sprite new pi-sprites-test`| Creates and selects the Sprite. Its initial `remoteCwd` is derived from the local project unless configured. |
55
+
| 1.4 |`/sprite-use pi-sprites-test /workspace/pi-sprites-test`| Selects an explicit test working directory. |
56
+
| 1.5 |`!mkdir -p /workspace/pi-sprites-test` then `!pwd`| Creates the workspace and prints `/workspace/pi-sprites-test` from the **remote** Sprite. |
57
+
| 1.6 | Ask Pi to write a file `hello.txt` with some text | The `write` tool creates the file remotely. |
58
+
| 1.7 | Ask Pi to read `hello.txt` and list the directory | The `read` and `ls` tools show the remote file. |
59
+
| 1.8 |`/sprite-local` then `!pwd`| Returns to your **local** machine's cwd. |
60
+
| 1.9 |`/sprite-use pi-sprites-test /workspace/pi-sprites-test` then ask Pi to list the directory | Back in the remote workspace, the file is still present. |
56
61
57
62
**Pass criteria:** native tools transparently switch between local and remote,
58
63
and selection survives within the session.
@@ -79,7 +84,7 @@ asks for confirmation; the model cannot restore.
79
84
80
85
| Step | Action | Expect |
81
86
|---|---|---|
82
-
| 3.1 |`/sprite-service create web npm run dev` (or any simple command that stays up) | Service definition created in `remoteCwd`. |
87
+
| 3.1 |`/sprite-service create web python3 -m http.server 3000`| Creates a long-running service in `remoteCwd` without relying on project-specific scripts. |
83
88
| 3.2 |`/sprite-services`| Lists services with status. |
84
89
| 3.3 |`/sprite-service logs web 200`| Streams recent logs. |
| 8.5 |`curl -sS -H 'Content-Type: application/json' -d '{"type":"get_state"}' http://localhost:43120/rpc`|Sends one JSON command over HTTP and returns its correlated Pi RPC response. |
165
171
| 8.6 |`/sprite-rpc remove`, confirm | Deletes the service (session data remains). |
166
172
167
173
**Pass criteria:** host installs as a service, is reachable only via local proxy
168
174
by default, and removal confirms. (Only test `httpPort` + bearer secret if you
169
-
explicitly want public HTTP routing.)
175
+
explicitly want routing through the Sprite URL. Making that URL public is a
176
+
separate platform setting and is not part of this plan.)
170
177
171
178
---
172
179
@@ -182,9 +189,13 @@ selection.
182
189
183
190
## 10. Session reset behavior
184
191
185
-
Start a new/resumed/forked Pi session and run `/sprite status`: selection,
186
-
proxies, and last-checkpoint state must reset. This guards against a stale
187
-
session silently operating on the wrong environment.
192
+
Select a Sprite other than the one declared in configuration, then start a new,
193
+
resumed, or forked Pi session and run `/sprite status`. The transient selection
194
+
must reset to the newly loaded configuration (or to no selection if none is
195
+
configured), rather than carrying over the prior session's choice. Proxies are
196
+
closed, and `/sprite-undo` must report that Pi has not created a checkpoint in
197
+
the new session. This guards against stale state silently targeting the wrong
198
+
environment.
188
199
189
200
---
190
201
@@ -206,7 +217,7 @@ no longer shows the test Sprites.
206
217
| Extension | Covered by |
207
218
|---|---|
208
219
| Core | §1, §9, §10 |
209
-
| Checkpoints | §2, plus auto checkpoints in §5/§6 |
220
+
| Checkpoints | §2, plus bootstrap and CI failure checkpoints in §5/§6 |
Copy file name to clipboardExpand all lines: docs/releasing.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Future npm releases
2
2
3
-
`pi-sprites` is not currently published to npm, and this repository does not contain an active npm publishing workflow. Users should install directly from GitHub until maintainers announce otherwise.
3
+
`pi-sprites` is not currently published to npm, and this repository does not contain an active npm publishing workflow. Until maintainers announce otherwise, install directly from GitHub; while the repository is not public, this requires existing GitHub access.
0 commit comments