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

@@ -43,6 +43,7 @@ from shotgun.sdk.codebase import CodebaseSDK
43
43
  from shotgun.sdk.exceptions import CodebaseNotFoundError, InvalidPathError
44
44
  from shotgun.sdk.services import get_codebase_service
45
45
  from shotgun.tui.commands import CommandHandler
46
+ from shotgun.tui.screens.chat_screen.hint_message import HintMessage
46
47
  from shotgun.tui.screens.chat_screen.history import ChatHistory
47
48
 
48
49
  from ..components.prompt_input import PromptInput
@@ -322,7 +323,7 @@ class ChatScreen(Screen[None]):
322
323
  value = reactive("")
323
324
  mode = reactive(AgentType.RESEARCH)
324
325
  history: PromptHistory = PromptHistory()
325
- messages = reactive(list[ModelMessage]())
326
+ messages = reactive(list[ModelMessage | HintMessage]())
326
327
  working = reactive(False)
327
328
  question: reactive[UserQuestion | None] = reactive(None)
328
329
  indexing_job: reactive[CodebaseIndexSelection | None] = reactive(None)
@@ -375,7 +376,7 @@ class ChatScreen(Screen[None]):
375
376
  dir.is_dir() and dir.name in ["__pycache__", ".git", ".shotgun"]
376
377
  for dir in cur_dir.iterdir()
377
378
  )
378
- if is_empty:
379
+ if is_empty or self.continue_session:
379
380
  return
380
381
 
381
382
  # Check if the current directory has any accessible codebases
@@ -417,7 +418,7 @@ class ChatScreen(Screen[None]):
417
418
  spinner.set_classes("" if is_working else "hidden")
418
419
  spinner.display = is_working
419
420
 
420
- def watch_messages(self, messages: list[ModelMessage]) -> None:
421
+ def watch_messages(self, messages: list[ModelMessage | HintMessage]) -> None:
421
422
  """Update the chat history when messages change."""
422
423
  if self.is_mounted:
423
424
  chat_history = self.query_one(ChatHistory)
@@ -479,14 +480,8 @@ class ChatScreen(Screen[None]):
479
480
  yield Static("", id="indexing-job-display")
480
481
 
481
482
  def mount_hint(self, markdown: str) -> None:
482
- chat_history = self.query_one(ChatHistory)
483
- if not chat_history.vertical_tail:
484
- return
485
- chat_history.vertical_tail.mount(Markdown(markdown))
486
- # Scroll to bottom after mounting hint
487
- chat_history.vertical_tail.call_after_refresh(
488
- chat_history.vertical_tail.scroll_end, animate=False
489
- )
483
+ hint = HintMessage(message=markdown)
484
+ self.agent_manager.add_hint_message(hint)
490
485
 
491
486
  @on(PartialResponseMessage)
492
487
  def handle_partial_response(self, event: PartialResponseMessage) -> None:
@@ -543,9 +538,7 @@ class ChatScreen(Screen[None]):
543
538
  f"📁 Modified {num_files} files in: `{path_obj.parent}`"
544
539
  )
545
540
 
546
- # Add this as a simple markdown widget
547
- file_info_widget = Markdown(message)
548
- chat_history.vertical_tail.mount(file_info_widget)
541
+ self.mount_hint(message)
549
542
 
550
543
  @on(PromptInput.Submitted)
551
544
  async def handle_submit(self, message: PromptInput.Submitted) -> None:
@@ -730,6 +723,7 @@ class ChatScreen(Screen[None]):
730
723
  last_agent_model=state.agent_type,
731
724
  )
732
725
  conversation.set_agent_messages(state.agent_messages)
726
+ conversation.set_ui_messages(state.ui_messages)
733
727
 
734
728
  # Save to file
735
729
  self.conversation_manager.save(conversation)
@@ -742,10 +736,12 @@ class ChatScreen(Screen[None]):
742
736
 
743
737
  # Restore agent state
744
738
  agent_messages = conversation.get_agent_messages()
739
+ ui_messages = conversation.get_ui_messages()
745
740
 
746
741
  # Create ConversationState for restoration
747
742
  state = ConversationState(
748
743
  agent_messages=agent_messages,
744
+ ui_messages=ui_messages,
749
745
  agent_type=conversation.last_agent_model,
750
746
  )
751
747
 
@@ -0,0 +1,40 @@
1
+ from typing import Literal
2
+
3
+ from pydantic import BaseModel
4
+ from textual.app import ComposeResult
5
+ from textual.widget import Widget
6
+ from textual.widgets import Markdown
7
+
8
+
9
+ class HintMessage(BaseModel):
10
+ message: str
11
+ kind: Literal["hint"] = "hint"
12
+
13
+
14
+ class HintMessageWidget(Widget):
15
+ """A message for the user generated by shotgun, not the agent.."""
16
+
17
+ DEFAULT_CSS = """
18
+ HintMessageWidget {
19
+ background: $secondary-background-darken-1;
20
+ height: auto;
21
+ margin: 1;
22
+ margin-left: 1;
23
+ padding: 1;
24
+
25
+ * > Markdown {
26
+ height: auto;
27
+ offset-x: -1;
28
+ padding: 0;
29
+ margin: 0;
30
+ }
31
+ }
32
+
33
+ """
34
+
35
+ def __init__(self, message: HintMessage) -> None:
36
+ super().__init__()
37
+ self.message = message
38
+
39
+ def compose(self) -> ComposeResult:
40
+ yield Markdown(markdown=f"{self.message.message}")
@@ -19,6 +19,7 @@ from textual.widget import Widget
19
19
  from textual.widgets import Markdown
20
20
 
21
21
  from shotgun.tui.components.vertical_tail import VerticalTail
22
+ from shotgun.tui.screens.chat_screen.hint_message import HintMessage, HintMessageWidget
22
23
 
23
24
 
24
25
  class PartialResponseWidget(Widget): # TODO: doesn't work lol
@@ -75,16 +76,19 @@ class ChatHistory(Widget):
75
76
 
76
77
  def __init__(self) -> None:
77
78
  super().__init__()
78
- self.items: list[ModelMessage] = []
79
+ self.items: list[ModelMessage | HintMessage] = []
79
80
  self.vertical_tail: VerticalTail | None = None
80
81
  self.partial_response = None
81
82
 
82
83
  def compose(self) -> ComposeResult:
83
84
  self.vertical_tail = VerticalTail()
85
+
84
86
  with self.vertical_tail:
85
87
  for item in self.items:
86
88
  if isinstance(item, ModelRequest):
87
89
  yield UserQuestionWidget(item)
90
+ elif isinstance(item, HintMessage):
91
+ yield HintMessageWidget(item)
88
92
  elif isinstance(item, ModelResponse):
89
93
  yield AgentResponseWidget(item)
90
94
  yield PartialResponseWidget(self.partial_response).data_bind(
@@ -94,7 +98,7 @@ class ChatHistory(Widget):
94
98
  def watch_partial_response(self, _partial_response: ModelMessage | None) -> None:
95
99
  self.call_after_refresh(self.autoscroll)
96
100
 
97
- def update_messages(self, messages: list[ModelMessage]) -> None:
101
+ def update_messages(self, messages: list[ModelMessage | HintMessage]) -> None:
98
102
  """Update the displayed messages without recomposing."""
99
103
  if not self.vertical_tail:
100
104
  return
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: shotgun-sh
3
- Version: 0.1.0.dev25
3
+ Version: 0.1.0.dev27
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
@@ -7,12 +7,13 @@ 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=ApRzriE3mvAms5144rQ4Vjv1JWvRS89DruTtBvgVPdg,20235
11
- shotgun/agents/common.py,sha256=z4MOOHXpGWVpnxfGbOmfz-gYX9r8gjzcPPIOAJ9-2hc,15704
12
- shotgun/agents/conversation_history.py,sha256=vw7LMOCmpkidQGAidPIxPly2sh1k1K-5NF3iYkXOAAU,1815
10
+ shotgun/agents/agent_manager.py,sha256=Tz20_cmCQhuUOIyr3rGrtvN_XBAYBZNuzhXBo-BFngQ,22349
11
+ shotgun/agents/common.py,sha256=vt7ECq1rT6GR5Rt63t0whH0R0cydrk7Mty2KyPL8mEg,19045
12
+ shotgun/agents/conversation_history.py,sha256=5J8_1yxdZiiWTq22aDio88DkBDZ4_Lh_p5Iy5_ENszc,3898
13
13
  shotgun/agents/conversation_manager.py,sha256=fxAvXbEl3Cl2ugJ4N9aWXaqZtkrnfj3QzwjWC4LFXwI,3514
14
14
  shotgun/agents/export.py,sha256=Zke952DbJ_lOBUmN-TPHw7qmjbfqsFu1uycBRQI_pkg,2969
15
- shotgun/agents/models.py,sha256=MzQJFHZ7F_q2VEl48LDzuwroi0bvPR74g9qq5Zkqkq4,7339
15
+ shotgun/agents/messages.py,sha256=wNn0qC5AqASM8LMaSGFOerZEJPn5FsIOmaJs1bdosuU,1036
16
+ shotgun/agents/models.py,sha256=fljmjHoCzNXPWOHSA-1KmQk1epk8ovowqDM7j5zZKB8,7853
16
17
  shotgun/agents/plan.py,sha256=s-WfILBOW4l8kY59RUOVtX5MJSuSzFm1nGp6b17If78,3030
17
18
  shotgun/agents/research.py,sha256=lYG7Rytcitop8mXs3isMI3XvYzzI3JH9u0VZz6K9zfo,3274
18
19
  shotgun/agents/specify.py,sha256=7MoMxfIn34G27mw6wrp_F0i2O5rid476L3kHFONDCd0,3137
@@ -27,12 +28,12 @@ shotgun/agents/history/compaction.py,sha256=KY_ZvRvvlrB6eLPGqtlC6H8h4HPPOtuPcUkg
27
28
  shotgun/agents/history/constants.py,sha256=yWY8rrTZarLA3flCCMB_hS2NMvUDRDTwP4D4j7MIh1w,446
28
29
  shotgun/agents/history/context_extraction.py,sha256=yVka1U6TqNVsORR4JlxpWi9yBt3Quip8g_u3x2Vi9Gs,3564
29
30
  shotgun/agents/history/history_building.py,sha256=6LFDZ60MTPDoGAcmu_mjlnjVYu8YYWdIi-cGbF3jm7A,3532
30
- shotgun/agents/history/history_processors.py,sha256=beipmLkHxhQDxrtoCGGK86arOIzcu8aa1fFCvxa5v2o,15097
31
- shotgun/agents/history/message_utils.py,sha256=S7wqix4W3uvC8rChs6TMxp7yjnjr8a2AqPxLIKnDyjI,1526
31
+ shotgun/agents/history/history_processors.py,sha256=PMfgiqQXsILzLeShfGnvTx6XxHxH96a57PT2vZTYlFA,15880
32
+ shotgun/agents/history/message_utils.py,sha256=aPusAl2RYKbjc7lBxPaNprRHmZEG6fe97q7DQUlhlzU,2918
32
33
  shotgun/agents/history/token_counting.py,sha256=RasWy84eNjbmqyQDTGAzj1Q1I9ml_G_9R-maWN7gr8s,13839
33
34
  shotgun/agents/history/token_estimation.py,sha256=iNqhDSqFzG0YYxGijMRzj54GALFglOp0qVMB6G59RhU,4690
34
35
  shotgun/agents/tools/__init__.py,sha256=QaN80IqWvB5qEcjHqri1-PYvYlO74vdhcwLugoEdblo,772
35
- shotgun/agents/tools/file_management.py,sha256=XvRBwz7KmlwqQlAbYraDCo9murk5oko1zLo2g2fGeOA,7100
36
+ shotgun/agents/tools/file_management.py,sha256=HYNe_QA4T3_bPzSWBYcFZcnWdj8eb4aQ3GB735-G8Nw,7138
36
37
  shotgun/agents/tools/user_interaction.py,sha256=b3ncEpvoD06Cz4hwsS-ppVbQajQj640iWnVfA5WBjAA,1236
37
38
  shotgun/agents/tools/codebase/__init__.py,sha256=ceAGkK006NeOYaIJBLQsw7Q46sAyCRK9PYDs8feMQVw,661
38
39
  shotgun/agents/tools/codebase/codebase_shell.py,sha256=9b7ZStAVFprdGqp1O23ZgwkToMytlUdp_R4MhvmENhc,8584
@@ -73,16 +74,16 @@ shotgun/codebase/core/parser_loader.py,sha256=LZRrDS8Sp518jIu3tQW-BxdwJ86lnsTteI
73
74
  shotgun/prompts/__init__.py,sha256=RswUm0HMdfm2m2YKUwUsEdRIwoczdbI7zlucoEvHYRo,132
74
75
  shotgun/prompts/loader.py,sha256=jy24-E02pCSmz2651aCT2NgHfRrHAGMYvKrD6gs0Er8,4424
75
76
  shotgun/prompts/agents/__init__.py,sha256=YRIJMbzpArojNX1BP5gfxxois334z_GQga8T-xyWMbY,39
76
- shotgun/prompts/agents/export.j2,sha256=qnb_V4QZycaOKDevb-9ZzAY10pEgBxbdk3kKyIRDex8,5466
77
- shotgun/prompts/agents/plan.j2,sha256=npu7x1p2O2O_ONI0nmkSvG7Kv6OC1dU8_IuqTOV1sHU,3420
77
+ shotgun/prompts/agents/export.j2,sha256=GKpOfGbZA9PVa4TNtMORUYiBIAcN6JCo8URmTCWKlWw,15936
78
+ shotgun/prompts/agents/plan.j2,sha256=MyZDyOS21V-zrHNzbIhIdzcESGh_3KVbA4qh9rZR2_E,6086
78
79
  shotgun/prompts/agents/research.j2,sha256=JBtjXaMVDRuNTt7-Ai8gUb2InfolfqCkQoEkn9PsQZk,3929
79
80
  shotgun/prompts/agents/specify.j2,sha256=AP7XrA3KE7GZsCvW4guASxZHBM2mnrMw3irdZ3RUOBs,2808
80
81
  shotgun/prompts/agents/tasks.j2,sha256=Vm6nFSgYzdwRBySUzwMzWHhfYR12Cb_xKPqif7yMuhs,4909
81
82
  shotgun/prompts/agents/partials/codebase_understanding.j2,sha256=7WH-PVd-TRBFQUdOdKkwwn9hAUaJznFZMAGHhO7IGGU,5633
82
- shotgun/prompts/agents/partials/common_agent_system_prompt.j2,sha256=f5cpo2Ds7EceHvXYUHNs_1NoXv_K4BrWduXYcT2PL40,1803
83
+ shotgun/prompts/agents/partials/common_agent_system_prompt.j2,sha256=eFuc3z1pSJzQtPJfjMIDNHv5XX9lP6YVrmKcbbskJj8,1877
83
84
  shotgun/prompts/agents/partials/content_formatting.j2,sha256=MG0JB7SSp8YV5akDWpbs2f9DcdREIYqLp38NnoWLeQ0,1854
84
85
  shotgun/prompts/agents/partials/interactive_mode.j2,sha256=9sYPbyc46HXg3k1FT_LugIQvOyNDnMQwsMIgOgN-_aY,1100
85
- shotgun/prompts/agents/state/system_state.j2,sha256=k7WICOLFCZ7yhH004AzqCBJ1U0MCF56ODSzdb7fe7Ck,905
86
+ shotgun/prompts/agents/state/system_state.j2,sha256=TQPnCLtmiNwQCbMxnCE7nLhXMJpKlBCnlNBKt7FTjuo,1033
86
87
  shotgun/prompts/agents/state/codebase/codebase_graphs_available.j2,sha256=U-hy-H9bPwV0sYIHTZ5TESxc5EOCtntI8GUZOmJipJw,601
87
88
  shotgun/prompts/codebase/__init__.py,sha256=NYuPMtmYM2ptuwf3YxVuotNlJOUq0hnjmwlzKcJkGK4,42
88
89
  shotgun/prompts/codebase/cypher_query_patterns.j2,sha256=ufTx_xT3VoS76KcVUbIgGQx-bJoJHx3bBE3dagAXv18,8913
@@ -107,22 +108,23 @@ shotgun/tui/components/prompt_input.py,sha256=Ss-htqraHZAPaehGE4x86ij0veMjc4Ugad
107
108
  shotgun/tui/components/spinner.py,sha256=ovTDeaJ6FD6chZx_Aepia6R3UkPOVJ77EKHfRmn39MY,2427
108
109
  shotgun/tui/components/splash.py,sha256=vppy9vEIEvywuUKRXn2y11HwXSRkQZHLYoVjhDVdJeU,1267
109
110
  shotgun/tui/components/vertical_tail.py,sha256=kkCH0WjAh54jDvRzIaOffRZXUKn_zHFZ_ichfUpgzaE,1071
110
- shotgun/tui/screens/chat.py,sha256=UlyFrd3OISB-M62R3fGBb-E9CoD6G4untbMVfDUSV3U,27820
111
+ shotgun/tui/screens/chat.py,sha256=474e6W6r2QgQZvWwZoFds9Y7YmhjNukR_bXvwutHetM,27690
111
112
  shotgun/tui/screens/chat.tcss,sha256=2Yq3E23jxsySYsgZf4G1AYrYVcpX0UDW6kNNI0tDmtM,437
112
113
  shotgun/tui/screens/directory_setup.py,sha256=lIZ1J4A6g5Q2ZBX8epW7BhR96Dmdcg22CyiM5S-I5WU,3237
113
114
  shotgun/tui/screens/provider_config.py,sha256=A_tvDHF5KLP5PV60LjMJ_aoOdT3TjI6_g04UIUqGPqM,7126
114
115
  shotgun/tui/screens/splash.py,sha256=E2MsJihi3c9NY1L28o_MstDxGwrCnnV7zdq00MrGAsw,706
115
116
  shotgun/tui/screens/chat_screen/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
116
117
  shotgun/tui/screens/chat_screen/command_providers.py,sha256=55JIH9T8QnyHRsMoXhOi87FiVM-d6o7OKpCe82uDP9I,7840
117
- shotgun/tui/screens/chat_screen/history.py,sha256=AP8wdXCxQ0uZeZE29WnLF6RCaZjcJzG97tjzqXFceoY,7711
118
+ shotgun/tui/screens/chat_screen/hint_message.py,sha256=WOpbk8q7qt7eOHTyyHvh_IQIaublVDeJGaLpsxEk9FA,933
119
+ shotgun/tui/screens/chat_screen/history.py,sha256=PKUqj3kYk0NqQyQRoM7fTn4lsivfTOlKqm_77cO5RG4,7930
118
120
  shotgun/tui/utils/__init__.py,sha256=cFjDfoXTRBq29wgP7TGRWUu1eFfiIG-LLOzjIGfadgI,150
119
121
  shotgun/tui/utils/mode_progress.py,sha256=lseRRo7kMWLkBzI3cU5vqJmS2ZcCjyRYf9Zwtvc-v58,10931
120
122
  shotgun/utils/__init__.py,sha256=WinIEp9oL2iMrWaDkXz2QX4nYVPAm8C9aBSKTeEwLtE,198
121
123
  shotgun/utils/env_utils.py,sha256=8QK5aw_f_V2AVTleQQlcL0RnD4sPJWXlDG46fsHu0d8,1057
122
124
  shotgun/utils/file_system_utils.py,sha256=l-0p1bEHF34OU19MahnRFdClHufThfGAjQ431teAIp0,1004
123
125
  shotgun/utils/update_checker.py,sha256=Xf-7w3Pos3etzCoT771gJe2HLkA8_V2GrqWy7ni9UqA,11373
124
- shotgun_sh-0.1.0.dev25.dist-info/METADATA,sha256=GkDNaK-wokG1FYKaeQOLGZ2vVS0AehWd82rYBpjmbes,11197
125
- shotgun_sh-0.1.0.dev25.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
126
- shotgun_sh-0.1.0.dev25.dist-info/entry_points.txt,sha256=asZxLU4QILneq0MWW10saVCZc4VWhZfb0wFZvERnzfA,45
127
- shotgun_sh-0.1.0.dev25.dist-info/licenses/LICENSE,sha256=YebsZl590zCHrF_acCU5pmNt0pnAfD2DmAnevJPB1tY,1065
128
- shotgun_sh-0.1.0.dev25.dist-info/RECORD,,
126
+ shotgun_sh-0.1.0.dev27.dist-info/METADATA,sha256=yE6vp8p3JZUIQeu8t1RWTU086EaiZ8wQO7CzCX2HxXU,11197
127
+ shotgun_sh-0.1.0.dev27.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
128
+ shotgun_sh-0.1.0.dev27.dist-info/entry_points.txt,sha256=asZxLU4QILneq0MWW10saVCZc4VWhZfb0wFZvERnzfA,45
129
+ shotgun_sh-0.1.0.dev27.dist-info/licenses/LICENSE,sha256=YebsZl590zCHrF_acCU5pmNt0pnAfD2DmAnevJPB1tY,1065
130
+ shotgun_sh-0.1.0.dev27.dist-info/RECORD,,