mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-07 17:28:53 +00:00
- Rename packages/opencode → packages/tfcode (directory only) - Rename bin/opencode → bin/tfcode (CLI binary) - Rename .opencode → .tfcode (config directory) - Update package.json name and bin field - Update config directory path references (.tfcode) - Keep internal code references as 'opencode' for easy upstream sync - Keep @opencode-ai/* workspace package names This minimal branding approach allows clean merges from upstream opencode repository while providing tfcode branding for users.
21 lines
695 B
TypeScript
21 lines
695 B
TypeScript
import { lazy } from "@/util/lazy"
|
|
import type { Adaptor } from "../types"
|
|
|
|
const ADAPTORS: Record<string, () => Promise<Adaptor>> = {
|
|
worktree: lazy(async () => (await import("./worktree")).WorktreeAdaptor),
|
|
}
|
|
|
|
export function getAdaptor(type: string): Promise<Adaptor> {
|
|
return ADAPTORS[type]()
|
|
}
|
|
|
|
export function installAdaptor(type: string, adaptor: Adaptor) {
|
|
// This is experimental: mostly used for testing right now, but we
|
|
// will likely allow this in the future. Need to figure out the
|
|
// TypeScript story
|
|
|
|
// @ts-expect-error we force the builtin types right now, but we
|
|
// will implement a way to extend the types for custom adaptors
|
|
ADAPTORS[type] = () => adaptor
|
|
}
|