Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🤖 feat: Add Agent Duplication Functionality with Permission #4981

Closed
wants to merge 4 commits into from

Conversation

berry-13
Copy link
Collaborator

@berry-13 berry-13 commented Dec 14, 2024

Summary

This pull request introduces the functionality to duplicate agents and includes various related changes across the codebase. The most important changes include adding a new permission type, creating a duplicate agent handler, and updating the user interface to support the duplication feature

New Permission Type:

  • Added Permissions.DUPLICATE to the permissions schema and default roles schema in packages/data-provider/src/roles.ts [1] [2] [3]
  • Updated roleSchema in api/models/schema/roleSchema.js to include the new DUPLICATE permission

Backend Changes:

  • Introduced duplicateAgentHandler in api/server/controllers/agents/v1.js to handle agent duplication requests
  • Added a new route for duplicating agents in api/server/routes/agents/v1.js
  • Updated the exports in api/server/controllers/agents/v1.js to include the new duplicateAgentHandler

Frontend Changes:

  • Added a DuplicateAgent component in client/src/components/SidePanel/Agents/DuplicateAgent.tsx to handle the UI for duplicating agents
  • Updated AdminSettings and AgentConfig components to support the new DUPLICATE permission and include the duplicate button. [1] [2] [3] [4]
  • Modified localization files to include new strings related to agent duplication. [1] [2]

Utility and Hook Changes:

  • Added useDuplicateAgentMutation hook in client/src/data-provider/mutations.ts to handle the duplication API call
  • Created the duplicateAgent function in packages/data-provider/src/data-service.ts to perform the duplication request

These changes collectively enable the duplication of agents, providing a new feature for users to quickly create copies of existing agents with minimal effort

Change Type

  • New feature (non-breaking change which adds functionality)

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.

@berry-13 berry-13 changed the title feat: Implement Agent duplication functionality 🤖 feat: Add Agent Duplication Functionality with Permission Dec 14, 2024
@danny-avila danny-avila marked this pull request as draft December 14, 2024 18:12
@berry-13 berry-13 marked this pull request as ready for review December 15, 2024 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants