function buildSearchContentBlocks(input, data) {
  if (input.format === "stream_answer") {
    const { warning, answer, ...rest } = data;
    const envelope = {
      stream: answer ?? "",
      ...rest
    };
    if (warning) envelope.notice = warning;
    return [{ type: "text", text: JSON.stringify(envelope, null, 2) }];
  }
  const blocks = [];
  if (data.warning) {
    blocks.push({ type: "text", text: `[wigolo notice] ${data.warning}` });
  }
  blocks.push({ type: "text", text: JSON.stringify(data, null, 2) });
  return blocks;
}
export {
  buildSearchContentBlocks
};
//# sourceMappingURL=search-response.js.map