mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-05 10:31:35 +00:00
* feat(gateway): carry reviewer-only detail on plugin approvals * chore(protocol): regenerate projections for plugin approval detail * chore(plugin-sdk): budget reviewer-detail surface additions
24 lines
895 B
TypeScript
24 lines
895 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { validatePluginApprovalRequestParams } from "./index.js";
|
|
|
|
describe("plugin approval protocol validators", () => {
|
|
it("validates bounded reviewer-only detail independently from the description", () => {
|
|
const request = {
|
|
title: "Apply workspace skill proposal",
|
|
description: "d".repeat(512),
|
|
};
|
|
|
|
expect(validatePluginApprovalRequestParams(request)).toBe(true);
|
|
expect(validatePluginApprovalRequestParams({ ...request, detail: "full tool input" })).toBe(
|
|
true,
|
|
);
|
|
expect(validatePluginApprovalRequestParams({ ...request, detail: "" })).toBe(false);
|
|
expect(validatePluginApprovalRequestParams({ ...request, detail: "x".repeat(16_385) })).toBe(
|
|
false,
|
|
);
|
|
expect(validatePluginApprovalRequestParams({ ...request, description: "d".repeat(513) })).toBe(
|
|
false,
|
|
);
|
|
});
|
|
});
|