improvement(schema): centralize derivation of block schemas#3175
improvement(schema): centralize derivation of block schemas#3175icecrasher321 merged 11 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryThis PR centralizes block output/path/type derivation by introducing Key integration points:
Issues to address before merge mainly relate to option consistency (triggerMode vs preferToolOutputs) and payload/test shape mismatches that can cause consumers to see missing/incorrect outputs or inconsistent metadata. Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as UI (TagDropdown/OutputSelect)
participant Store as SubBlockStore/WorkflowStore
participant BO as block-outputs.ts
participant Reg as BlockRegistry/ToolsRegistry
participant Exec as Executor (BlockResolver)
UI->>Store: read block.type + subBlocks
UI->>BO: getEffectiveBlockOutputPaths/Type(type, subBlocks, opts)
BO->>Reg: getBlock(type)
alt preferToolOutputs && !triggerMode
BO->>Reg: blockConfig.tools.config.tool(params)
BO->>Reg: getTool(toolId).outputs
BO-->>UI: tool-derived outputs/paths/types
else triggerMode && triggers.enabled
BO->>Reg: getTrigger(triggerId).outputs
BO-->>UI: trigger-derived outputs
else
BO-->>UI: blockConfig.outputs + inputFormat applied
end
Exec->>BO: getEffectiveBlockOutputs(type, paramsToSubBlocks(config.params), includeHidden)
BO-->>Exec: output schema for validation
Exec-->>Exec: resolveBlockReference() validates path against schema
|
Additional Comments (1)
|
...onents/panel/components/editor/components/sub-block/components/tag-dropdown/tag-dropdown.tsx
Show resolved
Hide resolved
|
@cursor review |
|
@cursor review |
…-derivation Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # apps/sim/lib/copilot/tools/client/workflow/block-output-utils.ts
|
@cursor review |
|
@cursor review |
|
@greptile |
apps/sim/lib/copilot/tools/server/workflow/edit-workflow/builders.test.ts
Show resolved
Hide resolved
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-block-output-fields.ts
Show resolved
Hide resolved
Additional Comments (1)
In |
|
@cursor review |
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Summary
Derive the block/tool outputs the same way throughout codebase -- based on actual block registry. Previously, resolver takes it from block outputs [from state rather than registry]
Type of Change
Testing
Tested manually
Checklist