// tools/warp_grep/agent/formatter.ts
var ToolOutputFormatter = class {
  format(toolName, _args, output, options = {}) {
    const name = (toolName ?? "").trim();
    if (!name) {
      return "";
    }
    const payload = output?.toString?.()?.trim?.() ?? "";
    const isError = Boolean(options.isError);
    if (!payload && !isError) {
      return "";
    }
    return `<tool_response>
${payload}
</tool_response>`;
  }
};
var sharedFormatter = new ToolOutputFormatter();
function formatAgentToolOutput(toolName, args, output, options = {}) {
  return sharedFormatter.format(toolName, args, output, options);
}

export {
  ToolOutputFormatter,
  formatAgentToolOutput
};
//# sourceMappingURL=chunk-QRXG5CAZ.js.map