-
Notifications
You must be signed in to change notification settings - Fork 3k
feat(copilot): add tools to access block outputs and upstream references #2546
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR adds two new copilot tools that enable the AI assistant to introspect workflow structure and block relationships. The Key Changes:
Issues Found:
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Copilot
participant GetBlockOutputsTool
participant GetUpstreamRefsTool
participant WorkflowRegistry
participant WorkflowStore
participant SubBlockStore
participant VariablesStore
participant BlockPathCalculator
Note over Copilot,BlockPathCalculator: Get Block Outputs Flow
Copilot->>GetBlockOutputsTool: execute(blockIds?)
GetBlockOutputsTool->>WorkflowRegistry: getState()
WorkflowRegistry-->>GetBlockOutputsTool: activeWorkflowId
GetBlockOutputsTool->>WorkflowStore: getState()
WorkflowStore-->>GetBlockOutputsTool: blocks, loops, parallels
GetBlockOutputsTool->>SubBlockStore: getWorkflowSubBlockValues(workflowId)
SubBlockStore-->>GetBlockOutputsTool: subBlockValues
loop For each block
GetBlockOutputsTool->>GetBlockOutputsTool: computeBlockOutputPaths(block, ctx)
GetBlockOutputsTool->>GetBlockOutputsTool: formatOutputsWithPrefix(paths, blockName)
end
GetBlockOutputsTool->>VariablesStore: getWorkflowVariables(workflowId)
VariablesStore-->>GetBlockOutputsTool: variables
GetBlockOutputsTool-->>Copilot: {blocks: [...], variables: [...]}
Note over Copilot,BlockPathCalculator: Get Upstream References Flow
Copilot->>GetUpstreamRefsTool: execute(blockIds)
GetUpstreamRefsTool->>WorkflowRegistry: getState()
WorkflowRegistry-->>GetUpstreamRefsTool: activeWorkflowId
GetUpstreamRefsTool->>WorkflowStore: getState()
WorkflowStore-->>GetUpstreamRefsTool: blocks, edges, loops, parallels
GetUpstreamRefsTool->>SubBlockStore: getWorkflowSubBlockValues(workflowId)
SubBlockStore-->>GetUpstreamRefsTool: subBlockValues
loop For each blockId
GetUpstreamRefsTool->>BlockPathCalculator: findAllPathNodes(edges, blockId)
BlockPathCalculator-->>GetUpstreamRefsTool: ancestorIds
GetUpstreamRefsTool->>GetUpstreamRefsTool: determine containing loops/parallels
GetUpstreamRefsTool->>GetUpstreamRefsTool: build accessibleBlocks with outputs
end
GetUpstreamRefsTool->>VariablesStore: getWorkflowVariables(workflowId)
VariablesStore-->>GetUpstreamRefsTool: variables
GetUpstreamRefsTool-->>Copilot: {results: [{blockId, accessibleBlocks, variables}]}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 files reviewed, 1 comment
…ces (#2546) * Add copilot references tools * Minor fixes * Omit vars field in block outputs when id is provided
Summary
Add tools to access block outputs and upstream references
Type of Change
Testing
Manual
Checklist