@flutchai/flutch-sdk 0.6.11 → 0.6.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -5414,6 +5414,10 @@ exports.EventProcessor = class _EventProcessor {
5414
5414
  ...acc.attachments,
5415
5415
  ...attachments
5416
5416
  ];
5417
+ this.sendDelta(channel, {
5418
+ type: "attachments_added",
5419
+ attachments
5420
+ }, onPartial);
5417
5421
  this.logger.debug("[ATTACHMENTS] Extracted from send_attachments event", {
5418
5422
  extractedCount: attachments.length,
5419
5423
  totalAccCount: acc.attachments.length
@@ -5428,7 +5432,8 @@ exports.EventProcessor = class _EventProcessor {
5428
5432
  if (chunk.content) {
5429
5433
  blocks.push(...this.normalizeContentBlocks(chunk.content));
5430
5434
  }
5431
- if (Array.isArray(chunk.tool_call_chunks) && chunk.tool_call_chunks.length > 0) {
5435
+ const contentHasToolBlocks = blocks.some((block) => block?.type === "tool_use" || block?.type === "tool_call" || block?.type === "input_json_delta");
5436
+ if (!contentHasToolBlocks && Array.isArray(chunk.tool_call_chunks) && chunk.tool_call_chunks.length > 0) {
5432
5437
  blocks.push(...this.toolCallChunksToBlocks(chunk.tool_call_chunks));
5433
5438
  }
5434
5439
  if (blocks.length > 0) {