feat(auto-update-checker): improve local dev version display

- Add getLocalDevPath() and getLocalDevVersion() functions
- Improve getCachedVersion() with fallback to bundled package.json
- Display correct version in startup toast for local dev mode

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2025-12-14 17:48:41 +09:00
parent 3dea568007
commit 3adedca810
3 changed files with 50 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
import type { PluginInput } from "@opencode-ai/plugin"
import { checkForUpdate, getCachedVersion } from "./checker"
import { checkForUpdate, getCachedVersion, getLocalDevVersion } from "./checker"
import { invalidatePackage } from "./cache"
import { PACKAGE_NAME } from "./constants"
import { log } from "../../shared/logger"
@@ -25,7 +25,8 @@ export function createAutoUpdateCheckerHook(ctx: PluginInput, options: AutoUpdat
if (result.isLocalDev) {
log("[auto-update-checker] Skipped: local development mode")
if (showStartupToast) {
await showVersionToast(ctx, getCachedVersion())
const version = getLocalDevVersion(ctx.directory) ?? getCachedVersion()
await showVersionToast(ctx, version)
}
return
}