feat: expose seal approval tools

This commit is contained in:
gitea committed 2026-06-05 16:04:44 +08:00
1 parent d575683c8b
commit 73e201a83c
6 files changed
+723

No files matched your search

+27
View File
@@ -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();
});
});