feat(compat): package rename compatibility layer for oh-my-opencode → oh-my-openagent
- Add legacy plugin startup warning when oh-my-opencode config detected - Update CLI installer and TUI installer for new package name - Split monolithic config-manager.test.ts into focused test modules - Add plugin config detection tests for legacy name fallback - Update processed-command-store to use plugin-identity constants - Add claude-code-plugin-loader discovery test for both config names - Update chat-params and ultrawork-db tests for plugin identity Part of #2823
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { checkForLegacyPluginEntry } from "./legacy-plugin-warning"
|
||||
import { log } from "./logger"
|
||||
import { LEGACY_PLUGIN_NAME, PLUGIN_NAME } from "./plugin-identity"
|
||||
|
||||
function toCanonicalEntry(entry: string): string {
|
||||
if (entry === LEGACY_PLUGIN_NAME) {
|
||||
return PLUGIN_NAME
|
||||
}
|
||||
|
||||
if (entry.startsWith(`${LEGACY_PLUGIN_NAME}@`)) {
|
||||
return `${PLUGIN_NAME}${entry.slice(LEGACY_PLUGIN_NAME.length)}`
|
||||
}
|
||||
|
||||
return entry
|
||||
}
|
||||
|
||||
export function logLegacyPluginStartupWarning(): void {
|
||||
const result = checkForLegacyPluginEntry()
|
||||
if (!result.hasLegacyEntry) {
|
||||
return
|
||||
}
|
||||
|
||||
log("[OhMyOpenCodePlugin] Legacy plugin entry detected in OpenCode config", {
|
||||
legacyEntries: result.legacyEntries,
|
||||
suggestedEntries: result.legacyEntries.map(toCanonicalEntry),
|
||||
hasCanonicalEntry: result.hasCanonicalEntry,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user