- Resolves #9771 - ... in a non-persistent way, so it won't work for webhook-triggered agents For webhooks: #9541 ### Changes 🏗️ Frontend: - Add credentials inputs in Library "New run" screen (based on `graph.credentials_input_schema`) - Refactor `CredentialsInput` and `useCredentials` to not rely on XYFlow context - Unsplit lists of saved credentials in `CredentialsProvider` state - Move logic that was being executed at component render to `useEffect` hooks in `CredentialsInput` Backend: - Implement logic to aggregate credentials input requirements to one per provider per graph - Add `BaseGraph.credentials_input_schema` (JSON schema) computed field Underlying added logic: - `BaseGraph._credentials_input_schema` - makes a `BlockSchema` from a graph's aggregated credentials inputs - `BaseGraph.aggregate_credentials_inputs()` - aggregates a graph's nodes' credentials inputs using `CredentialsFieldInfo.combine(..)` - `BlockSchema.get_credentials_fields_info() -> dict[str, CredentialsFieldInfo]` - `CredentialsFieldInfo` model (created from `_CredentialsFieldSchemaExtra`) - Implement logic to inject explicitly passed credentials into graph execution - Add `credentials_inputs` parameter to `execute_graph` endpoint - Add `graph_credentials_input` parameter to `.executor.utils.add_graph_execution(..)` - Implement `.executor.utils.make_node_credentials_input_map(..)` - Amend `.executor.utils.construct_node_execution_input` - Add `GraphExecutionEntry.node_credentials_input_map` attribute - Amend validation to allow injecting credentials - Amend `GraphModel._validate_graph(..)` - Amend `.executor.utils._validate_node_input_credentials` - Add `node_credentials_map` parameter to `ExecutionManager.add_execution(..)` - Amend execution validation to handle side-loaded credentials - Add `GraphExecutionEntry.node_execution_map` attribute - Add mechanism to inject passed credentials into node execution data - Add credentials injection mechanism to node execution queueing logic in `Executor._on_graph_execution(..)` - Replace boilerplate logic in `v1.execute_graph` endpoint with call to existing `.executor.utils.add_graph_execution(..)` - Replace calls to `.server.routers.v1.execute_graph` with `add_graph_execution` Also: - Address tech debt in `GraphModel._validate_gaph(..)` - Fix type checking in `BaseGraph._generate_schema(..)` #### TODO - [ ] ~~Make "Run again" work with credentials in `AgentRunDetailsView`~~ - [ ] Prohibit saving a graph if it has nodes with missing discriminator value for discriminated credentials inputs ### Checklist 📋 #### For code changes: - [ ] I have clearly listed my changes in the PR description - [ ] I have made a test plan - [ ] I have tested my changes according to the test plan: <!-- Put your test plan here: --> - [ ] ...
This is the frontend for AutoGPT's next generation
Getting Started
Run the following installation once.
npm install
# or
yarn install
# or
pnpm install
# or
bun install
Next, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
For subsequent runs, you do not have to npm install again. Simply do npm run dev.
If the project is updated via git, you will need to npm install after each update.
This project uses next/font to automatically optimize and load Inter, a custom Google Font.
Deploy
TODO
Storybook
Storybook is a powerful development environment for UI components. It allows you to build UI components in isolation, making it easier to develop, test, and document your components independently from your main application.
Purpose in the Development Process
- Component Development: Develop and test UI components in isolation.
- Visual Testing: Easily spot visual regressions.
- Documentation: Automatically document components and their props.
- Collaboration: Share components with your team or stakeholders for feedback.
How to Use Storybook
-
Start Storybook: Run the following command to start the Storybook development server:
npm run storybookThis will start Storybook on port 6006. Open http://localhost:6006 in your browser to view your component library.
-
Build Storybook: To build a static version of Storybook for deployment, use:
npm run build-storybook -
Running Storybook Tests: Storybook tests can be run using:
npm run test-storybookFor CI environments, use:
npm run test-storybook:ci -
Writing Stories: Create
.stories.tsxfiles alongside your components to define different states and variations of your components.
By integrating Storybook into our development workflow, we can streamline UI development, improve component reusability, and maintain a consistent design system across the project.