pi-updater 0.3.0 → 0.3.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/CHANGELOG.md +8 -0
- package/README.md +3 -1
- package/index.ts +11 -11
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.1 - 2026-04-04
|
|
4
|
+
|
|
5
|
+
- Compatibility with pi 0.65+: use `session_start` instead of legacy `session_switch` for automatic checks. See [pi-mono v0.65.0](https://github.com/badlogic/pi-mono/releases/tag/v0.65.0).
|
|
6
|
+
- Store cache and dismissed-version state in pi's configured agent directory.
|
|
7
|
+
- Preserve `--no-session` mode when restarting after an update and show the correct manual restart hint.
|
|
8
|
+
|
|
9
|
+
## Unreleased
|
|
10
|
+
|
|
3
11
|
## 0.3.0 - 2026-03-23
|
|
4
12
|
|
|
5
13
|
- Auto-restart pi after a successful update. Asks to restart, then seamlessly relaunches on the current session.
|
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ A lightweight, Codex-style auto-updater for pi with fast, cache-first startup ch
|
|
|
16
16
|
- **Skip** — dismiss until next session
|
|
17
17
|
- **Skip this version** — don't ask again until a newer version appears
|
|
18
18
|
|
|
19
|
-
After a successful update, pi-updater asks whether to restart immediately. If confirmed, pi relaunches seamlessly on the current session. In non-interactive modes or if auto-restart fails, it falls back to a manual restart message.
|
|
19
|
+
After a successful update, pi-updater asks whether to restart immediately. If confirmed, pi relaunches seamlessly on the current session. In non-interactive modes or if auto-restart fails, it falls back to a manual restart message. Ephemeral `--no-session` runs stay ephemeral on restart.
|
|
20
20
|
|
|
21
21
|
**In the background (once per run):** performs one live npm check and can show the prompt in the same session when a new release is detected.
|
|
22
22
|
|
|
@@ -47,6 +47,8 @@ pi install git:github.com/tonze/pi-updater
|
|
|
47
47
|
|
|
48
48
|
Use `/update` inside pi to manually check for updates and install them.
|
|
49
49
|
|
|
50
|
+
Cache and dismissed-version state are stored in pi's configured agent directory and respect `PI_CODING_AGENT_DIR`.
|
|
51
|
+
|
|
50
52
|
## Environment flags
|
|
51
53
|
|
|
52
54
|
Disable automatic version checks:
|
package/index.ts
CHANGED
|
@@ -2,15 +2,14 @@ import type {
|
|
|
2
2
|
ExtensionAPI,
|
|
3
3
|
ExtensionContext,
|
|
4
4
|
} from "@mariozechner/pi-coding-agent";
|
|
5
|
-
import { VERSION, BorderedLoader } from "@mariozechner/pi-coding-agent";
|
|
5
|
+
import { VERSION, BorderedLoader, getAgentDir } from "@mariozechner/pi-coding-agent";
|
|
6
6
|
import { spawnSync } from "node:child_process";
|
|
7
7
|
import { readFileSync, writeFileSync, mkdirSync } from "node:fs";
|
|
8
8
|
import { join, dirname } from "node:path";
|
|
9
|
-
import { homedir } from "node:os";
|
|
10
9
|
|
|
11
10
|
const PACKAGE_NAME = "@mariozechner/pi-coding-agent";
|
|
12
11
|
const REGISTRY_URL = `https://registry.npmjs.org/${PACKAGE_NAME}/latest`;
|
|
13
|
-
const CACHE_FILE = join(
|
|
12
|
+
const CACHE_FILE = join(getAgentDir(), "update-cache.json");
|
|
14
13
|
|
|
15
14
|
const ENV_SKIP_VERSION_CHECK = "PI_SKIP_VERSION_CHECK";
|
|
16
15
|
const ENV_OFFLINE = "PI_OFFLINE";
|
|
@@ -144,7 +143,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
144
143
|
async function restartPi(ctx: ExtensionContext): Promise<boolean> {
|
|
145
144
|
const piBinary = await findPiBinary();
|
|
146
145
|
const sessionFile = ctx.sessionManager.getSessionFile();
|
|
147
|
-
const restartArgs = sessionFile ? ["--session", sessionFile] : ["-
|
|
146
|
+
const restartArgs = sessionFile ? ["--session", sessionFile] : ["--no-session"];
|
|
148
147
|
|
|
149
148
|
return ctx.ui.custom<boolean>((tui, _theme, _kb, done) => {
|
|
150
149
|
tui.stop();
|
|
@@ -190,9 +189,13 @@ export default function (pi: ExtensionAPI) {
|
|
|
190
189
|
|
|
191
190
|
if (!success) return;
|
|
192
191
|
|
|
192
|
+
const restartTip = ctx.sessionManager.getSessionFile()
|
|
193
|
+
? "Tip: run `pi -c` to continue this session."
|
|
194
|
+
: "Tip: run `pi --no-session` to continue without a saved session.";
|
|
195
|
+
|
|
193
196
|
if (!canAutoRestart(ctx)) {
|
|
194
197
|
ctx.ui.notify(
|
|
195
|
-
`Updated to ${latest}! Please restart pi.\
|
|
198
|
+
`Updated to ${latest}! Please restart pi.\n${restartTip}`,
|
|
196
199
|
"info",
|
|
197
200
|
);
|
|
198
201
|
return;
|
|
@@ -212,7 +215,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
212
215
|
}
|
|
213
216
|
|
|
214
217
|
ctx.ui.notify(
|
|
215
|
-
`Updated to ${latest}! Auto-restart failed. Please restart pi manually.\
|
|
218
|
+
`Updated to ${latest}! Auto-restart failed. Please restart pi manually.\n${restartTip}`,
|
|
216
219
|
"error",
|
|
217
220
|
);
|
|
218
221
|
}
|
|
@@ -272,11 +275,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
272
275
|
.catch(() => {});
|
|
273
276
|
}
|
|
274
277
|
|
|
275
|
-
pi.on("session_start", async (
|
|
276
|
-
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
pi.on("session_switch", async (_event, ctx) => {
|
|
278
|
+
pi.on("session_start", async (event, ctx) => {
|
|
279
|
+
if (event.reason === "reload" || event.reason === "fork") return;
|
|
280
280
|
runAutoChecks(ctx);
|
|
281
281
|
});
|
|
282
282
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-updater",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Codex-style auto-updater for pi. Checks for new versions on startup and prompts to install.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@mariozechner/pi-coding-agent": "*"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@mariozechner/pi-coding-agent": "^0.
|
|
32
|
+
"@mariozechner/pi-coding-agent": "^0.65.0",
|
|
33
33
|
"@types/node": "^25.3.2",
|
|
34
34
|
"typescript": "^5.9.3"
|
|
35
35
|
}
|