Fix TypeScript compilation errors and consolidate version handling

🤖 Generated with [opencode](https://opencode.ai)

Co-Authored-By: opencode <noreply@opencode.ai>
This commit is contained in:
Dax Raad
2025-06-17 10:27:49 -04:00
parent 2d68814abc
commit 68e1b3c46c
15 changed files with 123 additions and 181 deletions

View File

@@ -5,19 +5,33 @@ import { ListTool } from "../../src/tool/ls"
describe("tool.glob", () => {
test("truncate", async () => {
await App.provide({ cwd: process.cwd(), version: "test" }, async () => {
await App.provide({ cwd: process.cwd() }, async () => {
let result = await GlobTool.execute(
{ pattern: "./node_modules/**/*" },
{ sessionID: "test" },
{
pattern: "./node_modules/**/*",
path: null,
},
{
sessionID: "test",
messageID: "",
abort: AbortSignal.any([]),
},
)
expect(result.metadata.truncated).toBe(true)
})
})
test("basic", async () => {
await App.provide({ cwd: process.cwd(), version: "test" }, async () => {
await App.provide({ cwd: process.cwd() }, async () => {
let result = await GlobTool.execute(
{ pattern: "*.json" },
{ sessionID: "test" },
{
pattern: "*.json",
path: null,
},
{
sessionID: "test",
messageID: "",
abort: AbortSignal.any([]),
},
)
expect(result.metadata).toMatchObject({
truncated: false,
@@ -29,15 +43,16 @@ describe("tool.glob", () => {
describe("tool.ls", () => {
test("basic", async () => {
const result = await App.provide(
{ cwd: process.cwd(), version: "test" },
async () => {
return await ListTool.execute(
{ path: "./example" },
{ sessionID: "test" },
)
},
)
const result = await App.provide({ cwd: process.cwd() }, async () => {
return await ListTool.execute(
{ path: "./example", ignore: [".git"] },
{
sessionID: "test",
messageID: "",
abort: AbortSignal.any([]),
},
)
})
expect(result.output).toMatchSnapshot()
})
})