mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
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
This commit is contained in:
1 parent
97370a8296
commit
b5dd900efb
53 files changed
+3003
-1665
No files matched your search
@@ -22,7 +22,6 @@ export interface ApiErrorResponse {
|
||||
detail?: string
|
||||
details?: unknown
|
||||
validationIssues?: Array<{ path: string; message: string }>
|
||||
removedFields?: string[]
|
||||
}
|
||||
|
||||
export class FetchError extends Error {
|
||||
@@ -31,7 +30,6 @@ export class FetchError extends Error {
|
||||
detail?: string
|
||||
details?: unknown
|
||||
validationIssues?: Array<{ path: string; message: string }>
|
||||
removedFields?: string[]
|
||||
|
||||
constructor(
|
||||
message: string,
|
||||
@@ -41,7 +39,6 @@ export class FetchError extends Error {
|
||||
options?: {
|
||||
details?: unknown
|
||||
validationIssues?: Array<{ path: string; message: string }>
|
||||
removedFields?: string[]
|
||||
}
|
||||
) {
|
||||
super(message)
|
||||
@@ -51,6 +48,5 @@ export class FetchError extends Error {
|
||||
this.detail = detail
|
||||
this.details = options?.details
|
||||
this.validationIssues = options?.validationIssues
|
||||
this.removedFields = options?.removedFields
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
CustomCommandSchema,
|
||||
OpenCodeConfigSchema,
|
||||
OpenCodeConfigFileSchema,
|
||||
OpenCodeConfigSourceFileSchema,
|
||||
OpenCodeConfigValidationIssueSchema,
|
||||
UpdateOpenCodeConfigRequestSchema,
|
||||
ServerEnvVarSchema,
|
||||
@@ -59,6 +60,8 @@ export type UpdateSettingsRequest = z.infer<typeof UpdateSettingsRequestSchema>
|
||||
export type CustomCommand = z.infer<typeof CustomCommandSchema>
|
||||
export type ServerEnvVar = z.infer<typeof ServerEnvVarSchema>
|
||||
export type OpenCodeConfigFile = z.infer<typeof OpenCodeConfigFileSchema>
|
||||
export type { OpenCodeConfigSourceName } from '../config/defaults'
|
||||
export type OpenCodeConfigSourceFile = z.infer<typeof OpenCodeConfigSourceFileSchema>
|
||||
export type OpenCodeConfigValidationIssue = z.infer<typeof OpenCodeConfigValidationIssueSchema>
|
||||
export type OpenCodeConfigInput = z.infer<typeof OpenCodeConfigSchema>
|
||||
export type UpdateOpenCodeConfigRequest = z.infer<typeof UpdateOpenCodeConfigRequestSchema>
|
||||
|
||||
Reference in new issue
Block a user