@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/dist/index.js CHANGED
@@ -3013,17 +3013,19 @@ var INTEGRATION_FUNCTIONS = {
3013
3013
  { slug: "delete_google_calendar_event", label: "Remover Evento", description: "Cancelar/remover evento", defaultInstructions: "Remover evento do Google Calendar" }
3014
3014
  ]
3015
3015
  };
3016
- function buildCustomInstructions(integrationSlug, selectedFunctions, functionInstructions) {
3016
+ function buildCustomInstructions(integrationSlug, integrationName, selectedFunctions, functionInstructions) {
3017
3017
  const fns = INTEGRATION_FUNCTIONS[integrationSlug];
3018
3018
  if (!fns) return "";
3019
3019
  const activeFns = fns.filter((f) => selectedFunctions.has(f.slug));
3020
3020
  if (activeFns.length === 0) return "";
3021
- const lines = activeFns.map((f) => {
3021
+ const lines = [];
3022
+ lines.push(`## ${integrationName} (${integrationSlug})`);
3023
+ for (const f of activeFns) {
3022
3024
  const instruction = functionInstructions[f.slug] || f.defaultInstructions;
3023
- return `- ${f.slug}: ${instruction}`;
3024
- });
3025
- return `Fun\xE7\xF5es dispon\xEDveis (${integrationSlug}):
3026
- ${lines.join("\n")}`;
3025
+ lines.push(`### ${f.slug}`);
3026
+ lines.push(instruction);
3027
+ }
3028
+ return lines.join("\n");
3027
3029
  }
3028
3030
  function IntegrationsTab({
3029
3031
  config,
@@ -3171,7 +3173,7 @@ function IntegrationsTab({
3171
3173
  if (!toolId) continue;
3172
3174
  }
3173
3175
  }
3174
- const customInstructions = buildCustomInstructions(slug, local.selectedFunctions, local.functionInstructions);
3176
+ const customInstructions = buildCustomInstructions(slug, card.definition.name, local.selectedFunctions, local.functionInstructions);
3175
3177
  await addAgentTool.mutateAsync({
3176
3178
  idAgent: agentId,
3177
3179
  body: { id_tool: toolId, enabled: true, ...customInstructions ? { custom_instructions: customInstructions } : {} }
@@ -3189,7 +3191,7 @@ function IntegrationsTab({
3189
3191
  if (toolId) {
3190
3192
  const agentTool = agentTools.find((at) => at.id_tool === toolId);
3191
3193
  if (agentTool) {
3192
- const customInstructions = buildCustomInstructions(slug, local.selectedFunctions, local.functionInstructions);
3194
+ const customInstructions = buildCustomInstructions(slug, card.definition.name, local.selectedFunctions, local.functionInstructions);
3193
3195
  await updateAgentTool.mutateAsync({
3194
3196
  idAgent: agentId,
3195
3197
  id: agentTool.id,