feat: add --model flag (#32)

This commit is contained in:
Devansh Jain
2025-10-30 16:07:21 -07:00
committed by GitHub
parent f71d2c9b66
commit 09e4f0b13a
14 changed files with 98 additions and 27 deletions

View File

@@ -80,7 +80,7 @@ describe("Bash tool", () => {
});
test("throws error when command is missing", async () => {
await expect(bash({} as any)).rejects.toThrow(
await expect(bash({} as Parameters<typeof bash>[0])).rejects.toThrow(
/missing required parameter.*command/,
);
});

View File

@@ -71,7 +71,7 @@ describe("Edit tool", () => {
edit({
old_string: "foo",
new_string: "bar",
} as any),
} as Parameters<typeof edit>[0]),
).rejects.toThrow(/missing required parameter.*file_path/);
});
@@ -83,7 +83,7 @@ describe("Edit tool", () => {
edit({
file_path: file,
new_string: "bar",
} as any),
} as Parameters<typeof edit>[0]),
).rejects.toThrow(/missing required parameter.*old_string/);
});
@@ -95,7 +95,7 @@ describe("Edit tool", () => {
edit({
file_path: file,
old_string: "foo",
} as any),
} as Parameters<typeof edit>[0]),
).rejects.toThrow(/missing required parameter.*new_string/);
});
@@ -108,7 +108,7 @@ describe("Edit tool", () => {
file_path: file,
old_string: "World",
new_str: "Bun",
} as any),
} as Parameters<typeof edit>[0]),
).rejects.toThrow(/missing required parameter.*new_string/);
});
});

View File

@@ -58,7 +58,7 @@ describe("Grep tool", () => {
});
test("throws error when pattern is missing", async () => {
await expect(grep({} as any)).rejects.toThrow(
await expect(grep({} as Parameters<typeof grep>[0])).rejects.toThrow(
/missing required parameter.*pattern/,
);
});

View File

@@ -47,7 +47,7 @@ describe("LS tool", () => {
});
test("throws error when path is missing", async () => {
await expect(ls({} as any)).rejects.toThrow(
await expect(ls({} as Parameters<typeof ls>[0])).rejects.toThrow(
/missing required parameter.*path/,
);
});

View File

@@ -45,7 +45,7 @@ describe("MultiEdit tool", () => {
await expect(
multi_edit({
edits: [{ old_string: "foo", new_string: "bar" }],
} as any),
} as Parameters<typeof multi_edit>[0]),
).rejects.toThrow(/missing required parameter.*file_path/);
});
@@ -56,7 +56,7 @@ describe("MultiEdit tool", () => {
await expect(
multi_edit({
file_path: file,
} as any),
} as Parameters<typeof multi_edit>[0]),
).rejects.toThrow(/missing required parameter.*edits/);
});
@@ -67,7 +67,9 @@ describe("MultiEdit tool", () => {
await expect(
multi_edit({
file_path: file,
edits: [{ new_string: "bar" } as any],
edits: [
{ new_string: "bar" } as Parameters<typeof multi_edit>[0]["edits"][0],
],
}),
).rejects.toThrow(/missing required parameter.*old_string/);
});
@@ -79,7 +81,9 @@ describe("MultiEdit tool", () => {
await expect(
multi_edit({
file_path: file,
edits: [{ old_string: "foo" } as any],
edits: [
{ old_string: "foo" } as Parameters<typeof multi_edit>[0]["edits"][0],
],
}),
).rejects.toThrow(/missing required parameter.*new_string/);
});
@@ -91,7 +95,11 @@ describe("MultiEdit tool", () => {
await expect(
multi_edit({
file_path: file,
edits: [{ old_string: "foo", new_str: "baz" } as any],
edits: [
{ old_string: "foo", new_str: "baz" } as Parameters<
typeof multi_edit
>[0]["edits"][0],
],
}),
).rejects.toThrow(/missing required parameter.*new_string/);
});

View File

@@ -104,7 +104,7 @@ export default box;
});
test("throws error when file_path is missing", async () => {
await expect(read({} as any)).rejects.toThrow(
await expect(read({} as Parameters<typeof read>[0])).rejects.toThrow(
/missing required parameter.*file_path/,
);
});

View File

@@ -53,7 +53,7 @@ describe("Write tool", () => {
await expect(
write({
content: "Hello",
} as any),
} as Parameters<typeof write>[0]),
).rejects.toThrow(/missing required parameter.*file_path/);
});
@@ -64,7 +64,7 @@ describe("Write tool", () => {
await expect(
write({
file_path: filePath,
} as any),
} as Parameters<typeof write>[0]),
).rejects.toThrow(/missing required parameter.*content/);
});
});