@greatapps/greatagents-ui 0.3.19 → 0.3.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greatapps/greatagents-ui",
3
- "version": "0.3.19",
3
+ "version": "0.3.20",
4
4
  "description": "Shared agents UI components for Great platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -84,9 +84,17 @@ function buildPreview(
84
84
  .map((at) => ({ at, tool: toolMap.get(at.id_tool) }))
85
85
  .filter((x): x is { at: AgentTool; tool: Tool } => !!x.tool);
86
86
 
87
- if (toolBindings.length > 0) {
87
+ // Deduplicate by id_tool — keep only the first (most recent) binding per tool
88
+ const seenToolIds = new Set<number>();
89
+ const dedupedBindings = toolBindings.filter(({ at }) => {
90
+ if (seenToolIds.has(at.id_tool)) return false;
91
+ seenToolIds.add(at.id_tool);
92
+ return true;
93
+ });
94
+
95
+ if (dedupedBindings.length > 0) {
88
96
  preview += "\n\n[TOOLS]";
89
- for (const { at, tool } of toolBindings) {
97
+ for (const { at, tool } of dedupedBindings) {
90
98
  if (at.custom_instructions) {
91
99
  preview += `\n\n${at.custom_instructions}`;
92
100
  } else {