first pass making system prompt less fast

This commit is contained in:
Dax Raad
2025-06-15 20:24:51 -04:00
parent c5eefd1752
commit 7d174767b0
5 changed files with 75 additions and 9 deletions

View File

@@ -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()

View File

@@ -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)
}
}