mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-21 03:04:32 +00:00
Integrate OpenHandoff factory workspace (#212)
This commit is contained in:
parent
3d9476ed0b
commit
bf282199b5
251 changed files with 42824 additions and 692 deletions
25
factory/packages/backend/src/services/openhandoff-paths.ts
Normal file
25
factory/packages/backend/src/services/openhandoff-paths.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import type { AppConfig } from "@openhandoff/shared";
|
||||
import { homedir } from "node:os";
|
||||
import { dirname, join, resolve } from "node:path";
|
||||
|
||||
function expandPath(input: string): string {
|
||||
if (input.startsWith("~/")) {
|
||||
return `${homedir()}/${input.slice(2)}`;
|
||||
}
|
||||
return input;
|
||||
}
|
||||
|
||||
export function openhandoffDataDir(config: AppConfig): string {
|
||||
// Keep data collocated with the backend DB by default.
|
||||
const dbPath = expandPath(config.backend.dbPath);
|
||||
return resolve(dirname(dbPath));
|
||||
}
|
||||
|
||||
export function openhandoffRepoClonePath(
|
||||
config: AppConfig,
|
||||
workspaceId: string,
|
||||
repoId: string
|
||||
): string {
|
||||
return resolve(join(openhandoffDataDir(config), "repos", workspaceId, repoId));
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue