Refactor application path handling and data storage architecture

Replace simple directory-based path system with git-aware data management that uses global data directories and proper workspace detection.

🤖 Generated with opencode
Co-Authored-By: opencode <noreply@opencode.ai>
This commit is contained in:
Dax Raad
2025-06-01 14:40:44 -04:00
parent 4be9f7ab9c
commit 526a8ea19a
17 changed files with 69 additions and 42 deletions

View File

@@ -3,8 +3,8 @@ import { LocalStorageAdapter } from "@flystorage/local-fs"
import fs from "fs/promises"
import { Log } from "../util/log"
import { App } from "../app/app"
import { AppPath } from "../app/path"
import { Bus } from "../bus"
import path from "path"
import z from "zod"
export namespace Storage {
@@ -19,7 +19,7 @@ export namespace Storage {
const state = App.state("storage", async () => {
const app = await App.use()
const storageDir = AppPath.storage(app.root)
const storageDir = path.join(app.path.data, "storage")
await fs.mkdir(storageDir, { recursive: true })
const storage = new FileStorage(new LocalStorageAdapter(storageDir))
log.info("created", { path: storageDir })