mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 04:44:21 +01:00
feat: add explicit OpenCode host import and repo relink (#176)
* feat: add explicit OpenCode host import and repo relink * fix: tighten OpenCode import and relink reporting * Add OpenCode config schema and JSONC parser imports * Fix repo relinking and state availability detection for config-only imports * Remove unused exports and internalize row-shape types * Remove unused reserveScheduleJobNextRun function --------- Co-authored-by: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com>
This commit is contained in:
1 parent
173dbf578e
commit
6b1a1e2005
15 files changed
+1031
-245
No files matched your search
@@ -5,6 +5,8 @@ import type {
|
||||
OpenCodeConfigResponse,
|
||||
CreateOpenCodeConfigRequest,
|
||||
UpdateOpenCodeConfigRequest,
|
||||
OpenCodeImportStatus,
|
||||
SyncOpenCodeImportResponse,
|
||||
SkillFileInfo,
|
||||
CreateSkillRequest,
|
||||
UpdateSkillRequest,
|
||||
@@ -145,6 +147,18 @@ export const settingsApi = {
|
||||
})
|
||||
},
|
||||
|
||||
getOpenCodeImportStatus: async (): Promise<OpenCodeImportStatus> => {
|
||||
return fetchWrapper(`${API_BASE_URL}/api/settings/opencode-import/status`)
|
||||
},
|
||||
|
||||
syncOpenCodeImport: async (overwriteState = true): Promise<SyncOpenCodeImportResponse> => {
|
||||
return fetchWrapper(`${API_BASE_URL}/api/settings/opencode-import`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ overwriteState }),
|
||||
})
|
||||
},
|
||||
|
||||
getOpenCodeVersions: async (): Promise<{
|
||||
versions: Array<{
|
||||
version: string
|
||||
|
||||
@@ -98,3 +98,27 @@ export interface OpenCodeConfigResponse {
|
||||
configs: OpenCodeConfig[]
|
||||
defaultConfig: OpenCodeConfig | null
|
||||
}
|
||||
|
||||
export interface OpenCodeImportStatus {
|
||||
configSourcePath: string | null
|
||||
stateSourcePath: string | null
|
||||
workspaceConfigPath: string
|
||||
workspaceStatePath: string
|
||||
workspaceStateExists: boolean
|
||||
}
|
||||
|
||||
export interface SyncOpenCodeImportResponse extends OpenCodeImportStatus {
|
||||
success: boolean
|
||||
message: string
|
||||
serverRestarted: boolean
|
||||
configImported: boolean
|
||||
stateImported: boolean
|
||||
relinkedRepos?: {
|
||||
repos: Array<Record<string, unknown>>
|
||||
relinkedCount: number
|
||||
existingCount: number
|
||||
nonRepoPathCount: number
|
||||
duplicatePathCount: number
|
||||
errors: Array<{ path: string; error: string }>
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user