* 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:
authored and GitHub committed 2026-03-20 21:06:09 -04:00
1 parent 8d9a8ba36a
commit 21a2094cfd
30 files changed
+1073 -312

No files matched your search

+18
View File
@@ -7,6 +7,7 @@ export const RepoSchema = z.object({
repoUrl: z.string().url().optional(),
localPath: z.string(),
fullPath: z.string(),
sourcePath: z.string().optional(),
branch: z.string().optional(),
defaultBranch: z.string(),
cloneStatus: RepoStatusSchema,
@@ -31,3 +32,20 @@ export const CreateRepoRequestSchema = z.object({
path: ["repoUrl"],
}
)
export const DiscoverReposRequestSchema = z.object({
rootPath: z.string().trim().min(1),
maxDepth: z.number().int().min(0).max(8).optional(),
})
export const DiscoverReposResponseSchema = z.object({
repos: z.array(RepoSchema),
discoveredCount: z.number().int().nonnegative(),
existingCount: z.number().int().nonnegative(),
errors: z.array(
z.object({
path: z.string(),
error: z.string(),
})
),
})
+4
View File
@@ -13,6 +13,8 @@ import {
import {
RepoSchema,
CreateRepoRequestSchema,
DiscoverReposRequestSchema,
DiscoverReposResponseSchema,
RepoStatusSchema,
} from '../schemas/repo'
import {
@@ -48,6 +50,8 @@ export type OpenCodeConfigResponse = z.infer<typeof OpenCodeConfigResponseSchema
export type Repo = z.infer<typeof RepoSchema>
export type CreateRepoRequest = z.infer<typeof CreateRepoRequestSchema>
export type DiscoverReposRequest = z.infer<typeof DiscoverReposRequestSchema>
export type DiscoverReposResponse = z.infer<typeof DiscoverReposResponseSchema>
export type RepoStatus = z.infer<typeof RepoStatusSchema>
export type FileInfo = z.infer<typeof FileInfoSchema>