feat: expose seal approval tools
This commit is contained in:
1 parent
d575683c8b
commit
73e201a83c
6 files changed
+723
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import { z } from "zod";
|
||||
import { sealTools } from "./tools.js";
|
||||
|
||||
describe("sealTools", () => {
|
||||
test("exposes concrete JSON schemas for parameterized tools", () => {
|
||||
const createRule = sealTools.find((tool) => tool.name === "seal_approval_rule_create");
|
||||
expect(createRule).toBeDefined();
|
||||
|
||||
const schema = z.toJSONSchema(createRule!.parameters) as {
|
||||
properties?: Record<string, unknown>;
|
||||
required?: string[];
|
||||
};
|
||||
|
||||
expect(Object.keys(schema.properties ?? {})).toEqual([
|
||||
"description",
|
||||
"scope",
|
||||
"strictness"
|
||||
]);
|
||||
expect(schema.required).toEqual(["description", "scope", "strictness"]);
|
||||
});
|
||||
|
||||
test("includes the approval context aggregation tool", () => {
|
||||
const tool = sealTools.find((item) => item.name === "seal_approval_context_get");
|
||||
expect(tool).toBeDefined();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user