mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-04 08:03:14 +00:00
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:
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user