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(workflow): Implement Visual Workflow Editor with Execution Engine #6055

Open
wants to merge 36 commits into
base: main
Choose a base branch
from

Commits on Nov 2, 2024

  1. feat(webviews): add Toolbox tab with placeholder tools

    The new Toolbox tab allows users to access various tools and workflows to enhance their coding experience.
    
    This change is part of the ongoing effort to expand the capabilities of the Cody AI assistant and provide a more comprehensive set of development tools.
    
    Co-authored-by: Cody <[email protected]>
    PriNova and Cody committed Nov 2, 2024
    Configuration menu
    Copy the full SHA
    b5aef24 View commit details
    Browse the repository at this point in the history
  2. feat(workflow): add Workflow Editor

    This change introduces a new Workflow Editor feature to the Cody AI assistant. The Workflow Editor allows users to create, edit, and manage their custom workflows directly within the Cody extension.
    
    The key changes include:
    
    - Added a new `ToolboxTab` component with a button to open the Workflow Editor
    - Implemented a new `WorkflowEditor` component that renders the Workflow Editor UI
    - Registered a new `cody.openWorkflowEditor` command to open the Workflow Editor panel
    - Added the necessary HTML, TypeScript, and package.json changes to support the Workflow Editor functionality
    
    This enhancement is part of the ongoing effort to expand the capabilities of the Cody AI assistant and provide a more comprehensive set of development tools for users.
    PriNova committed Nov 2, 2024
    Configuration menu
    Copy the full SHA
    823fa3b View commit details
    Browse the repository at this point in the history
  3. feat(webview): implement workflow editor with ReactFlow

    - Add workflow editor implementation with basic node/edge support
    - Update webview dist path to 'dist/webviews'
    - Refactor VSCode API usage in ToolboxTab component
    - Rename 'Workflows' tab to 'Toolbox' for clarity
    - Add workflow.html entry in vite config
    
    This change introduces a visual workflow editor using ReactFlow library,
    enabling drag-and-drop workflow creation with initial nodes for git operations.
    PriNova committed Nov 2, 2024
    Configuration menu
    Copy the full SHA
    9a4e067 View commit details
    Browse the repository at this point in the history

Commits on Nov 3, 2024

  1. refactor(workflow): extract WorkflowApp component and improve resourc…

    …e cleanup
    
    - Extract WorkflowApp component from index.tsx for better code organization
    - Add dispose handler in workflow.ts for proper resource cleanup
    - Wrap workflow app with AppWrapper component
    - Update script extension from .tsx to .js in workflow.html
    
    This change improves component modularity and memory management while maintaining
    existing functionality.
    PriNova committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    aff3f32 View commit details
    Browse the repository at this point in the history
  2. refactor(workflow-editor): integrate VSCode API and improve TypeScrip…

    …t support
    
    - Add VSCodeWrapper API integration to WorkflowApp component
    - Update workflow entry point from .js to .tsx
    - Refine component props interface
    - Simplify editor button text
    PriNova committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    94545e4 View commit details
    Browse the repository at this point in the history
  3. feat(workflow): enhance workflow editor with sidebar and improved UI …

    …components
    
    - Refactor WorkflowApp to use ReactFlowProvider for better state management
    - Add WorkflowSidebar component with actions and templates sections
    - Create WorkflowEditor story for component testing
    - Improve ToolboxTab UI using shadcn Button components
    - Restructure workflow-related components for better organization
    
    This change improves the workflow editor's functionality and maintainability while providing a better user experience through consistent UI components.
    PriNova committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    fd42c68 View commit details
    Browse the repository at this point in the history
  4. style(workflow): enhance node visualization with VSCode theme integra…

    …tion
    
    - Add Flow.module.css for consistent node styling
    - Apply VSCode theme variables for colors and borders
    - Ensure visual consistency across all node types
    - Improve code formatting in story file
    PriNova committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    8e23248 View commit details
    Browse the repository at this point in the history
  5. refactor(workflow): improve node types and visualization

    - Add typed CLI and LLM node components with specific styling
    - Replace CSS modules with inline component styles
    - Enhance node connections with bezier curves
    - Restructure sidebar with clear CLI and LLM action categories
    - Improve type safety with WorkflowNode interface
    
    Migration: Flow.module.css styles moved to inline component styles
    PriNova committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    022e4a8 View commit details
    Browse the repository at this point in the history
  6. refactor(workflow)!: reorganize workflow module structure

    * Move workflow.ts from commands/ to dedicated workflow/ directory
    * Update import paths in main.ts to reflect new structure
    * fix(ui): rename sidebar button from "Cody Generate Reply" to "Cody Inference"
    
    BREAKING CHANGE: workflow module path has changed from 'commands/workflow' to 'workflow/workflow'
    PriNova committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    36fe3e5 View commit details
    Browse the repository at this point in the history
  7. feat(workflow): add node property editor and enhanced state visualiza…

    …tion
    
    - Add property editor sidebar panel for editing node attributes
    - Implement node selection and movement state tracking
    - Add new UI components (Input, Label, Textarea) for form controls
    - Enhance node visualization with different border states for selected/moving
    - Add @radix-ui/react-label dependency for accessible form labels
    PriNova committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    1fae6cd View commit details
    Browse the repository at this point in the history
  8. refactor(workflow): restructure node components and enhance selection…

    … handling
    
    - Extract node logic into separate component file
    - Implement proper selection management with background interactions
    - Add shared node styling and type definitions
    - Organize Flow component into logical sections with clear comments
    - Create factory function for node creation
    - Move default workflow configuration to Nodes component
    PriNova committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    17c64b8 View commit details
    Browse the repository at this point in the history
  9. feat(workflow-sidebar): add workflow management actions and improve b…

    …utton styling
    
    - Add Open/Save workflow buttons at the top
    - Update button styling from ghost to secondary variant
    - Remove redundant div wrappers around buttons
    - Add visual separator between sections
    - Standardize button width and spacing
    PriNova committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    76ef2e9 View commit details
    Browse the repository at this point in the history
  10. feat(workflow): add save/load functionality for workflow editor

    - Implement workflow file save/load operations with JSON support
    - Add UI controls for saving and loading workflows in sidebar
    - Create workflow protocol types for extension communication
    - Update component types for better type safety
    - Configure default save path under .cody/workflows
    PriNova committed Nov 3, 2024
    Configuration menu
    Copy the full SHA
    2afbce5 View commit details
    Browse the repository at this point in the history

Commits on Nov 4, 2024

  1. feat(workflow): add workflow loading functionality

    - Add load workflow handler in extension
    - Implement workflow loading UI with open button
    - Add message protocol for bi-directional workflow loading
    - Setup event listeners for loaded workflow data
    - Update WorkflowProtocol types to support load operations
    PriNova committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    f04e585 View commit details
    Browse the repository at this point in the history
  2. feat(workflow): implement workflow execution engine

    - Add workflow executor with topological sorting for node execution order
    - Implement CLI and LLM node execution handlers with status feedback
    - Add execution UI controls and visual node status indicators
    - Extend workflow protocol to support execution status messages
    - Add execute button in workflow sidebar
    
    This change enables users to execute workflow nodes in the correct order
    with visual feedback of execution progress.
    PriNova committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    7f9d010 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7bfc482 View commit details
    Browse the repository at this point in the history
  4. fix: biome formatting

    PriNova committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    945434b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    89fac8b View commit details
    Browse the repository at this point in the history
  6. feat(workflow): implement secure CLI execution with node context

    - Add execution context to handle inter-node data flow
    - Implement secure CLI command execution with workspace validation
    - Add forbidden commands list for security
    - Add parent-child node output passing
    - Enhance UI to display node execution results
    - Show node IDs in property editor
    
    Security: Prevents execution of dangerous system commands
    PriNova committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    c96e355 View commit details
    Browse the repository at this point in the history
  7. feat(workflow): respect edge order in workflow execution

    - Enhance topological sort to maintain source node ordering
    - Add combineParentOutputsByConnectionOrder helper function
    - Refactor input combination logic to preserve connection sequence
    - Improve predictability of multi-parent node execution
    
    This change ensures workflow outputs are combined in the exact order
    of edge connections, providing more deterministic behavior.
    PriNova committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    0a3721e View commit details
    Browse the repository at this point in the history
  8. feat(workflow): add ordered edge visualization with topological sorting

    - Introduce CustomOrderedEdge component for numbered edge display
    - Implement topological sorting for proper edge order management
    - Move Edge type definition to dedicated component
    - Update workflow graph to show numbered execution order
    - Maintain visual consistency with VS Code theme using badge styling
    
    This change improves workflow readability by clearly indicating execution order.
    PriNova committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    7120d1f View commit details
    Browse the repository at this point in the history
  9. refactor(toolbox): simplify toolbox UI to workflow editor button

    - Remove unused accordion structure and placeholder features
    - Delete ToolboxItem interface and related data
    - Focus UI on core workflow editor functionality
    - Clean up component imports
    PriNova committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    c1ff4b8 View commit details
    Browse the repository at this point in the history
  10. refactor(workflow-ui): normalize node type labels in sidebar

    - Simplify CLI node label from "Git Diff" to "CLI Command"
    - Consolidate LLM node references to simply "Cody"
    PriNova committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    940814d View commit details
    Browse the repository at this point in the history
  11. feat(workflow): enhance error handling and node validation

    - Add pre-execution validation for CLI and LLM nodes
    - Implement visual error states for invalid nodes
    - Add error highlighting in node UI with VS Code theme colors
    - Streamline error messaging to prevent duplicates
    - Add execution completion message on workflow errors
    - Improve error state management in React components
    
    This improves user experience by providing immediate feedback for invalid nodes
    and clearer error visualization during workflow execution.
    PriNova committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    986d2d1 View commit details
    Browse the repository at this point in the history
  12. feat(workflow): implement LLM node execution with input sanitization

    - Add ChatClient integration for LLM node execution
    - Implement proper message streaming and response handling
    - Add security measures with shell and prompt input sanitization
    - Remove mock delay implementations
    - Pass chatClient through workflow registration chain
    
    This completes the LLM node execution feature and improves workflow security.
    PriNova committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    4f4d8fd View commit details
    Browse the repository at this point in the history
  13. feat(workflow): add preview node type for visual workflow output

    - Implement PreviewNode component with read-only content display
    - Add preview node execution logic in workflow executor
    - Update Flow component to handle preview node state updates
    - Add Preview section in workflow sidebar for node creation
    - Integrate preview functionality with existing node system
    PriNova committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    813cf84 View commit details
    Browse the repository at this point in the history
  14. feat(workflow): improve execution state management and feedback

    - Retain webview context when hidden for better state persistence
    - Add visual execution status indicators in workflow sidebar
    - Track workflow execution state to prevent concurrent runs
    - Initialize default content for preview nodes
    - Streamline workflow protocol type definitions
    
    This enhances the user experience by providing clear feedback during workflow execution and prevents potential state-related issues.
    PriNova committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    dbd5d1b View commit details
    Browse the repository at this point in the history
  15. refactor(workflow): migrate to UUID-based node identification

    * Replace numeric IDs with UUID for workflow nodes
    * Add comprehensive test coverage for topology sorting
    * Optimize node output handling and sanitization
    * Clean up redundant comments and simplify code
    
    BREAKING CHANGE: Node ID generation now uses UUID instead of incremental numbers
    PriNova committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    eb18d1d View commit details
    Browse the repository at this point in the history

Commits on Nov 5, 2024

  1. feat(workflow): add Input node type and streamline node validation

    - Introduce new Input node type for direct text input in workflows
    - Refactor CLI node validation to be more flexible
    - Update workflow executor to handle Input node processing
    - Add UI components for Input node in sidebar and property editor
    - Streamline Preview node implementation
    PriNova committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    2931d67 View commit details
    Browse the repository at this point in the history
  2. docs(workflow): add comprehensive JSDoc documentation to workflow module

    - Add detailed JSDoc comments to key functions in workflow-executor.ts
    - Document workflow saving/loading functions in workflow-io.ts
    - Add function documentation in workflow.ts and Nodes.tsx
    - Improve code organization in Flow.tsx
    - Rename WorkflowTab.story.tsx to ToolboxTab.story.tsx
    
    This change improves code maintainability by providing clear function descriptions and usage instructions across the workflow module.
    PriNova committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    ec849e4 View commit details
    Browse the repository at this point in the history
  3. refactor(workflow): enhance node types and UI components

    - Rename 'input' node type to 'text-format' for clarity
    - Add consistent border color system for different node states
    - Implement shadcn/ui Textarea component
    - Improve node creation behavior for Preview and Input types
    - Enhance visual feedback for node states (error, executing, selected)
    PriNova committed Nov 5, 2024
    Configuration menu
    Copy the full SHA
    e76567f View commit details
    Browse the repository at this point in the history

Commits on Nov 6, 2024

  1. feat(workflow): add resizable sidebar with drag handle

    - Implement sidebar resizing functionality with min/max width constraints
    - Add mouse event handlers for smooth resize experience
    - Refactor topologicalEdgeSort placement for better code organization
    - Introduce createEdge helper function for improved edge creation
    - Update WorkflowSidebar to support dynamic width
    - Enhance type safety and styling consistency
    PriNova committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    b064d1e View commit details
    Browse the repository at this point in the history
  2. style(ui): enhance workflow editor visual hierarchy

    - Add consistent borders and VS Code theme-aware styling
    - Improve sidebar layout with accordion-based property editor
    - Refine resizer appearance and interaction states
    PriNova committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    9e4d34b View commit details
    Browse the repository at this point in the history
  3. feat(workflow): implement node cloning and add clear workflow functio…

    …nality
    
    - Add shift-drag node cloning capability for duplicating workflow nodes
    - Introduce clear workflow button to reset entire workflow state
    - Adjust node positioning calculation for better initial placement
    - Restructure WorkflowSidebar component to accommodate new controls
    
    The node cloning feature improves workflow building efficiency while clear
    functionality helps with workflow management.
    PriNova committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    ae1af5e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3f48a88 View commit details
    Browse the repository at this point in the history
  5. feat(workflow): implement positional inputs for workflow nodes

    - Add support for indexed inputs (${1}, ${2}, etc.) in node configurations
    - Modify parent output handling to preserve input ordering
    - Update UI placeholders to reflect new input syntax
    - Enhance CLI, LLM, preview and text-format nodes to handle multiple inputs
    
    This change allows workflow nodes to reference specific parent outputs by position,
    enabling more precise and flexible workflow configurations.
    PriNova committed Nov 6, 2024
    Configuration menu
    Copy the full SHA
    ddb785e View commit details
    Browse the repository at this point in the history