mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
Pr 158 (#161)
* feat: discover local repos and reconnect OpenCode sessions Replace one-by-one local repo setup with parent-folder discovery and path-aware repo linking so first-time installs can recover existing OpenCode chats. Add first-run import support and onboarding docs for standalone OpenCode users, including Docker path-matching guidance. * fix: address session discovery review feedback * fix: improve delete/unlink messaging for local vs cloned repos * feat: discover local repos and reconnect OpenCode sessions (#158) --------- Co-authored-by: itz4blitz <justinscroggins@outlook.com> Co-authored-by: itz4blitz <60281870+itz4blitz@users.noreply.github.com>
This commit is contained in:
30 files changed
+1073
-312
No files matched your search
@@ -1,6 +1,7 @@
|
||||
import type { Repo } from './types'
|
||||
import { FetchError, fetchWrapper, fetchWrapperVoid, fetchWrapperBlob } from './fetchWrapper'
|
||||
import { API_BASE_URL } from '@/config'
|
||||
import type { DiscoverReposResponse } from '@opencode-manager/shared/types'
|
||||
|
||||
export async function createRepo(
|
||||
repoUrl?: string,
|
||||
@@ -21,6 +22,14 @@ export async function listRepos(): Promise<Repo[]> {
|
||||
return fetchWrapper(`${API_BASE_URL}/api/repos`)
|
||||
}
|
||||
|
||||
export async function discoverRepos(rootPath: string, maxDepth?: number): Promise<DiscoverReposResponse> {
|
||||
return fetchWrapper(`${API_BASE_URL}/api/repos/discover`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ rootPath, maxDepth }),
|
||||
})
|
||||
}
|
||||
|
||||
export async function getRepo(id: number): Promise<Repo> {
|
||||
return fetchWrapper(`${API_BASE_URL}/api/repos/${id}`)
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
export interface Repo {
|
||||
id: number
|
||||
repoUrl: string
|
||||
repoUrl?: string
|
||||
localPath: string
|
||||
fullPath: string
|
||||
sourcePath?: string
|
||||
branch?: string
|
||||
currentBranch?: string
|
||||
defaultBranch: string
|
||||
@@ -11,6 +12,7 @@ export interface Repo {
|
||||
lastPulled?: number
|
||||
openCodeConfigName?: string
|
||||
isWorktree?: boolean
|
||||
isLocal?: boolean
|
||||
}
|
||||
|
||||
import type { components } from './opencode-types'
|
||||
|
||||
Reference in new issue
Block a user