refactor(agents): remove tool display record facade

This commit is contained in:
Vincent Koc
2026-06-18 09:55:47 +08:00
parent 2e49b6b769
commit 4552ea7ba0
4 changed files with 5 additions and 8 deletions
+3 -1
View File
@@ -3,6 +3,9 @@
* Redacts and summarizes arguments into short labels/details for chat and UI
* tool update streams.
*/
import {
asOptionalObjectRecord as asRecord,
} from "@openclaw/normalization-core/record-coerce";
import {
normalizeLowercaseStringOrEmpty,
normalizeOptionalString,
@@ -10,7 +13,6 @@ import {
import { parseStrictFiniteNumber } from "../infra/parse-finite-number.js";
import { redactToolPayloadText } from "../logging/redact.js";
import { resolveExecDetail, type ToolDetailMode } from "./tool-display-exec.js";
import { asRecord } from "./tool-display-record.js";
type ToolDisplayActionSpec = {
label?: string;
+1 -1
View File
@@ -3,6 +3,7 @@
*
* Turns common shell commands into short redacted labels for tool timelines and transcripts.
*/
import { asOptionalObjectRecord as asRecord } from "@openclaw/normalization-core/record-coerce";
import { redactToolPayloadText } from "../logging/redact.js";
import {
binaryName,
@@ -17,7 +18,6 @@ import {
trimLeadingEnv,
unwrapShellWrapper,
} from "./tool-display-exec-shell.js";
import { asRecord } from "./tool-display-record.js";
function summarizeKnownExec(words: string[]): string {
if (words.length === 0) {
-5
View File
@@ -1,5 +0,0 @@
/**
* Compatibility export for tool display payload code that wants the shared
* optional-record coercion helper under the shorter local name.
*/
export { asOptionalObjectRecord as asRecord } from "../../packages/normalization-core/src/record-coerce.js";
+1 -1
View File
@@ -3,11 +3,11 @@
*
* Identifies mutating tool calls and file targets so retry/recovery logic can reason about side effects.
*/
import { asOptionalObjectRecord as asRecord } from "@openclaw/normalization-core/record-coerce";
import {
normalizeLowercaseStringOrEmpty,
normalizeOptionalLowercaseString,
} from "@openclaw/normalization-core/string-coerce";
import { asRecord } from "./tool-display-record.js";
const MUTATING_TOOL_NAMES = new Set([
"write",