@flutchai/flutch-sdk 0.2.5 → 0.2.7
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 +36 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +36 -28
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -4943,6 +4943,17 @@ exports.EventProcessor = class EventProcessor {
|
|
|
4943
4943
|
const blocks = this.normalizeContentBlocks(event.data.content);
|
|
4944
4944
|
this.processContentStream(acc, channel, blocks, onPartial);
|
|
4945
4945
|
}
|
|
4946
|
+
if (event.name === "send_attachments" && event.data.attachments) {
|
|
4947
|
+
const attachments = event.data.attachments || [];
|
|
4948
|
+
acc.attachments = [...acc.attachments, ...attachments];
|
|
4949
|
+
this.logger.debug(
|
|
4950
|
+
"[ATTACHMENTS] Extracted from send_attachments event",
|
|
4951
|
+
{
|
|
4952
|
+
extractedCount: attachments.length,
|
|
4953
|
+
totalAccCount: acc.attachments.length
|
|
4954
|
+
}
|
|
4955
|
+
);
|
|
4956
|
+
}
|
|
4946
4957
|
return;
|
|
4947
4958
|
}
|
|
4948
4959
|
if (event.event === "on_chat_model_stream" && event.data?.chunk?.content) {
|
|
@@ -5040,32 +5051,24 @@ exports.EventProcessor = class EventProcessor {
|
|
|
5040
5051
|
});
|
|
5041
5052
|
return;
|
|
5042
5053
|
}
|
|
5043
|
-
if (event.event === "on_chain_end") {
|
|
5044
|
-
const
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
};
|
|
5062
|
-
} else if (output?.attachments || output?.metadata) {
|
|
5063
|
-
acc.attachments = [
|
|
5064
|
-
...acc.attachments,
|
|
5065
|
-
...this.extractAttachments(output.attachments)
|
|
5066
|
-
];
|
|
5067
|
-
acc.metadata = { ...acc.metadata, ...output.metadata || {} };
|
|
5068
|
-
}
|
|
5054
|
+
if (event.event === "on_chain_end" && event.metadata?.langgraph_node) {
|
|
5055
|
+
const output = event.data?.output;
|
|
5056
|
+
this.logger.debug("[CHAIN_END] Received on_chain_end event", {
|
|
5057
|
+
nodeName: event.metadata.langgraph_node,
|
|
5058
|
+
hasOutput: !!output,
|
|
5059
|
+
outputKeys: output ? Object.keys(output) : [],
|
|
5060
|
+
hasMetadata: !!output?.metadata,
|
|
5061
|
+
metadata: output?.metadata || null,
|
|
5062
|
+
fullOutput: output
|
|
5063
|
+
// Full output for debugging
|
|
5064
|
+
});
|
|
5065
|
+
if (output?.metadata) {
|
|
5066
|
+
acc.metadata = { ...acc.metadata, ...output.metadata };
|
|
5067
|
+
this.logger.debug("[CHAIN_END] Extracted metadata from node", {
|
|
5068
|
+
nodeName: event.metadata.langgraph_node,
|
|
5069
|
+
metadata: output.metadata,
|
|
5070
|
+
accumulatedMetadata: acc.metadata
|
|
5071
|
+
});
|
|
5069
5072
|
}
|
|
5070
5073
|
return;
|
|
5071
5074
|
}
|
|
@@ -5112,7 +5115,9 @@ exports.EventProcessor = class EventProcessor {
|
|
|
5112
5115
|
textChains: allChains.filter((c) => c.channel === "text").length,
|
|
5113
5116
|
processingChains: allChains.filter((c) => c.channel === "processing").length,
|
|
5114
5117
|
totalSteps: allChains.reduce((sum, c) => sum + c.steps.length, 0),
|
|
5115
|
-
textLength: text.length
|
|
5118
|
+
textLength: text.length,
|
|
5119
|
+
attachmentsCount: acc.attachments?.length || 0,
|
|
5120
|
+
attachments: acc.attachments
|
|
5116
5121
|
});
|
|
5117
5122
|
return {
|
|
5118
5123
|
content: {
|
|
@@ -5524,6 +5529,9 @@ async function createStaticMessage(content, config) {
|
|
|
5524
5529
|
await dispatch.dispatchCustomEvent("send_static_message", { content }, config);
|
|
5525
5530
|
return message;
|
|
5526
5531
|
}
|
|
5532
|
+
async function dispatchAttachments(attachments, config) {
|
|
5533
|
+
await dispatch.dispatchCustomEvent("send_attachments", { attachments }, config);
|
|
5534
|
+
}
|
|
5527
5535
|
|
|
5528
5536
|
// src/core/universal-graph.module.ts
|
|
5529
5537
|
init_builder_registry_service();
|
|
@@ -7666,6 +7674,7 @@ exports.createEndpointDescriptors = createEndpointDescriptors;
|
|
|
7666
7674
|
exports.createGraphAttachment = createGraphAttachment;
|
|
7667
7675
|
exports.createMongoClientAdapter = createMongoClientAdapter;
|
|
7668
7676
|
exports.createStaticMessage = createStaticMessage;
|
|
7677
|
+
exports.dispatchAttachments = dispatchAttachments;
|
|
7669
7678
|
exports.executeToolWithAttachments = executeToolWithAttachments;
|
|
7670
7679
|
exports.findCallbackMethod = findCallbackMethod;
|
|
7671
7680
|
exports.findEndpointMethod = findEndpointMethod;
|