@greatapps/greatagents-ui 0.3.20 → 0.3.21

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.20",
3
+ "version": "0.3.21",
4
4
  "description": "Shared agents UI components for Great platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -53,6 +53,7 @@ const INTEGRATION_FUNCTIONS: Record<string, IntegrationFunction[]> = {
53
53
 
54
54
  function buildCustomInstructions(
55
55
  integrationSlug: string,
56
+ integrationName: string,
56
57
  selectedFunctions: Set<string>,
57
58
  functionInstructions: Record<string, string>,
58
59
  ): string {
@@ -62,12 +63,16 @@ function buildCustomInstructions(
62
63
  const activeFns = fns.filter((f) => selectedFunctions.has(f.slug));
63
64
  if (activeFns.length === 0) return "";
64
65
 
65
- const lines = activeFns.map((f) => {
66
+ const lines: string[] = [];
67
+ lines.push(`## ${integrationName} (${integrationSlug})`);
68
+
69
+ for (const f of activeFns) {
66
70
  const instruction = functionInstructions[f.slug] || f.defaultInstructions;
67
- return `- ${f.slug}: ${instruction}`;
68
- });
71
+ lines.push(`### ${f.slug}`);
72
+ lines.push(instruction);
73
+ }
69
74
 
70
- return `Funções disponíveis (${integrationSlug}):\n${lines.join("\n")}`;
75
+ return lines.join("\n");
71
76
  }
72
77
 
73
78
  // ---------------------------------------------------------------------------
@@ -260,7 +265,7 @@ export function IntegrationsTab({
260
265
  if (!toolId) continue;
261
266
  }
262
267
  }
263
- const customInstructions = buildCustomInstructions(slug, local.selectedFunctions, local.functionInstructions);
268
+ const customInstructions = buildCustomInstructions(slug, card.definition.name, local.selectedFunctions, local.functionInstructions);
264
269
  await addAgentTool.mutateAsync({
265
270
  idAgent: agentId,
266
271
  body: { id_tool: toolId, enabled: true, ...(customInstructions ? { custom_instructions: customInstructions } : {}) },
@@ -280,7 +285,7 @@ export function IntegrationsTab({
280
285
  if (toolId) {
281
286
  const agentTool = agentTools.find((at) => at.id_tool === toolId);
282
287
  if (agentTool) {
283
- const customInstructions = buildCustomInstructions(slug, local.selectedFunctions, local.functionInstructions);
288
+ const customInstructions = buildCustomInstructions(slug, card.definition.name, local.selectedFunctions, local.functionInstructions);
284
289
  await updateAgentTool.mutateAsync({
285
290
  idAgent: agentId, id: agentTool.id,
286
291
  body: { custom_instructions: customInstructions },