improvement(copilot): add subblock enums to block metadata#870
improvement(copilot): add subblock enums to block metadata#870
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
There was a problem hiding this comment.
Greptile Summary
This PR enhances the copilot's understanding of block configurations by adding comprehensive subblock metadata extraction. The change introduces a new processSubBlocks function that extracts detailed UI configuration properties from block subBlocks, including dropdowns, sliders, inputs, and other UI elements. A helper function resolveSubBlockOptions safely handles both static arrays and function-based options configurations.
The implementation adds extensive property mapping to capture UI element details like labels, descriptions, options, default values, and conditional visibility settings. Special hardcoded metadata is included for 'loop' and 'parallel' blocks since these core workflow control blocks aren't in the standard registry but are essential for the copilot to understand.
The main metadata extraction flow is enhanced to include additional block properties (longDescription, category, bgColor, hideFromToolbar) and integrates the new subblock processing. This provides the copilot AI assistant with complete visibility into block UI structure, enabling it to better assist users with workflow configuration by understanding all available block capabilities and their configuration options.
Confidence score: 4/5
- This PR is safe to merge with minimal production risk as it primarily adds metadata extraction without changing core functionality
- Score reflects comprehensive implementation with proper error handling, though the large amount of hardcoded metadata introduces some maintenance overhead
- Pay close attention to the hardcoded SPECIAL_BLOCKS_METADATA section for accuracy and completeness
1 file reviewed, 1 comment
apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts
Outdated
Show resolved
Hide resolved
…data.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Add subblock enums to metadata * Update apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…ing and styling (#872) * fix(copilot-ui): added user scrolling, fixed code block, fixed code copying and styling * use console logger instead of console * fix(copilot): make chat history non-interfering (#869) * Add basic personalizatoin * Make chat history non-interfering * Always personalize * improvement(copilot): add subblock enums to block metadata (#870) * Add subblock enums to metadata * Update apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix(copilot): fix state message sent on move to background (#871) * Initial fix * Add execution start time to message * Lint * autofocus on new tab open --------- Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Add subblock enums to metadata * Update apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…ing and styling (#872) * fix(copilot-ui): added user scrolling, fixed code block, fixed code copying and styling * use console logger instead of console * fix(copilot): make chat history non-interfering (#869) * Add basic personalizatoin * Make chat history non-interfering * Always personalize * improvement(copilot): add subblock enums to block metadata (#870) * Add subblock enums to metadata * Update apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix(copilot): fix state message sent on move to background (#871) * Initial fix * Add execution start time to message * Lint * autofocus on new tab open --------- Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
* Add subblock enums to metadata * Update apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…ing and styling (#872) * fix(copilot-ui): added user scrolling, fixed code block, fixed code copying and styling * use console logger instead of console * fix(copilot): make chat history non-interfering (#869) * Add basic personalizatoin * Make chat history non-interfering * Always personalize * improvement(copilot): add subblock enums to block metadata (#870) * Add subblock enums to metadata * Update apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix(copilot): fix state message sent on move to background (#871) * Initial fix * Add execution start time to message * Lint * autofocus on new tab open --------- Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…ai#870) * Add subblock enums to metadata * Update apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…ing and styling (simstudioai#872) * fix(copilot-ui): added user scrolling, fixed code block, fixed code copying and styling * use console logger instead of console * fix(copilot): make chat history non-interfering (simstudioai#869) * Add basic personalizatoin * Make chat history non-interfering * Always personalize * improvement(copilot): add subblock enums to block metadata (simstudioai#870) * Add subblock enums to metadata * Update apps/sim/lib/copilot/tools/server-tools/blocks/get-blocks-metadata.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * fix(copilot): fix state message sent on move to background (simstudioai#871) * Initial fix * Add execution start time to message * Lint * autofocus on new tab open --------- Co-authored-by: Siddharth Ganesan <33737564+Sg312@users.noreply.github.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Summary
Adds subblock enums to give the copilot more context for each block
Type of Change
Testing
Manual testing
Checklist