mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-03 07:33:45 +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:
@@ -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 = []
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = []
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user