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

@@ -51,7 +51,7 @@ export const GlobTool = Tool.define({
}),
async execute(params) {
const app = await App.use()
const search = params.path || app.root
const search = params.path || app.path.cwd
const limit = 100
const glob = new Bun.Glob(params.pattern)
const files = []

View File

@@ -287,7 +287,7 @@ export const GrepTool = Tool.define({
}
const app = await App.use()
const searchPath = params.path || app.root
const searchPath = params.path || app.path.cwd
// If literalText is true, escape the pattern
const searchPattern = params.literalText

View File

@@ -26,7 +26,7 @@ export const ListTool = Tool.define({
}),
async execute(params) {
const app = await App.use()
const searchPath = path.resolve(app.root, params.path || ".")
const searchPath = path.resolve(app.path.cwd, params.path || ".")
const glob = new Bun.Glob("**/*")
const files = []

View File

@@ -37,7 +37,7 @@ TIPS:
const app = await App.use()
const normalized = path.isAbsolute(args.path)
? args.path
: path.join(app.root, args.path)
: path.join(app.path.cwd, args.path)
await LSP.file(normalized)
const diagnostics = await LSP.diagnostics()
const file = diagnostics[normalized]

View File

@@ -21,7 +21,7 @@ export const LspHoverTool = Tool.define({
const app = await App.use()
const file = path.isAbsolute(args.file)
? args.file
: path.join(app.root, args.file)
: path.join(app.path.cwd, args.file)
await LSP.file(file)
const result = await LSP.hover({
...args,