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

@@ -6,18 +6,15 @@ Your job is to help create comprehensive, actionable plans for software projects
6
6
 
7
7
  ## PLANNING WORKFLOW
8
8
 
9
- For planning tasks:
10
- 1. **Check existing work**: Use `list_artifacts("plan")` to see what plans already exist and create a new one if needed
11
- 2. **Review specifications**: Use `list_artifacts("specify")` and read relevant specifications artifacts
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
9
+ For PLANNING tasks:
10
+ 0. **Check specify**, if any - Consider Existing Artifacts available in specify mode.
11
+ 1. **Check existing work**: Consider Existing Artifacts available in plan mode already.
12
+ IF NO SUITABLE ARTIFACT ALREADY EXISTS:
13
+ 2. **Look for suitable artifact template**: Consider Available Artifact Templates available in plan mode.
14
+ 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.
15
+ 4. **Analyze requirements**: Consider Existing Artifacts available in specify and research modes already.
16
+ 5. **Define specifications**: Create detailed technical and functional plans
17
+ 6. **Structure documentation**: Use `write_artifact_section()` to organize plans
21
18
 
22
19
  Use meaningful artifact IDs like: "mvp-roadmap", "migration-strategy", "product-launch"
23
20
 
@@ -7,11 +7,11 @@ 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**: 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.
10
+ 1. **Check existing work**: Consider "Existing Artifacts" available in research mode already.
11
11
  IF NO SUITABLE ARTIFACT ALREADY EXISTS:
12
- 2. **Look for suitable artifact template**: Use `list_artifact_templates("research")` to see what templates are available.
12
+ 2. **Look for suitable artifact template**: Consider "Available Artifact Templates" available in research mode.
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
- 4. **Analyze previous work**: Use `read_artifact()` to understand what has been done
14
+ 4. **Analyze previous work**: Consider "Existing Artifacts" available in research mode already.
15
15
  5. **Identify gaps**: Determine what additional research is needed
16
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
17
  7. **Search strategically**: Use web search to fill knowledge gaps (max 3 searches per session)
@@ -22,6 +22,9 @@ Use meaningful artifact IDs like: "api-design-patterns", "microservices-study",
22
22
 
23
23
  ## RESEARCH PRINCIPLES
24
24
 
25
+ {% if interactive_mode -%}
26
+ - CRITICAL: BEFORE RUNNING ANY SEARCH TOOL, ASK THE USER FOR CONFIRMATION USING ask_user().
27
+ {% endif -%}
25
28
  - Build upon existing research rather than starting from scratch
26
29
  - Focus on practical, actionable information over theoretical concepts
27
30
  - Include specific examples, tools, and implementation details
@@ -9,15 +9,14 @@ 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
13
- 2. **Review research**: Use `list_artifacts("research")` to see what research already exists.
14
- IF NO SUITABLE ARTIFACT EXISTS:
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
12
+ 0. **Check research**, if any - Consider Existing Artifacts available in research mode already.
13
+ 1. **Check existing work**: Consider Existing Artifacts available in specify mode already.
14
+ IF NO SUITABLE ARTIFACT ALREADY EXISTS:
15
+ 2. **Look for suitable artifact template**: Consider Available Artifact Templates available in specify mode.
16
+ 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.
17
+ 4. **Analyze requirements**: Understand the functional and non-functional requirements
18
+ 5. **Define specifications**: Create detailed technical and functional specifications
19
+ 6. **Structure documentation**: Use `write_artifact_section()` to organize specifications
21
20
 
22
21
  Use meaningful artifact IDs like: "user-auth-spec", "api-gateway-spec", "data-model-spec"
23
22
 
@@ -1,6 +1,8 @@
1
1
  {% if available_templates %}
2
2
 
3
- ## Available Artifact Templates
3
+ ## Available Artifact Templates (up to date, no need to check again)
4
+
5
+ ### Below if the current output of list_artifact_templates()
4
6
 
5
7
  You have access to these pre-built templates for creating structured artifacts:
6
8
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Existing Artifacts (All Modes)
4
4
 
5
+ ### Below if the current output of list_artifacts()
6
+
5
7
  Work already completed across all agent modes:
6
8
 
7
9
  {% for mode, artifacts in existing_artifacts.items() %}
@@ -8,7 +8,7 @@ Your job is to help create and manage actionable tasks for software projects.
8
8
 
9
9
  For task management:
10
10
  1. **Check existing work**: Use `list_artifacts("tasks")` to see what tasks already exist
11
- 2. **Review context**: Use `list_artifacts("plan")` and `list_artifacts("research")` to understand project context
11
+ 2. **Review context**: Use `list_artifacts("plan")` and `list_artifacts("specify")` to understand project context
12
12
  3. **Analyze requirements**: Understand the current situation and user's task requirements
13
13
  4. **Create structured tasks**: Use `write_artifact_section()` to organize task output
14
14
  5. **Build incrementally**: Update and refine tasks based on new information
@@ -1,3 +1,5 @@
1
+ # FOLLOW THESE PATTERNS TO GENERATE THE CORRECT CYPHER QUERY:
2
+
1
3
  **Pattern: Finding All Classes**
2
4
  ```cypher
3
5
  // "Find all Python classes" or "list all classes" or "show me all classes"
@@ -1,7 +1,9 @@
1
- **1. Graph Schema Definition**
1
+
2
+ # Codebase Graph Schema Definition
2
3
  The database contains information about a codebase, structured with the following nodes and relationships.
3
4
 
4
- Node Labels and Their Key Properties:
5
+ THE ONLY PROPERTIES THAT ARE AVAILABLE ARE THE ONES LISTED BELOW. DO NOT MAKE UP ANY OTHER PROPERTIES.
6
+ PAY ATTENTION TO THE PROPERTY TYPES.
5
7
  - Project: {name: string}
6
8
  - Package: {qualified_name: string, name: string, path: string}
7
9
  - Folder: {path: string, name: string}
shotgun/tui/app.py CHANGED
@@ -1,5 +1,9 @@
1
- from textual.app import App
1
+ from collections.abc import Iterable
2
+ from typing import Any
3
+
4
+ from textual.app import App, SystemCommand
2
5
  from textual.binding import Binding
6
+ from textual.screen import Screen
3
7
 
4
8
  from shotgun.agents.config import ConfigManager, get_config_manager
5
9
  from shotgun.logging_config import get_logger
@@ -41,6 +45,7 @@ class ShotgunApp(App[None]):
41
45
  logger.debug(f"Update notification received: {notification}")
42
46
 
43
47
  def on_mount(self) -> None:
48
+ self.theme = "gruvbox"
44
49
  # Track TUI startup
45
50
  from shotgun.posthog_telemetry import track_event
46
51
 
@@ -88,6 +93,9 @@ class ShotgunApp(App[None]):
88
93
  console.print(f"\n[cyan]{self.update_notification}[/cyan]", style="bold")
89
94
  self.exit()
90
95
 
96
+ def get_system_commands(self, screen: Screen[Any]) -> Iterable[SystemCommand]:
97
+ return [] # we don't want any system commands
98
+
91
99
 
92
100
  def run(no_update_check: bool = False) -> None:
93
101
  """Run the TUI application.
@@ -0,0 +1,73 @@
1
+ """Command handling for the TUI chat interface."""
2
+
3
+ from collections.abc import Callable
4
+
5
+
6
+ class CommandHandler:
7
+ """Handles slash commands in the TUI chat interface."""
8
+
9
+ def __init__(self) -> None:
10
+ """Initialize the command handler with available commands."""
11
+ self.commands: dict[str, Callable[[], str]] = {
12
+ "help": self.get_help_text,
13
+ }
14
+
15
+ def is_command(self, text: str) -> bool:
16
+ """Check if the text is a command (starts with /)."""
17
+ return text.strip().startswith("/")
18
+
19
+ def parse_command(self, text: str) -> str:
20
+ """Extract the command name from the text."""
21
+ text = text.strip()
22
+ if not text.startswith("/"):
23
+ return ""
24
+
25
+ # Split on whitespace and get the command part
26
+ parts = text[1:].split()
27
+ return parts[0] if parts else ""
28
+
29
+ def handle_command(self, text: str) -> tuple[bool, str]:
30
+ """
31
+ Handle a command and return success status and response text.
32
+
33
+ Args:
34
+ text: The full command text including the leading /
35
+
36
+ Returns:
37
+ Tuple of (success, response_text)
38
+ """
39
+ if not self.is_command(text):
40
+ return False, ""
41
+
42
+ command = self.parse_command(text)
43
+
44
+ if command in self.commands:
45
+ response = self.commands[command]()
46
+ return True, response
47
+ else:
48
+ return False, self.get_error_message(command)
49
+
50
+ def get_help_text(self) -> str:
51
+ """Return the help text for the /help command."""
52
+ return """📚 **Shotgun Help**
53
+
54
+ **Commands:**
55
+ • `/help` - Show this help message
56
+
57
+ **Keyboard Shortcuts:**
58
+ • `Enter` - Send message
59
+ • `Ctrl+P` - Open command palette
60
+ • `Shift+Tab` - Cycle agent modes
61
+ • `Ctrl+C` - Quit application
62
+
63
+ **Agent Modes:**
64
+ • **Research** - Research topics with web search and synthesize findings
65
+ • **Planning** - Create comprehensive, actionable plans with milestones
66
+ • **Tasks** - Generate specific, actionable tasks from research and plans
67
+
68
+ **Usage:**
69
+ Type your message and press Enter to chat with the AI. The AI will respond based on the current mode."""
70
+
71
+ def get_error_message(self, command: str) -> str:
72
+ """Return a polite error message for unknown commands."""
73
+ return f"⚠️ Sorry, `/{command}` is not a recognized command. Type `/help` to see available commands."