refactor(doctor): use plugin-identity constants for package names

Update doctor checks to use centralized constants from plugin-identity:
- PACKAGE_NAME now references PUBLISHED_PACKAGE_NAME
- System check uses PLUGIN_NAME and LEGACY_PLUGIN_NAME for plugin
  registration validation and legacy name detection
- Formatters updated for consistency

🤖 Generated with assistance of OhMyOpenCode
This commit is contained in:
YeonGyu-Kim
2026-04-10 11:16:08 +09:00
parent 58a981e07b
commit 41b9b4d724
6 changed files with 12 additions and 9 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ import { findOpenCodeBinary, getOpenCodeVersion, compareVersions } from "./syste
import { getPluginInfo } from "./system-plugin"
import { getLatestPluginVersion, getLoadedPluginVersion, getSuggestedInstallTag } from "./system-loaded-version"
import { parseJsonc } from "../../../shared"
import { PLUGIN_NAME, LEGACY_PLUGIN_NAME } from "../../../shared/plugin-identity"
import { PUBLISHED_PACKAGE_NAME, PLUGIN_NAME, LEGACY_PLUGIN_NAME } from "../../../shared/plugin-identity"
function isConfigValid(configPath: string | null): boolean {
if (!configPath) return true
@@ -85,7 +85,7 @@ export async function checkSystem(): Promise<CheckResult> {
issues.push({
title: `${PLUGIN_NAME} is not registered`,
description: "Plugin entry is missing from OpenCode configuration.",
fix: `Run: bunx ${PLUGIN_NAME} install`,
fix: `Run: bunx ${PUBLISHED_PACKAGE_NAME} install`,
severity: "error",
affects: ["all agents"],
})
@@ -125,7 +125,7 @@ export async function checkSystem(): Promise<CheckResult> {
issues.push({
title: "Loaded plugin is outdated",
description: `Loaded ${systemInfo.loadedVersion}, latest ${latestVersion}.`,
fix: `Update: cd "${loadedInfo.cacheDir}" && bun add ${PLUGIN_NAME}@${installTag}`,
fix: `Update: cd "${loadedInfo.cacheDir}" && bun add ${PUBLISHED_PACKAGE_NAME}@${installTag}`,
severity: "warning",
affects: ["plugin features"],
})