mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-01 23:02:26 +00:00
first pass making system prompt less fast
This commit is contained in:
10
packages/opencode/src/external/fzf.ts
vendored
10
packages/opencode/src/external/fzf.ts
vendored
@@ -116,11 +116,15 @@ export namespace Fzf {
|
||||
return filepath
|
||||
}
|
||||
|
||||
export async function search(cwd: string, query: string) {
|
||||
const results = await $`${await filepath()} --filter ${query}`
|
||||
export async function search(input: {
|
||||
cwd: string
|
||||
query: string
|
||||
limit?: number
|
||||
}) {
|
||||
const results = await $`${await filepath()} --filter=${input.query}`
|
||||
.quiet()
|
||||
.throws(false)
|
||||
.cwd(cwd)
|
||||
.cwd(input.cwd)
|
||||
.text()
|
||||
const split = results
|
||||
.trim()
|
||||
|
||||
9
packages/opencode/src/external/ripgrep.ts
vendored
9
packages/opencode/src/external/ripgrep.ts
vendored
@@ -5,6 +5,7 @@ import fs from "fs/promises"
|
||||
import { z } from "zod"
|
||||
import { NamedError } from "../util/error"
|
||||
import { lazy } from "../util/lazy"
|
||||
import { $ } from "bun"
|
||||
|
||||
export namespace Ripgrep {
|
||||
const PLATFORM = {
|
||||
@@ -111,4 +112,12 @@ export namespace Ripgrep {
|
||||
const { filepath } = await state()
|
||||
return filepath
|
||||
}
|
||||
|
||||
export async function files(cwd: string) {
|
||||
const result =
|
||||
await $`${await filepath()} --files --hidden --glob '!.git/*'`
|
||||
.cwd(cwd)
|
||||
.text()
|
||||
return result.split("\n").filter(Boolean)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user