pi-spaces 0.0.0-stage β†’ 0.16.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,360 @@
1
+ # Changelog
2
+
3
+ Each release of `pi-spaces` (published as `@jals1212/pi-spaces` up to 0.15.1). Versions follow
4
+ [semantic versioning](https://semver.org); before 1.0.0 a minor version may add
5
+ commands and options and a patch version fixes.
6
+
7
+ ## Unreleased
8
+
9
+ ## 0.16.0
10
+
11
+ ### Changed
12
+
13
+ - The package is now published as `pi-spaces`, without the `@jals1212` scope;
14
+ `@jals1212/pi-spaces` stops at 0.15.1 and is deprecated. To move, replace
15
+ `npm:@jals1212/pi-spaces` with `npm:pi-spaces` in the `packages` of every
16
+ `settings.json` that declares it (the base home and each space), or run
17
+ `pi remove npm:@jals1212/pi-spaces` and `pi install npm:pi-spaces`. Keep only
18
+ one of the two: both together load `/space` twice. The library exports are
19
+ now `pi-spaces/spaces` and `pi-spaces/config`.
20
+
21
+ ## 0.15.1
22
+
23
+ ### Fixed
24
+
25
+ - herdr-app sidebar: an agent no longer loses its space after the Herdr app is
26
+ closed and opened. The `space` label was set once, and a set that failed while
27
+ herdr-core was starting (or a core restarted under a running Pi) left the
28
+ terminal without it. The session now follows `hc events` for its terminal and
29
+ sets the label again when it is missing or changed, following the stream again
30
+ with backoff when it ends. A label removed while the session lasts, by
31
+ anything, comes back the same way.
32
+
33
+ ## 0.15.0
34
+
35
+ ### Documentation
36
+
37
+ - The README explains that the extension and the `pi-space` command are independent: use either one, or both, with what each one gives and cannot do alone.
38
+
39
+ ## 0.14.0
40
+
41
+ ### Added
42
+
43
+ - Herdr sidebar: the status line text (`πŸͺ <profile>/<name>`) also shows in Herdr's
44
+ Agents sidebar. In a Herdr pane it is the pane's `$space` metadata token
45
+ (30-second TTL, refreshed every 10 seconds, cleared when the session ends),
46
+ shown by a `$space` row item; in a herdr-app terminal it is the terminal's
47
+ `space` label (`hc label`), set once, removed when the session ends or moves
48
+ to another terminal. Display only. The README shows how to add both to the
49
+ sidebar.
50
+
51
+ ## 0.13.0
52
+
53
+ ### Added
54
+
55
+ - The config file can be TOML: a path ending in `.toml` is read as TOML (with
56
+ `#` comments), any other as JSON as before. Both have the same keys and
57
+ checks. TOML is parsed with the `smol-toml` dependency.
58
+ - `configFile(env, home)` returns the config file and, when there is one, the
59
+ `config.json` that a `config.toml` in the same folder shadows.
60
+
61
+ ### Changed
62
+
63
+ - The config file is looked up as `config.toml`, then `config.json`, in
64
+ `~/.config/pi-spaces` (or `$XDG_CONFIG_HOME/pi-spaces`), then in
65
+ `~/.pi-spaces`; with no file the answer of `configPath` is
66
+ `~/.pi-spaces/config.toml` (it was `~/.pi-spaces/config.json`). An existing
67
+ `config.json` keeps working where it is.
68
+ - When `config.toml` and `config.json` are in the same folder, `config.toml` is
69
+ read and the extension warns that the `config.json` is ignored.
70
+
71
+ ## 0.12.0
72
+
73
+ ### Added
74
+
75
+ - A space is a root folder with its agent home inside it, always named `agent`:
76
+ `<spaces folder>/<name>/agent` is `PI_CODING_AGENT_DIR` (and `{home}`) for every
77
+ profile, as `~/.pi/agent` is for Pi's own home. `/space new` and
78
+ `createSpace` make the root with `agent/settings.json`. Spaces made before,
79
+ with no `agent/` folder, keep working as they are (their folder is the agent
80
+ home); list, rename, remove, backups, `/space switch` and the active-space
81
+ detection work for both layouts, and rename, remove and backups act on the
82
+ root.
83
+ - `{space}` in `spaceEnv` values and in `commands` and `setup`: the space's root
84
+ folder (the same folder as `{home}` for an old space; in base, the folder that
85
+ holds the profile's `home`). `expandSpaceEnv`, `spaceEnvFor` and `setupCommand`
86
+ take it as an optional last argument.
87
+ - `spaceHome(root)`, `isRooted(root)`, `AGENT` and `migrateSpace(...)` in
88
+ `@jals1212/pi-spaces/spaces`: `migrateSpace` copies an old space to
89
+ `.backups/<name>-<UTC time>`, then moves its content into `<root>/agent`,
90
+ undoing the moves if one fails. See
91
+ [Moving an old space](README.md#moving-an-old-space).
92
+
93
+ ### Changed
94
+
95
+ - `createSpace` returns the space's root (as before) but writes
96
+ `settings.json` in `<root>/agent`. `SwitchTarget` and `LaunchTarget` carry
97
+ `spaceRoot`, and `targetHome` of a space with an `agent/` folder is that
98
+ folder. `PI_SPACE_HOME` is the space's agent home.
99
+
100
+ ## 0.11.3
101
+
102
+ ### Added
103
+
104
+ - A preview image (`pi.image`) for the Pi package gallery, also shown at the
105
+ top of the README.
106
+
107
+ ## 0.11.2
108
+
109
+ ### Fixed
110
+
111
+ - `/space switch` with a v2 profile runs the profile's `commands` (`commands.base`
112
+ for base, `commands.space` or `<base> --space <name>` for a space) instead of
113
+ starting the running Pi again, so a launcher's own setup for base is kept. A
114
+ Pi started with `--space` no longer returns to that space after a switch.
115
+
116
+ ## 0.11.1
117
+
118
+ ### Changed
119
+
120
+ - The docs and the skill use a generic launcher in their examples; the README
121
+ keeps one example profile for a real program.
122
+
123
+ ## 0.11.0
124
+
125
+ ### Added
126
+
127
+ - Config schema `pi-spaces.config/v2`: a profile has `commands` instead of
128
+ `command`, `setup` and `homeless`. `commands.base` starts the base home as it
129
+ is (the words after it, no `--space`); `commands.space` is the template of a
130
+ space, with `{home}` and `{name}` (without it a space starts
131
+ `<base> --space <name>`); `commands.setup` prepares a new space. For a v2
132
+ profile `PI_SPACES_COMMAND` is `commands.space`, else `commands.base`, and
133
+ `PI_SPACES_SETUP` is `commands.setup`. A v1 file keeps working unchanged;
134
+ [Moving from v1 to v2](README.md#moving-from-v1-to-v2) shows the edit. An
135
+ older pi-spaces refuses a v2 file as "needs a newer pi-spaces", so update
136
+ every home before switching the file.
137
+ - The config file accepts `//` and `/* */` comments, in both schemas.
138
+
139
+ ### Changed
140
+
141
+ - The `SCHEMA` export of `@jals1212/pi-spaces/config` is now
142
+ `pi-spaces.config/v2`; `SCHEMA_V1` is the first schema. The "needs a newer
143
+ pi-spaces" message names both: `this one reads "pi-spaces.config/v1" and
144
+ "pi-spaces.config/v2"`, and a v2 profile's unknown-key message lists
145
+ `"home", "commands", "dir" and "spaceEnv"`.
146
+ - The `<pi_space>` prompt section says `pi-space <profile>/<name>` starts a
147
+ space when the command has `{name}` as well as `{home}`.
148
+
149
+ ## 0.10.0
150
+
151
+ ### Added
152
+
153
+ - A profile may list `homeless` words (`"homeless": ["upgrade"]`): with one of
154
+ them first, `pi-space` runs the profile's `command` without its home part
155
+ and without `--space`, so `pi-space gentle/base upgrade` runs
156
+ `gentle-shell upgrade`. A non-empty list of words with no spaces; anything
157
+ else is refused like any wrong key. An older pi-spaces refuses a file with
158
+ `homeless` as an unknown key, so update every home before adding it.
159
+
160
+ ### Fixed
161
+
162
+ - The README and the skill no longer say that `pi-space gentle/base upgrade`
163
+ runs gentle-shell's `upgrade` through `--home`: gentle-shell recognizes it
164
+ only as its first word, so after `--home` it goes to Pi. `homeless` covers it.
165
+
166
+ ## 0.9.0
167
+
168
+ ### Added
169
+
170
+ - A profile `command` may contain `{home}` and `{name}`
171
+ (`"gentle-shell --home {home}"`): `pi-space` then runs it directly in the
172
+ space's home, without `--space`, so the program's own commands work
173
+ (`pi-space gentle/base upgrade`). The `<pi_space>` section of the system
174
+ prompt then says that `pi-space <profile>/<name>` starts a space, not
175
+ `<command> --space <name>`.
176
+ - The config file is also found in `~/.config/pi-spaces/config.json`
177
+ (`$XDG_CONFIG_HOME/pi-spaces/config.json` when `XDG_CONFIG_HOME` is an
178
+ absolute path; on Windows `%USERPROFILE%\.config\pi-spaces\config.json`),
179
+ so it can live in your dotfiles without `PI_SPACES_CONFIG`. Order:
180
+ `PI_SPACES_CONFIG`, then that file when it exists, then
181
+ `~/.pi-spaces/config.json` as before; with both files the XDG one wins, and
182
+ nothing is moved. `configPath(env, home)` takes an optional existence check.
183
+
184
+ ## 0.8.0
185
+
186
+ ### Changed
187
+
188
+ - πŸͺ is pi-spaces' emoji. The status line shows the active space as
189
+ `πŸͺ <profile>/<name>` instead of `β—† <name>`, the same name `pi-space`
190
+ takes, with the profile of the running Pi (`pi` when no profile matches its
191
+ base home); in the base home opened by pi-spaces it shows
192
+ `πŸͺ <profile>/base` instead of `β—† base`.
193
+
194
+ ## 0.7.0
195
+
196
+ ### Changed
197
+
198
+ - The setup hint of `/space new` names the space with its profile, as
199
+ `pi-space` now requires: `pi-space setup <profile>/<name>`, where the
200
+ profile is the one of the running Pi (`pi` when no profile matches its base
201
+ home). `/space` itself still takes the bare name.
202
+
203
+ ### Fixed
204
+
205
+ - The built-in `pi` profile no longer takes another profile's home: inside
206
+ the Pi of a program whose profile names its `home`, `PI_CODING_AGENT_DIR`
207
+ holds that home, and `pi` now keeps `~/.pi/agent` (its spaces in
208
+ `~/.pi/spaces`) instead of pointing at that program's home and spaces.
209
+
210
+ ## 0.6.0
211
+
212
+ ### Added
213
+
214
+ - Profiles in a config file (`~/.pi-spaces/config.json`, or `PI_SPACES_CONFIG`):
215
+ named descriptions of a program that runs Pi, with its base `home`,
216
+ `command`, spaces `dir`, `setup` command and `spaceEnv`. The format carries a
217
+ version (`"schema": "pi-spaces.config/v1"`); a newer version is refused with
218
+ a message that it needs a newer pi-spaces, and unknown keys are refused. A
219
+ built-in `pi` profile always exists and can be replaced. See the README.
220
+ - `spaceEnv`: variables that exist only in spaces. Entering a space sets them
221
+ (`{home}` and `{name}` filled in) and moving between spaces recomputes
222
+ them. Going back to `base` puts back the values the base home had (kept in `PI_SPACES_BASE_ENV` meanwhile). Without
223
+ `spaceEnv`, whatever a program keeps outside its agent home stays shared with
224
+ the base home, as before. The variables pi-spaces sets itself are refused.
225
+ - The extension applies the profile whose `home` is the base home: its
226
+ `spaceEnv` on `/space switch` and `pi --space`, its `dir` as the spaces
227
+ folder, and `/space new` names `pi-space setup <name>` when it has a `setup`.
228
+ - `@jals1212/pi-spaces/config` exports the loader (`loadConfig`, `configPath`,
229
+ `profileByName`, `profileForHome`, `spaceEnvFor`, `activeProfile`,
230
+ `ConfigError`) for the `pi-space` command.
231
+
232
+ ### Changed
233
+
234
+ - `completion` is a reserved name, for `pi-space completion`. A space already
235
+ named `completion` is no longer listed; rename its folder by hand.
236
+ - The spaces folder is `PI_SPACES_DIR`, else the matching profile's `dir`, else
237
+ `spaces` next to the base home. `spacesDir` takes the profile's dir as an
238
+ optional third argument.
239
+ - `relaunchEnv` and `planStartup` take an optional `spaceEnv`; without it they
240
+ behave exactly as before.
241
+ - A config file that cannot be used never stops Pi: the extension warns once
242
+ when the session starts and behaves as with no file.
243
+
244
+ ## 0.5.0
245
+
246
+ ### Added
247
+
248
+ - `/space new` names `pi-space setup <name>` when `PI_SPACES_SETUP` holds a
249
+ setup command, so a space a program needs prepared is not entered bare.
250
+
251
+ ### Changed
252
+
253
+ - `setup` is a reserved name, as the other command words are. A space already
254
+ named `setup` is no longer listed; rename its folder by hand.
255
+
256
+ ## 0.4.1
257
+
258
+ ### Changed
259
+
260
+ - The status line shows `β—† base` in the base home when pi-spaces opened it
261
+ (`pi --space base`, `pi-space base`, or a switch back to base); Pi started
262
+ plainly still shows nothing there.
263
+
264
+ ## 0.4.0
265
+
266
+ ### Added
267
+
268
+ - `pi --space <name> <command> [args...]` runs one of Pi's package commands
269
+ (`install`, `remove`, `uninstall`, `update`, `list`) in a space, or in the
270
+ base home with `base`, through the same Pi: `pi --space work update
271
+ --extensions`. Options before `--space`, such as a launcher's own `-e`, are
272
+ left out, since Pi runs a package command only as its first argument.
273
+
274
+ ### Changed
275
+
276
+ - The command words `list`, `new`, `remove`, `rename`, `switch`, `update`,
277
+ `install` and `uninstall` are reserved and can no longer name a space, so
278
+ `pi-space <name>` never reads as a command. A folder with such a name in the
279
+ spaces folder is no longer listed as a space.
280
+
281
+ ## 0.3.0
282
+
283
+ ### Added
284
+
285
+ - Pi knows the space it runs in. Every Pi with the extension sets
286
+ `PI_SPACE` (unset in the base home), `PI_SPACE_HOME` (its agent home) and
287
+ `PI_SPACES_COMMAND` (its configured value, else `pi`), with or without a
288
+ switch, and the system prompt gets a `<pi_space>` section with the same
289
+ facts. `spaceInfo`, `exportSpaceInfo` and `spacePrompt` in the core build
290
+ them.
291
+ - A `pi-spaces` skill, declared in the package, that tells agents what a
292
+ space is, how to read the current space, home and command, and which
293
+ `/space` or `pi-space` action to use.
294
+
295
+ ### Changed
296
+
297
+ - The status line shows the active space as `β—† <name>` instead of
298
+ `space: <name>`, so it stands out among other extensions' statuses.
299
+
300
+ ## 0.2.0
301
+
302
+ ### Added
303
+
304
+ - `/space remove` asks, after the confirmation, whether to keep a backup:
305
+ the space moves to `.backups/<name>-<UTC time>` in the spaces folder, and
306
+ keeping one is the first choice. `--yes` keeps a backup, and `--no-backup`
307
+ deletes without one. `backupSpace` and `BACKUPS` in the core do it, with the
308
+ same checks as `removeSpace`.
309
+
310
+ ### Changed
311
+
312
+ - `/space remove <name> --yes` now keeps a backup instead of deleting the
313
+ space; add `--no-backup` to delete it as before.
314
+
315
+ ### Fixed
316
+
317
+ - `/space new` copies a local path that loads another copy of this package
318
+ (a folder whose `package.json` is named `@jals1212/pi-spaces`) instead of
319
+ writing the folder of the copy that runs.
320
+ - `/space remove` and `backupSpace` report a backup that cannot be written
321
+ (for example a read-only spaces folder) as an error that says the space was
322
+ not removed and offers `--no-backup`, instead of a raw filesystem error.
323
+ - `findOwnDeclaration` takes an optional fallback, answered when nothing
324
+ matches, and an empty package folder matches a local path only by its
325
+ `package.json` name.
326
+
327
+ ## 0.1.1
328
+
329
+ ### Changed
330
+
331
+ - The `pi-space` command moved to its own package, `@jals1212/pi-spaces-cli`, so each one is installed and updated on its own; this package is now only the Pi extension.
332
+
333
+ ### Fixed
334
+
335
+ - The README, the `pi-space --help` text and the examples name no particular
336
+ program that runs Pi; they use a generic `my-launcher`. 0.1.0 is withdrawn
337
+ from npm: use 0.1.1.
338
+
339
+ ## 0.1.0
340
+
341
+ ### Added
342
+
343
+ - Named spaces: separate Pi agent homes in a `spaces` folder next to the home
344
+ Pi starts with (`~/.pi/spaces` for `~/.pi/agent`), or `PI_SPACES_DIR`.
345
+ - `/space` opens a picker of the other spaces and restarts Pi in the chosen
346
+ one; without the interactive terminal it lists them. `/space list`,
347
+ `/space new <name>`, `/space switch [<name>]`, `/space rename <old> <new>`
348
+ and `/space remove <name>`. `base` is the home Pi started with. (#1, #4)
349
+ - The switch restarts Pi with the same options and moves every variable that
350
+ points into the old home, so a program that runs Pi with its own home keeps
351
+ working. (#1, #3)
352
+ - `pi --space <name>` starts Pi directly in a space, keeping the prompt and the
353
+ session options. (#1)
354
+ - The active space in the status line.
355
+ - The optional `pi-space` command (`npm install -g`): a numbered picker,
356
+ `pi-space <name> [pi args...]` and `pi-space list`. `PI_SPACES_COMMAND`
357
+ chooses the program it runs. (#2)
358
+ - `remove` and `rename` refuse `base`, the active space, symlinks, a space that
359
+ holds the current or base home, and a spaces folder that is the filesystem
360
+ root, the home folder or the agent home.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jeffrey LeΓ³n
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.