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

@@ -4,7 +4,7 @@ import { invalidatePackage } from "./cache"
import { PACKAGE_NAME } from "./constants"
import { log } from "../../shared/logger"
import { getUserConfigPath } from "../../shared/config-path"
import { getConfigLoadErrors, clearConfigLoadErrors } from "../../index"
import { getConfigLoadErrors, clearConfigLoadErrors } from "../../shared/config-errors"
import type { AutoUpdateCheckerOptions } from "./types"
export function createAutoUpdateCheckerHook(ctx: PluginInput, options: AutoUpdateCheckerOptions = {}) {