shotgun-sh 0.4.0.dev1__py3-none-any.whl → 0.6.2__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.
- shotgun/agents/agent_manager.py +307 -8
- shotgun/agents/cancellation.py +103 -0
- shotgun/agents/common.py +12 -0
- shotgun/agents/config/README.md +0 -1
- shotgun/agents/config/manager.py +10 -7
- shotgun/agents/config/models.py +5 -27
- shotgun/agents/config/provider.py +44 -27
- shotgun/agents/conversation/history/token_counting/base.py +51 -9
- shotgun/agents/file_read.py +176 -0
- shotgun/agents/messages.py +15 -3
- shotgun/agents/models.py +24 -1
- shotgun/agents/router/models.py +8 -0
- shotgun/agents/router/tools/delegation_tools.py +55 -1
- shotgun/agents/router/tools/plan_tools.py +88 -7
- shotgun/agents/runner.py +17 -2
- shotgun/agents/tools/__init__.py +8 -0
- shotgun/agents/tools/codebase/directory_lister.py +27 -39
- shotgun/agents/tools/codebase/file_read.py +26 -35
- shotgun/agents/tools/codebase/query_graph.py +9 -0
- shotgun/agents/tools/codebase/retrieve_code.py +9 -0
- shotgun/agents/tools/file_management.py +32 -2
- shotgun/agents/tools/file_read_tools/__init__.py +7 -0
- shotgun/agents/tools/file_read_tools/multimodal_file_read.py +167 -0
- shotgun/agents/tools/markdown_tools/__init__.py +62 -0
- shotgun/agents/tools/markdown_tools/insert_section.py +148 -0
- shotgun/agents/tools/markdown_tools/models.py +86 -0
- shotgun/agents/tools/markdown_tools/remove_section.py +114 -0
- shotgun/agents/tools/markdown_tools/replace_section.py +119 -0
- shotgun/agents/tools/markdown_tools/utils.py +453 -0
- shotgun/agents/tools/registry.py +44 -6
- shotgun/agents/tools/web_search/openai.py +42 -23
- shotgun/attachments/__init__.py +41 -0
- shotgun/attachments/errors.py +60 -0
- shotgun/attachments/models.py +107 -0
- shotgun/attachments/parser.py +257 -0
- shotgun/attachments/processor.py +193 -0
- shotgun/build_constants.py +4 -7
- shotgun/cli/clear.py +2 -2
- shotgun/cli/codebase/commands.py +181 -65
- shotgun/cli/compact.py +2 -2
- shotgun/cli/context.py +2 -2
- shotgun/cli/error_handler.py +2 -2
- shotgun/cli/run.py +90 -0
- shotgun/cli/spec/backup.py +2 -1
- shotgun/codebase/__init__.py +2 -0
- shotgun/codebase/benchmarks/__init__.py +35 -0
- shotgun/codebase/benchmarks/benchmark_runner.py +309 -0
- shotgun/codebase/benchmarks/exporters.py +119 -0
- shotgun/codebase/benchmarks/formatters/__init__.py +49 -0
- shotgun/codebase/benchmarks/formatters/base.py +34 -0
- shotgun/codebase/benchmarks/formatters/json_formatter.py +106 -0
- shotgun/codebase/benchmarks/formatters/markdown.py +136 -0
- shotgun/codebase/benchmarks/models.py +129 -0
- shotgun/codebase/core/__init__.py +4 -0
- shotgun/codebase/core/call_resolution.py +91 -0
- shotgun/codebase/core/change_detector.py +11 -6
- shotgun/codebase/core/errors.py +159 -0
- shotgun/codebase/core/extractors/__init__.py +23 -0
- shotgun/codebase/core/extractors/base.py +138 -0
- shotgun/codebase/core/extractors/factory.py +63 -0
- shotgun/codebase/core/extractors/go/__init__.py +7 -0
- shotgun/codebase/core/extractors/go/extractor.py +122 -0
- shotgun/codebase/core/extractors/javascript/__init__.py +7 -0
- shotgun/codebase/core/extractors/javascript/extractor.py +132 -0
- shotgun/codebase/core/extractors/protocol.py +109 -0
- shotgun/codebase/core/extractors/python/__init__.py +7 -0
- shotgun/codebase/core/extractors/python/extractor.py +141 -0
- shotgun/codebase/core/extractors/rust/__init__.py +7 -0
- shotgun/codebase/core/extractors/rust/extractor.py +139 -0
- shotgun/codebase/core/extractors/types.py +15 -0
- shotgun/codebase/core/extractors/typescript/__init__.py +7 -0
- shotgun/codebase/core/extractors/typescript/extractor.py +92 -0
- shotgun/codebase/core/gitignore.py +252 -0
- shotgun/codebase/core/ingestor.py +644 -354
- shotgun/codebase/core/kuzu_compat.py +119 -0
- shotgun/codebase/core/language_config.py +239 -0
- shotgun/codebase/core/manager.py +256 -46
- shotgun/codebase/core/metrics_collector.py +310 -0
- shotgun/codebase/core/metrics_types.py +347 -0
- shotgun/codebase/core/parallel_executor.py +424 -0
- shotgun/codebase/core/work_distributor.py +254 -0
- shotgun/codebase/core/worker.py +768 -0
- shotgun/codebase/indexing_state.py +86 -0
- shotgun/codebase/models.py +94 -0
- shotgun/codebase/service.py +13 -0
- shotgun/exceptions.py +9 -9
- shotgun/main.py +3 -16
- shotgun/posthog_telemetry.py +165 -24
- shotgun/prompts/agents/file_read.j2 +48 -0
- shotgun/prompts/agents/partials/common_agent_system_prompt.j2 +19 -47
- shotgun/prompts/agents/partials/content_formatting.j2 +12 -33
- shotgun/prompts/agents/partials/interactive_mode.j2 +9 -32
- shotgun/prompts/agents/partials/router_delegation_mode.j2 +21 -22
- shotgun/prompts/agents/plan.j2 +14 -0
- shotgun/prompts/agents/router.j2 +531 -258
- shotgun/prompts/agents/specify.j2 +14 -0
- shotgun/prompts/agents/state/codebase/codebase_graphs_available.j2 +14 -1
- shotgun/prompts/agents/state/system_state.j2 +13 -11
- shotgun/prompts/agents/tasks.j2 +14 -0
- shotgun/settings.py +49 -10
- shotgun/tui/app.py +149 -18
- shotgun/tui/commands/__init__.py +9 -1
- shotgun/tui/components/attachment_bar.py +87 -0
- shotgun/tui/components/prompt_input.py +25 -28
- shotgun/tui/components/status_bar.py +14 -7
- shotgun/tui/dependencies.py +3 -8
- shotgun/tui/protocols.py +18 -0
- shotgun/tui/screens/chat/chat.tcss +15 -0
- shotgun/tui/screens/chat/chat_screen.py +766 -235
- shotgun/tui/screens/chat/codebase_index_prompt_screen.py +8 -4
- shotgun/tui/screens/chat_screen/attachment_hint.py +40 -0
- shotgun/tui/screens/chat_screen/command_providers.py +0 -10
- shotgun/tui/screens/chat_screen/history/chat_history.py +54 -14
- shotgun/tui/screens/chat_screen/history/formatters.py +22 -0
- shotgun/tui/screens/chat_screen/history/user_question.py +25 -3
- shotgun/tui/screens/database_locked_dialog.py +219 -0
- shotgun/tui/screens/database_timeout_dialog.py +158 -0
- shotgun/tui/screens/kuzu_error_dialog.py +135 -0
- shotgun/tui/screens/model_picker.py +1 -3
- shotgun/tui/screens/models.py +11 -0
- shotgun/tui/state/processing_state.py +19 -0
- shotgun/tui/widgets/widget_coordinator.py +18 -0
- shotgun/utils/file_system_utils.py +4 -1
- {shotgun_sh-0.4.0.dev1.dist-info → shotgun_sh-0.6.2.dist-info}/METADATA +87 -34
- {shotgun_sh-0.4.0.dev1.dist-info → shotgun_sh-0.6.2.dist-info}/RECORD +128 -79
- shotgun/cli/export.py +0 -81
- shotgun/cli/plan.py +0 -73
- shotgun/cli/research.py +0 -93
- shotgun/cli/specify.py +0 -70
- shotgun/cli/tasks.py +0 -78
- shotgun/sentry_telemetry.py +0 -232
- shotgun/tui/screens/onboarding.py +0 -584
- {shotgun_sh-0.4.0.dev1.dist-info → shotgun_sh-0.6.2.dist-info}/WHEEL +0 -0
- {shotgun_sh-0.4.0.dev1.dist-info → shotgun_sh-0.6.2.dist-info}/entry_points.txt +0 -0
- {shotgun_sh-0.4.0.dev1.dist-info → shotgun_sh-0.6.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from textual.widget import Widget
|
|
4
4
|
|
|
5
|
-
from shotgun.tui.protocols import QAStateProvider
|
|
5
|
+
from shotgun.tui.protocols import QAStateProvider, QuitConfirmationProvider
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class StatusBar(Widget):
|
|
@@ -26,7 +26,11 @@ class StatusBar(Widget):
|
|
|
26
26
|
|
|
27
27
|
def render(self) -> str:
|
|
28
28
|
"""Render the status bar with contextual help text."""
|
|
29
|
-
# Check if
|
|
29
|
+
# Check if quit confirmation is pending (highest priority)
|
|
30
|
+
if isinstance(self.app, QuitConfirmationProvider) and self.app.quit_pending:
|
|
31
|
+
return "[$foreground-muted][bold $warning]Press Ctrl+C again to quit[/] • [bold $text]esc[/] to cancel[/]"
|
|
32
|
+
|
|
33
|
+
# Check if in Q&A mode
|
|
30
34
|
if isinstance(self.screen, QAStateProvider) and self.screen.qa_mode:
|
|
31
35
|
return (
|
|
32
36
|
"[$foreground-muted][bold $text]esc[/] to exit Q&A mode • "
|
|
@@ -36,13 +40,16 @@ class StatusBar(Widget):
|
|
|
36
40
|
if self.working:
|
|
37
41
|
return (
|
|
38
42
|
"[$foreground-muted][bold $text]esc[/] to stop • "
|
|
39
|
-
"[bold $text]enter[/] to send • [bold $text]ctrl+j[/]
|
|
40
|
-
"[bold $text]
|
|
41
|
-
"
|
|
43
|
+
"[bold $text]enter[/] to send • [bold $text]ctrl+j[/] newline • "
|
|
44
|
+
"[bold $text]/[/] command palette • "
|
|
45
|
+
"[bold $text]shift+tab[/] toggle mode • "
|
|
46
|
+
"[bold $text]ctrl+c[/] copy • [bold $text]ctrl+v[/] paste[/]"
|
|
42
47
|
)
|
|
43
48
|
else:
|
|
44
49
|
return (
|
|
45
50
|
"[$foreground-muted][bold $text]enter[/] to send • "
|
|
46
|
-
"[bold $text]ctrl+j[/]
|
|
47
|
-
"[bold $text]
|
|
51
|
+
"[bold $text]ctrl+j[/] newline • "
|
|
52
|
+
"[bold $text]/[/] command palette • "
|
|
53
|
+
"[bold $text]shift+tab[/] toggle mode • "
|
|
54
|
+
"[bold $text]ctrl+c[/] copy • [bold $text]ctrl+v[/] paste[/]"
|
|
48
55
|
)
|
shotgun/tui/dependencies.py
CHANGED
|
@@ -4,7 +4,7 @@ from typing import Any
|
|
|
4
4
|
|
|
5
5
|
from pydantic_ai import RunContext
|
|
6
6
|
|
|
7
|
-
from shotgun.agents.config import
|
|
7
|
+
from shotgun.agents.config import get_provider_model
|
|
8
8
|
from shotgun.agents.config.models import ModelConfig
|
|
9
9
|
from shotgun.agents.models import AgentDeps
|
|
10
10
|
from shotgun.agents.router.models import RouterDeps, RouterMode
|
|
@@ -68,7 +68,7 @@ async def create_default_router_deps() -> RouterDeps:
|
|
|
68
68
|
|
|
69
69
|
This creates a RouterDeps configuration suitable for interactive
|
|
70
70
|
TUI usage with:
|
|
71
|
-
- Router mode
|
|
71
|
+
- Router mode always starts in PLANNING (not persisted)
|
|
72
72
|
- Interactive mode enabled
|
|
73
73
|
- TUI context flag set
|
|
74
74
|
- Filtered codebase service (restricted to CWD)
|
|
@@ -79,16 +79,11 @@ async def create_default_router_deps() -> RouterDeps:
|
|
|
79
79
|
"""
|
|
80
80
|
model_config, codebase_service = await _get_tui_config()
|
|
81
81
|
|
|
82
|
-
# Load router mode from config (default to PLANNING)
|
|
83
|
-
config_manager = get_config_manager()
|
|
84
|
-
config = await config_manager.load()
|
|
85
|
-
router_mode = RouterMode(config.router_mode)
|
|
86
|
-
|
|
87
82
|
return RouterDeps(
|
|
88
83
|
interactive_mode=True,
|
|
89
84
|
is_tui_context=True,
|
|
90
85
|
llm_model=model_config,
|
|
91
86
|
codebase_service=codebase_service,
|
|
92
87
|
system_prompt_fn=_placeholder_system_prompt_fn,
|
|
93
|
-
router_mode=
|
|
88
|
+
router_mode=RouterMode.PLANNING,
|
|
94
89
|
)
|
shotgun/tui/protocols.py
CHANGED
|
@@ -80,3 +80,21 @@ class ActiveSubAgentProvider(Protocol):
|
|
|
80
80
|
a sub-agent is executing, None if idle.
|
|
81
81
|
"""
|
|
82
82
|
...
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
@runtime_checkable
|
|
86
|
+
class QuitConfirmationProvider(Protocol):
|
|
87
|
+
"""Protocol for apps that provide quit confirmation state.
|
|
88
|
+
|
|
89
|
+
This protocol allows components (like StatusBar) to check if a quit
|
|
90
|
+
confirmation is pending without importing the concrete App class.
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
@property
|
|
94
|
+
def quit_pending(self) -> bool:
|
|
95
|
+
"""Whether a quit confirmation is pending.
|
|
96
|
+
|
|
97
|
+
Returns:
|
|
98
|
+
True if user pressed Ctrl+C and needs to confirm quit.
|
|
99
|
+
"""
|
|
100
|
+
...
|
|
@@ -59,4 +59,19 @@ ModeIndicator.mode-drafting {
|
|
|
59
59
|
|
|
60
60
|
#indexing-job-display {
|
|
61
61
|
text-align: end;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
AttachmentBar {
|
|
65
|
+
height: auto;
|
|
66
|
+
padding: 0 1;
|
|
67
|
+
background: $secondary-background;
|
|
68
|
+
margin-bottom: 1;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
AttachmentBar.hidden {
|
|
72
|
+
display: none;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
AttachmentBar Static {
|
|
76
|
+
color: $text-accent;
|
|
62
77
|
}
|