shotgun-sh 0.1.0.dev13__py3-none-any.whl → 0.1.0.dev15__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.

Files changed (40) hide show
  1. shotgun/agents/agent_manager.py +30 -6
  2. shotgun/agents/artifact_state.py +58 -0
  3. shotgun/agents/common.py +48 -14
  4. shotgun/agents/config/models.py +61 -0
  5. shotgun/agents/history/compaction.py +85 -0
  6. shotgun/agents/history/constants.py +19 -0
  7. shotgun/agents/history/context_extraction.py +108 -0
  8. shotgun/agents/history/history_building.py +104 -0
  9. shotgun/agents/history/history_processors.py +354 -157
  10. shotgun/agents/history/message_utils.py +46 -0
  11. shotgun/agents/history/token_counting.py +429 -0
  12. shotgun/agents/history/token_estimation.py +138 -0
  13. shotgun/agents/models.py +145 -1
  14. shotgun/agents/tools/artifact_management.py +56 -24
  15. shotgun/agents/tools/file_management.py +30 -11
  16. shotgun/agents/tools/web_search/anthropic.py +78 -17
  17. shotgun/agents/tools/web_search/gemini.py +1 -1
  18. shotgun/agents/tools/web_search/openai.py +16 -2
  19. shotgun/artifacts/manager.py +2 -1
  20. shotgun/artifacts/models.py +6 -4
  21. shotgun/codebase/core/nl_query.py +4 -4
  22. shotgun/prompts/agents/partials/artifact_system.j2 +4 -1
  23. shotgun/prompts/agents/partials/codebase_understanding.j2 +1 -2
  24. shotgun/prompts/agents/plan.j2 +9 -7
  25. shotgun/prompts/agents/research.j2 +7 -5
  26. shotgun/prompts/agents/specify.j2 +8 -7
  27. shotgun/prompts/agents/state/artifact_templates_available.j2 +18 -0
  28. shotgun/prompts/agents/state/codebase/codebase_graphs_available.j2 +3 -1
  29. shotgun/prompts/agents/state/existing_artifacts_available.j2 +23 -0
  30. shotgun/prompts/agents/state/system_state.j2 +9 -1
  31. shotgun/prompts/history/incremental_summarization.j2 +53 -0
  32. shotgun/sdk/services.py +14 -0
  33. shotgun/tui/app.py +1 -1
  34. shotgun/tui/screens/chat.py +42 -3
  35. shotgun/utils/file_system_utils.py +6 -1
  36. {shotgun_sh-0.1.0.dev13.dist-info → shotgun_sh-0.1.0.dev15.dist-info}/METADATA +2 -1
  37. {shotgun_sh-0.1.0.dev13.dist-info → shotgun_sh-0.1.0.dev15.dist-info}/RECORD +40 -29
  38. {shotgun_sh-0.1.0.dev13.dist-info → shotgun_sh-0.1.0.dev15.dist-info}/WHEEL +0 -0
  39. {shotgun_sh-0.1.0.dev13.dist-info → shotgun_sh-0.1.0.dev15.dist-info}/entry_points.txt +0 -0
  40. {shotgun_sh-0.1.0.dev13.dist-info → shotgun_sh-0.1.0.dev15.dist-info}/licenses/LICENSE +0 -0
@@ -8,6 +8,8 @@ from typing import Any
8
8
 
9
9
  from pydantic import BaseModel, Field, field_validator, model_validator
10
10
 
11
+ from shotgun.utils.file_system_utils import get_shotgun_base_path
12
+
11
13
 
12
14
  class AgentMode(str, Enum):
13
15
  """Supported agent modes for artifacts."""
@@ -181,7 +183,7 @@ class Artifact(BaseModel):
181
183
  def has_template(self, base_path: Path | None = None) -> bool:
182
184
  """Check if this artifact was created from a template."""
183
185
  if base_path is None:
184
- base_path = Path.cwd() / ".shotgun"
186
+ base_path = get_shotgun_base_path()
185
187
  elif isinstance(base_path, str):
186
188
  base_path = Path(base_path)
187
189
 
@@ -212,7 +214,7 @@ class Artifact(BaseModel):
212
214
  import yaml
213
215
 
214
216
  if base_path is None:
215
- base_path = Path.cwd() / ".shotgun"
217
+ base_path = get_shotgun_base_path()
216
218
  elif isinstance(base_path, str):
217
219
  base_path = Path(base_path)
218
220
 
@@ -248,7 +250,7 @@ class Artifact(BaseModel):
248
250
  Creation timestamp based on artifact directory creation time.
249
251
  """
250
252
  if base_path is None:
251
- base_path = Path.cwd() / ".shotgun"
253
+ base_path = get_shotgun_base_path()
252
254
  elif isinstance(base_path, str):
253
255
  base_path = Path(base_path)
254
256
 
@@ -267,7 +269,7 @@ class Artifact(BaseModel):
267
269
  Last modified timestamp based on most recently modified file in artifact directory.
268
270
  """
269
271
  if base_path is None:
270
- base_path = Path.cwd() / ".shotgun"
272
+ base_path = get_shotgun_base_path()
271
273
  elif isinstance(base_path, str):
272
274
  base_path = Path(base_path)
273
275
 
@@ -4,7 +4,6 @@ import time
4
4
  from datetime import datetime
5
5
  from typing import TYPE_CHECKING
6
6
 
7
- from pydantic_ai.direct import model_request
8
7
  from pydantic_ai.messages import (
9
8
  ModelRequest,
10
9
  SystemPromptPart,
@@ -13,6 +12,7 @@ from pydantic_ai.messages import (
13
12
  )
14
13
 
15
14
  from shotgun.agents.config import get_provider_model
15
+ from shotgun.agents.config.models import shotgun_model_request
16
16
  from shotgun.logging_config import get_logger
17
17
  from shotgun.prompts import PromptLoader
18
18
 
@@ -35,9 +35,9 @@ async def llm_cypher_prompt(system_prompt: str, user_prompt: str) -> str:
35
35
  The generated Cypher query as a string
36
36
  """
37
37
  model_config = get_provider_model()
38
- # Use the Model instance directly (has API key baked in)
39
- query_cypher_response = await model_request(
40
- model=model_config.model_instance,
38
+ # Use shotgun wrapper to maximize response quality for codebase queries
39
+ query_cypher_response = await shotgun_model_request(
40
+ model_config=model_config,
41
41
  messages=[
42
42
  ModelRequest(
43
43
  parts=[
@@ -25,8 +25,11 @@ You have access to a structured artifact system for organizing your work. Use ar
25
25
 
26
26
  Use artifact templates to help you create new artifacts.
27
27
 
28
+ MOST IMPORTANT: WHEN YOU CREATE AN ARTIFACT FROM A TEMPLATE, ALWAYS RESPECT AND FOLLOW THE "INSTRUCTIONS" AND "PROMPT" CONTAINED IN THE TEMPLATE TO THE LETTER.
29
+
28
30
  Use `list_artifact_templates(agent_mode)` to see what templates are available.
29
31
 
30
32
  Use `create_artifact(artifact_id, agent_mode, name, template_id)` to create a new artifact with a template.
31
33
 
32
- Template ID example: "research/market_research"
34
+ Template ID example: "research/market_research"
35
+
@@ -1,4 +1,3 @@
1
- {% if codebase_understanding_graphs -%}
2
1
  **Graph Tools Available**:
3
2
  - `query_graph` - Query this graph using natural language
4
3
  - `retrieve_code` - Get source code by qualified name (e.g., "module.Class.method")
@@ -76,4 +75,4 @@ If the task you received is about codebase management, follow the codebase manag
76
75
  - If "entity not found", try alternative names or explore the file system
77
76
  - If "graph not found", verify the exact graph name with `list_graphs()`
78
77
  - Report errors clearly and try alternative approaches
79
- {% endif %}
78
+
@@ -8,14 +8,16 @@ Your job is to help create comprehensive, actionable plans for software projects
8
8
 
9
9
  For planning tasks:
10
10
  1. **Check existing work**: Use `list_artifacts("plan")` to see what plans already exist and create a new one if needed
11
- IF NO SUITABLE ARTIFACT EXISTS:
12
- 2. **Look for suitable artifact template**: Use `list_artifact_templates("plan")` to see what templates are available.
13
- 3. **Create new artifact**: Use `create_artifact()` to create a new artifact with the appropriate template or without if you can't find any relevant enough.
14
11
  2. **Review specifications**: Use `list_artifacts("specify")` and read relevant specifications artifacts
15
- 3. **Consider research**: Use `list_artifacts("research")` and read relevant research artifacts (but specifications drive the plan)
16
- 4. **Analyze context**: Understand the current situation and user's goals
17
- 5. **Create structured plans**: Use `write_artifact_section()` to organize planning output
18
- 6. **Build iteratively**: Update and refine plans based on new information
12
+ 3. **Consider research**: Use `list_artifacts("research")` and read relevant research artifacts (but specifications drive the plan)
13
+ IF NO SUITABLE ARTIFACT EXISTS:
14
+ 4. **Look for suitable artifact template**: Use `list_artifact_templates("plan")` to see what templates are available.
15
+ 5. **Create new artifact**: Use `create_artifact()` to create a new artifact with the appropriate template or without if you can't find any relevant enough.
16
+ 6. **Review specifications**: Use `list_artifacts("specify")` and read relevant specifications artifacts
17
+ 7. **Consider research**: Use `list_artifacts("research")` and read relevant research artifacts (but specifications drive the plan)
18
+ 8. **Analyze context**: Understand the current situation and user's goals
19
+ 9. **Create structured plans**: Use `write_artifact_section()` to organize planning output
20
+ 10. **Build iteratively**: Update and refine plans based on new information
19
21
 
20
22
  Use meaningful artifact IDs like: "mvp-roadmap", "migration-strategy", "product-launch"
21
23
 
@@ -7,15 +7,16 @@ Your job is to help the user research various subjects related to their software
7
7
  ## RESEARCH WORKFLOW
8
8
 
9
9
  For research tasks:
10
- 1. **Check existing work**: Use `list_artifacts("research")` to see what research already exists.
11
- IF NO SUITABLE ARTIFACT EXISTS:
10
+ 1. **Check existing work**: ALWAYS first use `list_artifacts("research")` to see what research already exists and read it if it exists and is relevant, not to repeat the work that was already done.
11
+ IF NO SUITABLE ARTIFACT ALREADY EXISTS:
12
12
  2. **Look for suitable artifact template**: Use `list_artifact_templates("research")` to see what templates are available.
13
13
  3. **Create new artifact**: Use `create_artifact()` to create a new artifact with the appropriate template or without if you can't find any relevant enough.
14
14
  4. **Analyze previous work**: Use `read_artifact()` to understand what has been done
15
15
  5. **Identify gaps**: Determine what additional research is needed
16
- 6. **Search strategically**: Use web search to fill knowledge gaps (max 3 searches per session)
17
- 7. **Synthesize findings**: Combine existing and new information
18
- 8. **Create structured artifacts**: Use `write_artifact_section()` to organize findings
16
+ 6. DO NOT ASSUME YOU KNOW THE ANSWER TO THE QUERY. ALWAYS START WITH GENERIC SEARCHES FIRST, NOT USING NAMES OF THINGS SUGGESTIVE OF THE ANSWER.
17
+ 7. **Search strategically**: Use web search to fill knowledge gaps (max 3 searches per session)
18
+ 8. **Synthesize findings**: Combine existing and new information
19
+ 9. **Create structured artifacts**: Use `write_artifact_section()` to organize findings
19
20
 
20
21
  Use meaningful artifact IDs like: "api-design-patterns", "microservices-study", "database-comparison"
21
22
 
@@ -31,6 +32,7 @@ Use meaningful artifact IDs like: "api-design-patterns", "microservices-study",
31
32
  - Critical Analysis - Evaluate trade-offs, limitations, and real-world applicability
32
33
  - Actionable Insights - Provide concrete recommendations and next steps when you're done
33
34
  - Comprehensive Citations - Include detailed source citations for verification
35
+ - AVOID combining multiple topics into single search query. In fact, try similar queries across different providers/tools.
34
36
 
35
37
  ## Response Standards
36
38
  Your responses should always be:
@@ -9,14 +9,15 @@ Transform requirements into detailed, actionable specifications that development
9
9
  ## SPECIFICATION WORKFLOW
10
10
 
11
11
  For specification tasks:
12
- 1. **Check existing work**: Use `list_artifacts("specify")` to see what specifications already exist.
12
+ 1. **Check existing work**: Use `list_artifacts("specify")` to see what specifications already exist
13
+ 2. **Review research**: Use `list_artifacts("research")` to see what research already exists.
13
14
  IF NO SUITABLE ARTIFACT EXISTS:
14
- 2. **Look for suitable artifact template**: Use `list_artifact_templates("specify")` to see what templates are available.
15
- 3. **Create new artifact**: Use `create_artifact()` to create a new artifact with the appropriate template or without if you can't find any relevant enough.
16
- 4. **Analyze requirements**: Understand the functional and non-functional requirements
17
- 5. **Review existing artifacts**: Check research outputs if any with list_artifacts("research")
18
- 6. **Define specifications**: Create detailed technical and functional specifications
19
- 7. **Structure documentation**: Use `write_artifact_section()` to organize specifications
15
+ 3. **Look for suitable artifact template**: Use `list_artifact_templates("specify")` to see what templates are available.
16
+ 4. **Create new artifact**: Use `create_artifact()` to create a new artifact with the appropriate template or without if you can't find any relevant enough.
17
+ 5. **Analyze requirements**: Understand the functional and non-functional requirements
18
+ 6. **Review existing artifacts**: Check research outputs if any with list_artifacts("research")
19
+ 7. **Define specifications**: Create detailed technical and functional specifications
20
+ 8. **Structure documentation**: Use `write_artifact_section()` to organize specifications
20
21
 
21
22
  Use meaningful artifact IDs like: "user-auth-spec", "api-gateway-spec", "data-model-spec"
22
23
 
@@ -0,0 +1,18 @@
1
+ {% if available_templates %}
2
+
3
+ ## Available Artifact Templates
4
+
5
+ You have access to these pre-built templates for creating structured artifacts:
6
+
7
+ {% for mode, templates in available_templates.items() %}
8
+ ### {{ mode.title() }} Templates
9
+ {% for template in templates %}
10
+ - **{{ template.name }}** (`{{ template.template_id }}`)
11
+ Purpose: {{ template.purpose[:150] }}{% if template.purpose|length > 150 %}...{% endif %}
12
+ {% endfor %}
13
+
14
+ {% endfor %}
15
+ Use `list_artifact_templates("mode")` to get detailed template information for a specific mode, or `list_artifact_templates()` for all templates.
16
+ Use `create_artifact(artifact_id, agent_mode, name, template_id)` to create a new artifact with any of these templates.
17
+
18
+ {% endif %}
@@ -1,9 +1,11 @@
1
+ ## Codebase Graphs Available
2
+
1
3
  {% if codebase_understanding_graphs -%}
2
4
 
3
5
  You have access to the following codebase graphs:
4
6
 
5
7
  {% for graph in codebase_understanding_graphs -%}
6
- - {{ graph.name }} ID: {{ graph.graph_id }}
8
+ - {{ graph.name }} ID: {{ graph.graph_id }} Path: {{ graph.repo_path }}
7
9
  {% endfor -%}
8
10
 
9
11
  {% else -%}
@@ -0,0 +1,23 @@
1
+ {% if existing_artifacts %}
2
+
3
+ ## Existing Artifacts (All Modes)
4
+
5
+ Work already completed across all agent modes:
6
+
7
+ {% for mode, artifacts in existing_artifacts.items() %}
8
+ ### {{ mode.title() }} Artifacts
9
+ {% for artifact in artifacts %}
10
+ - **{{ artifact.artifact_id }}** ({{ artifact.section_count }} sections)
11
+ Updated: {{ artifact.updated_at.strftime('%B %d, %Y') }}
12
+ {% endfor %}
13
+
14
+ {% endfor %}
15
+ Use `read_artifact(artifact_id)` to access full content, `list_artifacts()` for detailed view, or `list_artifacts("mode")` for specific mode.
16
+
17
+ {% else %}
18
+
19
+ ## Existing Artifacts
20
+
21
+ No artifacts have been created yet. Use `create_artifact()` with available templates to start new work.
22
+
23
+ {% endif %}
@@ -1 +1,9 @@
1
- {% include 'agents/state/codebase/codebase_graphs_available.j2' %}
1
+ {% if current_date %}
2
+ ## System Status
3
+
4
+ Today's date: {{ current_date }}
5
+
6
+ {% endif %}
7
+ {% include 'agents/state/codebase/codebase_graphs_available.j2' %}
8
+ {% include 'agents/state/existing_artifacts_available.j2' %}
9
+ {% include 'agents/state/artifact_templates_available.j2' %}
@@ -0,0 +1,53 @@
1
+ You are extending an existing conversation summary with new messages.
2
+
3
+ Your task is to merge the new information into the existing summary while maintaining the same structured format and preserving all important information.
4
+
5
+ <EXISTING_SUMMARY>
6
+ {{ existing_summary }}
7
+ </EXISTING_SUMMARY>
8
+
9
+ <NEW_MESSAGES>
10
+ {{ new_messages }}
11
+ </NEW_MESSAGES>
12
+
13
+ Instructions:
14
+ 1. Update the existing summary sections with new information from the NEW_MESSAGES
15
+ 2. Maintain the same structure and format as the existing summary
16
+ 3. Preserve all important information from both existing and new content
17
+ 4. Do not repeat information already covered in the existing summary unless it's been updated or expanded
18
+ 5. Focus on integrating new developments, decisions, or progress into the appropriate sections
19
+
20
+ <OUTPUT_FORMAT>
21
+ Provide the complete updated summary following the exact same format as the existing summary:
22
+
23
+ # Context
24
+
25
+ Updated summary of the discussion, incorporating new topics or tasks. Present it as clear bullet points. Be brief but do not lose information that might be important for the current state, task or objectives.
26
+
27
+ # Key elements, learnings and entities
28
+
29
+ Present the updated important elements of context, learnings and entities from the entire discussion. Be very detailed.
30
+
31
+ Present it as clear bullet points. Be brief but do not lose information that might be important for the current state, task or objectives.
32
+
33
+ If new tool results were obtained, preserve them verbatim if short, summarize if long focusing on preserving all important facts.
34
+
35
+ If new user messages exist, preserve them verbatim if short to medium length, summarize if long focusing on preserving all important facts.
36
+
37
+ If there are any new links, IDs, filenames, etc. - preserve them verbatim.
38
+
39
+ # Timeline
40
+
41
+ Update the timeline with new important tasks and content:
42
+ - User: asked to handle a complex task X: <summary of the task>
43
+ - Assistant: we handle it by doing A, B, C...
44
+ - Tools used and output summary
45
+
46
+ [Include any new timeline entries from the new messages]
47
+
48
+ # Current status, task and objectives
49
+
50
+ Based on the complete conversation including new messages, update the current status, task and objectives.
51
+
52
+ CRITICAL: This section should reflect the most current state based on all messages including the new ones. This is not about summarizing but about the status, task and objectives currently active in the conversation to keep as much context as possible.
53
+ </OUTPUT_FORMAT>
shotgun/sdk/services.py CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  from pathlib import Path
4
4
 
5
+ from shotgun.artifacts.service import ArtifactService
5
6
  from shotgun.codebase.service import CodebaseService
6
7
  from shotgun.utils import get_shotgun_home
7
8
 
@@ -21,3 +22,16 @@ def get_codebase_service(storage_dir: Path | str | None = None) -> CodebaseServi
21
22
  elif isinstance(storage_dir, str):
22
23
  storage_dir = Path(storage_dir)
23
24
  return CodebaseService(storage_dir)
25
+
26
+
27
+ def get_artifact_service(base_path: Path | None = None) -> ArtifactService:
28
+ """Get ArtifactService instance with configurable base path.
29
+
30
+ Args:
31
+ base_path: Optional base path for artifacts.
32
+ Defaults to .shotgun in current directory.
33
+
34
+ Returns:
35
+ Configured ArtifactService instance
36
+ """
37
+ return ArtifactService(base_path)
shotgun/tui/app.py CHANGED
@@ -2,9 +2,9 @@ from textual.app import App
2
2
  from textual.binding import Binding
3
3
 
4
4
  from shotgun.agents.config import ConfigManager, get_config_manager
5
- from shotgun.agents.tools.file_management import get_shotgun_base_path
6
5
  from shotgun.logging_config import get_logger
7
6
  from shotgun.tui.screens.splash import SplashScreen
7
+ from shotgun.utils.file_system_utils import get_shotgun_base_path
8
8
  from shotgun.utils.update_checker import check_for_updates_async
9
9
 
10
10
  from .screens.chat import ChatScreen
@@ -23,8 +23,13 @@ from textual.widgets import Markdown
23
23
 
24
24
  from shotgun.agents.agent_manager import AgentManager, AgentType, MessageHistoryUpdated
25
25
  from shotgun.agents.config import get_provider_model
26
- from shotgun.agents.models import AgentDeps, UserAnswer, UserQuestion
27
- from shotgun.sdk.services import get_codebase_service
26
+ from shotgun.agents.models import (
27
+ AgentDeps,
28
+ FileOperationTracker,
29
+ UserAnswer,
30
+ UserQuestion,
31
+ )
32
+ from shotgun.sdk.services import get_artifact_service, get_codebase_service
28
33
 
29
34
  from ..components.prompt_input import PromptInput
30
35
  from ..components.spinner import Spinner
@@ -315,13 +320,15 @@ class ChatScreen(Screen[None]):
315
320
 
316
321
  def __init__(self) -> None:
317
322
  super().__init__()
318
- # Get the model configuration and codebase service
323
+ # Get the model configuration and services
319
324
  model_config = get_provider_model()
320
325
  codebase_service = get_codebase_service()
326
+ artifact_service = get_artifact_service()
321
327
  self.deps = AgentDeps(
322
328
  interactive_mode=True,
323
329
  llm_model=model_config,
324
330
  codebase_service=codebase_service,
331
+ artifact_service=artifact_service,
325
332
  system_prompt_fn=_dummy_system_prompt_fn,
326
333
  )
327
334
  self.agent_manager = AgentManager(deps=self.deps, initial_type=self.mode)
@@ -410,6 +417,38 @@ class ChatScreen(Screen[None]):
410
417
  """Handle message history updates from the agent manager."""
411
418
  self.messages = event.messages
412
419
 
420
+ # If there are file operations, add a message showing the modified files
421
+ if event.file_operations:
422
+ chat_history = self.query_one(ChatHistory)
423
+ if chat_history.vertical_tail:
424
+ tracker = FileOperationTracker(operations=event.file_operations)
425
+ display_path = tracker.get_display_path()
426
+
427
+ if display_path:
428
+ # Create a simple markdown message with the file path
429
+ # The terminal emulator will make this clickable automatically
430
+ from pathlib import Path
431
+
432
+ path_obj = Path(display_path)
433
+
434
+ if len(event.file_operations) == 1:
435
+ message = f"📝 Modified: `{display_path}`"
436
+ else:
437
+ num_files = len({op.file_path for op in event.file_operations})
438
+ if path_obj.is_dir():
439
+ message = (
440
+ f"📁 Modified {num_files} files in: `{display_path}`"
441
+ )
442
+ else:
443
+ # Common path is a file, show parent directory
444
+ message = (
445
+ f"📁 Modified {num_files} files in: `{path_obj.parent}`"
446
+ )
447
+
448
+ # Add this as a simple markdown widget
449
+ file_info_widget = Markdown(message)
450
+ chat_history.vertical_tail.mount(file_info_widget)
451
+
413
452
  @on(PromptInput.Submitted)
414
453
  async def handle_submit(self, message: PromptInput.Submitted) -> None:
415
454
  self.history.append(message.text)
@@ -4,6 +4,11 @@ import os
4
4
  from pathlib import Path
5
5
 
6
6
 
7
+ def get_shotgun_base_path() -> Path:
8
+ """Get the absolute path to the .shotgun directory."""
9
+ return Path.cwd() / ".shotgun"
10
+
11
+
7
12
  def get_shotgun_home() -> Path:
8
13
  """Get the Shotgun home directory path.
9
14
 
@@ -25,7 +30,7 @@ def ensure_shotgun_directory_exists() -> Path:
25
30
  Returns:
26
31
  Path: The path to the .shotgun directory.
27
32
  """
28
- shotgun_dir = Path.cwd() / ".shotgun"
33
+ shotgun_dir = get_shotgun_base_path()
29
34
  shotgun_dir.mkdir(exist_ok=True)
30
35
  # Note: Removed logger to avoid circular dependency with logging_config
31
36
  return shotgun_dir
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shotgun-sh
3
- Version: 0.1.0.dev13
3
+ Version: 0.1.0.dev15
4
4
  Summary: AI-powered research, planning, and task management CLI tool
5
5
  Project-URL: Homepage, https://shotgun.sh/
6
6
  Project-URL: Repository, https://github.com/shotgun-sh/shotgun
@@ -36,6 +36,7 @@ Requires-Dist: rich>=13.0.0
36
36
  Requires-Dist: sentry-sdk[pure-eval]>=2.0.0
37
37
  Requires-Dist: textual-dev>=1.7.0
38
38
  Requires-Dist: textual>=6.1.0
39
+ Requires-Dist: tiktoken>=0.7.0
39
40
  Requires-Dist: tree-sitter-go>=0.23.0
40
41
  Requires-Dist: tree-sitter-javascript>=0.23.0
41
42
  Requires-Dist: tree-sitter-python>=0.23.0
@@ -7,9 +7,10 @@ shotgun/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  shotgun/sentry_telemetry.py,sha256=3r9on0GQposn9aX6Dkb9mrfaVQl_dIZzhu9BjE838AU,2854
8
8
  shotgun/telemetry.py,sha256=aBwCRFU97oiIK5K13OhT7yYCQUAVQyrvnoG-aX3k2ZE,3109
9
9
  shotgun/agents/__init__.py,sha256=8Jzv1YsDuLyNPFJyckSr_qI4ehTVeDyIMDW4omsfPGc,25
10
- shotgun/agents/agent_manager.py,sha256=1Aof8btrV2Ei3V3bNn8bLzdBiBsJ-sjaQq0t7bnwbpo,6564
11
- shotgun/agents/common.py,sha256=_f9paljxInVDMevNCbHePrgd4G2b43-WHCvyTWFztvU,9949
12
- shotgun/agents/models.py,sha256=feF9oJ8C8takN10Nw7YvC4qcm5yIc_QMbLUmwf6cKqA,2684
10
+ shotgun/agents/agent_manager.py,sha256=5jSHlDHO4gZjry9z_9RBuf_Rh_7Uz2sYSyAbQ9s9Tdo,7362
11
+ shotgun/agents/artifact_state.py,sha256=WkspYQe-9CvBS90PapBsX997yvJ5KWH-qtSXIWmfvp0,2121
12
+ shotgun/agents/common.py,sha256=my-Y7VNNpDDYxDJ4hlRmTs7lIS8tBKFvR9ew7uKxcPE,11369
13
+ shotgun/agents/models.py,sha256=6edILmN7caDAmf8x-qgl7lA42tl2b-ZsiC3da8tS3Xw,7127
13
14
  shotgun/agents/plan.py,sha256=mn0S4r-uXWjerMTzfJLJo7n0pweNp_v8TI53wOxMdZ4,2984
14
15
  shotgun/agents/research.py,sha256=tee5gHT0d1Iupr5MI9ogNTh35xqh0j2N71rmb4dUtG0,3224
15
16
  shotgun/agents/specify.py,sha256=E9hYxTTVEOkpym-D-q74FI3L_mwllY6QOu8C3U6SEww,3088
@@ -17,13 +18,20 @@ shotgun/agents/tasks.py,sha256=ChPet4pw1cIJUWqBM05CKIKzEXOFAlAov9QqQOcPK-w,2935
17
18
  shotgun/agents/config/__init__.py,sha256=Fl8K_81zBpm-OfOW27M_WWLSFdaHHek6lWz95iDREjQ,318
18
19
  shotgun/agents/config/constants.py,sha256=c1k7LFvx29rzQCUXxyfr2PukwS5ol8rH8AXQaxALPVM,526
19
20
  shotgun/agents/config/manager.py,sha256=kwMbPjz0kEH_WCQAamESGjHdE8d_P-ztel4NL4FWNUw,10662
20
- shotgun/agents/config/models.py,sha256=AsstJiAJ1J0_7Lv3IuyKsJYQG_g2CHwwKJoWD3eCtgg,3678
21
+ shotgun/agents/config/models.py,sha256=CSA7bt22fYB1OJ17hngcoL2XyKD2QmZrRBtAc7fPoFE,6019
21
22
  shotgun/agents/config/provider.py,sha256=qvgHKpKrI2pC9Qb9ahojgaNAD1DqM6vPg9o6NPaX0-0,5949
22
23
  shotgun/agents/history/__init__.py,sha256=XFQj2a6fxDqVg0Q3juvN9RjV_RJbgvFZtQOCOjVJyp4,147
23
- shotgun/agents/history/history_processors.py,sha256=U0HiJM4zVLfwUnlZ6_2YoXNRteedMxwmr52KE4jky5w,7036
24
+ shotgun/agents/history/compaction.py,sha256=KY_ZvRvvlrB6eLPGqtlC6H8h4HPPOtuPcUkgQJUjK5I,2890
25
+ shotgun/agents/history/constants.py,sha256=yWY8rrTZarLA3flCCMB_hS2NMvUDRDTwP4D4j7MIh1w,446
26
+ shotgun/agents/history/context_extraction.py,sha256=yVka1U6TqNVsORR4JlxpWi9yBt3Quip8g_u3x2Vi9Gs,3564
27
+ shotgun/agents/history/history_building.py,sha256=6LFDZ60MTPDoGAcmu_mjlnjVYu8YYWdIi-cGbF3jm7A,3532
28
+ shotgun/agents/history/history_processors.py,sha256=beipmLkHxhQDxrtoCGGK86arOIzcu8aa1fFCvxa5v2o,15097
29
+ shotgun/agents/history/message_utils.py,sha256=S7wqix4W3uvC8rChs6TMxp7yjnjr8a2AqPxLIKnDyjI,1526
30
+ shotgun/agents/history/token_counting.py,sha256=RasWy84eNjbmqyQDTGAzj1Q1I9ml_G_9R-maWN7gr8s,13839
31
+ shotgun/agents/history/token_estimation.py,sha256=iNqhDSqFzG0YYxGijMRzj54GALFglOp0qVMB6G59RhU,4690
24
32
  shotgun/agents/tools/__init__.py,sha256=QaN80IqWvB5qEcjHqri1-PYvYlO74vdhcwLugoEdblo,772
25
- shotgun/agents/tools/artifact_management.py,sha256=tBZXn44oydkXzVv2yPFhymIRh-IXuee7bcfYjlA0yuI,15979
26
- shotgun/agents/tools/file_management.py,sha256=Hj37ErL_bpF3NoDAE-hIS_uZl04nxdgKEJ-xRtmWk_o,3983
33
+ shotgun/agents/tools/artifact_management.py,sha256=Oq5FMguiTQWsJXfoa-0VR-LmUeD8v9yH5p7cKzJOIZA,17240
34
+ shotgun/agents/tools/file_management.py,sha256=6ru6DXAl-S6DiCt2HLGTDrK2rJBJpn-t6RkSHzYbxc4,4571
27
35
  shotgun/agents/tools/user_interaction.py,sha256=7l0OY8EdgO-9gkKy-yOv0V0P_Uzzfk0jMU39d4XN1xM,1087
28
36
  shotgun/agents/tools/codebase/__init__.py,sha256=ceAGkK006NeOYaIJBLQsw7Q46sAyCRK9PYDs8feMQVw,661
29
37
  shotgun/agents/tools/codebase/codebase_shell.py,sha256=2zEq8YXzdcYttYAfKso_JGRqXHyy3xgAuWlf0unopFg,8635
@@ -33,14 +41,14 @@ shotgun/agents/tools/codebase/models.py,sha256=8eR3_8DQiBNgB2twu0aC_evIJbugN9KW3
33
41
  shotgun/agents/tools/codebase/query_graph.py,sha256=ffm8kTZap0KwPTtae5hvYLy_AQDjpDHUcx0ui9nX2OQ,2136
34
42
  shotgun/agents/tools/codebase/retrieve_code.py,sha256=yhWCiam6Dgs9Pyx0mVVzsC4KhQb2NmP5DEToOj3q1Vw,2899
35
43
  shotgun/agents/tools/web_search/__init__.py,sha256=Sj1tVokrCsJiLRWWTq0zrAolMHEGntRIYnqiyFi8L2E,1840
36
- shotgun/agents/tools/web_search/anthropic.py,sha256=v6R4z_c5L_YbBX3FPNWYUKXUBgFQwTxEgHvtGDlqlgk,3092
37
- shotgun/agents/tools/web_search/gemini.py,sha256=RB7AeGDBvjlsA2RLCI8ErxZh3gOPtA0rhxtW28NyOeE,3025
38
- shotgun/agents/tools/web_search/openai.py,sha256=ItpV3IquamYJ13ZNUHYjXrSsgOROD51jDd2mwnz0KCE,2972
44
+ shotgun/agents/tools/web_search/anthropic.py,sha256=IEcSujX5F7-b-87HZqcCHfp3C_E0WSSlb3Hvjq43KvE,4908
45
+ shotgun/agents/tools/web_search/gemini.py,sha256=hXjWUF-aTX3B9ViaKe5aF2aHXlaoBA5am40cgilinGE,2981
46
+ shotgun/agents/tools/web_search/openai.py,sha256=V8GeqwUAi5wrbRuU41Y38schpXRdyeIfw85-CT5rAhY,3415
39
47
  shotgun/agents/tools/web_search/utils.py,sha256=GLJ5QV9bT2ubFMuFN7caMN7tK9OTJ0R3GD57B-tCMF0,532
40
48
  shotgun/artifacts/__init__.py,sha256=FMgUfa1XzmLVMyYdTFWN1NpQDB9LfmJdnvhRvbVZaDA,494
41
49
  shotgun/artifacts/exceptions.py,sha256=iaGYlTw7iOqjyzunrSvZS8FZXtL_BZHJmKMkZKqRZoI,3074
42
- shotgun/artifacts/manager.py,sha256=il3CcrFqEBeAcgwgRJHoH-gnyJqQRKvd1MLXYVSBQM8,19467
43
- shotgun/artifacts/models.py,sha256=92ux8ONtinV8D4are7o9KsbRUwiorZsD_pbI8TUlaG0,12224
50
+ shotgun/artifacts/manager.py,sha256=DtL0P8SldF4Qb8lL8lg-WRdSvdK0DDJEIjVHxtzSh1E,19533
51
+ shotgun/artifacts/models.py,sha256=RjqLBKnymgXrT-FqvzgzDW7IHUO--L1ODuSQF6lXNew,12291
44
52
  shotgun/artifacts/service.py,sha256=EJR9F8UcGI9qjOzq_SzF7J0qHTrPBML3cYk9RA6bcMA,14546
45
53
  shotgun/artifacts/utils.py,sha256=UNz1hkPH2qaHJsS2KWMT0BUcSaDydIKmQPrVtNiLWHg,2176
46
54
  shotgun/artifacts/templates/__init__.py,sha256=X0qT2IofYOdotDMi7a7JGbgKOLCRWksHS7Pcz81vHRk,246
@@ -72,22 +80,24 @@ shotgun/codebase/core/code_retrieval.py,sha256=_JVyyQKHDFm3dxOOua1mw9eIIOHIVz3-I
72
80
  shotgun/codebase/core/ingestor.py,sha256=zMjadeqDOEr2v3vhTS25Jvx0WsLPXpgwquZfbdiz57o,59810
73
81
  shotgun/codebase/core/language_config.py,sha256=vsqHyuFnumRPRBV1lMOxWKNOIiClO6FyfKQR0fGrtl4,8934
74
82
  shotgun/codebase/core/manager.py,sha256=5GlJKykDGvnb6nTr9w3kyCPTL4OQgmBoesnWr28wvTg,55419
75
- shotgun/codebase/core/nl_query.py,sha256=ZQRVc9qBNEqPwdPIHmgePCKgBZrWzqos8Xd1dALRMYY,11377
83
+ shotgun/codebase/core/nl_query.py,sha256=iV6NbsyDd1SQpT9U9BtgxcZPsNoEW3OHrkk475r_jAY,11410
76
84
  shotgun/codebase/core/parser_loader.py,sha256=LZRrDS8Sp518jIu3tQW-BxdwJ86lnsTteI478ER9Td8,4278
77
85
  shotgun/prompts/__init__.py,sha256=RswUm0HMdfm2m2YKUwUsEdRIwoczdbI7zlucoEvHYRo,132
78
86
  shotgun/prompts/loader.py,sha256=jy24-E02pCSmz2651aCT2NgHfRrHAGMYvKrD6gs0Er8,4424
79
87
  shotgun/prompts/agents/__init__.py,sha256=YRIJMbzpArojNX1BP5gfxxois334z_GQga8T-xyWMbY,39
80
- shotgun/prompts/agents/plan.j2,sha256=sx3AT6NtZDNtogSVM41i6fus7aFDo97pg10SNjXrT0Y,2661
81
- shotgun/prompts/agents/research.j2,sha256=-l1vHibwCWBIzU6OShyHLl0JvzdJpyVjHqk5NU4fTyc,2621
82
- shotgun/prompts/agents/specify.j2,sha256=Ztf27HzlaNpCZb84HctEnzqxvl_J4IQIIj1ZltVEcGM,1825
88
+ shotgun/prompts/agents/plan.j2,sha256=N6nv3S2up4SPVuB3OZSj7vLqsLfNzynFVjvb9I7Jn3U,2899
89
+ shotgun/prompts/agents/research.j2,sha256=YQUlYQX2w4pD8mQ5vOAu7EVrbtZlbGDuwias950JEyc,2997
90
+ shotgun/prompts/agents/specify.j2,sha256=vBwMTEDUOCLSJl7J9_oVL5tTk5uFV4LJWlo5Tnw93Zw,1918
83
91
  shotgun/prompts/agents/tasks.j2,sha256=0gmbZe6J9IyORx8w66Z0cEYrs3TcXO1jSxM1DWd6Fdw,3614
84
- shotgun/prompts/agents/partials/artifact_system.j2,sha256=UHhwBSN51UFhP7iVFqvXqTbO7c7urIC0ZizDnHbSSy4,1515
85
- shotgun/prompts/agents/partials/codebase_understanding.j2,sha256=HpSCplcInmutlSEPTT4DSzpBCr0pcedv6pAqFp_bXXU,5102
92
+ shotgun/prompts/agents/partials/artifact_system.j2,sha256=AD1CvHDSZEmjplmDw443PeOmcXUgM5JdNLu1_mz18kM,1678
93
+ shotgun/prompts/agents/partials/codebase_understanding.j2,sha256=AQmN04VRzGmLbxKKthMK4hkJZ9mIU1NMKIpTDOHJrPM,5051
86
94
  shotgun/prompts/agents/partials/common_agent_system_prompt.j2,sha256=UgEHSudzfsCcKHp-Nt6tlsel8ap93z7yevbt0r9SSSg,1663
87
95
  shotgun/prompts/agents/partials/content_formatting.j2,sha256=MG0JB7SSp8YV5akDWpbs2f9DcdREIYqLp38NnoWLeQ0,1854
88
96
  shotgun/prompts/agents/partials/interactive_mode.j2,sha256=QYpG7Nyjmylpp0fLQhJQfY6QBV3ET6eigSTu4foIUys,671
89
- shotgun/prompts/agents/state/system_state.j2,sha256=jy9FAakhNt6Bf5Ds8Tbg_w8QOLw7kqfSk3tJNRI_zPo,66
90
- shotgun/prompts/agents/state/codebase/codebase_graphs_available.j2,sha256=7qtyNJ0D4YIVa-G6RLtK4HhccDhV8XIp6z8deW52JqQ,355
97
+ shotgun/prompts/agents/state/artifact_templates_available.j2,sha256=gs8k50_RTSfo_6DYj7MMXDm4mwXyr2yUnVQ8PQGGr5I,720
98
+ shotgun/prompts/agents/state/existing_artifacts_available.j2,sha256=Z5yobwaf7sfTt94LmQ1L9vZY5upGvQeOGCPMnFkdr08,686
99
+ shotgun/prompts/agents/state/system_state.j2,sha256=NFuBOo7cGy0tQrnDUs3wGO19oytGNHK2K8tgoG4cw1M,274
100
+ shotgun/prompts/agents/state/codebase/codebase_graphs_available.j2,sha256=IX9Xrg1d2uh_C4096shY_hpqhuu0RJLZpH0NbXEMSXI,413
91
101
  shotgun/prompts/codebase/__init__.py,sha256=NYuPMtmYM2ptuwf3YxVuotNlJOUq0hnjmwlzKcJkGK4,42
92
102
  shotgun/prompts/codebase/cypher_query_patterns.j2,sha256=4vIqiQ2JG9fQ4Xf0nSbUpZQtTNgQ1e0JhBRi2mSkGhc,8850
93
103
  shotgun/prompts/codebase/cypher_system.j2,sha256=kV-OJ8gM3vsBo8hW4mLSEHpJW-wV_2tNaPck3HUM52c,1497
@@ -96,6 +106,7 @@ shotgun/prompts/codebase/partials/cypher_rules.j2,sha256=vtc5OqTp-z5Rq_ti-_RG31b
96
106
  shotgun/prompts/codebase/partials/graph_schema.j2,sha256=hSzfxQ4C6Pfs6BIMeBekpMwfzQLUWmrLJkFVcYJFKMs,1832
97
107
  shotgun/prompts/codebase/partials/temporal_context.j2,sha256=yYHQHBQ4EeSs6TtKPm9fflGW3y6H0-yAANcTdsApkk4,1388
98
108
  shotgun/prompts/history/__init__.py,sha256=wbMLQ8yWmYz1sfXXigEAUlNkFcM50KdQv0kp4VU_P58,43
109
+ shotgun/prompts/history/incremental_summarization.j2,sha256=GmnNh0pWTjaEaI1sPwKNsGCys5fK8xrzWqalAs_LhJw,2447
99
110
  shotgun/prompts/history/summarization.j2,sha256=OYNVHg65zbuWB6_pXzTOs2T2k5qFD2gyfbmr6NP01rs,2268
100
111
  shotgun/sdk/__init__.py,sha256=ESV0WM9MigjXG30g9qVjcCMI40GQv-P-MSMGVuOisK4,380
101
112
  shotgun/sdk/artifact_models.py,sha256=5txP6KCCqwmGl9eBbJt5yyic9p1FeTk58ox8AZ_u6aw,5550
@@ -103,25 +114,25 @@ shotgun/sdk/artifacts.py,sha256=YbGPdDFd9ORt1vDWSbbPhGlSZ6MXLS6N0kcucxDDEc4,1481
103
114
  shotgun/sdk/codebase.py,sha256=T8QprL7_PKmAFNpo341NjHczJsd1lfptAR2ZQ-oNK3Q,6064
104
115
  shotgun/sdk/exceptions.py,sha256=qBcQv0v7ZTwP7CMcxZST4GqCsfOWtOUjSzGBo0-heqo,412
105
116
  shotgun/sdk/models.py,sha256=RsR9e2wiVrNGP2zTvjIZVvBlibgluuhDZlCNcw8JTTA,5488
106
- shotgun/sdk/services.py,sha256=J4PJFSxCQ6--u7rb3Ta-9eYtlYcxcbnzrMP6ThyCnw4,705
117
+ shotgun/sdk/services.py,sha256=WJi_AANWJZPdWdq9LntP5nlYgLxLlsFyXt28DGYNoJo,1132
107
118
  shotgun/tui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
- shotgun/tui/app.py,sha256=dZJCZLu646-raAuW3atEkrjcfpxM_Am2NWQOgmFDZP0,3386
119
+ shotgun/tui/app.py,sha256=kaRBsz2-09ij_peNopkAxhPPHBy7zsgR8V_5tAs8VRk,3381
109
120
  shotgun/tui/styles.tcss,sha256=ETyyw1bpMBOqTi5RLcAJUScdPWTvAWEqE9YcT0kVs_E,121
110
121
  shotgun/tui/components/prompt_input.py,sha256=Ss-htqraHZAPaehGE4x86ij0veMjc4UgadMXpbdXr40,2229
111
122
  shotgun/tui/components/spinner.py,sha256=ovTDeaJ6FD6chZx_Aepia6R3UkPOVJ77EKHfRmn39MY,2427
112
123
  shotgun/tui/components/splash.py,sha256=vppy9vEIEvywuUKRXn2y11HwXSRkQZHLYoVjhDVdJeU,1267
113
124
  shotgun/tui/components/vertical_tail.py,sha256=kkCH0WjAh54jDvRzIaOffRZXUKn_zHFZ_ichfUpgzaE,1071
114
- shotgun/tui/screens/chat.py,sha256=X8-r2MOosyJgY71D4aGC00vKhS3Rtc521PSVOhtt0Yg,15509
125
+ shotgun/tui/screens/chat.py,sha256=Fh-D0l3OV0w_Zdeo0DOiEbDYCSpDOUSRmcEpAabc_Rs,17201
115
126
  shotgun/tui/screens/chat.tcss,sha256=MV7-HhXSpBxIsSbB57RugNeM0wOpqMpIVke7qCf4-yQ,312
116
127
  shotgun/tui/screens/directory_setup.py,sha256=lIZ1J4A6g5Q2ZBX8epW7BhR96Dmdcg22CyiM5S-I5WU,3237
117
128
  shotgun/tui/screens/provider_config.py,sha256=A_tvDHF5KLP5PV60LjMJ_aoOdT3TjI6_g04UIUqGPqM,7126
118
129
  shotgun/tui/screens/splash.py,sha256=E2MsJihi3c9NY1L28o_MstDxGwrCnnV7zdq00MrGAsw,706
119
130
  shotgun/utils/__init__.py,sha256=WinIEp9oL2iMrWaDkXz2QX4nYVPAm8C9aBSKTeEwLtE,198
120
131
  shotgun/utils/env_utils.py,sha256=8QK5aw_f_V2AVTleQQlcL0RnD4sPJWXlDG46fsHu0d8,1057
121
- shotgun/utils/file_system_utils.py,sha256=KQCxgkspb1CR8VE1n66q7-oT6O7MmV_edCXFEEO-CNY,871
132
+ shotgun/utils/file_system_utils.py,sha256=l-0p1bEHF34OU19MahnRFdClHufThfGAjQ431teAIp0,1004
122
133
  shotgun/utils/update_checker.py,sha256=Xf-7w3Pos3etzCoT771gJe2HLkA8_V2GrqWy7ni9UqA,11373
123
- shotgun_sh-0.1.0.dev13.dist-info/METADATA,sha256=gGaxZ3KD4dedFsu1xuCrF2vtmSHK7N-jVnVuO_5zgQU,11240
124
- shotgun_sh-0.1.0.dev13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
125
- shotgun_sh-0.1.0.dev13.dist-info/entry_points.txt,sha256=asZxLU4QILneq0MWW10saVCZc4VWhZfb0wFZvERnzfA,45
126
- shotgun_sh-0.1.0.dev13.dist-info/licenses/LICENSE,sha256=YebsZl590zCHrF_acCU5pmNt0pnAfD2DmAnevJPB1tY,1065
127
- shotgun_sh-0.1.0.dev13.dist-info/RECORD,,
134
+ shotgun_sh-0.1.0.dev15.dist-info/METADATA,sha256=VpKsQmeuor8Mc27fgdeVfKU4xtMNpQNx9AAfwVcyEC4,11271
135
+ shotgun_sh-0.1.0.dev15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
136
+ shotgun_sh-0.1.0.dev15.dist-info/entry_points.txt,sha256=asZxLU4QILneq0MWW10saVCZc4VWhZfb0wFZvERnzfA,45
137
+ shotgun_sh-0.1.0.dev15.dist-info/licenses/LICENSE,sha256=YebsZl590zCHrF_acCU5pmNt0pnAfD2DmAnevJPB1tY,1065
138
+ shotgun_sh-0.1.0.dev15.dist-info/RECORD,,