mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 22:30:22 +00:00
refactor: dedupe provider channel readers
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import fs from "node:fs/promises";
|
||||
import { Static, Type } from "@sinclair/typebox";
|
||||
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
||||
import { normalizeOptionalString } from "openclaw/plugin-sdk/text-runtime";
|
||||
import type { AnyAgentTool, OpenClawPluginApi, OpenClawPluginToolContext } from "../api.js";
|
||||
import { PlaywrightDiffScreenshotter, type DiffScreenshotter } from "./browser.js";
|
||||
import { resolveDiffImageRenderOptions } from "./config.js";
|
||||
@@ -469,9 +470,9 @@ function normalizeDiffInput(params: DiffsToolParams): DiffInput {
|
||||
}
|
||||
assertMaxBytes(before, "before", MAX_BEFORE_AFTER_BYTES);
|
||||
assertMaxBytes(after, "after", MAX_BEFORE_AFTER_BYTES);
|
||||
const path = params.path?.trim() || undefined;
|
||||
const lang = params.lang?.trim() || undefined;
|
||||
const title = params.title?.trim() || undefined;
|
||||
const path = normalizeOptionalString(params.path);
|
||||
const lang = normalizeOptionalString(params.lang);
|
||||
const title = normalizeOptionalString(params.title);
|
||||
if (path) {
|
||||
assertMaxBytes(path, "path", MAX_PATH_BYTES);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user