feat(flow): add support for new CrewAI Flow decorators (#40)#64
Open
cassiocouto wants to merge 1 commit intoTrusera:mainfrom
Open
feat(flow): add support for new CrewAI Flow decorators (#40)#64cassiocouto wants to merge 1 commit intoTrusera:mainfrom
cassiocouto wants to merge 1 commit intoTrusera:mainfrom
Conversation
b538637 to
c64719c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Issue #40 — adds detection for CrewAI Flow decorators and class inheritance.
@start,@listen,@routertoCREWAI_FLOW_PATTERNS(config.py) and CrewAIusage_patterns(llm_patterns.py)_detect_flow_classesmethod in the AST scanner that detectsclass MyFlow(Flow)with alias-resilient matching (handlesFlow as BaseFlow,crewai.flow.Flow, etc.)_detect_decoratorsto extract@listen(...)/@router(...)arguments into metadata (listens_to,routes_from), supporting name refs, attribute refs (self.begin), string literals, and multiple argumentsUsageType.orchestrationinstead of genericUsageType.agentfor better reportingsample_crew_flow.pyfixture and comprehensiveTestCrewAIFlowDecoratorsclass covering decorator detection, class inheritance (direct, aliased, attribute chain), relationship edge cases, and a full integration testFiles Changed
src/ai_bom/config.py@start,@listen,@routertoCREWAI_FLOW_PATTERNSsrc/ai_bom/detectors/llm_patterns.pysrc/ai_bom/scanners/ast_scanner.py_detect_flow_classes,_collect_flow_aliases,_extract_decorator_refs; enhanced_detect_decoratorstests/fixtures/sample_crew_flow.pytests/test_detection_enhanced.pyTest plan
tests/test_detection_enhanced.py)Closes #40