Include tool aliases in conformance snapshot
This commit is contained in:
parent
d24ae43654
commit
ce244decd0
@ -9,7 +9,7 @@ type ToolProfilePolicy = {
|
||||
deny?: string[];
|
||||
};
|
||||
|
||||
const TOOL_NAME_ALIASES: Record<string, string> = {
|
||||
export const TOOL_NAME_ALIASES: Record<string, string> = {
|
||||
bash: "exec",
|
||||
"apply-patch": "apply_patch",
|
||||
};
|
||||
|
||||
@ -7,11 +7,9 @@
|
||||
* the formal models/extractors.
|
||||
*/
|
||||
|
||||
import { TOOL_GROUPS } from "./tool-policy.js";
|
||||
|
||||
// Tool name aliases are intentionally not exported from tool-policy today.
|
||||
// Keep the conformance snapshot focused on exported policy constants.
|
||||
import { TOOL_GROUPS, TOOL_NAME_ALIASES } from "./tool-policy.js";
|
||||
|
||||
export const TOOL_POLICY_CONFORMANCE = {
|
||||
toolGroups: TOOL_GROUPS,
|
||||
toolNameAliases: TOOL_NAME_ALIASES,
|
||||
} as const;
|
||||
|
||||
@ -136,6 +136,11 @@ describe("TOOL_POLICY_CONFORMANCE", () => {
|
||||
expect(TOOL_POLICY_CONFORMANCE.toolGroups).toEqual(TOOL_GROUPS);
|
||||
});
|
||||
|
||||
it("includes all exported policy constants needed for drift detection", async () => {
|
||||
const { TOOL_NAME_ALIASES } = await import("./tool-policy.js");
|
||||
expect(TOOL_POLICY_CONFORMANCE.toolNameAliases).toEqual(TOOL_NAME_ALIASES);
|
||||
});
|
||||
|
||||
it("is JSON-serializable", () => {
|
||||
expect(() => JSON.stringify(TOOL_POLICY_CONFORMANCE)).not.toThrow();
|
||||
});
|
||||
|
||||
@ -4,6 +4,7 @@ import {
|
||||
normalizeToolName,
|
||||
resolveToolProfilePolicy,
|
||||
TOOL_GROUPS,
|
||||
TOOL_NAME_ALIASES,
|
||||
} from "./tool-policy-shared.js";
|
||||
import type { AnyAgentTool } from "./tools/common.js";
|
||||
export {
|
||||
@ -12,6 +13,7 @@ export {
|
||||
normalizeToolName,
|
||||
resolveToolProfilePolicy,
|
||||
TOOL_GROUPS,
|
||||
TOOL_NAME_ALIASES,
|
||||
} from "./tool-policy-shared.js";
|
||||
export type { ToolProfileId } from "./tool-policy-shared.js";
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user