Files
opencode-manager/frontend/src/lib/jsonc.ts
T
Chris Scott b5dd900efb feat(config): support layered OpenCode config sources with revision-guarded saves (#358)
* feat(config): support layered OpenCode config sources with revision-guarded saves

* refactor(config): harden multi-source OpenCode config handling

- extract shared config-source helpers and default source name
- reject shadowed removals with 409 and require sources/revision
- restart the server on reload with session resume
- mirror multiple host config files on import and warn on removals
- skip restart for mcp-only saves
- drop removedFields and CONFIG_PATCH_TIMEOUT_MS

* fix(config): return null when archiving broken OpenCode config fails
2026-09-20 15:51:40 -04:00

10 lines
490 B
TypeScript

export { parseJsonc, parseJsoncErrorLine } from '@opencode-manager/shared/utils'
import { findJsoncLineForPath, parseJsoncPathSegments } from '@opencode-manager/shared/utils'
export function resolveJsoncIssueLine(content: string, path: PropertyKey[] | string): number | null {
const segments = Array.isArray(path)
? path.map((segment) => (typeof segment === 'number' ? segment : String(segment)))
: parseJsoncPathSegments(path)
return findJsoncLineForPath(content, segments)
}