🤖 feat: Add Agent Duplication Functionality with Permission #4981
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Permissions.DUPLICATE
to the permissions schema and default roles schema inpackages/data-provider/src/roles.ts
[1] [2] [3]roleSchema
inapi/models/schema/roleSchema.js
to include the newDUPLICATE
permissionBackend Changes:
duplicateAgentHandler
inapi/server/controllers/agents/v1.js
to handle agent duplication requestsapi/server/routes/agents/v1.js
api/server/controllers/agents/v1.js
to include the newduplicateAgentHandler
Frontend Changes:
DuplicateAgent
component inclient/src/components/SidePanel/Agents/DuplicateAgent.tsx
to handle the UI for duplicating agentsAdminSettings
andAgentConfig
components to support the newDUPLICATE
permission and include the duplicate button. [1] [2] [3] [4]Utility and Hook Changes:
useDuplicateAgentMutation
hook inclient/src/data-provider/mutations.ts
to handle the duplication API callduplicateAgent
function inpackages/data-provider/src/data-service.ts
to perform the duplication requestThese 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
Checklist