code-review-ai-cli 1.0.2__tar.gz → 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/PKG-INFO +26 -1
  2. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/README.md +26 -1
  3. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/code_review_ai_cli.egg-info/PKG-INFO +26 -1
  4. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/code_review_ai_cli.egg-info/SOURCES.txt +3 -1
  5. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/pyproject.toml +1 -1
  6. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/src/ai_review.py +691 -32
  7. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/src/config.py +141 -3
  8. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/src/formatter.py +2 -2
  9. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/src/llm_client.py +514 -48
  10. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/src/prompts/config.yaml.template +81 -2
  11. code_review_ai_cli-1.1.0/src/tfs_client.py +1725 -0
  12. code_review_ai_cli-1.1.0/src/usage_tracker.py +364 -0
  13. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/tests/test_ai_review.py +306 -6
  14. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/tests/test_config.py +76 -1
  15. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/tests/test_llm_client.py +88 -3
  16. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/tests/test_tfs_client.py +313 -1
  17. code_review_ai_cli-1.1.0/tests/test_usage_tracker.py +186 -0
  18. code_review_ai_cli-1.0.2/src/tfs_client.py +0 -751
  19. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/code_review_ai_cli.egg-info/dependency_links.txt +0 -0
  20. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/code_review_ai_cli.egg-info/entry_points.txt +0 -0
  21. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/code_review_ai_cli.egg-info/requires.txt +0 -0
  22. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/code_review_ai_cli.egg-info/top_level.txt +0 -0
  23. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/setup.cfg +0 -0
  24. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/src/__init__.py +0 -0
  25. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/src/git_utils.py +0 -0
  26. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/src/prompts/review_prompt.md.template +0 -0
  27. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/tests/test_formatter.py +0 -0
  28. {code_review_ai_cli-1.0.2 → code_review_ai_cli-1.1.0}/tests/test_git_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-review-ai-cli
3
- Version: 1.0.2
3
+ Version: 1.1.0
4
4
  Summary: Automated AI-powered code review CLI for Azure DevOps / TFS Pull Requests
5
5
  License: MIT
6
6
  Keywords: code-review,ai,azure-devops,tfs,pull-request,llm
@@ -47,7 +47,9 @@ Automated code review tool with Pull Request integration for Azure DevOps/TFS an
47
47
  - **Dry-run Mode** — Validate reviews before posting
48
48
  - **Multiple LLM Providers** — OpenAI, Azure OpenAI, Gemini, Claude, Ollama, GitHub Copilot, AWS Bedrock
49
49
  - **Smart Filtering** — Filter by file extensions, limit diff size
50
+ - **Project-aware PR Context** — Sends repository and linked work item context while restricting findings to modified PR lines
50
51
  - **Customizable Prompts** — Markdown-based review guidelines
52
+ - **Usage Tracking** — Store per-PR token usage and optional cost estimates
51
53
  - **Interactive CLI** — Menu-driven selection and confirmation
52
54
 
53
55
  ## Installation & Quick Start
@@ -100,6 +102,9 @@ ai-review pr-review 42
100
102
 
101
103
  # Dry-run (preview without posting)
102
104
  ai-review pr-review 42 --dry-run
105
+
106
+ # Check stored token/cost usage
107
+ ai-review usage
103
108
  ```
104
109
 
105
110
  ## Configuration File
@@ -122,10 +127,30 @@ tfs:
122
127
  review:
123
128
  language: pt
124
129
  verbosity: detailed # or: quick, security
130
+ scope: diff_with_context # diff_with_context, diff_only, full_code
125
131
  file_extensions_filter: [".cs", ".ts", ".py"]
126
132
  max_diff_files: 50
133
+ project_context:
134
+ enabled: true
135
+ mode: on_demand # on_demand, full
136
+ manifest_max_chars: 60000
137
+ retrieval_max_rounds: 2
138
+ retrieval_max_files: 20
139
+ retrieval_max_chars: 120000
140
+ retrieval_file_max_chars: 30000
141
+ work_item_context:
142
+ enabled: true
143
+ max_items: 20
127
144
  ```
128
145
 
146
+ By default, repository context is loaded on demand: the prompt includes the PR
147
+ diff, full changed-file contents, linked work item documentation, and a
148
+ repository manifest, then the model requests any extra files it needs. Set
149
+ `review.project_context.mode: full` to send the full eligible repository
150
+ snapshot instead. Bedrock uses a default estimated prompt budget of 180000
151
+ tokens; override it with `llm.max_prompt_tokens` if your model supports more or
152
+ less.
153
+
129
154
  ## Development & Testing
130
155
 
131
156
  This is a standard Python project with the following structure:
@@ -10,7 +10,9 @@ Automated code review tool with Pull Request integration for Azure DevOps/TFS an
10
10
  - **Dry-run Mode** — Validate reviews before posting
11
11
  - **Multiple LLM Providers** — OpenAI, Azure OpenAI, Gemini, Claude, Ollama, GitHub Copilot, AWS Bedrock
12
12
  - **Smart Filtering** — Filter by file extensions, limit diff size
13
+ - **Project-aware PR Context** — Sends repository and linked work item context while restricting findings to modified PR lines
13
14
  - **Customizable Prompts** — Markdown-based review guidelines
15
+ - **Usage Tracking** — Store per-PR token usage and optional cost estimates
14
16
  - **Interactive CLI** — Menu-driven selection and confirmation
15
17
 
16
18
  ## Installation & Quick Start
@@ -63,6 +65,9 @@ ai-review pr-review 42
63
65
 
64
66
  # Dry-run (preview without posting)
65
67
  ai-review pr-review 42 --dry-run
68
+
69
+ # Check stored token/cost usage
70
+ ai-review usage
66
71
  ```
67
72
 
68
73
  ## Configuration File
@@ -85,10 +90,30 @@ tfs:
85
90
  review:
86
91
  language: pt
87
92
  verbosity: detailed # or: quick, security
93
+ scope: diff_with_context # diff_with_context, diff_only, full_code
88
94
  file_extensions_filter: [".cs", ".ts", ".py"]
89
95
  max_diff_files: 50
96
+ project_context:
97
+ enabled: true
98
+ mode: on_demand # on_demand, full
99
+ manifest_max_chars: 60000
100
+ retrieval_max_rounds: 2
101
+ retrieval_max_files: 20
102
+ retrieval_max_chars: 120000
103
+ retrieval_file_max_chars: 30000
104
+ work_item_context:
105
+ enabled: true
106
+ max_items: 20
90
107
  ```
91
108
 
109
+ By default, repository context is loaded on demand: the prompt includes the PR
110
+ diff, full changed-file contents, linked work item documentation, and a
111
+ repository manifest, then the model requests any extra files it needs. Set
112
+ `review.project_context.mode: full` to send the full eligible repository
113
+ snapshot instead. Bedrock uses a default estimated prompt budget of 180000
114
+ tokens; override it with `llm.max_prompt_tokens` if your model supports more or
115
+ less.
116
+
92
117
  ## Development & Testing
93
118
 
94
119
  This is a standard Python project with the following structure:
@@ -155,4 +180,4 @@ Predefined tasks for quick execution in VS Code:
155
180
  In VS Code:
156
181
  1. `Ctrl+Shift+P` → "Tasks: Run Task"
157
182
  2. Select the desired task
158
- 3. Fill in parameters if needed
183
+ 3. Fill in parameters if needed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-review-ai-cli
3
- Version: 1.0.2
3
+ Version: 1.1.0
4
4
  Summary: Automated AI-powered code review CLI for Azure DevOps / TFS Pull Requests
5
5
  License: MIT
6
6
  Keywords: code-review,ai,azure-devops,tfs,pull-request,llm
@@ -47,7 +47,9 @@ Automated code review tool with Pull Request integration for Azure DevOps/TFS an
47
47
  - **Dry-run Mode** — Validate reviews before posting
48
48
  - **Multiple LLM Providers** — OpenAI, Azure OpenAI, Gemini, Claude, Ollama, GitHub Copilot, AWS Bedrock
49
49
  - **Smart Filtering** — Filter by file extensions, limit diff size
50
+ - **Project-aware PR Context** — Sends repository and linked work item context while restricting findings to modified PR lines
50
51
  - **Customizable Prompts** — Markdown-based review guidelines
52
+ - **Usage Tracking** — Store per-PR token usage and optional cost estimates
51
53
  - **Interactive CLI** — Menu-driven selection and confirmation
52
54
 
53
55
  ## Installation & Quick Start
@@ -100,6 +102,9 @@ ai-review pr-review 42
100
102
 
101
103
  # Dry-run (preview without posting)
102
104
  ai-review pr-review 42 --dry-run
105
+
106
+ # Check stored token/cost usage
107
+ ai-review usage
103
108
  ```
104
109
 
105
110
  ## Configuration File
@@ -122,10 +127,30 @@ tfs:
122
127
  review:
123
128
  language: pt
124
129
  verbosity: detailed # or: quick, security
130
+ scope: diff_with_context # diff_with_context, diff_only, full_code
125
131
  file_extensions_filter: [".cs", ".ts", ".py"]
126
132
  max_diff_files: 50
133
+ project_context:
134
+ enabled: true
135
+ mode: on_demand # on_demand, full
136
+ manifest_max_chars: 60000
137
+ retrieval_max_rounds: 2
138
+ retrieval_max_files: 20
139
+ retrieval_max_chars: 120000
140
+ retrieval_file_max_chars: 30000
141
+ work_item_context:
142
+ enabled: true
143
+ max_items: 20
127
144
  ```
128
145
 
146
+ By default, repository context is loaded on demand: the prompt includes the PR
147
+ diff, full changed-file contents, linked work item documentation, and a
148
+ repository manifest, then the model requests any extra files it needs. Set
149
+ `review.project_context.mode: full` to send the full eligible repository
150
+ snapshot instead. Bedrock uses a default estimated prompt budget of 180000
151
+ tokens; override it with `llm.max_prompt_tokens` if your model supports more or
152
+ less.
153
+
129
154
  ## Development & Testing
130
155
 
131
156
  This is a standard Python project with the following structure:
@@ -13,6 +13,7 @@ src/formatter.py
13
13
  src/git_utils.py
14
14
  src/llm_client.py
15
15
  src/tfs_client.py
16
+ src/usage_tracker.py
16
17
  src/prompts/config.yaml.template
17
18
  src/prompts/review_prompt.md.template
18
19
  tests/test_ai_review.py
@@ -20,4 +21,5 @@ tests/test_config.py
20
21
  tests/test_formatter.py
21
22
  tests/test_git_utils.py
22
23
  tests/test_llm_client.py
23
- tests/test_tfs_client.py
24
+ tests/test_tfs_client.py
25
+ tests/test_usage_tracker.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "code-review-ai-cli"
7
- version = "1.0.2"
7
+ version = "1.1.0"
8
8
  description = "Automated AI-powered code review CLI for Azure DevOps / TFS Pull Requests"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"