shotgun-sh 0.1.0.dev27__py3-none-any.whl → 0.1.0.dev29__py3-none-any.whl
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.
Potentially problematic release.
This version of shotgun-sh might be problematic. Click here for more details.
- shotgun/agents/agent_manager.py +3 -0
- shotgun/agents/tools/web_search/anthropic.py +4 -7
- shotgun/logging_config.py +21 -0
- shotgun/main.py +9 -0
- shotgun/posthog_telemetry.py +4 -2
- shotgun/prompts/agents/tasks.j2 +45 -7
- shotgun/sentry_telemetry.py +4 -2
- shotgun/telemetry.py +3 -2
- shotgun/tui/screens/chat.py +2 -0
- {shotgun_sh-0.1.0.dev27.dist-info → shotgun_sh-0.1.0.dev29.dist-info}/METADATA +1 -1
- {shotgun_sh-0.1.0.dev27.dist-info → shotgun_sh-0.1.0.dev29.dist-info}/RECORD +14 -14
- {shotgun_sh-0.1.0.dev27.dist-info → shotgun_sh-0.1.0.dev29.dist-info}/WHEEL +0 -0
- {shotgun_sh-0.1.0.dev27.dist-info → shotgun_sh-0.1.0.dev29.dist-info}/entry_points.txt +0 -0
- {shotgun_sh-0.1.0.dev27.dist-info → shotgun_sh-0.1.0.dev29.dist-info}/licenses/LICENSE +0 -0
shotgun/agents/agent_manager.py
CHANGED
|
@@ -270,6 +270,9 @@ class AgentManager(Widget):
|
|
|
270
270
|
if deps is None:
|
|
271
271
|
raise ValueError("AgentDeps must be provided")
|
|
272
272
|
|
|
273
|
+
# Clear file tracker before each run to track only this run's operations
|
|
274
|
+
deps.file_tracker.clear()
|
|
275
|
+
|
|
273
276
|
if prompt:
|
|
274
277
|
self.ui_message_history.append(ModelRequest.user_text_prompt(prompt))
|
|
275
278
|
self._post_messages_updated()
|
|
@@ -90,16 +90,13 @@ def anthropic_web_search_tool(query: str) -> str:
|
|
|
90
90
|
|
|
91
91
|
def main() -> None:
|
|
92
92
|
"""Main function for testing the Anthropic web search tool."""
|
|
93
|
-
import logging
|
|
94
93
|
import os
|
|
95
94
|
import sys
|
|
96
95
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
stream=sys.stdout,
|
|
102
|
-
)
|
|
96
|
+
from shotgun.logging_config import setup_logger
|
|
97
|
+
|
|
98
|
+
# Use project's logging configuration instead of basicConfig
|
|
99
|
+
setup_logger(__name__)
|
|
103
100
|
|
|
104
101
|
if len(sys.argv) < 2:
|
|
105
102
|
print(
|
shotgun/logging_config.py
CHANGED
|
@@ -158,6 +158,27 @@ def setup_logger(
|
|
|
158
158
|
return logger
|
|
159
159
|
|
|
160
160
|
|
|
161
|
+
def get_early_logger(name: str) -> logging.Logger:
|
|
162
|
+
"""Get a logger with NullHandler for early initialization.
|
|
163
|
+
|
|
164
|
+
Use this for loggers created at module import time, before
|
|
165
|
+
configure_root_logger() is called. The NullHandler prevents
|
|
166
|
+
Python from automatically adding a StreamHandler when WARNING
|
|
167
|
+
or ERROR messages are logged.
|
|
168
|
+
|
|
169
|
+
Args:
|
|
170
|
+
name: Logger name (typically __name__)
|
|
171
|
+
|
|
172
|
+
Returns:
|
|
173
|
+
Logger with NullHandler attached
|
|
174
|
+
"""
|
|
175
|
+
logger = logging.getLogger(name)
|
|
176
|
+
# Only add NullHandler if no handlers exist
|
|
177
|
+
if not logger.handlers:
|
|
178
|
+
logger.addHandler(logging.NullHandler())
|
|
179
|
+
return logger
|
|
180
|
+
|
|
181
|
+
|
|
161
182
|
def get_logger(name: str) -> logging.Logger:
|
|
162
183
|
"""Get a logger instance with default configuration.
|
|
163
184
|
|
shotgun/main.py
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
"""Main CLI application for shotgun."""
|
|
2
2
|
|
|
3
|
+
import logging
|
|
4
|
+
|
|
5
|
+
# CRITICAL: Add NullHandler to root logger before ANY other imports.
|
|
6
|
+
# This prevents Python from automatically adding a StreamHandler when
|
|
7
|
+
# WARNING/ERROR messages are logged by modules during import.
|
|
8
|
+
# DO NOT MOVE THIS BELOW OTHER IMPORTS.
|
|
9
|
+
logging.getLogger().addHandler(logging.NullHandler())
|
|
10
|
+
|
|
11
|
+
# ruff: noqa: E402 (module import not at top - intentionally after NullHandler setup)
|
|
3
12
|
from typing import Annotated
|
|
4
13
|
|
|
5
14
|
import typer
|
shotgun/posthog_telemetry.py
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"""PostHog analytics setup for Shotgun."""
|
|
2
2
|
|
|
3
|
-
import logging
|
|
4
3
|
import os
|
|
5
4
|
from typing import Any
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
from shotgun.logging_config import get_early_logger
|
|
7
|
+
|
|
8
|
+
# Use early logger to prevent automatic StreamHandler creation
|
|
9
|
+
logger = get_early_logger(__name__)
|
|
8
10
|
|
|
9
11
|
# Global PostHog client instance
|
|
10
12
|
_posthog_client = None
|
shotgun/prompts/agents/tasks.j2
CHANGED
|
@@ -19,14 +19,22 @@ Your job is to help create and manage actionable tasks for software projects and
|
|
|
19
19
|
|
|
20
20
|
**CRITICAL**: Your output will be consumed by AI coding agents (Claude Code, Cursor, Windsurf, etc.)
|
|
21
21
|
- These agents already know how to code - don't teach programming concepts
|
|
22
|
+
- Each task MUST have a checkbox `[ ]` for tracking completion
|
|
22
23
|
- Each task should be a specific file modification or creation
|
|
23
|
-
- Format:
|
|
24
|
+
- Format each task as: `- [ ] In [file path], [add/modify/delete] [specific code/feature]`
|
|
24
25
|
- Include acceptance criteria as executable commands (npm test, curl endpoints)
|
|
25
26
|
- Reference specific line numbers or function names when modifying existing code
|
|
26
27
|
- Break complex features into atomic, single-file tasks when possible
|
|
27
28
|
- Include validation steps that can be automated
|
|
28
29
|
- Every task should be immediately executable by an AI agent without interpretation
|
|
29
30
|
|
|
31
|
+
Example task format:
|
|
32
|
+
```markdown
|
|
33
|
+
- [ ] In src/api/auth.py, add JWT token validation to authenticate() function
|
|
34
|
+
- [ ] In tests/test_auth.py, add unit tests for JWT validation (must achieve 80% coverage)
|
|
35
|
+
- [ ] In docs/API.md, update authentication section with JWT token requirements
|
|
36
|
+
```
|
|
37
|
+
|
|
30
38
|
## TASK MANAGEMENT WORKFLOW
|
|
31
39
|
|
|
32
40
|
For task management:
|
|
@@ -36,16 +44,45 @@ For task management:
|
|
|
36
44
|
4. **Create structured tasks**: Use `write_file("tasks.md", content)` to save organized tasks
|
|
37
45
|
5. **Build incrementally**: Update and refine tasks based on new information
|
|
38
46
|
|
|
47
|
+
## TASK FORMAT
|
|
48
|
+
|
|
49
|
+
**CRITICAL**: All tasks MUST use checkbox format for tracking completion:
|
|
50
|
+
- Use `[ ]` for incomplete tasks
|
|
51
|
+
- Use `[X]` for completed tasks
|
|
52
|
+
- Include instructions at the top of tasks.md explaining how to mark tasks complete
|
|
53
|
+
|
|
39
54
|
## TASK FILE STRUCTURE
|
|
40
55
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
56
|
+
Start tasks.md with these instructions:
|
|
57
|
+
```markdown
|
|
58
|
+
# Task Management
|
|
59
|
+
|
|
60
|
+
## Instructions
|
|
61
|
+
- Mark tasks as complete by replacing `[ ]` with `[X]`
|
|
62
|
+
- Tasks without an `[X]` are not finished yet
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Then organize tasks into logical sections:
|
|
66
|
+
```markdown
|
|
67
|
+
## Backlog
|
|
68
|
+
- [ ] Task description with clear action
|
|
69
|
+
- [ ] Another specific task to complete
|
|
70
|
+
|
|
71
|
+
## In Progress
|
|
72
|
+
- [ ] Currently working on this task
|
|
73
|
+
- [ ] Task being actively developed
|
|
74
|
+
|
|
75
|
+
## Done
|
|
76
|
+
- [X] Completed task for reference
|
|
77
|
+
- [X] Another finished task
|
|
78
|
+
|
|
79
|
+
## Blocked
|
|
80
|
+
- [ ] Task waiting on dependency (blocked by: reason)
|
|
81
|
+
```
|
|
46
82
|
|
|
47
83
|
## TASK CREATION PRINCIPLES
|
|
48
84
|
|
|
85
|
+
- **ALWAYS use checkbox format `[ ]` for every task**
|
|
49
86
|
- Base tasks on available research findings and plan requirements
|
|
50
87
|
- Create specific, actionable tasks with clear acceptance criteria
|
|
51
88
|
- Include effort estimates and priority levels when possible
|
|
@@ -55,7 +92,8 @@ Organize tasks into logical sections in tasks.md:
|
|
|
55
92
|
- Include both development and testing/validation tasks
|
|
56
93
|
- Break down complex work into manageable chunks
|
|
57
94
|
- Keep tasks.md as the single source of truth
|
|
58
|
-
-
|
|
95
|
+
- Group related tasks under clear section headings
|
|
96
|
+
- Mark completed tasks with `[X]` when updating the file
|
|
59
97
|
|
|
60
98
|
{% if interactive_mode %}
|
|
61
99
|
USER INTERACTION - ASK CLARIFYING QUESTIONS:
|
shotgun/sentry_telemetry.py
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"""Sentry observability setup for Shotgun."""
|
|
2
2
|
|
|
3
|
-
import logging
|
|
4
3
|
import os
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
from shotgun.logging_config import get_early_logger
|
|
6
|
+
|
|
7
|
+
# Use early logger to prevent automatic StreamHandler creation
|
|
8
|
+
logger = get_early_logger(__name__)
|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
def setup_sentry_observability() -> bool:
|
shotgun/telemetry.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"""Observability setup for Logfire."""
|
|
2
2
|
|
|
3
|
-
import logging
|
|
4
3
|
import os
|
|
5
4
|
|
|
5
|
+
from shotgun.logging_config import get_early_logger
|
|
6
6
|
from shotgun.utils.env_utils import is_falsy, is_truthy
|
|
7
7
|
|
|
8
|
-
logger
|
|
8
|
+
# Use early logger to prevent automatic StreamHandler creation
|
|
9
|
+
logger = get_early_logger(__name__)
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
def setup_logfire_observability() -> bool:
|
shotgun/tui/screens/chat.py
CHANGED
|
@@ -760,6 +760,7 @@ def codebase_indexed_hint(codebase_name: str) -> str:
|
|
|
760
760
|
|
|
761
761
|
def help_text_with_codebase() -> str:
|
|
762
762
|
return (
|
|
763
|
+
"Howdy! Welcome to Shotgun - the context tool for software engineering. \n\nYou can research, build specs, plan, create tasks, and export context to your favorite code-gen agents.\n\n"
|
|
763
764
|
"I can help with:\n\n"
|
|
764
765
|
"- Speccing out a new feature\n"
|
|
765
766
|
"- Onboarding you onto this project\n"
|
|
@@ -770,6 +771,7 @@ def help_text_with_codebase() -> str:
|
|
|
770
771
|
|
|
771
772
|
def help_text_empty_dir() -> str:
|
|
772
773
|
return (
|
|
774
|
+
"Howdy! Welcome to Shotgun - the context tool for software engineering.\n\nYou can research, build specs, plan, create tasks, and export context to your favorite code-gen agents.\n\n"
|
|
773
775
|
"What would you like to build? Here are some examples:\n\n"
|
|
774
776
|
"- Research FastAPI vs Django\n"
|
|
775
777
|
"- Plan my new web app using React\n"
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
shotgun/__init__.py,sha256=P40K0fnIsb7SKcQrFnXZ4aREjpWchVDhvM1HxI4cyIQ,104
|
|
2
2
|
shotgun/build_constants.py,sha256=RXNxMz46HaB5jucgMVpw8a2yCJqjbhTOh0PddyEVMN8,713
|
|
3
|
-
shotgun/logging_config.py,sha256=
|
|
4
|
-
shotgun/main.py,sha256=
|
|
5
|
-
shotgun/posthog_telemetry.py,sha256=
|
|
3
|
+
shotgun/logging_config.py,sha256=UKenihvgH8OA3W0b8ZFcItYaFJVe9MlsMYlcevyW1HY,7440
|
|
4
|
+
shotgun/main.py,sha256=5WEtPs5kwD1tdeWCnM-jIAwarcwQNc4dhaqdPKCyxug,5510
|
|
5
|
+
shotgun/posthog_telemetry.py,sha256=usfaJ8VyqckLIbLgoj2yhuNyDh0VWA5EJPRr7a0dyVs,5054
|
|
6
6
|
shotgun/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
shotgun/sentry_telemetry.py,sha256=
|
|
8
|
-
shotgun/telemetry.py,sha256=
|
|
7
|
+
shotgun/sentry_telemetry.py,sha256=0W0o810ewFpIcdPsi_q4uKLiaP6zDYRRE5MHpIbQIPo,2954
|
|
8
|
+
shotgun/telemetry.py,sha256=Ves6Ih3hshpKVNVAUUmwRdtW8NkTjFPg8hEqvFKZ0t0,3208
|
|
9
9
|
shotgun/agents/__init__.py,sha256=8Jzv1YsDuLyNPFJyckSr_qI4ehTVeDyIMDW4omsfPGc,25
|
|
10
|
-
shotgun/agents/agent_manager.py,sha256=
|
|
10
|
+
shotgun/agents/agent_manager.py,sha256=zfGlZGb7A6ZRvTtHaJa9_mFnL_myc52wNbkdVS8Bfxk,22465
|
|
11
11
|
shotgun/agents/common.py,sha256=vt7ECq1rT6GR5Rt63t0whH0R0cydrk7Mty2KyPL8mEg,19045
|
|
12
12
|
shotgun/agents/conversation_history.py,sha256=5J8_1yxdZiiWTq22aDio88DkBDZ4_Lh_p5Iy5_ENszc,3898
|
|
13
13
|
shotgun/agents/conversation_manager.py,sha256=fxAvXbEl3Cl2ugJ4N9aWXaqZtkrnfj3QzwjWC4LFXwI,3514
|
|
@@ -43,7 +43,7 @@ shotgun/agents/tools/codebase/models.py,sha256=8eR3_8DQiBNgB2twu0aC_evIJbugN9KW3
|
|
|
43
43
|
shotgun/agents/tools/codebase/query_graph.py,sha256=vOeyN4-OZj-vpTSk3Z9W5TjraZAepJ-Qjk_zzvum3fU,2115
|
|
44
44
|
shotgun/agents/tools/codebase/retrieve_code.py,sha256=2VjiqVKJMd9rPV-mGrL4C-N8fqGjYLW6ZInFGbcTxOM,2878
|
|
45
45
|
shotgun/agents/tools/web_search/__init__.py,sha256=Sj1tVokrCsJiLRWWTq0zrAolMHEGntRIYnqiyFi8L2E,1840
|
|
46
|
-
shotgun/agents/tools/web_search/anthropic.py,sha256=
|
|
46
|
+
shotgun/agents/tools/web_search/anthropic.py,sha256=NDhj8MrdxLsmGwHp7uM0IQeJVW2poY58GCUTJEM9dew,4827
|
|
47
47
|
shotgun/agents/tools/web_search/gemini.py,sha256=hXjWUF-aTX3B9ViaKe5aF2aHXlaoBA5am40cgilinGE,2981
|
|
48
48
|
shotgun/agents/tools/web_search/openai.py,sha256=V8GeqwUAi5wrbRuU41Y38schpXRdyeIfw85-CT5rAhY,3415
|
|
49
49
|
shotgun/agents/tools/web_search/utils.py,sha256=GLJ5QV9bT2ubFMuFN7caMN7tK9OTJ0R3GD57B-tCMF0,532
|
|
@@ -78,7 +78,7 @@ shotgun/prompts/agents/export.j2,sha256=GKpOfGbZA9PVa4TNtMORUYiBIAcN6JCo8URmTCWK
|
|
|
78
78
|
shotgun/prompts/agents/plan.j2,sha256=MyZDyOS21V-zrHNzbIhIdzcESGh_3KVbA4qh9rZR2_E,6086
|
|
79
79
|
shotgun/prompts/agents/research.j2,sha256=JBtjXaMVDRuNTt7-Ai8gUb2InfolfqCkQoEkn9PsQZk,3929
|
|
80
80
|
shotgun/prompts/agents/specify.j2,sha256=AP7XrA3KE7GZsCvW4guASxZHBM2mnrMw3irdZ3RUOBs,2808
|
|
81
|
-
shotgun/prompts/agents/tasks.j2,sha256=
|
|
81
|
+
shotgun/prompts/agents/tasks.j2,sha256=9gGCimCWVvpaQSxkAjt7WmIxFHXJY2FlmqhqomFxQTA,5949
|
|
82
82
|
shotgun/prompts/agents/partials/codebase_understanding.j2,sha256=7WH-PVd-TRBFQUdOdKkwwn9hAUaJznFZMAGHhO7IGGU,5633
|
|
83
83
|
shotgun/prompts/agents/partials/common_agent_system_prompt.j2,sha256=eFuc3z1pSJzQtPJfjMIDNHv5XX9lP6YVrmKcbbskJj8,1877
|
|
84
84
|
shotgun/prompts/agents/partials/content_formatting.j2,sha256=MG0JB7SSp8YV5akDWpbs2f9DcdREIYqLp38NnoWLeQ0,1854
|
|
@@ -108,7 +108,7 @@ shotgun/tui/components/prompt_input.py,sha256=Ss-htqraHZAPaehGE4x86ij0veMjc4Ugad
|
|
|
108
108
|
shotgun/tui/components/spinner.py,sha256=ovTDeaJ6FD6chZx_Aepia6R3UkPOVJ77EKHfRmn39MY,2427
|
|
109
109
|
shotgun/tui/components/splash.py,sha256=vppy9vEIEvywuUKRXn2y11HwXSRkQZHLYoVjhDVdJeU,1267
|
|
110
110
|
shotgun/tui/components/vertical_tail.py,sha256=kkCH0WjAh54jDvRzIaOffRZXUKn_zHFZ_ichfUpgzaE,1071
|
|
111
|
-
shotgun/tui/screens/chat.py,sha256=
|
|
111
|
+
shotgun/tui/screens/chat.py,sha256=c9g457FR8JUr_ArTi1bbweC_chYlXastUvCa9XGfDYQ,28075
|
|
112
112
|
shotgun/tui/screens/chat.tcss,sha256=2Yq3E23jxsySYsgZf4G1AYrYVcpX0UDW6kNNI0tDmtM,437
|
|
113
113
|
shotgun/tui/screens/directory_setup.py,sha256=lIZ1J4A6g5Q2ZBX8epW7BhR96Dmdcg22CyiM5S-I5WU,3237
|
|
114
114
|
shotgun/tui/screens/provider_config.py,sha256=A_tvDHF5KLP5PV60LjMJ_aoOdT3TjI6_g04UIUqGPqM,7126
|
|
@@ -123,8 +123,8 @@ shotgun/utils/__init__.py,sha256=WinIEp9oL2iMrWaDkXz2QX4nYVPAm8C9aBSKTeEwLtE,198
|
|
|
123
123
|
shotgun/utils/env_utils.py,sha256=8QK5aw_f_V2AVTleQQlcL0RnD4sPJWXlDG46fsHu0d8,1057
|
|
124
124
|
shotgun/utils/file_system_utils.py,sha256=l-0p1bEHF34OU19MahnRFdClHufThfGAjQ431teAIp0,1004
|
|
125
125
|
shotgun/utils/update_checker.py,sha256=Xf-7w3Pos3etzCoT771gJe2HLkA8_V2GrqWy7ni9UqA,11373
|
|
126
|
-
shotgun_sh-0.1.0.
|
|
127
|
-
shotgun_sh-0.1.0.
|
|
128
|
-
shotgun_sh-0.1.0.
|
|
129
|
-
shotgun_sh-0.1.0.
|
|
130
|
-
shotgun_sh-0.1.0.
|
|
126
|
+
shotgun_sh-0.1.0.dev29.dist-info/METADATA,sha256=XLRPwFmfmINfF-iyE1j77l3J2XQ42BJvAIx7d-nz6-k,11197
|
|
127
|
+
shotgun_sh-0.1.0.dev29.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
128
|
+
shotgun_sh-0.1.0.dev29.dist-info/entry_points.txt,sha256=asZxLU4QILneq0MWW10saVCZc4VWhZfb0wFZvERnzfA,45
|
|
129
|
+
shotgun_sh-0.1.0.dev29.dist-info/licenses/LICENSE,sha256=YebsZl590zCHrF_acCU5pmNt0pnAfD2DmAnevJPB1tY,1065
|
|
130
|
+
shotgun_sh-0.1.0.dev29.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|