feat(codemode): make search a global built-in and rewrite README (#36450)
This commit is contained in:
parent
1ccaca826e
commit
6eeeb4bfcf
11 changed files with 274 additions and 416 deletions
|
|
@ -342,9 +342,7 @@ describe("JSDoc signatures in catalogs and search results", () => {
|
|||
const runtime = CodeMode.make({ tools: { github: { list_issues: listIssues }, orders: { lookup: lookupOrder } } })
|
||||
|
||||
const search = async (query: string) => {
|
||||
const result = await Effect.runPromise(
|
||||
runtime.execute(`return await tools.$codemode.search({ query: ${JSON.stringify(query)} })`),
|
||||
)
|
||||
const result = await Effect.runPromise(runtime.execute(`return search({ query: ${JSON.stringify(query)} })`))
|
||||
expect(result.ok).toBe(true)
|
||||
if (!result.ok) throw new Error("search failed")
|
||||
return result.value as { items: Array<{ path: string; signature: string }>; remaining: number }
|
||||
|
|
@ -436,9 +434,7 @@ describe("non-identifier tool paths", () => {
|
|||
})
|
||||
|
||||
test("search results return callable bracket-notation paths and signatures", async () => {
|
||||
const result = await Effect.runPromise(
|
||||
runtime.execute(`return await tools.$codemode.search({ query: "resolve library" })`),
|
||||
)
|
||||
const result = await Effect.runPromise(runtime.execute(`return search({ query: "resolve library" })`))
|
||||
expect(result.ok).toBe(true)
|
||||
if (!result.ok) throw new Error("search failed")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue