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.
- shotgun/agents/agent_manager.py +243 -24
- shotgun/agents/tools/artifact_management.py +2 -3
- shotgun/artifacts/templates/research/sdk_comparison.yaml +73 -73
- shotgun/prompts/agents/partials/interactive_mode.j2 +10 -1
- shotgun/prompts/agents/plan.j2 +9 -12
- shotgun/prompts/agents/research.j2 +6 -3
- shotgun/prompts/agents/specify.j2 +8 -9
- shotgun/prompts/agents/state/artifact_templates_available.j2 +3 -1
- shotgun/prompts/agents/state/existing_artifacts_available.j2 +2 -0
- shotgun/prompts/agents/tasks.j2 +1 -1
- shotgun/prompts/codebase/cypher_query_patterns.j2 +2 -0
- shotgun/prompts/codebase/partials/graph_schema.j2 +4 -2
- shotgun/tui/app.py +9 -1
- shotgun/tui/commands/__init__.py +73 -0
- shotgun/tui/screens/chat.py +361 -178
- shotgun/tui/screens/chat.tcss +11 -0
- shotgun/tui/screens/chat_screen/__init__.py +0 -0
- shotgun/tui/screens/chat_screen/command_providers.py +197 -0
- shotgun/tui/screens/chat_screen/history.py +160 -0
- {shotgun_sh-0.1.0.dev15.dist-info → shotgun_sh-0.1.0.dev16.dist-info}/METADATA +1 -1
- {shotgun_sh-0.1.0.dev15.dist-info → shotgun_sh-0.1.0.dev16.dist-info}/RECORD +24 -20
- {shotgun_sh-0.1.0.dev15.dist-info → shotgun_sh-0.1.0.dev16.dist-info}/WHEEL +0 -0
- {shotgun_sh-0.1.0.dev15.dist-info → shotgun_sh-0.1.0.dev16.dist-info}/entry_points.txt +0 -0
- {shotgun_sh-0.1.0.dev15.dist-info → shotgun_sh-0.1.0.dev16.dist-info}/licenses/LICENSE +0 -0
shotgun/prompts/agents/plan.j2
CHANGED
|
@@ -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
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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**:
|
|
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**:
|
|
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**:
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
IF NO SUITABLE ARTIFACT EXISTS:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
|
shotgun/prompts/agents/tasks.j2
CHANGED
|
@@ -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("
|
|
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,7 +1,9 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
|
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."
|