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:
itz4blitzandChris Scott authored and GitHub committed 2026-04-12 10:50:37 -04:00
1 parent 173dbf578e
commit 6b1a1e2005
15 files changed
+1031 -245

No files matched your search

+14
View File
@@ -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
+24
View File
@@ -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 }>
}
}