feat(coding-agent): implement install method detection and update instructions

Added functionality to detect the installation method (bun-binary, npm, pnpm, yarn, bun, unknown) and provide corresponding update instructions for the package. This enhances user experience by guiding them on how to update the package based on their environment.
This commit is contained in:
Daniel Fu 2026-02-02 15:33:01 -05:00
parent 1fbafd6cc7
commit 0d828f925e
2 changed files with 61 additions and 5 deletions

View file

@ -48,8 +48,7 @@ import {
getAuthPath,
getDebugLogPath,
getShareViewerUrl,
isBunBinary,
isBunRuntime,
getUpdateInstruction,
VERSION,
} from "../../config.js";
import { type AgentSession, type AgentSessionEvent, parseSkillBlock } from "../../core/agent-session.js";
@ -2754,9 +2753,7 @@ export class InteractiveMode {
}
showNewVersionNotification(newVersion: string): void {
const action = isBunBinary
? `Download from: ${theme.fg("accent", "https://github.com/badlogic/pi-mono/releases/latest")}`
: `Run: ${theme.fg("accent", `${isBunRuntime ? "bun" : "npm"} install -g @mariozechner/pi-coding-agent`)}`;
const action = theme.fg("accent", getUpdateInstruction("@mariozechner/pi-coding-agent"));
const updateInstruction = theme.fg("muted", `New version ${newVersion} is available. `) + action;
const changelogUrl = theme.fg(
"accent",