fix: break circular dependency in config error utilities to prevent plugin loader crash

- Created src/shared/config-errors.ts to isolate config error state management
- Removed function re-exports (getConfigLoadErrors, clearConfigLoadErrors) from main index.ts
- Only ConfigLoadError type is re-exported from main module to avoid OpenCode calling it as a plugin
- Updated auto-update-checker hook to import from shared/config-errors instead of main index
- Fixes "TypeError: undefined is not an object" crash when OpenCode iterated through ALL exports and called clearConfigLoadErrors(input) which returned undefined

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2025-12-19 02:19:54 +09:00
parent 63fea77572
commit dad534e7c0
4 changed files with 28 additions and 19 deletions

View File

@@ -0,0 +1,18 @@
export type ConfigLoadError = {
path: string
error: string
}
let configLoadErrors: ConfigLoadError[] = []
export function getConfigLoadErrors(): ConfigLoadError[] {
return configLoadErrors
}
export function clearConfigLoadErrors(): void {
configLoadErrors = []
}
export function addConfigLoadError(error: ConfigLoadError): void {
configLoadErrors.push(error)
}