import { r as truncateUtf16Safe } from "./utf16-slice-D_ngcYKd.js";
import { p as redactSensitiveText } from "./redact-CONqVXTy.js";
import { r as formatErrorMessage } from "./errors-Z0lU1pH3.js";
//#region src/gateway/worker-environments/worker-error.ts
function boundedWorkerError(error, maxChars = 1024) {
	return truncateUtf16Safe(redactSensitiveText(formatErrorMessage(error), { mode: "tools" }).replace(/\s+/g, " ").trim() || "unknown error", maxChars);
}
//#endregion
export { boundedWorkerError as t };
