mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-19 23:01:32 +00:00
fix: show bun install instead of npm install in update notification when running under Bun (#714)
Co-authored-by: Mario Zechner <badlogicgames@gmail.com>
This commit is contained in:
parent
0c135d0141
commit
5279bb92da
3 changed files with 11 additions and 6 deletions
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Show `bun install` instead of `npm install` in update notification when running under Bun
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Edit tool now uses fuzzy matching as fallback when exact match fails, tolerating trailing whitespace, smart quotes, Unicode dashes, and special spaces
|
- Edit tool now uses fuzzy matching as fallback when exact match fails, tolerating trailing whitespace, smart quotes, Unicode dashes, and special spaces
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,9 @@ const __dirname = dirname(__filename);
|
||||||
export const isBunBinary =
|
export const isBunBinary =
|
||||||
import.meta.url.includes("$bunfs") || import.meta.url.includes("~BUN") || import.meta.url.includes("%7EBUN");
|
import.meta.url.includes("$bunfs") || import.meta.url.includes("~BUN") || import.meta.url.includes("%7EBUN");
|
||||||
|
|
||||||
|
/** Detect if Bun is the runtime (compiled binary or bun run) */
|
||||||
|
export const isBunRuntime = !!process.versions.bun;
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
// Package Asset Paths (shipped with executable)
|
// Package Asset Paths (shipped with executable)
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ import {
|
||||||
visibleWidth,
|
visibleWidth,
|
||||||
} from "@mariozechner/pi-tui";
|
} from "@mariozechner/pi-tui";
|
||||||
import { spawn, spawnSync } from "child_process";
|
import { spawn, spawnSync } from "child_process";
|
||||||
import { APP_NAME, getAuthPath, getDebugLogPath, isBunBinary, VERSION } from "../../config.js";
|
import { APP_NAME, getAuthPath, getDebugLogPath, isBunBinary, isBunRuntime, VERSION } from "../../config.js";
|
||||||
import type { AgentSession, AgentSessionEvent } from "../../core/agent-session.js";
|
import type { AgentSession, AgentSessionEvent } from "../../core/agent-session.js";
|
||||||
import type {
|
import type {
|
||||||
ExtensionContext,
|
ExtensionContext,
|
||||||
|
|
@ -2330,11 +2330,10 @@ export class InteractiveMode {
|
||||||
}
|
}
|
||||||
|
|
||||||
showNewVersionNotification(newVersion: string): void {
|
showNewVersionNotification(newVersion: string): void {
|
||||||
const updateInstruction = isBunBinary
|
const action = isBunBinary
|
||||||
? theme.fg("muted", `New version ${newVersion} is available. Download from: `) +
|
? `Download from: ${theme.fg("accent", "https://github.com/badlogic/pi-mono/releases/latest")}`
|
||||||
theme.fg("accent", "https://github.com/badlogic/pi-mono/releases/latest")
|
: `Run: ${theme.fg("accent", `${isBunRuntime ? "bun" : "npm"} install -g @mariozechner/pi-coding-agent`)}`;
|
||||||
: theme.fg("muted", `New version ${newVersion} is available. Run: `) +
|
const updateInstruction = theme.fg("muted", `New version ${newVersion} is available. `) + action;
|
||||||
theme.fg("accent", "npm install -g @mariozechner/pi-coding-agent");
|
|
||||||
|
|
||||||
this.chatContainer.addChild(new Spacer(1));
|
this.chatContainer.addChild(new Spacer(1));
|
||||||
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
this.chatContainer.addChild(new DynamicBorder((text) => theme.fg("warning", text)));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue