refactor: dedupe tool mutation record helper

This commit is contained in:
Peter Steinberger
2026-04-06 23:25:35 +01:00
parent bd2798ec5f
commit e0018999b3

View File

@@ -1,3 +1,5 @@
import { asRecord } from "./tool-display-record.js";
const MUTATING_TOOL_NAMES = new Set([
"write",
"edit",
@@ -56,10 +58,6 @@ export type ToolActionRef = {
actionFingerprint?: string;
};
function asRecord(value: unknown): Record<string, unknown> | undefined {
return value && typeof value === "object" ? (value as Record<string, unknown>) : undefined;
}
function normalizeActionName(value: unknown): string | undefined {
if (typeof value !== "string") {
return undefined;